/* Chiara Alessio — site styles. No framework. Measures taken from the reference site (SITE_SPEC.md). */

/* ---------- Fonts (Circular Std, licensed by the agency) ---------- */
@font-face { font-family: Circular; src: url(../fonts/CircularStd-Book.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: Circular; src: url(../fonts/CircularStd-Medium.woff2) format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: Circular; src: url(../fonts/CircularStd-MediumItalic.woff2) format("woff2"); font-weight: 500; font-style: italic; font-display: swap; }
@font-face { font-family: Circular; src: url(../fonts/CircularStd-Bold.woff2) format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: Circular; src: url(../fonts/CircularStd-BoldItalic.woff2) format("woff2"); font-weight: 700; font-style: italic; font-display: swap; }

/* ---------- Base ---------- */
:root {
	--noir: #000;
	--gris: #4a4c4d;
	--gris-clair: #7f7f7f;
	--trait: #f2f2f2;
	--conteneur: 1110px;
	--marge: 20px;                                   /* side gutter on small screens */
	--c: min(var(--conteneur), calc(100vw - 2 * var(--marge)));
	--cote: calc((100vw - var(--c)) / 2);           /* space left of the container */
	--entete: 80px;
	--rythme: 100px;
	--police: Circular, "Helvetica Neue", Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: var(--entete); }
body {
	margin: 0;
	font-family: var(--police);
	font-size: 16px;
	line-height: 1.5;
	color: var(--noir);
	background: #fff;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--noir); }
h1, h2, h3, h4 { font-weight: 400; margin: 0 0 .5em; line-height: 1.2; }
p { margin: 0 0 1em; }
sup { font-size: .6em; line-height: 0; vertical-align: .7em; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
svg { width: 22px; height: 22px; display: block; }
:focus-visible { outline: 2px solid var(--noir); outline-offset: 3px; }

.conteneur { width: var(--c); margin-inline: auto; }
.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; word-wrap: normal;
}
.lien-evitement { position: absolute; left: -9999px; top: 0; z-index: 100; background: #fff; padding: 10px 16px; }
.lien-evitement:focus { left: 10px; top: 10px; }

/* ---------- Header ---------- */
.entete {
	position: sticky; top: 0; z-index: 50;
	background: #fff;
	border-bottom: 1px solid var(--trait);
}
.admin-bar .entete { top: 32px; }
.entete__barre { display: flex; align-items: center; justify-content: space-between; height: var(--entete); }
.entete__logo img { width: 280px; height: auto; }
.navigation ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; }
.navigation li { position: relative; }
.navigation a {
	display: block; padding: 0 15px;
	line-height: var(--entete);
	font-size: 16px; color: var(--gris);
	transition: color .2s;
}
.navigation a:hover, .navigation .is-actif a { color: var(--noir); }
.navigation .is-actif::after {
	content: ""; position: absolute; left: 0; right: 0; bottom: -1px;
	height: 1px; background: var(--noir);
}
.navigation__recherche { margin-left: 15px; }
.bouton-recherche { display: block; padding: 10px 0 10px 10px; color: var(--gris); }
.bouton-recherche:hover { color: var(--noir); }
.entete__menu-bouton { display: none; }
.navigation { display: flex; align-items: center; }

/* Language switcher: header (after the search icon) and home page (top right, over the slideshow) */
.langues { list-style: none; margin: 0 0 0 20px; padding: 0; display: flex; font-size: 13px; letter-spacing: .04em; }
.langues a { display: block; padding: 6px 5px; line-height: 1; color: var(--gris); }
.langues a:hover, .langues .is-courant { color: var(--noir); }
.langues .is-courant { text-decoration: underline; text-underline-offset: 4px; }
.langues--accueil { position: absolute; z-index: 3; top: 24px; right: 30px; margin: 0; }
.langues--accueil a, .langues--accueil a:hover, .langues--accueil .is-courant { color: #fff; text-shadow: 0 0 12px rgba(0, 0, 0, .35); }
.langues--accueil a:not(.is-courant) { opacity: .75; }
.langues--accueil a:hover { opacity: 1; }

/* Search dialog (full screen) */
.recherche {
	width: 100vw; height: 100vh; max-width: none; max-height: none;
	margin: 0; padding: 0; border: 0;
	background: rgba(255, 255, 255, .97);
}
.recherche[open] { display: flex; align-items: center; justify-content: center; }
.recherche form { width: var(--c); }
.recherche input {
	width: 100%; border: 0; border-bottom: 1px solid var(--noir);
	font: inherit; font-size: clamp(28px, 5vw, 60px); text-align: center;
	padding: .2em 0; background: transparent; outline: none;
}
.recherche__fermer { position: absolute; top: 24px; right: 24px; padding: 8px; }
.recherche__fermer svg { width: 32px; height: 32px; }

/* ---------- Footer ---------- */
.pied { padding: 50px 0 60px; }
.pied__barre { display: flex; align-items: center; justify-content: center; gap: 40px; }
.pied__reseaux { list-style: none; margin: 0; padding: 0; display: flex; gap: 30px; }
.pied__reseaux a { color: #666; }
.pied__reseaux a:hover { color: var(--noir); }
.pied__reseaux svg { width: 26px; height: 26px; }
.pied__copyright { margin: 0; font-size: 16px; }

/* ---------- Home: full-screen slideshow ---------- */
.is-accueil { overflow: hidden; }
.diaporama { position: relative; height: 100vh; height: 100svh; min-height: 300px; background: #222; color: #fff; }
.diaporama__images { list-style: none; margin: 0; padding: 0; }
.diaporama__image {
	position: absolute; inset: 0;
	opacity: 0; transition: opacity 1s ease;
}
.diaporama__image.is-active { opacity: 1; }
.diaporama__image img { width: 100%; height: 100%; object-fit: cover; }
.diaporama__legende {
	position: absolute; left: 0; right: 0; bottom: 40px; margin: 0; padding: 0 20px;
	text-align: center; font-size: 24px; line-height: 1.25;
	text-shadow: 0 0 20px rgba(0, 0, 0, .25);
}
.diaporama__logo { position: absolute; z-index: 2; top: 70px; left: 50%; transform: translateX(-50%); width: 16%; min-width: 180px; }
.diaporama__logo img { width: 100%; transition: transform 1s; }
.diaporama__logo:hover img { transform: scale(1.2); }
.diaporama__nav {
	position: absolute; z-index: 2; top: 50%; transform: translateY(-50%);
	padding: 20px; color: #fff; opacity: 0; transition: opacity .3s;
}
.diaporama__nav svg { width: 36px; height: 36px; }
.diaporama:hover .diaporama__nav, .diaporama__nav:focus-visible { opacity: .8; }
.diaporama__nav--prec { left: 10px; }
.diaporama__nav--suiv { right: 10px; }

/* ---------- Projects grid ---------- */
.projets { padding-bottom: 80px; }
.projets-filtres {
	display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 20px;
	padding: 70px 0 80px;
	font-size: 18px; line-height: 24px;
}
.projets-filtres a { color: #999; transition: color .2s; }
.projets-filtres a:hover, .projets-filtres a[aria-pressed="true"] { color: var(--noir); }

/* Without JavaScript: simple 2-column grid. With JavaScript: masonry (positions set by site.js). */
.projets-grille { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 70px; align-items: start; }
.projets-grille.is-masonry { display: block; position: relative; }
.projets-grille.is-masonry .projet-tuile { position: absolute; top: 0; left: 0; transition: transform .4s ease, opacity .4s ease; }
.projet-tuile.is-cache { display: none; }
.projet-tuile__lien { display: block; position: relative; overflow: hidden; }
.projet-tuile img { width: 100%; }
.projet-tuile__titre {
	position: absolute; inset: 0;
	display: flex; align-items: center; justify-content: center; text-align: center; padding: 20px;
	background: rgba(255, 255, 255, .6);
	font-size: 24px; line-height: 1.3; color: var(--noir);
	opacity: 0; transition: opacity .3s;
}
a.projet-tuile__lien:hover .projet-tuile__titre, a.projet-tuile__lien:focus-visible .projet-tuile__titre { opacity: 1; }

/* ---------- Project page ---------- */
.projet__entete { padding-top: var(--rythme); }
.projet__titre { font-size: 60px; line-height: 72px; margin: 0; }
.projet__contenu > .projet-lieu {
	width: var(--c); margin: 0 auto; padding-bottom: calc(var(--rythme) + 30px);
	font-size: 24px; line-height: 29px;
}
.projet__contenu > :first-child:not(.projet-lieu) { margin-top: var(--rythme); }

.projet-presentation {
	width: var(--c); margin: 0 auto; padding: var(--rythme) 0;
	display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 40px; align-items: start;
}
.projet-fiche { margin: 0; padding-right: 40px; font-size: 16px; line-height: 20px; }
.projet-fiche__ligne { margin-bottom: 20px; }
.projet-fiche dt { text-transform: uppercase; color: var(--gris-clair); font-size: 14px; line-height: 22px; }
.projet-fiche dd { margin: 0; }
.projet-texte { font-size: 18px; line-height: 28px; }
.projet-texte p { margin: 0 0 20px; }
.projet-texte h2, .projet-texte h3 { font-size: 24px; margin: 36px 0 16px; }
.projet-texte ul, .projet-texte ol { margin: 0 0 20px; padding-left: 1.2em; }
.projet-texte blockquote { margin: 0 0 20px; padding-left: 20px; border-left: 1px solid var(--noir); }
.projet-credit { width: var(--c); margin: 0 auto; padding: 50px 0; text-align: center; font-size: 16px; color: var(--gris); }

/* Photo placements (image block "Styles"). Width is relative to the window; the container is --c wide. */
.projet-photos { overflow: hidden; }
.projet-photos > .wp-block-image,
.projet-photos > .wp-block-gallery { margin: 0 0 0 var(--cote); width: var(--c); }
.projet-photos > .wp-block-image img, .projet-photos .wp-block-gallery img { width: 100% !important; height: auto !important; aspect-ratio: auto !important; } /* placement decides the size, not manual resizing */
.projet-photos > .wp-block-image figcaption, .projet-photos .wp-block-gallery figcaption { font-size: 14px; color: var(--gris); margin-top: 8px; }
.projet-photos > .is-style-pleine, .projet-photos > .is-style-default,
.projet-photos > .wp-block-image:not([class*="is-style-"]),
.projet-photos > .wp-block-gallery { margin-block: var(--rythme); }
.projet-photos > .is-style-bord { width: 100%; margin: var(--rythme) 0; }
.projet-photos > .is-style-grande-gauche { margin: 0; width: calc(var(--cote) + var(--c) * .82); }
.projet-photos > .is-style-large-droite { margin-block: var(--rythme); margin-left: calc(var(--cote) + var(--c) / 3); width: calc(var(--c) * 2 / 3); }
.projet-photos > .is-style-gauche { width: calc((var(--c) - 100px) / 2); }
.projet-photos > .is-style-droite { width: calc((var(--c) - 100px) / 2); margin-left: calc(var(--cote) + (var(--c) + 100px) / 2); }
.projet-photos > .is-style-centre { margin-block: var(--rythme); margin-left: calc(var(--cote) + var(--c) / 6); width: calc(var(--c) * 2 / 3); }
.projet-photos--tete > :first-child { margin-top: 0; }
/* pairs: core gallery */
.projet-photos .wp-block-gallery.has-nested-images { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px; }
.projet-photos .wp-block-gallery.has-nested-images figure.wp-block-image { width: auto !important; margin: 0; }
.projet-photos .wp-block-gallery.has-nested-images figure.wp-block-image img { height: auto; object-fit: initial; }

/* Fade-in on scroll (site.js adds .apparait / .est-visible; nothing happens without JavaScript) */
.apparait { opacity: 0; transition: opacity .8s ease; }
.apparait.est-visible { opacity: 1; }

/* ---------- Fixed pages (Agence) ---------- */
.page-fixe__contenu { padding: 130px 0 50px; font-size: 18px; line-height: 28px; }
.page-fixe__contenu > * + * { margin-top: 0; }
.page-fixe__contenu .wp-block-columns { gap: 120px; margin: 0 0 80px; }
.page-fixe__contenu h2 { font-size: 30px; line-height: 1.25; margin: 40px 0 24px; }
.page-fixe__contenu .has-grand-font-size { font-size: 36px !important; line-height: 1.38; margin-bottom: 36px; }
.page-fixe__contenu .has-petit-font-size { font-size: 14px !important; line-height: 1.4; color: var(--gris); }
.page-fixe__contenu .wp-block-image { margin: 0 0 12px; }
.page-fixe__contenu .wp-block-image img { width: 100%; }

/* ---------- Search results, 404 ---------- */
.resultats, .erreur { padding: 80px 0; min-height: 50vh; }
.resultats__titre, .erreur h1 { font-size: 36px; margin-bottom: 40px; }
.resultats__liste { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 40px; }
.resultats__liste img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; margin-bottom: 10px; }

/* ---------- Tablet ---------- */
@media (max-width: 1199px) {
	.projet__titre { font-size: 48px; line-height: 56px; }
	.page-fixe__contenu .wp-block-columns { gap: 60px; }
}

/* ---------- Mobile ---------- */
@media (max-width: 959px) {
	.entete__barre { justify-content: center; position: relative; }
	.entete__logo img { width: min(210px, calc(100vw - 150px)); }
	.entete__menu-bouton { display: block; position: absolute; right: var(--marge); top: 50%; transform: translateY(-50%); padding: 8px; }
	.entete__menu-bouton svg { width: 26px; height: 26px; }
	.navigation {
		position: fixed; inset: var(--entete) 0 0 0; z-index: 49;
		background: #fff; padding: 30px var(--marge);
		transform: translateX(100%); transition: transform .3s ease; visibility: hidden;
	}
	.admin-bar .navigation { inset-block-start: calc(var(--entete) + 46px); }
	.navigation.is-ouvert { transform: none; visibility: visible; }
	.navigation ul { flex-direction: column; align-items: stretch; }
	.navigation a { line-height: 1.4; padding: 14px 0; font-size: 22px; border-bottom: 1px solid var(--trait); }
	.navigation .is-actif::after { display: none; }
	.navigation__recherche { margin: 20px 0 0; }
	.navigation { display: block; }
	.navigation .langues { flex-direction: row; margin: 24px 0 0; }
	.navigation .langues a { font-size: 16px; line-height: 1; padding: 6px 16px 6px 0; border: 0; }
	.bouton-recherche { padding: 10px 0; }
}
@media (max-width: 767px) {
	:root { --rythme: 50px; }
	.projet__titre { font-size: 30px; line-height: 36px; }
	.projet__contenu > .projet-lieu { font-size: 16px; line-height: 19px; }
	.projet-presentation { grid-template-columns: 1fr; gap: 30px; }
	.projet-fiche { padding: 0; }
	.projet-photos > .wp-block-image,
	.projet-photos > .wp-block-gallery,
	.projet-photos > [class*="is-style-"] { width: var(--c) !important; margin: 0 0 20px var(--cote) !important; }
	.projet-photos > .is-style-bord { width: 100% !important; margin-left: 0 !important; }
	.projet-photos .wp-block-gallery.has-nested-images { grid-template-columns: 1fr; gap: 20px; }
	.page-fixe__contenu { padding-top: 60px; }
	.page-fixe__contenu .has-grand-font-size { font-size: 26px !important; }
	.pied__barre { flex-direction: column; gap: 20px; }
}
@media (max-width: 639px) {
	.projets-filtres { padding: 40px 0 30px; gap: 0 20px; }
	.projets-grille { grid-template-columns: 1fr; gap: 40px; }
	.diaporama__logo { width: 50%; top: 60px; }
	.diaporama__legende { font-size: 20px; bottom: 30px; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; animation: none !important; }
	.apparait { opacity: 1; }
}
