/*
Theme Name: EDB Studio
Theme URI: https://www.emmanueldubourg.com/
Author: Emmanuel du Bourg
Description: Thème sur mesure pour le portfolio d'Emmanuel du Bourg — éditorial, grille justifiée sans recadrage, transitions de page.
Version: 1.0.2
Requires at least: 6.4
Requires PHP: 8.0
License: GNU General Public License v2 or later
Text Domain: edb-studio
*/

/* ---------- Polices (Inter, licence OFL, hébergée localement) ---------- */
@font-face { font-family: "Inter"; src: url("assets/fonts/Inter-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("assets/fonts/Inter-Italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Inter"; src: url("assets/fonts/Inter-Medium.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter Display"; src: url("assets/fonts/InterDisplay-Light.woff2") format("woff2"); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter Display"; src: url("assets/fonts/InterDisplay-Medium.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }

/* ---------- Variables ---------- */
:root {
	--bg: #f3f1ed;
	--ink: #151515;
	--muted: #86837d;
	--line: rgba(21, 21, 21, .14);
	--pad: clamp(18px, 4vw, 56px);
	--gap: clamp(14px, 2vw, 28px);
	--text: 680px;
	--wide: min(1240px, calc(100vw - 2 * var(--pad)));
	--ease: cubic-bezier(.2, 0, 0, 1);
	--display: "Inter Display", "Inter", system-ui, sans-serif;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
	margin: 0; background: var(--bg); color: var(--ink);
	font: 400 17px/1.6 "Inter", system-ui, sans-serif;
	-webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
	font-feature-settings: "ss01", "calt";
}
img, video, svg { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .18em; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 500; line-height: 1.1; letter-spacing: -.02em; margin: 1.6em 0 .6em; }
p { margin: 0 0 1.1em; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: var(--pad); top: 8px; z-index: 100; background: var(--ink); color: var(--bg); padding: 8px 12px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* ---------- En-tête ---------- */
.site-header {
	position: sticky; top: 0; z-index: 50;
	background: color-mix(in srgb, var(--bg) 86%, transparent);
	-webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
	view-transition-name: site-header;
}
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }
.site-header-inner {
	display: flex; align-items: center; justify-content: space-between; gap: 24px;
	padding: 18px var(--pad);
}
.brand { display: flex; flex-direction: column; text-decoration: none; line-height: 1.15; }
.brand-name { font-weight: 500; font-size: 17px; letter-spacing: -.01em; }
.brand-role { color: var(--muted); font-size: 14px; }
.site-nav .menu { list-style: none; margin: 0; padding: 0; display: flex; gap: clamp(18px, 3vw, 40px); }
.site-nav a { text-decoration: none; font-size: 16px; position: relative; padding: 4px 0; }
.site-nav a::after {
	content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: currentColor;
	transform: scaleX(0); transform-origin: right; transition: transform .35s var(--ease);
}
.site-nav a:hover::after, .site-nav .current-menu-item > a::after { transform: scaleX(1); transform-origin: left; }
.menu-toggle { display: none; }

@media (max-width: 760px) {
	.menu-toggle {
		display: block; background: none; border: 0; padding: 6px 0; font: inherit; font-size: 16px; color: inherit; cursor: pointer;
		position: relative; z-index: 2;
	}
	.menu-toggle-close, .menu-open .menu-toggle-open { display: none; }
	.menu-open .menu-toggle-close { display: inline; }
	.site-nav {
		position: fixed; inset: 0; z-index: 1; background: var(--bg);
		display: flex; align-items: flex-end; padding: var(--pad) var(--pad) 18vh;
		opacity: 0; visibility: hidden; transition: opacity .3s var(--ease), visibility 0s .3s;
	}
	.menu-open .site-nav { opacity: 1; visibility: visible; transition: opacity .3s var(--ease); }
	.menu-open { overflow: hidden; }
	.menu-open .brand { position: relative; z-index: 2; }
	.site-nav .menu { flex-direction: column; gap: 6px; }
	.site-nav a { font-family: var(--display); font-weight: 500; font-size: clamp(40px, 12vw, 64px); letter-spacing: -.03em; line-height: 1.05; }
	.site-nav a::after { display: none; }
	.site-nav .current-menu-item > a { color: var(--muted); }
}

/* ---------- Introduction (accueil / rubriques) ---------- */
.intro { padding: clamp(48px, 10vw, 140px) var(--pad) clamp(40px, 7vw, 96px); display: grid; gap: 28px; }
.intro-statement {
	font-family: var(--display); font-weight: 300; font-size: clamp(44px, 8.6vw, 136px);
	line-height: .98; letter-spacing: -.045em; margin: 0;
}
.intro-text { max-width: 30em; color: var(--muted); font-size: clamp(16px, 1.4vw, 19px); margin: 0; }
.intro-text a { color: var(--ink); }
@media (min-width: 1000px) {
	.intro:not(.intro-archive) { grid-template-columns: 1fr auto; align-items: end; }
	.intro-text { justify-self: end; text-align: left; max-width: 22em; }
}
.intro-archive { padding-bottom: clamp(28px, 4vw, 56px); }

/* ---------- Grille justifiée ---------- */
.grid { padding: 0 var(--pad); display: grid; gap: calc(var(--gap) * 2.2); }
.grid-row { display: flex; gap: var(--gap); align-items: flex-start; }
.card { flex: var(--ar) 1 0%; min-width: 0; text-decoration: none; display: block; }
.grid-row > .card:only-child { flex: 0 1 min(100%, calc(var(--ar) * 46vh)); }
.card-media { display: block; overflow: hidden; background: color-mix(in srgb, var(--ink) 6%, transparent); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .9s var(--ease), opacity .4s var(--ease); }
.card:hover .card-media img { transform: scale(1.025); }
/* Vignette en diaporama : les images se succèdent en fondu */
.card-slides { position: relative; }
.card-slides .slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.2s ease, transform .9s var(--ease); }
.card-slides .slide.is-on { opacity: 1; }
.card-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding-top: 12px; }
.card-title { font-weight: 500; font-size: 16px; letter-spacing: -.005em; }
.card-info { color: var(--muted); font-size: 14px; text-align: right; }
.card-title { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .4s var(--ease); }
.card:hover .card-title { background-size: 100% 1px; }
@media (max-width: 760px) {
	.grid { gap: 40px; }
	.grid-row { flex-direction: column; gap: 40px; }
	.card { width: 100%; }
}

/* ---------- Page projet ---------- */
.project-header { padding: clamp(48px, 9vw, 120px) var(--pad) clamp(28px, 4vw, 56px); }
.project-title {
	font-family: var(--display); font-weight: 400; font-size: clamp(44px, 8vw, 120px);
	line-height: .98; letter-spacing: -.045em; margin: 0;
}
.project-info { color: var(--muted); margin: 18px 0 0; font-size: 15px; }
.project-hero { margin: 0 auto clamp(40px, 6vw, 80px); width: var(--wide); }
.project-hero img { width: 100%; max-height: 88vh; object-fit: contain; }

.entry-content { padding: 0 var(--pad) clamp(40px, 6vw, 80px); }
.entry-content > * { max-width: var(--text); margin-left: auto; margin-right: auto; }
.entry-content > p, .entry-content > ul, .entry-content > ol { font-size: clamp(17px, 1.35vw, 20px); }
.entry-content > .alignwide, .entry-content > .alignfull,
.entry-content > figure.wp-block-image, .entry-content > .wp-block-image,
.entry-content > .wp-block-video, .entry-content > .wp-block-gallery,
.entry-content > .wp-block-columns, .entry-content > .wp-block-embed,
.entry-content > .wp-block-cover, .entry-content > .wp-block-group.alignwide { max-width: var(--wide); }
.entry-content figure { margin-top: 0; margin-bottom: clamp(20px, 3vw, 40px); }
.entry-content .wp-block-image img, .entry-content .wp-block-video video {
	width: 100%; height: auto; max-height: min(1240px, 92vw); object-fit: contain;
}
.entry-content .wp-block-columns { gap: clamp(16px, 2.5vw, 40px); margin-bottom: clamp(20px, 3vw, 40px); align-items: flex-start; }
.entry-content .wp-block-columns figure { margin-bottom: 0; }
.entry-content h2 { font-size: clamp(26px, 3vw, 40px); }
.entry-content figcaption { color: var(--muted); font-size: 14px; margin-top: 10px; text-align: left; }
.entry-content > a.edb-mail { display: block; max-width: var(--text); margin: 0 auto 1.1em; font-size: clamp(17px, 1.35vw, 20px); }
.page-article .entry-content > p:first-child { font-family: var(--display); font-size: clamp(24px, 2.6vw, 36px); line-height: 1.2; letter-spacing: -.02em; }

/* ---------- Projet suivant ---------- */
.next-project {
	display: block; margin: 0 var(--pad); padding: clamp(32px, 5vw, 64px) 0; border-top: 1px solid var(--line);
	text-decoration: none;
}
.next-kicker, .footer-cta-kicker { display: block; color: var(--muted); font-size: 15px; margin-bottom: 10px; }
.next-title, .footer-cta-title {
	font-family: var(--display); font-weight: 400; font-size: clamp(36px, 6vw, 88px); line-height: 1; letter-spacing: -.04em;
}
.arrow { display: inline-block; transition: transform .45s var(--ease); }
.next-project:hover .arrow, .footer-cta:hover .arrow { transform: translateX(.25em); }

/* ---------- Pied de page ---------- */
.site-footer { padding: 0 var(--pad) 28px; }
.footer-cta { display: block; padding: clamp(40px, 7vw, 96px) 0; border-top: 1px solid var(--line); text-decoration: none; }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 14px; padding-top: 20px; border-top: 1px solid var(--line); }
.home .footer-cta, .archive .footer-cta { margin-top: clamp(48px, 8vw, 120px); }

/* ---------- Transitions entre pages (Chrome, Edge, Safari récents) ---------- */
@view-transition { navigation: auto; }
::view-transition-group(*) { animation-duration: .55s; animation-timing-function: var(--ease); }
::view-transition-old(root) { animation: .28s var(--ease) both edb-out; }
::view-transition-new(root) { animation: .5s var(--ease) both edb-in; }
@keyframes edb-out { to { opacity: 0; transform: translateY(-10px); } }
@keyframes edb-in { from { opacity: 0; transform: translateY(18px); } }

/* ---------- Mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { transition: none !important; animation: none !important; }
	@view-transition { navigation: none; }
}
