/* ==========================================================================
   GBS – styles
   ========================================================================== */

:root {
    --c-fond: #ffffff;
    --c-texte: #111111;
    --c-gris: #6b6b6b;
    --c-ligne: #e2e2e2;
    --c-overlay: rgba(255, 255, 255, 0.97);

    --f-texte: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;

    --gutter: clamp(16px, 3vw, 40px);
    --gap: 8px;
    --max: 1400px;
    --max-texte: 760px;
    --header-h: 80px;
}

/* ---------- Base ---------- */

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--c-fond);
    color: var(--c-texte);
    font-family: var(--f-texte);
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }

a { color: inherit; text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; text-underline-offset: 3px; }

:focus-visible { outline: 2px solid var(--c-texte); outline-offset: 2px; }

h1, h2, h3 { font-weight: 400; line-height: 1.2; margin: 0 0 .6em; }

.screen-reader-text {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}

.skip-link {
    position: absolute; left: -9999px; top: 0;
    background: var(--c-texte); color: var(--c-fond);
    padding: 8px 12px; z-index: 1000;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ---------- Mise en page ---------- */

.container {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.container--texte { max-width: calc(var(--max-texte) + 2 * var(--gutter)); }

.site-main { min-height: 60vh; padding-bottom: 80px; }

.page-header { margin: 40px 0 32px; }
.page-title { font-size: clamp(1.6rem, 3vw, 2.4rem); }

/* ---------- En-tête ---------- */

.site-header {
    position: sticky; top: 0; z-index: 50;
    display: flex; align-items: center; justify-content: space-between;
    height: var(--header-h);
    padding: 0 var(--gutter);
    background: var(--c-fond);
}

.site-header__logo img { max-height: 48px; width: auto; }
.site-header__logo a { font-size: 1.1rem; letter-spacing: .04em; text-transform: uppercase; }

.site-header__actions { display: flex; align-items: center; gap: 24px; }

.lang-switcher {
    display: flex; gap: 10px;
    list-style: none; margin: 0; padding: 0;
    text-transform: uppercase; font-size: .85rem;
}
.lang-switcher .current-lang a { font-weight: 700; }

.menu-toggle {
    width: 32px; height: 24px;
    border: 0; padding: 0; background: none; cursor: pointer;
    position: relative;
}
.menu-toggle__bars,
.menu-toggle__bars::before,
.menu-toggle__bars::after {
    position: absolute; left: 0; right: 0;
    height: 2px; background: var(--c-texte);
    content: "";
}
.menu-toggle__bars { top: 50%; transform: translateY(-50%); }
.menu-toggle__bars::before { top: -9px; }
.menu-toggle__bars::after { top: 9px; }

/* ---------- Menu plein écran ---------- */

.menu-overlay {
    position: fixed; inset: 0; z-index: 100;
    background: var(--c-overlay);
    display: flex; align-items: center; justify-content: center;
    padding: var(--gutter);
    overflow-y: auto;
}
.menu-overlay[hidden] { display: none; }

.menu-close {
    position: absolute; top: 20px; right: var(--gutter);
    border: 0; background: none; cursor: pointer;
    font-size: 2.5rem; line-height: 1;
}

.menu-principal,
.menu-principal ul { list-style: none; margin: 0; padding: 0; }

.menu-principal {
    display: grid; gap: 40px;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    width: min(900px, 100%);
}
.menu-principal > li > a { font-size: clamp(1.6rem, 4vw, 2.6rem); }
.menu-principal .sub-menu { margin-top: 12px; }
.menu-principal .sub-menu a { display: block; padding: 4px 0; color: var(--c-gris); }
.menu-principal .sub-menu a:hover,
.menu-principal .current-menu-item > a { color: var(--c-texte); }

body.menu-ouvert { overflow: hidden; }

/* ---------- Filtres projets ---------- */

.filtres { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: .95rem; }
.filtres a { color: var(--c-gris); }
.filtres a[aria-current="page"] { color: var(--c-texte); text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Mosaïque (liste des projets et galeries) ----------
   Grille CSS de 6 colonnes, sans JavaScript, ordre toujours respecté.
   Mises en page (mêmes valeurs que le site d'origine) :
     item--100          6 colonnes
     item--50           3 colonnes (pleine largeur sur mobile)
     item--33           2 colonnes (3 sur tablette, 6 sur mobile)
     item--portrait     comme 50, sur deux rangées
     item--33_portrait  comme 33, sur deux rangées
   Un cadre normal a un ratio fixe (hauteur = 67 % de la largeur) ; un cadre
   portrait s'étire sur deux rangées + l'espace entre elles, donc il s'aligne
   exactement à côté de deux images empilées.
   ------------------------------------------------------------------ */

:root {
    --item-gap-x: 2vw;
    --item-gap-y: 1.7vw;
}

.mosaique {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    column-gap: var(--item-gap-x);
    row-gap: var(--item-gap-y);
    margin: 0 var(--gutter);
}

.item {
    display: block;
    position: relative;
    grid-column: span 6;
    min-width: 0;
}

.item__inner {
    display: block;
    position: relative;
    width: 100%;
    aspect-ratio: 100 / 67;
    overflow: hidden;
    background: var(--c-ligne);
}

.item--portrait,
.item--33_portrait { grid-row: span 2; }

/* Le portrait remplit ses deux rangées. Son ratio de secours (un peu plus
   court que deux rangées) ne sert que s'il est seul et ne les agrandit jamais. */
.item--portrait .item__inner,
.item--33_portrait .item__inner {
    aspect-ratio: 100 / 130;
    height: 100%;
}

.item__inner img {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
}

@media (min-width: 660px) {
    .item--50, .item--portrait,
    .item--33, .item--33_portrait { grid-column: span 3; }
}
@media (min-width: 860px) {
    .item--33, .item--33_portrait { grid-column: span 2; }
}

/* Panneau au survol : N°, titre, lieu, année */
.item__over {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; gap: .15em;
    padding-top: 1em;
    background: var(--c-fond);
    border-top: 1px solid var(--c-texte);
    border-bottom: 1px solid var(--c-texte);
    text-transform: uppercase;
    font-size: .85rem; line-height: 1.3;
    opacity: 0;
    transition: opacity .15s;
}
a.item:hover, a.item:focus-visible { text-decoration: none; }
.item:hover .item__over,
.item:focus-visible .item__over { opacity: 1; }

/* Galerie de la fiche : agrandir au clic */
.galerie { margin-bottom: 40px; }
.galerie .item { cursor: zoom-in; }

/* ---------- Fiche projet ---------- */

.projet__header { margin: 40px 0 24px; }
.projet__types { margin: 0 0 6px; color: var(--c-gris); font-size: .9rem; }

.projet__meta { font-size: 1.1rem; margin: 0 0 16px; }
.projet__credit { color: var(--c-gris); font-size: .85rem; margin-top: 32px; }

.projet__nav {
    display: flex; justify-content: space-between; gap: 24px;
    margin-top: 48px; padding-top: 16px;
    border-top: 1px solid var(--c-ligne);
    font-size: .9rem;
}

/* ---------- Contenu éditorial ---------- */

.entry__content > * + * { margin-top: 1em; }
.entry__content a { text-decoration: underline; text-underline-offset: 3px; }
.entry__hero { margin: 0 0 32px; }
.entry__hero img { width: 100%; max-height: 80vh; object-fit: cover; }
.entry__retour { margin-top: 48px; }

time { color: var(--c-gris); font-size: .9rem; }

/* ---------- Actualités ---------- */

.liste-actus { display: grid; gap: 48px; }

.card-actu {
    display: grid; gap: 24px;
    grid-template-columns: minmax(0, 1fr);
    padding-bottom: 48px;
    border-bottom: 1px solid var(--c-ligne);
}
.card-actu__titre { font-size: 1.4rem; margin-top: 6px; }

@media (min-width: 800px) {
    .card-actu { grid-template-columns: 1fr 1fr; align-items: center; }
}

/* ---------- Références & publications ---------- */

.references__annee,
.publications__annee {
    display: grid; gap: 8px 32px;
    padding: 20px 0;
    border-top: 1px solid var(--c-ligne);
}
.references__annee h2,
.publications__annee h2 { font-size: 1rem; font-weight: 700; margin: 0; }

.references__liste,
.publications__liste { list-style: none; margin: 0; padding: 0; }
.references__liste li,
.publications__liste li { padding: 3px 0; }
.references__liste a,
.publications__liste a { text-decoration: underline; text-underline-offset: 3px; }

@media (min-width: 700px) {
    .references__annee,
    .publications__annee { grid-template-columns: 120px 1fr; }
}

.badge {
    display: inline-block;
    font-size: .7rem; letter-spacing: .05em;
    padding: 1px 5px; margin-left: 4px;
    border: 1px solid currentColor;
    vertical-align: middle;
}

/* ---------- Équipe ---------- */

.equipe {
    display: grid; gap: 40px var(--gap);
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    list-style: none; margin: 32px 0 0; padding: 0;
}
.equipe__membre img,
.equipe__sans-photo {
    display: block;
    width: 100%; aspect-ratio: 2 / 3;
    object-fit: cover;
    margin-bottom: 12px;
    background: var(--c-ligne);
}
.equipe__membre p { margin: 0; }
.equipe__nom { font-weight: 700; }
.equipe__fonction { color: var(--c-gris); }
.equipe__email { margin-top: .25em !important; font-size: .9rem; }
.equipe__email a { text-decoration: underline; text-underline-offset: 3px; word-break: break-all; }

.equipe__listes {
    display: grid; gap: 40px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    margin-top: 64px; padding-top: 24px;
    border-top: 1px solid var(--c-ligne);
}
.equipe__listes h2 { font-size: 1rem; font-weight: 700; }
.equipe__noms {
    list-style: none; margin: 0; padding: 0;
    columns: 2 160px; column-gap: 24px;
    color: var(--c-gris);
}
.equipe__noms li { break-inside: avoid; padding: 2px 0; }

/* ---------- Pagination ---------- */

.nav-links { display: flex; gap: 16px; margin-top: 40px; }
.page-numbers.current { font-weight: 700; }

/* ---------- Pied de page ---------- */

.site-footer {
    display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px;
    padding: 32px var(--gutter);
    border-top: 1px solid var(--c-ligne);
    font-size: .85rem;
}
.site-footer__nom { margin: 0; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.menu-reseaux { display: flex; gap: 20px; list-style: none; margin: 0; padding: 0; }

/* ---------- Lightbox ---------- */

.lightbox {
    width: 100vw; height: 100vh;
    max-width: none; max-height: none;
    margin: 0; padding: 0; border: 0;
    background: rgba(255, 255, 255, .98);
}
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox::backdrop { background: transparent; }

.lightbox__img { max-width: 90vw; max-height: 90vh; width: auto; height: auto; object-fit: contain; }

.lightbox button {
    position: absolute;
    border: 0; background: none; cursor: pointer;
    font-size: 2.5rem; line-height: 1; padding: 12px;
    color: var(--c-texte);
}
.lightbox__close { top: 12px; right: 12px; }
.lightbox__prev { left: 8px; top: 50%; transform: translateY(-50%); }
.lightbox__next { right: 8px; top: 50%; transform: translateY(-50%); }

/* ---------- Mobile ---------- */

@media (max-width: 600px) {
    :root { --header-h: 64px; }
    .projet__nav { flex-direction: column; }
}

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