/* ==========================================================================
   Or Nord — direction « magazine de voyage » : photo d'abord, serif éditorial,
   ivoire / encre / or. Tokens en tête, puis du plus général au plus spécifique.
   ========================================================================== */

:root {
    --ivory: #f6f1e9;
    --paper: #fbf8f3;
    --ink: #1c1915;
    --ink-soft: #3d3831;
    --muted: #857b6e;
    --line: #e3dace;
    --gold: #a8834f;
    --gold-soft: #d8c3a0;
    --night: #141c19;
    --danger: #a4302a;

    --serif: 'Cormorant Garamond', 'Cormorant', Garamond, 'Times New Roman', serif;
    --sans: 'Jost', 'Futura', 'Avenir Next', system-ui, sans-serif;

    --wrap: 1240px;
    --gutter: clamp(20px, 4vw, 48px);
    --ease: cubic-bezier(.2, .7, .2, 1);
}

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

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

body {
    margin: 0;
    /* Pied de page collé en bas même sur une page courte (login, admin vide). */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.65;
    color: var(--ink);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
main { flex: 1; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.05; letter-spacing: -.01em; margin: 0; }
::selection { background: var(--gold-soft); color: var(--ink); }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

.kicker {
    margin: 0 0 14px;
    font-size: .72rem;
    font-weight: 500;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--gold);
}
.kicker--light { color: #e8d6b6; }

.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: .78rem;
    font-weight: 500;
    letter-spacing: .2em;
    text-transform: uppercase;
    text-decoration: none;
    padding-bottom: 6px;
    border-bottom: 1px solid currentColor;
    transition: gap .3s var(--ease);
}
.link-arrow::after { content: '→'; font-size: 1rem; letter-spacing: 0; }
.link-arrow:hover { gap: 20px; }
.link-arrow--light { color: #fff; }

.stars { color: var(--gold); letter-spacing: 3px; font-size: .8rem; }
.stars .off { color: var(--line); }

/* ── En-tête ─────────────────────────────────────────────────────────────── */
.site-header { position: relative; z-index: 10; border-bottom: 1px solid var(--line); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-block: 26px; }

.logo { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.logo span { font-family: var(--serif); font-size: 1.7rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; line-height: 1; }
.logo__star { width: 20px; height: 20px; fill: var(--gold); transition: transform .8s var(--ease); }
.logo:hover .logo__star { transform: rotate(90deg); }

.site-nav { display: flex; gap: clamp(18px, 3vw, 40px); }
.site-nav a { font-size: .75rem; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; text-decoration: none; padding-block: 6px; background: linear-gradient(currentColor, currentColor) left bottom / 0 1px no-repeat; transition: background-size .35s var(--ease); }
.site-nav a:hover { background-size: 100% 1px; }

.site-header__inner > .site-nav { margin-left: auto; }
/* Sans rubrique à afficher (aucun article en ligne), la zone compte se cale seule à droite. */
.site-header__inner > .logo + .site-account { margin-left: auto; padding-left: 0; border-left: 0; }

/* ── Zone compte (en-tête) ──────────────────────────────────────────────── */
.site-account { display: flex; align-items: center; gap: 20px; padding-left: clamp(18px, 3vw, 36px); border-left: 1px solid color-mix(in srgb, currentColor 22%, transparent); }
.site-account__login { font-size: .75rem; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; text-decoration: none; padding-block: 6px; background: linear-gradient(currentColor, currentColor) left bottom / 0 1px no-repeat; transition: background-size .35s var(--ease); }
.site-account__login:hover { background-size: 100% 1px; }
.site-account__cta { font-size: .72rem; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; text-decoration: none; padding: 10px 20px; border-radius: 999px; background: var(--ink); color: var(--paper); transition: background .25s, color .25s; }
.site-account__cta:hover { background: var(--gold); color: #fff; }
.has-hero .site-account__cta { background: #fff; color: var(--ink); }
.has-hero .site-account__cta:hover { background: var(--gold); color: #fff; }

/* Avatar : initiale du pseudo. Doré plein pour un admin, cerclé d'or pour un membre. */
.avatar { display: inline-grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; font: italic 500 1.15rem/1 var(--serif); color: var(--gold); background: var(--paper); box-shadow: inset 0 0 0 1px var(--gold-soft); }
.avatar--admin { color: #fff; background: linear-gradient(140deg, #c9a46a, var(--gold) 55%, #8a6a3c); box-shadow: none; }
.avatar--lg { width: 48px; height: 48px; font-size: 1.6rem; }

.account-menu { position: relative; }
.account-menu__trigger {
    display: flex; align-items: center; gap: 10px;
    padding: 4px 14px 4px 4px;
    border: 1px solid color-mix(in srgb, currentColor 22%, transparent);
    border-radius: 999px;
    cursor: pointer; list-style: none; user-select: none;
    transition: border-color .25s, background .25s;
}
.account-menu__trigger::-webkit-details-marker { display: none; }
.account-menu__trigger:hover, .account-menu[open] .account-menu__trigger { border-color: color-mix(in srgb, currentColor 55%, transparent); background: color-mix(in srgb, currentColor 6%, transparent); }
.account-menu__trigger:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.account-menu__name { max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; font-weight: 500; }
.account-menu__chevron { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; opacity: .6; transition: transform .3s var(--ease); }
.account-menu[open] .account-menu__chevron { transform: rotate(180deg); }

/* Le panneau garde ses couleurs claires même posé sur une photo (en-tête .has-hero). */
.account-menu__panel {
    position: absolute; top: calc(100% + 14px); right: 0; z-index: 30;
    width: 300px; max-width: calc(100vw - 32px);
    padding: 8px;
    color: var(--ink); background: #fff;
    border: 1px solid var(--line);
    box-shadow: 0 24px 60px -12px rgba(28, 25, 21, .25), 0 2px 6px rgba(28, 25, 21, .06);
    transform-origin: top right;
    animation: menu-in .22s var(--ease);
}
/* Petite pointe vers le bouton. */
.account-menu__panel::before { content: ''; position: absolute; top: -6px; right: 28px; width: 10px; height: 10px; background: #fff; border-top: 1px solid var(--line); border-left: 1px solid var(--line); transform: rotate(45deg); }
@keyframes menu-in { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }

.account-menu__head { display: flex; align-items: center; gap: 14px; padding: 16px 14px 18px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.account-menu__who { min-width: 0; }
.account-menu__pseudo { margin: 0; font: 500 1.35rem/1.15 var(--serif); }
.account-menu__email { margin: 2px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8rem; color: var(--muted); }
.account-menu__badge { display: inline-block; margin-top: 8px; padding: 3px 8px; font-size: .6rem; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: var(--gold); border: 1px solid var(--gold-soft); }

.account-menu__label { margin: 14px 14px 6px; font-size: .62rem; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.account-menu__link { display: flex; align-items: center; gap: 12px; padding: 10px 14px; font-size: .92rem; text-decoration: none; color: var(--ink); transition: background .15s, color .15s; }
.account-menu__link svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: stroke .15s; }
.account-menu__link:hover, .account-menu__link:focus-visible { background: var(--ivory); outline: none; }
.account-menu__link:hover svg, .account-menu__link:focus-visible svg { stroke: var(--gold); }
.account-menu__logout { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 14px; color: var(--muted); }
.account-menu__logout:hover { color: var(--danger); background: #fbf1ef; }
.account-menu__logout:hover svg { stroke: var(--danger); }

/* Sur une page à photo pleine largeur, l'en-tête se pose dessus en blanc. */
.has-hero .site-header { position: absolute; inset: 0 0 auto; border-bottom-color: rgba(255, 255, 255, .18); color: #fff; }

/* ── Hero (accueil « à la une » et couverture d'article) ─────────────────── */
.hero {
    position: relative;
    min-height: min(92vh, 900px);
    display: flex;
    align-items: flex-end;
    color: #fff;
    background: var(--night);
    overflow: hidden;
    isolation: isolate;
}
.hero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; animation: hero-in 2.4s var(--ease) both; }
.hero__shade {
    position: absolute; inset: 0; z-index: -1;
    background:
        linear-gradient(90deg, rgba(10, 12, 11, .5) 0%, rgba(10, 12, 11, 0) 65%),
        linear-gradient(180deg, rgba(10, 12, 11, .45) 0%, rgba(10, 12, 11, 0) 26%, rgba(10, 12, 11, .15) 48%, rgba(10, 12, 11, .82) 100%);
}
.hero .kicker, .hero__meta { text-shadow: 0 1px 12px rgba(0, 0, 0, .5); }
/* Accueil : léger voile sombre sur toute la photo, pour que le texte reste lisible
   quelle que soit l'image (couverture claire, ciel lumineux…). */
.hero--home .hero__shade { background-color: rgba(10, 12, 11, .22); }
.hero--home .hero__title, .hero--home .hero__excerpt { text-shadow: 0 2px 24px rgba(0, 0, 0, .35); }
.hero__img--default { object-position: 50% 62%; }

/* Invitation à descendre, en bas au centre du bandeau d'accueil. */
.hero--home .hero__content { padding-bottom: clamp(120px, 16vh, 160px); }
.scroll-cue {
    /* Centrage sans transform : l'animation d'apparition (rise) utilise déjà transform. */
    position: absolute; left: 0; right: 0; bottom: clamp(20px, 4vh, 36px);
    width: max-content; margin-inline: auto;
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    color: #fff; text-decoration: none;
    animation: rise 1s .9s var(--ease) both;
}
.scroll-cue__label { font-size: .64rem; font-weight: 500; letter-spacing: .3em; text-transform: uppercase; opacity: .8; text-shadow: 0 1px 10px rgba(0, 0, 0, .4); transition: opacity .3s; }
.scroll-cue__circle { display: grid; place-items: center; width: 40px; height: 40px; transition: transform .3s var(--ease); }
.scroll-cue svg { width: 24px; height: 24px; filter: drop-shadow(0 1px 6px rgba(0, 0, 0, .45)); fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; animation: cue-float 2.2s ease-in-out infinite; }
.scroll-cue:hover .scroll-cue__label { opacity: 1; }
.scroll-cue:hover .scroll-cue__circle { transform: translateY(4px); }
.scroll-cue:focus-visible { outline: none; }
.scroll-cue:focus-visible .scroll-cue__circle { outline: 2px solid var(--gold); outline-offset: 4px; }
@keyframes cue-float { 0%, 100% { transform: translateY(-3px); } 50% { transform: translateY(4px); } }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
.hero__content { width: 100%; padding-block: 140px clamp(48px, 9vh, 96px); animation: rise 1.2s .2s var(--ease) both; }
.hero__title { font-size: clamp(2.8rem, 7.4vw, 6.4rem); max-width: 15ch; margin-bottom: 24px; text-wrap: balance; }
.hero__excerpt { max-width: 52ch; margin: 0 0 36px; font-size: 1.1rem; line-height: 1.6; color: rgba(255, 255, 255, .86); }
.hero__meta { margin: 0; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: rgba(255, 255, 255, .75); }
.hero--post { min-height: min(84vh, 820px); }
.hero--post .hero__title { max-width: 18ch; font-size: clamp(2.6rem, 6.4vw, 5.6rem); }

@keyframes hero-in { from { transform: scale(1.08); opacity: .4; } to { transform: scale(1); opacity: 1; } }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ── Sections & filtres ─────────────────────────────────────────────────── */
.section { padding-block: clamp(64px, 10vw, 120px); }
.has-hero .section { padding-top: clamp(56px, 8vw, 96px); }
body:not(.has-hero) .section { padding-top: clamp(48px, 7vw, 88px); }

.section__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px 40px; flex-wrap: wrap; margin-bottom: clamp(36px, 5vw, 56px); padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.section__title { font-size: clamp(2.2rem, 4.4vw, 3.4rem); }

.filters { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.tabs { display: flex; gap: 24px; flex-wrap: wrap; }
.tabs a { font-size: .75rem; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; text-decoration: none; color: var(--muted); padding-block: 6px; border-bottom: 1px solid transparent; transition: color .2s, border-color .2s; }
.tabs a:hover { color: var(--ink); }
.tabs a.is-active { color: var(--ink); border-bottom-color: var(--gold); }
.filters select {
    width: auto;
    appearance: none;
    padding: 8px 34px 8px 0;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23857b6e'/%3E%3C/svg%3E") right 4px center no-repeat;
    font: 500 .75rem/1.4 var(--sans);
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--ink);
    cursor: pointer;
}
.filters select:focus { outline: none; border-bottom-color: var(--gold); }

/* ── Cartes ─────────────────────────────────────────────────────────────── */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(40px, 5vw, 64px) clamp(20px, 3vw, 40px); }
.card__link { display: block; text-decoration: none; }
.card__media { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: var(--ivory); }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.card__link:hover .card__media img { transform: scale(1.05); }
.card__placeholder { height: 100%; display: grid; place-items: center; background: radial-gradient(120% 90% at 30% 20%, #2a3530 0%, var(--night) 70%); }
.card__placeholder span { font-family: var(--serif); font-size: 7rem; font-style: italic; color: var(--gold-soft); opacity: .8; }
.card__type { position: absolute; top: 16px; left: 16px; padding: 6px 12px; font-size: .64rem; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; background: rgba(251, 248, 243, .92); color: var(--ink); backdrop-filter: blur(6px); }
.card__body { padding-top: 22px; }
.card__body .kicker { margin-bottom: 10px; }
.card__title { font-size: clamp(1.55rem, 2.2vw, 1.9rem); line-height: 1.12; margin-bottom: 12px; text-wrap: balance; background: linear-gradient(var(--ink), var(--ink)) left 96% / 0 1px no-repeat; transition: background-size .5s var(--ease); display: inline; }
.card__link:hover .card__title { background-size: 100% 1px; }
.card__body .stars { display: block; margin-top: 12px; }

.empty { text-align: center; padding-block: 80px; color: var(--muted); }
.empty__title { font-family: var(--serif); font-size: 2rem; font-style: italic; color: var(--ink); margin: 0 0 8px; }

/* Pagination (balisage par défaut de KnpPaginator) */
.pager { margin-top: 80px; display: flex; justify-content: center; }
.pager:not(:has(.pagination)) { display: none; }
.pagination { display: flex; gap: 4px; align-items: center; }
.pagination a, .pagination .current { display: grid; place-items: center; min-width: 44px; height: 44px; padding-inline: 10px; font-family: var(--serif); font-size: 1.2rem; text-decoration: none; color: var(--muted); border-bottom: 1px solid transparent; }
.pagination a:hover { color: var(--ink); }
.pagination .current { color: var(--ink); border-bottom-color: var(--gold); }

/* ── Article ────────────────────────────────────────────────────────────── */
.post { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: clamp(40px, 7vw, 110px); padding-block: clamp(56px, 8vw, 104px); }

.fiche { align-self: start; position: sticky; top: 32px; padding-top: 28px; border-top: 1px solid var(--ink); }
.fiche__label { margin: 0 0 10px; font-size: .7rem; letter-spacing: .22em; text-transform: uppercase; color: var(--gold); }
.fiche__name { margin: 0 0 24px; font-family: var(--serif); font-size: 1.7rem; line-height: 1.15; }
.fiche dl { margin: 0; }
.fiche dl div { display: flex; justify-content: space-between; gap: 16px; padding-block: 12px; border-bottom: 1px solid var(--line); font-size: .92rem; }
.fiche dt { color: var(--muted); }
.fiche dd { margin: 0; text-align: right; }
.fiche__score { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-top: 24px; }
.fiche__note { font-family: var(--serif); font-size: 3.6rem; line-height: 1; }
.fiche__note small { font-size: 1.3rem; color: var(--muted); }

.post__body { max-width: 680px; }
.lede { margin: 0 0 48px; font-family: var(--serif); font-size: clamp(1.5rem, 2.4vw, 1.9rem); font-style: italic; line-height: 1.4; color: var(--ink-soft); }

.prose { font-size: 1.08rem; line-height: 1.85; color: var(--ink-soft); }
.prose > * { margin-block: 0; }
.prose > * + * { margin-top: 1.4em; }
.prose > p:first-child::first-letter { float: left; font-family: var(--serif); font-size: 5.4em; line-height: .82; padding: .06em .12em 0 0; color: var(--gold); }
.prose > h2 { margin-top: 1.7em; font-size: clamp(1.9rem, 3vw, 2.4rem); color: var(--ink); }
.prose > h3 { margin-top: 1.6em; font-size: 1.5rem; color: var(--ink); }
.prose > :is(h2, h3) + * { margin-top: .7em; }
.prose a { color: var(--ink); text-decoration-color: var(--gold); text-underline-offset: 3px; }
.prose strong { color: var(--ink); font-weight: 500; }
.prose img { width: 100%; margin-block: 2.4em; }
.prose ul { padding-left: 0; list-style: none; }
.prose li { position: relative; padding-left: 28px; }
.prose li + li { margin-top: .5em; }
.prose li::before { content: ''; position: absolute; left: 4px; top: .8em; width: 12px; height: 1px; background: var(--gold); }
.prose > blockquote {
    margin-block: 2.2em;
    padding: 1.4em 0;
    border-block: 1px solid var(--line);
    font-family: var(--serif);
    font-size: clamp(1.7rem, 3vw, 2.2rem);
    font-style: italic;
    line-height: 1.3;
    color: var(--ink);
    text-align: center;
    text-wrap: balance;
}
.prose blockquote p { margin: 0; }
.prose hr { border: 0; text-align: center; margin-block: 3em; }
.prose hr::after { content: '✦  ✦  ✦'; color: var(--gold); letter-spacing: .4em; }

/* ── Galerie (page article) ─────────────────────────────────────────────── */
.gallery { padding-bottom: clamp(56px, 8vw, 104px); }
.gallery__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 24px; flex-wrap: wrap; margin-bottom: clamp(24px, 3vw, 36px); }
.gallery__all { padding-inline: 0; border-top: 0; border-inline: 0; background: none; color: var(--ink); cursor: pointer; font-family: var(--sans); }

/* Mosaïque éditoriale : une grande photo, les autres autour. Disposition selon le nombre. */
.gallery__mosaic { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: clamp(150px, 17vw, 250px); gap: 10px; }
.gallery__tile { position: relative; display: block; min-width: 0; padding: 0; border: 0; overflow: hidden; background: var(--ivory); cursor: zoom-in; }
.gallery__tile:nth-child(n+6) { display: none; } /* au-delà de 5 : visionneuse seulement */
.gallery__tile img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s var(--ease); }
.gallery__tile::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10, 12, 11, 0) 55%, rgba(10, 12, 11, .45)); opacity: 0; transition: opacity .4s var(--ease); }
.gallery__tile:hover img { transform: scale(1.045); }
.gallery__tile:hover::after { opacity: 1; }
.gallery__tile:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.gallery__zoom { position: absolute; right: 14px; bottom: 14px; z-index: 1; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: rgba(251, 248, 243, .92); color: var(--ink); opacity: 0; transform: translateY(6px); transition: opacity .3s, transform .3s var(--ease); }
.gallery__tile:hover .gallery__zoom, .gallery__tile:focus-visible .gallery__zoom { opacity: 1; transform: none; }
.gallery__zoom svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.gallery__more { position: absolute; inset: 0; z-index: 1; display: grid; place-content: center; text-align: center; gap: 2px; color: #fff; background: rgba(10, 12, 11, .52); font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; transition: background .3s; }
.gallery__more strong { font: 500 2.6rem/1 var(--serif); letter-spacing: 0; text-transform: none; }
.gallery__tile:hover .gallery__more { background: rgba(10, 12, 11, .62); }

.gallery--n1 .gallery__tile:nth-child(1) { grid-column: span 4; grid-row: span 2; }
.gallery--n2 .gallery__tile { grid-column: span 2; grid-row: span 2; }
.gallery--n3 .gallery__tile:nth-child(1) { grid-column: span 2; grid-row: span 2; }
.gallery--n3 .gallery__tile:nth-child(n+2) { grid-column: span 2; }
.gallery--n4 .gallery__tile:nth-child(1) { grid-column: span 2; grid-row: span 2; }
.gallery--n4 .gallery__tile:nth-child(2) { grid-column: span 2; }
.gallery--n5 .gallery__tile:nth-child(1) { grid-column: span 2; grid-row: span 2; }

/* Visionneuse plein écran : barre du haut, photo, flèches, bande de vignettes. */
.lightbox { width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; color: #fff; background: #0c0e0d; overflow: hidden; }
.lightbox::backdrop { background: #0c0e0d; }
.lightbox[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; animation: lightbox-in .25s var(--ease); }
@keyframes lightbox-in { from { opacity: 0; } to { opacity: 1; } }
.lightbox svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.lightbox__top { display: flex; align-items: center; gap: 20px; padding: 16px clamp(16px, 3vw, 32px); }
.lightbox__title { margin: 0; font: italic 500 1.25rem/1.2 var(--serif); color: rgba(255, 255, 255, .85); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lightbox__counter { margin: 0 0 0 auto; font-size: .78rem; letter-spacing: .2em; color: rgba(255, 255, 255, .6); white-space: nowrap; }
.lightbox__stage { display: grid; place-items: center; min-height: 0; overflow: hidden; padding: 4px clamp(16px, 9vw, 120px); }
/* Hauteur explicite (barre du haut + vignettes déduites) : un % ne se résout pas de façon
   fiable dans la cellule de grille, et la photo débordait alors sous les vignettes. */
.lightbox__image { max-width: 100%; max-height: calc(100dvh - 190px); object-fit: contain; user-select: none; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
.lightbox:not(:has(.lightbox__thumbs)) .lightbox__image { max-height: calc(100dvh - 100px); }

.lightbox__close, .lightbox__nav { display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 1px solid rgba(255, 255, 255, .22); border-radius: 50%; background: rgba(255, 255, 255, .06); color: #fff; cursor: pointer; transition: background .2s, border-color .2s; }
.lightbox__close:hover, .lightbox__nav:hover { background: rgba(255, 255, 255, .18); border-color: rgba(255, 255, 255, .6); }
.lightbox__close { flex: none; }
.lightbox__nav { position: absolute; top: 50%; transform: translateY(-50%); }
.lightbox__nav--prev { left: clamp(10px, 2vw, 32px); }
.lightbox__nav--next { right: clamp(10px, 2vw, 32px); }

.lightbox__thumbs { display: flex; justify-content: safe center; gap: 8px; padding: 14px clamp(16px, 3vw, 32px) 18px; overflow-x: auto; scrollbar-width: none; }
.lightbox__thumbs::-webkit-scrollbar { display: none; }
.lightbox__thumb { flex: none; width: 76px; height: 54px; padding: 0; border: 0; overflow: hidden; background: #222; opacity: .45; cursor: pointer; outline: 2px solid transparent; outline-offset: 2px; transition: opacity .2s, outline-color .2s; }
.lightbox__thumb img { width: 100%; height: 100%; object-fit: cover; }
.lightbox__thumb:hover { opacity: .8; }
.lightbox__thumb.is-current { opacity: 1; outline-color: var(--gold); }

.related { background: var(--ivory); padding-block: clamp(64px, 9vw, 112px); }

/* ── Pied de page ───────────────────────────────────────────────────────── */
.site-footer { background: var(--night); color: rgba(255, 255, 255, .72); padding-top: clamp(64px, 8vw, 96px); }
.site-footer__inner { display: flex; justify-content: space-between; gap: 48px; flex-wrap: wrap; padding-bottom: 64px; }
.site-footer__logo { margin: 0 0 16px; font-family: var(--serif); font-size: clamp(2.6rem, 6vw, 4.2rem); font-weight: 500; letter-spacing: .12em; text-transform: uppercase; line-height: 1; color: #fff; }
.site-footer__tagline { margin: 0; max-width: 38ch; line-height: 1.7; }
.site-footer__nav { display: grid; grid-template-columns: repeat(2, auto); gap: 14px 56px; align-content: start; }
.site-footer__nav a { font-size: .75rem; letter-spacing: .2em; text-transform: uppercase; text-decoration: none; }
.site-footer__nav a:hover { color: var(--gold-soft); }
.site-footer__legal { padding-bottom: 24px; font-size: .8rem; color: rgba(255, 255, 255, .45); }
.site-footer__legal::before { content: ''; display: block; height: 1px; margin-bottom: 24px; background: rgba(255, 255, 255, .1); }

/* ── Messages flash ─────────────────────────────────────────────────────── */
.flashes { padding-top: 24px; }
/* Sous l'en-tête (z-index 10) pour que le menu compte passe par-dessus les messages. */
.has-hero .flashes { position: absolute; top: 96px; left: 0; right: 0; z-index: 9; }
.flash { padding: 14px 20px; background: #e6efe6; color: #2e5c36; font-size: .92rem; border-left: 2px solid #2e5c36; }
.flash--error { background: #f6e5e2; color: var(--danger); border-left-color: var(--danger); }

/* ── Formulaires & admin ────────────────────────────────────────────────── */
.admin { padding-block: 56px 96px; }
.panel { background: #fff; border: 1px solid var(--line); padding: clamp(24px, 4vw, 40px); }
.narrow { max-width: 440px; margin: 72px auto 96px; }
.narrow h1 { font-size: 2.6rem; margin-bottom: 24px; }
.checkbox-row { display: flex; align-items: flex-start; gap: 10px; margin-top: 24px; }
.checkbox-row input { margin: 3px 0 0; flex: none; }
.checkbox-row label { margin: 0; font-weight: 400; font-size: .92rem; letter-spacing: 0; text-transform: none; color: var(--ink); line-height: 1.5; }
.turnstile { margin-top: 24px; min-height: 65px; }
.panel__text { margin: 0 0 16px; color: var(--ink-soft); line-height: 1.7; }
.flash a { color: inherit; font-weight: 500; text-underline-offset: 3px; }
.panel__alt { margin: 24px 0 0; padding-top: 20px; border-top: 1px solid var(--line); font-size: .9rem; color: var(--muted); }
.panel__alt a { color: var(--ink); text-decoration-color: var(--gold); text-underline-offset: 3px; }
label { display: block; font-size: .72rem; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin: 20px 0 8px; }
input:not([type=checkbox], [type=radio], [type=hidden], [type=submit]), select, textarea {
    width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 0; font: inherit; color: var(--ink); background: var(--paper);
}
.panel select { appearance: auto; }
textarea { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: .9rem; line-height: 1.6; }
input:focus, .panel select:focus, textarea:focus { outline: none; border-color: var(--gold); background: #fff; }
.help-text, .form-text { font-size: .82rem; color: var(--muted); margin-top: 6px; }
form ul { color: var(--danger); font-size: .88rem; padding-left: 18px; margin: 6px 0; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 24px; }
input[type=checkbox] { width: 18px; height: 18px; margin: 0 10px 0 0; accent-color: var(--ink); }
.article-form div:has(> input[type=checkbox]) { display: flex; align-items: center; margin-top: 24px; }
.article-form div:has(> input[type=checkbox]) label { margin: 0; color: var(--ink); }
.cover-preview { max-width: 320px; margin-top: 20px; }
/* Galerie dans l'admin */
.gallery-admin { margin: 28px 0 0; padding: 20px 24px 22px; border: 1px solid var(--line); background: var(--paper); }
.gallery-admin legend { padding: 0 8px; margin-left: -8px; font-size: .72rem; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.gallery-admin__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin: 0 0 8px; padding: 0; list-style: none; color: inherit; }
.gallery-admin__item { position: relative; }
.gallery-admin__item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: opacity .2s, filter .2s; }
.gallery-admin__item:has(input:checked) img { opacity: .35; filter: grayscale(1); }
.gallery-admin__remove { display: flex; align-items: center; gap: 6px; margin: 6px 0 0; font-size: .78rem; letter-spacing: 0; text-transform: none; color: var(--muted); cursor: pointer; }
.gallery-admin__remove input { margin: 0 !important; width: 15px; height: 15px; }
.gallery-admin__item:has(input:checked) .gallery-admin__remove { color: var(--danger); }
.slug-preview { margin: 6px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: .78rem/1.5 ui-monospace, 'SF Mono', Menlo, monospace; color: var(--gold); }

.btn { display: inline-block; margin-top: 28px; padding: 14px 28px; border: 1px solid var(--ink); border-radius: 0; background: var(--ink); color: var(--paper); font: 500 .75rem/1 var(--sans); letter-spacing: .2em; text-transform: uppercase; text-decoration: none; cursor: pointer; transition: background .2s, color .2s; }
.btn:hover { background: transparent; color: var(--ink); }
.btn--danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn--danger:hover { background: var(--danger); color: #fff; }
.danger-zone { margin-top: 24px; }

.admin-nav { display: flex; align-items: center; gap: 8px 28px; flex-wrap: wrap; margin-bottom: 40px; font-size: .72rem; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; }
.admin-nav a { text-decoration: none; color: var(--muted); padding-block: 6px; border-bottom: 1px solid transparent; }
.admin-nav a:hover { color: var(--ink); }
.admin-nav a.is-active { color: var(--ink); border-bottom-color: var(--gold); }
.password-form { max-width: 520px; }

.admin-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 32px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.admin-head h1 { font-size: clamp(2.2rem, 4vw, 3rem); }
.admin-head .btn { margin: 0; }
.admin-head > a:not(.btn) { font-size: .75rem; letter-spacing: .16em; text-transform: uppercase; text-decoration: none; color: var(--muted); }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); }
.table { width: 100%; border-collapse: collapse; font-size: .94rem; }
.table th, .table td { padding: 16px 20px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th { font-size: .68rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.table td a { text-decoration-color: var(--line); text-underline-offset: 3px; }
.table tr:last-child td { border-bottom: 0; }
.table .empty { padding: 40px; }
.table .actions { text-align: right; }
.table .actions .btn + .btn { margin-left: 8px; }
.btn--small { margin-top: 0; padding: 9px 16px; font-size: .66rem; }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); }
/* Les liens du tableau sont soulignés : pas les boutons. */
.table td a.btn { text-decoration: none; }
.status { font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; padding: 4px 10px; background: var(--ivory); color: var(--muted); }
.status--on { background: #e6efe6; color: #2e5c36; }
.status--scheduled { background: #f6eedf; color: #8a6a3c; }
.status-date { display: block; margin-top: 6px; font-size: .78rem; color: var(--muted); }
/* Les titres longs passent à la ligne plutôt que de faire déborder le tableau. */
.table .table__title { white-space: normal; min-width: 220px; }

.publish-box { margin: 28px 0 0; padding: 20px 24px 22px; border: 1px solid var(--line); background: var(--paper); }
.publish-box legend { padding: 0 8px; margin-left: -8px; font-size: .72rem; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.publish-box__row { display: flex; align-items: flex-start; gap: 16px 40px; flex-wrap: wrap; }
.publish-box__toggle { display: flex; align-items: center; padding-top: 34px; }
.publish-box__toggle label { margin: 0; color: var(--ink); font-size: .92rem; letter-spacing: 0; text-transform: none; }
.publish-box__date { flex: 1 1 260px; max-width: 360px; }
.publish-box__date label { margin-top: 0; }

/* ── Page de connexion ──────────────────────────────────────────────────── */
/* Photo plein écran sous le menu transparent (.has-hero) ; formulaire centré dans une
   carte claire ; légende en bas à gauche, hors du flux pour ne pas décentrer la carte. */
.auth {
    --auth-card: 460px;
    --auth-side: max(var(--gutter), calc((100vw - var(--wrap)) / 2 + var(--gutter)));
    position: relative; isolation: isolate;
    min-height: 100vh; min-height: 100svh;
    display: grid; grid-template-columns: minmax(0, var(--auth-card));
    place-content: center;
    padding: 140px var(--auth-side) 72px;
    color: #fff; background: var(--night);
}
.auth__bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.auth__bg img { width: 100%; height: 100%; object-fit: cover; object-position: 30% 50%; animation: hero-in 2.4s var(--ease) both; }
/* Assombrit le haut (lisibilité du menu) et le bas gauche (légende), laisse respirer le ciel. */
.auth__bg::after {
    content: ''; position: absolute; inset: 0;
    background:
        linear-gradient(180deg, rgba(10, 12, 11, .5) 0%, rgba(10, 12, 11, 0) 22%),
        linear-gradient(20deg, rgba(10, 12, 11, .72) 0%, rgba(10, 12, 11, .1) 50%, rgba(10, 12, 11, 0) 70%);
}
/* Largeur bornée à l'espace libre à gauche de la carte : jamais de chevauchement. */
.auth__caption {
    --caption-left: min(var(--auth-side), 6vw);
    position: absolute; left: var(--caption-left); bottom: 56px;
    max-width: calc(50vw - var(--auth-card) / 2 - var(--caption-left) - 32px);
    animation: rise 1s .2s var(--ease) both;
}
.auth__caption .kicker, .auth__caption-title { text-shadow: 0 1px 14px rgba(0, 0, 0, .45); }
.auth__caption-title { margin: 0 0 12px; font: 500 clamp(2rem, 3.4vw, 3.6rem)/1.05 var(--serif); text-wrap: balance; }
.nowrap { white-space: nowrap; }
.auth__caption-text { margin: 0; font-size: 1.1rem; color: rgba(255, 255, 255, .85); text-shadow: 0 1px 14px rgba(0, 0, 0, .45); }

.auth__panel {
    color: var(--ink);
    padding: clamp(32px, 4vw, 52px);
    background: rgba(251, 248, 243, .94);
    backdrop-filter: blur(14px) saturate(1.1);
    box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .45);
    animation: rise .8s var(--ease) both;
}
.auth__form { width: 100%; }
.auth__title { margin: 0 0 10px; font-size: clamp(2.6rem, 4vw, 3.4rem); }
.auth__intro { margin: 0 0 36px; color: var(--muted); }

.auth__alert { margin: 0 0 24px; padding: 14px 16px; font-size: .9rem; line-height: 1.5; color: var(--danger); background: #f8ebe8; border-left: 2px solid var(--danger); }
.auth__alert a { display: block; margin-top: 6px; color: inherit; font-weight: 500; text-underline-offset: 3px; }

.auth__field + .auth__field { margin-top: 22px; }
.auth__field label { margin: 0 0 8px; }
.auth__form input[type=email], .auth__form input[type=password], .auth__form input[type=text] {
    padding: 15px 16px; font-size: 1rem; background: #fff; border-color: var(--line);
    transition: border-color .2s, box-shadow .2s;
}
.auth__form input:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(168, 131, 79, .12); }
.auth__form input::placeholder { color: #b9b0a4; }

.auth__password { position: relative; }
.auth__password input { padding-right: 52px !important; }
.auth__reveal { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; background: none; color: var(--muted); cursor: pointer; }
.auth__reveal:hover, .auth__reveal:focus-visible { color: var(--ink); outline: none; }
.auth__reveal svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.auth__eye-off, .auth__reveal[aria-pressed="true"] .auth__eye { display: none; }
.auth__reveal[aria-pressed="true"] .auth__eye-off { display: block; }

.auth__submit { width: 100%; margin-top: 32px; padding: 17px 28px; font-size: .78rem; }
/* Inscription : champs rendus par form_row (aide, erreurs) dans la même carte. */
.auth--register .auth__bg img { object-position: 50% 60%; }
/* Carte un peu plus large sur ordinateur : mot de passe et confirmation côte à côte. */
@media (min-width: 1025px) {
    .auth--register { --auth-card: 560px; padding-top: 120px; }
    .auth__pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
}
/* Inscription sur portable (≤ 1000 px de haut) : carte resserrée pour garder le bouton visible. */
@media (min-width: 1025px) and (max-height: 1000px) {
    .auth--register { padding-top: 96px; padding-bottom: 32px; }
    .auth--register .auth__panel { padding: 28px 40px; }
    .auth--register .auth__title { font-size: 2.3rem; }
    .auth--register .auth__intro { margin-bottom: 16px; }
    .auth--register .auth__field + .auth__field { margin-top: 12px; }
    .auth--register input:not([type=checkbox]) { padding-block: 10px !important; }
    .auth--register .help-text, .auth--register .form-text { margin-top: 4px; font-size: .76rem; line-height: 1.45; }
    .auth--register .checkbox-row { margin-top: 14px; }
    .auth--register .turnstile { margin-top: 12px; }
    .auth--register .auth__submit { margin-top: 16px; padding-block: 14px; }
    .auth--register .auth__switch { margin-top: 14px; padding-top: 14px; }
}
.auth__field > div > label { margin-top: 0; }
.auth__field .help-text, .auth__field .form-text { margin-top: 6px; }
.auth__panel .turnstile { margin-top: 20px; }
.auth__panel .checkbox-row { margin-top: 22px; }
.auth__switch { margin: 28px 0 0; padding-top: 24px; border-top: 1px solid var(--line); text-align: center; font-size: .92rem; color: var(--muted); }
.auth__switch a { color: var(--ink); font-weight: 500; text-decoration-color: var(--gold); text-underline-offset: 4px; }

/* Écrans larges mais peu hauts (portables 1366×768…) : la carte doit tenir sans défiler. */
@media (min-width: 1025px) and (max-height: 860px) {
    .auth { padding-top: 104px; padding-bottom: 40px; }
    .auth__panel { padding: 32px 40px; }
    .auth__title { font-size: 2.4rem; }
    .auth__intro { margin-bottom: 22px; }
    .auth__alert { margin-bottom: 16px; padding: 10px 14px; }
    .auth__field + .auth__field { margin-top: 14px; }
    .auth__form input[type=email], .auth__form input[type=password], .auth__form input[type=text] { padding-block: 12px; }
    .auth__submit { margin-top: 22px; padding-block: 15px; }
    .auth__switch { margin-top: 20px; padding-top: 16px; }
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    /* Une colonne : légende au-dessus, carte en dessous, photo toujours en fond. */
    .auth { --auth-card: 520px; gap: 28px; padding-top: 120px; padding-bottom: 48px; }
    .auth__caption { position: static; max-width: none; }
    .auth__caption-title { font-size: clamp(2rem, 7vw, 2.8rem); }
    .auth__caption-text { display: none; }
    .grid { grid-template-columns: repeat(2, 1fr); }
    .post { grid-template-columns: 1fr; }
    .fiche { position: static; max-width: 680px; }
}

@media (max-width: 640px) {
    /* Mosaïque sur 2 colonnes : grande photo en tête, les autres en dessous. */
    .gallery__mosaic { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 130px; gap: 6px; }
    .gallery .gallery__tile { grid-column: span 1; grid-row: span 1; }
    .gallery .gallery__tile:nth-child(1) { grid-column: span 2; grid-row: span 2; }
    .gallery--n2 .gallery__tile:nth-child(2), .gallery--n4 .gallery__tile:nth-child(4) { grid-column: span 2; }
    .gallery__zoom { display: none; }
    .lightbox__nav { display: none; } /* au doigt : balayage */
    .lightbox__stage { padding: 4px 8px; }
    .lightbox__thumb { width: 60px; height: 44px; }
    .site-header__inner { padding-block: 20px; }
    .logo span { font-size: 1.35rem; }
    .site-nav { gap: 16px; }
    .site-nav a { font-size: .66rem; letter-spacing: .14em; }
    /* Sur mobile, les rubriques restent accessibles par les onglets de l'accueil et le pied de page. */
    .site-nav { display: none; }
    .site-account { gap: 14px; padding-left: 0; border-left: 0; }
    .site-account__login { font-size: .66rem; letter-spacing: .14em; }
    .site-account__cta { padding: 8px 14px; font-size: .64rem; letter-spacing: .14em; }
    /* Sur mobile, l'avatar suffit : le pseudo est repris en tête du menu. */
    .account-menu__name { display: none; }
    .account-menu__trigger { padding-right: 10px; gap: 6px; }
    .grid { grid-template-columns: 1fr; }
    .card__media { aspect-ratio: 4 / 4.4; }
    .hero { min-height: 86vh; }
    .hero__content { padding-top: 120px; }
    .filters { width: 100%; justify-content: space-between; }
    .tabs { gap: 16px; }
    .site-footer__nav { grid-template-columns: 1fr 1fr; gap: 14px 24px; }
}

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