/* ==========================================================================
   Mairie de Boufflers — design system (mobile d'abord)
   Mobile : base. Tablette : ≥ 768px. Bureau : ≥ 1024px.
   ========================================================================== */

:root {
    --bg: #F3F5F1;
    --surface: #FFFFFF;
    --surface-2: #E6EBE4;
    --ink: #17211D;
    --ink-2: #4B5752;
    --line: rgba(23, 33, 29, 0.14);
    --brand: #2F5D50;
    --brand-strong: #224A3F;
    --brand-soft: #E2ECE7;
    --on-brand: #FFFFFF;
    --night: #12221D;
    --gules: #A32030; /* le rouge du blason */
    --gules-fixed: #A32030;
    --ink-fixed: #17211D;
    --accent: #9E4F1B;
    --open: #1E7A4C;
    --closed: #B3261E;
    --focus: #C26A2C;

    --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-serif: 'Fraunces', Georgia, 'Times New Roman', serif;

    --radius-sm: 12px;
    --radius: 20px;
    --radius-lg: 24px;
    --shadow-sm: 0 1px 2px rgba(23, 33, 29, 0.06), 0 1px 1px rgba(23, 33, 29, 0.04);
    --shadow: 0 12px 32px -12px rgba(23, 33, 29, 0.18), 0 2px 6px rgba(23, 33, 29, 0.05);
    --shadow-lg: 0 30px 60px -20px rgba(23, 33, 29, 0.35);
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

    --header-h: 60px;
    --tabbar-h: 64px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --gutter: 16px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0E1412;
        --surface: #161F1C;
        --surface-2: #1C2724;
        --ink: #E9EFEC;
        --ink-2: #A8B6B0;
        --line: rgba(233, 239, 236, 0.11);
        --brand: #86C7B1;
        --brand-strong: #A5DAC7;
        --brand-soft: #1E322C;
        --on-brand: #0E1412;
        --gules: #FF9A8F;
        --accent: #F0A46E;
        --open: #6FD39C;
        --closed: #FF8A80;
        --focus: #F0A46E;
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
        --shadow: 0 12px 32px -12px rgba(0, 0, 0, 0.6);
        --shadow-lg: 0 30px 60px -20px rgba(0, 0, 0, 0.7);
    }
}

@media (min-width: 768px) {
    :root { --header-h: 68px; --tabbar-h: 0px; --gutter: 32px; }
}
@media (min-width: 1024px) {
    body { font-size: 1rem; }
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 12px);
    scroll-padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom));
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}
html:has(dialog[open]) { overflow: hidden; }

body {
    margin: 0;
    padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom));
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: clip;
}

img, video, svg, iframe { display: block; max-width: 100%; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
main:focus { outline: none; }

.icon { width: 1.25em; height: 1.25em; flex-shrink: 0; }

.sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0);
    white-space: nowrap; border: 0;
}

.skip-link {
    position: fixed;
    top: 8px; left: 8px;
    z-index: 100;
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    background: var(--brand);
    color: var(--on-brand);
    font-weight: 600;
    text-decoration: none;
    clip-path: inset(50%);
}
.skip-link:focus { clip-path: none; }

.container {
    width: 100%;
    max-width: calc(1296px + 2 * var(--gutter));
    margin-inline: auto;
    padding-inline: max(var(--gutter), env(safe-area-inset-left, 0px));
}

.muted { color: var(--ink-2); }

/* ---------- Typo ---------- */
.section-title {
    font-family: var(--font-serif);
    font-weight: 500;
    font-size: clamp(2rem, 1.6rem + 1.6vw, 3rem);
    line-height: 1.05;
    letter-spacing: -0.025em;
    text-wrap: balance;
}

.sub-title { margin: 0 0 16px; font-family: var(--font-serif); font-size: 1.5rem; font-weight: 500; line-height: 1.15; }

/* ---------- Boutons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 52px;
    padding: 0 24px;
    border-radius: 999px;
    border: 1.5px solid transparent;
    background: none;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    white-space: nowrap;
    transition: transform .2s var(--ease), background-color .2s, border-color .2s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: #FFFFFF; color: #17211D; }
.btn-solid { background: var(--brand); color: var(--on-brand); }
.btn-outline { border-color: color-mix(in srgb, var(--ink) 22%, transparent); color: var(--ink); }
@media (hover: hover) {
    .btn:hover { transform: translateY(-2px); }
    .btn-solid:hover { background: var(--brand-strong); }
    .btn-outline:hover { border-color: var(--brand); color: var(--brand); }
}

.link-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--brand);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
}
.link-more .icon { width: 1.1em; height: 1.1em; transition: transform .25s var(--ease); }
@media (hover: hover) {
    .link-more:hover { text-decoration: underline; text-underline-offset: 4px; }
    .link-more:hover .icon { transform: translateX(3px); }
}

/* Toute la carte devient la zone tactile du bouton. */
.stretched::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.stretched:focus-visible { outline: none; }
.stretched:focus-visible::after { outline: 3px solid var(--focus); outline-offset: 3px; }

/* ---------- En-tête ---------- */
.site-header {
    position: fixed;
    inset: 0 0 auto;
    z-index: 50;
    height: calc(var(--header-h) + env(safe-area-inset-top, 0px));
    padding-top: env(safe-area-inset-top, 0px);
    background: var(--bg);
}
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.brand { display: flex; align-items: center; gap: 10px; min-height: 44px; text-decoration: none; }
.brand-mark { display: block; width: 30px; flex-shrink: 0; }
.blason { display: block; width: 100%; height: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-family: var(--font-serif); font-weight: 600; font-size: 1.25rem; letter-spacing: -.01em; }
.brand-sub { display: none; font-size: .875rem; color: var(--ink-2); }

.site-nav { display: none; }
.header-call {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 999px;
    background: var(--brand);
    color: var(--on-brand);
    font-weight: 600;
    font-size: .9375rem;
    text-decoration: none;
}
.header-call .icon { width: 18px; height: 18px; }

@media (min-width: 768px) {
    .brand-mark { width: 36px; }
    .brand-name { font-size: 1.35rem; }
    .brand-sub { display: block; }
    .header-call { display: none; }
    .site-nav { display: block; }
    .menu { display: flex; align-items: center; gap: 4px; }
    .menu a {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
        padding: 0 16px;
        border-radius: 999px;
        font-weight: 500;
        font-size: 1rem;
        text-decoration: none;
        color: var(--ink);
        transition: background-color .2s, color .2s;
    }
    .menu a:hover, .menu a[aria-current="true"] { color: var(--ink); background: var(--surface-2); }
    .menu a.menu-cta { margin-left: 8px; background: var(--brand); color: var(--on-brand); font-weight: 600; }
    .menu a.menu-cta:hover { background: var(--brand-strong); }
}

/* ---------- Barre d'onglets mobile ---------- */
.tabbar {
    position: fixed;
    inset: auto 0 0;
    z-index: 50;
    padding-bottom: var(--safe-bottom);
    background: var(--surface);
}
.tabbar ul { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); height: var(--tabbar-h); }
.tabbar a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 100%;
    color: var(--ink-2);
    font-size: .8125rem;
    font-weight: 600;
    letter-spacing: -.01em;
    text-decoration: none;
}
.tabbar .icon {
    width: 56px;
    height: 30px;
    padding: 4px 16px;
    border-radius: 999px;
    stroke-width: 1.9;
    transition: background-color .25s var(--ease), color .25s;
}
.tabbar a[aria-current="true"] { color: var(--ink); }
.tabbar a[aria-current="true"] .icon { background: var(--brand-soft); color: var(--brand); }
.tabbar a:focus-visible { outline-offset: -4px; }
@media (min-width: 768px) { .tabbar { display: none; } }
@media (max-width: 359px) {
    .tabbar ul { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .tabbar li:first-child { display: none; } /* le blason ramène déjà en haut de page */
    .contact-actions .action { font-size: .9375rem; padding-inline: 4px; }
    .quick-item .quick-label { font-size: .875rem; }
}

/* ---------- Accueil : le plan du village, et l'essentiel posé dessus ---------- */
.hero { position: relative; isolation: isolate; overflow: hidden; background: var(--night); color: #FFFFFF; padding-top: calc(var(--header-h) + env(safe-area-inset-top, 0px)); }
.hero-panel { position: relative; z-index: 2; padding: 20px var(--gutter) 8px; }
.hero-title { font-family: var(--font-serif); font-weight: 500; font-size: clamp(2.75rem, 13vw, 3.75rem); line-height: .95; letter-spacing: -.035em; }
.hero-title span { display: block; font-size: .36em; letter-spacing: -.01em; margin-bottom: .2em; color: #BFE9DC; }
.quick { margin-top: 16px; }
.quick-status { display: inline-flex; align-items: center; gap: 10px; max-width: 100%; min-height: 52px; padding: 8px 18px; border-radius: 999px; background: rgba(255, 255, 255, .12); color: #FFFFFF; text-decoration: none; transition: transform .25s var(--ease), background-color .2s; }
.quick-status .quick-value { min-width: 0; font-weight: 700; font-size: clamp(1rem, 4.2vw, 1.125rem); line-height: 1.15; }
.quick-chevron { width: 20px; height: 20px; flex-shrink: 0; }
.status-dot { position: relative; width: 12px; height: 12px; border-radius: 999px; background: #E8EEEB; flex-shrink: 0; }
[data-state="open"] .status-dot { background: #7BE3A8; }
[data-state="soon"] .status-dot { background: #F7BE86; }
[data-state="closed"] .status-dot { background: #FF8A80; }
@media (prefers-reduced-motion: no-preference) {
    [data-state="open"] .status-dot::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: #7BE3A8; animation: pulse 2s ease-out 2; }
}
@keyframes pulse { to { transform: scale(2.6); opacity: 0; } }
.quick-actions { display: grid; gap: 8px; margin-top: 16px; }
.quick-item { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 10px 16px; border-radius: 18px; background: #FFFFFF; color: var(--night); text-decoration: none; transition: transform .25s var(--ease), background-color .2s; }
.quick-item .icon { width: 24px; height: 24px; flex-shrink: 0; color: var(--gules-fixed); }
.quick-text { min-width: 0; }
.quick-label { display: block; font-size: .875rem; line-height: 1.3; }
.quick-value { display: block; font-weight: 700; font-size: 1.0625rem; line-height: 1.25; overflow-wrap: anywhere; }
.quick-item:active { transform: scale(.98); }
.hero :focus-visible { outline-color: #F7BE86; }
@media (hover: hover) { .quick-item:hover { transform: translateY(-3px); } .quick-status:hover { background: rgba(255, 255, 255, .22); } }

.map { position: relative; height: 280px; }
.valley { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.valley path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.valley .valley-wood { fill: #173B30; }
.valley-road-s { stroke: rgba(255, 255, 255, .13); stroke-width: 1.2; }
.valley-road { stroke: rgba(255, 255, 255, .3); stroke-width: 2.2; }
.valley-river { stroke: #7FE7D6; stroke-width: 5; }
.valley-glow { stroke: #7FE7D6; stroke-width: 18; opacity: .22; }
.valley-labels text { fill: rgba(255, 255, 255, .62); font: italic 500 19px var(--font-serif); }
.valley-dot { fill: #FFFFFF; stroke: #A32030; stroke-width: 6; }
.valley-pulse { fill: #FFB1A8; opacity: .5; transform-box: fill-box; transform-origin: center; }
.valley-name { fill: #FFFFFF; font: 500 30px var(--font-serif); paint-order: stroke; stroke: var(--night); stroke-width: 6px; }
@media (prefers-reduced-motion: no-preference) {
    .valley-river, .valley-glow { stroke-dasharray: 1; animation: river-flow 2.8s cubic-bezier(.5, 0, .2, 1) both; }
    .valley-pin { animation: pin-in .6s 2s var(--ease) both; }
    /* RGAA 13.8 : le mouvement lancé automatiquement s'arrête avant 5 secondes. */
    .valley-pulse { animation: pin-pulse 2.4s 2.4s ease-out both; }
    .valley-pulse-2 { animation-delay: 2.6s; animation-duration: 2.2s; }
    .hero-title, .quick-status, .quick-actions li { animation: rise .8s var(--ease) both; }
    .quick-status { animation-delay: .1s; }
    .quick-actions li:nth-child(1) { animation-delay: .26s; } .quick-actions li:nth-child(2) { animation-delay: .33s; } .quick-actions li:nth-child(3) { animation-delay: .4s; }
}
@keyframes river-flow { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes pin-in { from { opacity: 0; } }
@keyframes pin-pulse { from { transform: scale(1); opacity: .55; } to { transform: scale(4.2); opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(22px); } }
.map-credit { position: absolute; right: var(--gutter); bottom: 6px; z-index: 3; font-size: .8125rem; color: rgba(255, 255, 255, .78); }

@media (min-width: 1024px) {
    .hero { display: flex; align-items: flex-end; min-height: clamp(600px, 100svh, 900px); }
    .map { position: absolute; inset: 0; height: auto; z-index: 0; }
    .map::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(18, 34, 29, .82) 0%, rgba(18, 34, 29, .25) 52%, rgba(18, 34, 29, 0) 75%); pointer-events: none; }
    .hero-panel { width: 100%; max-width: calc(1296px + 2 * var(--gutter)); margin-inline: auto; padding-block: 24px 56px; }
    .hero-title { font-size: clamp(3.5rem, 6.5vw, 6rem); }
    .hero-title span { font-size: .3em; }
    .quick { margin-top: 20px; }
    .quick-status { min-height: 48px; padding-inline: 20px; }
    .quick-status .quick-value { font-size: 1.125rem; }
    .quick-actions { margin-top: 24px; }
    .quick-actions { grid-template-columns: 1.3fr 1fr 1.1fr; max-width: 900px; gap: 12px; }
    .quick-item { min-height: 64px; padding-inline: 16px; }
    .quick-value { font-size: 1rem; }
    .map-credit { right: 16px; bottom: 8px; }
}
@media (min-width: 1024px) and (max-height: 760px) {
    .hero-title { font-size: clamp(3rem, 6vw, 4.5rem); }
    .hero-panel { padding-bottom: 28px; }
    .quick-item { min-height: 68px; }
}

/* En haut de page, l'en-tête se fond dans le plan. */
.site-header { transition: background-color .3s, color .3s; }
@media (min-width: 768px) {
    .site-header:not(.is-scrolled) { background: transparent; color: #FFFFFF; }
    .site-header:not(.is-scrolled) .brand-sub, .site-header:not(.is-scrolled) .menu a { color: #FFFFFF; }
    .site-header:not(.is-scrolled) .menu a:hover, .site-header:not(.is-scrolled) .menu a[aria-current="true"] { background: rgba(255, 255, 255, .16); }
    .site-header:not(.is-scrolled) .menu a.menu-cta { background: #FFFFFF; color: var(--night); }
}

/* ---------- Sections ---------- */
.section { padding: 48px 0; }
.section-alt { background: var(--surface-2); }
.section-head { margin-bottom: 32px; }
.section-intro { max-width: 52ch; margin-top: 12px; font-size: 1.0625rem; }

@media (min-width: 768px) {
    .section { padding: clamp(56px, 6vw, 88px) 0; }
    .section-head { margin-bottom: 28px; }
    .section-intro { font-size: 1.25rem; }
}
@media (min-width: 1024px) {
    .section-title { padding-left: 3vw; }
    .section-intro { margin-left: 3vw; }
}

/* ---------- Éléments de liste ---------- */
.card { position: relative; transition: transform .3s var(--ease); }
.card:has(.stretched:active) { transform: scale(.99); }
@media (hover: hover) {
    .card:has(.stretched):hover .card-title { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
    .card:hover .card-media img { transform: scale(1.04); }
}
.card-media { overflow: hidden; background: var(--surface-2); }
.card-media:has(.card-media-fallback) { display: none; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.card-media-fallback { display: none; }
.card-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.card-meta { display: block; font-size: .9375rem; color: var(--ink-2); }
.card-meta::first-letter { text-transform: uppercase; }
.card-title { font-size: 1.125rem; font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.card-excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 1rem;
}

/* Actualités : la une à gauche, le fil à droite */
.news-grid { display: grid; gap: 8px; }
.news-card { display: grid; grid-template-columns: 88px 1fr; align-items: center; gap: 14px; min-height: 72px; padding: 10px 0; }
.news-card:has(.card-media-fallback) { grid-template-columns: 1fr; }
.news-card .card-media { aspect-ratio: 1; }
.news-card .card-excerpt { display: none; }
/* Libellé masqué visuellement : la ligne entière reste la zone tactile. */
.news-card .link-more { font-size: 0; }
/* Titres jamais tronqués (RGAA 10.12 : rien ne doit disparaître quand on espace le texte). */

.news-card-featured, .news-card-featured:has(.card-media-fallback) { grid-template-columns: 1fr; gap: 0; padding: 0 0 16px; }
.news-card-featured .card-media { aspect-ratio: 4 / 3; }
.news-card-featured .card-body { padding-top: 16px; gap: 6px; }
.news-card-featured .card-title { font-family: var(--font-serif); font-weight: 500; font-size: 1.75rem; line-height: 1.15; }
.news-card-featured .card-excerpt { display: -webkit-box; -webkit-line-clamp: 3; }
.news-card-featured .link-more { font-size: 1rem; margin-top: 4px; min-height: 44px; }

.btn-more { width: 100%; margin-top: 16px; padding-block: 10px; white-space: normal; text-align: center; }

@media (min-width: 1024px) {
    .news-grid { display: flow-root; }
    .news-card { margin-left: 50%; grid-template-columns: 1fr; min-height: 0; padding: 18px 0; }
    .news-card .card-media { display: none; }
    .news-card .card-body { display: grid; grid-template-columns: 9.5rem 1fr; column-gap: 24px; }
    .news-card .card-meta { grid-row: 1 / span 2; padding-top: 3px; }
    .news-card .card-title { grid-column: 2; font-size: 1.375rem; }
    .news-card .card-excerpt { grid-column: 2; display: -webkit-box; }
    .news-card .link-more { grid-column: 2; }
    .news-card-featured { float: left; width: 42%; margin-left: 0; padding: 0; }
    .news-card-featured .card-media { display: block; aspect-ratio: 4 / 5; }
    .news-card-featured .card-media:has(.card-media-fallback) { display: none; }
    .news-card-featured .card-body { display: flex; }
    .news-card-featured .card-title { font-size: 2.25rem; }
    .btn-more { display: flex; width: auto; margin: 24px 0 0 50%; }
}

/* État vide */
.empty { display: flex; flex-direction: column; gap: 6px; padding: 40px 24px; background: var(--surface-2); }
.section-alt .empty { background: var(--bg); }
.empty-icon { display: none; }
.empty-title { font-family: var(--font-serif); font-size: 1.5rem; }
.empty-text { max-width: 44ch; font-size: 1rem; }

/* ---------- Agenda ---------- */
.agenda-picture { display: none; }
.event-list { display: grid; gap: 12px; }
.event-card { display: grid; grid-template-columns: 64px 1fr; gap: 4px 14px; padding: 14px 0; }
.date-tile { grid-row: 1 / span 2; align-self: start; display: flex; flex-direction: column; line-height: 1; }
.date-weekday, .date-month { font-size: .9375rem; }
.date-day { font-family: var(--font-serif); font-size: 2.5rem; font-weight: 500; letter-spacing: -.02em; margin: 2px 0 4px; }
.event-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.event-card .card-title { font-size: 1.25rem; }
.event-facts { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 1rem; }
.event-facts span { display: inline-flex; align-items: center; gap: 6px; }
.event-facts .icon { width: 1.05em; height: 1.05em; color: var(--brand); }
.event-card:has(.event-thumb) .date-tile { grid-row: 2 / span 2; }
.event-card:has(.event-thumb) .event-main { grid-column: 2; grid-row: 2; }
.event-card:has(.event-thumb) .event-actions { grid-row: 3; }
.event-thumb { grid-column: 1 / -1; grid-row: 1; width: 100%; aspect-ratio: 2 / 1; margin-bottom: 10px; object-fit: cover; object-position: center 25%; }
.event-actions { grid-column: 2; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-top: 6px; }
.event-actions .link-more { min-height: 44px; }
.chip-action {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 999px;
    background: var(--bg);
    color: var(--brand);
    font-weight: 600;
    font-size: .9375rem;
    text-decoration: none;
    transition: background-color .2s, color .2s;
}
.chip-action .icon { width: 18px; height: 18px; }
@media (hover: hover) { .chip-action:hover { background: var(--brand); color: var(--on-brand); } }

@media (min-width: 768px) {
    .event-card { grid-template-columns: 96px 1fr auto; gap: 6px 24px; padding: 20px 0; align-items: start; }
    .date-day { font-size: 3.25rem; }
    .event-card:has(.event-thumb) .date-tile { grid-row: 1 / span 2; }
    .event-card:has(.event-thumb) .event-main { grid-row: 1; }
    .event-card:has(.event-thumb) .event-actions { grid-row: 2; }
    .event-thumb { grid-column: 3; grid-row: 1 / span 2; width: 128px; height: 96px; aspect-ratio: auto; margin: 0; }
    .event-card .card-title { font-size: 1.5rem; }
    .event-actions { justify-content: flex-start; gap: 8px 24px; margin-top: 2px; }
}
@media (min-width: 1024px) {
    .agenda-layout { display: grid; grid-template-columns: 5fr 7fr; gap: 64px; align-items: start; }
    .agenda-picture { display: block; position: sticky; top: calc(var(--header-h) + 32px); }
    .agenda-picture img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
    .event-card.is-pictured .event-thumb { display: none; }
    .event-card.is-pictured { grid-template-columns: 96px 1fr; }
}

/* Événements passés : carrousel horizontal sur mobile */
.past { margin-top: 56px; }
.past-grid {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 72%;
    gap: 16px;
    margin-inline: calc(-1 * var(--gutter));
    padding: 4px var(--gutter) 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--gutter);
    overscroll-behavior-x: contain;
    scrollbar-width: none;
}
.past-grid::-webkit-scrollbar { display: none; }
.past-card { scroll-snap-align: start; overflow: hidden; }
.past-card .card-media { aspect-ratio: 16 / 9; margin-bottom: 12px; }
.past-card .card-title { font-size: 1.125rem; }
.past-card .link-more { margin-top: 6px; min-height: 44px; }
@media (min-width: 768px) {
    .past { margin-top: 96px; }
    .past-grid {
        grid-auto-flow: row;
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 32px;
        margin: 0;
        padding: 0;
        overflow: visible;
    }
}

/* ---------- Conseil ---------- */
.council { display: grid; gap: 16px; align-items: stretch; }
.council-photo img { width: 100%; height: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.council-exec { padding: 24px; background: var(--brand); color: var(--on-brand); }
.council-exec .sub-title { color: inherit; }
.exec-list { display: grid; gap: 18px; }
.exec-name { display: block; font-family: var(--font-serif); font-weight: 500; font-size: 1.5rem; line-height: 1.15; letter-spacing: -.01em; }
.exec-role { display: block; font-size: 1rem; }
.exec-role::first-letter { text-transform: uppercase; }
.council-rest { margin-top: 24px; }
.member-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.member-list li { font-size: 1.0625rem; line-height: 1.3; overflow-wrap: anywhere; }

.callout {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 32px;
    padding: 18px 20px;
    background: var(--surface-2);
    text-decoration: none;
    transition: background-color .2s, color .2s;
}
.callout:active { transform: scale(.99); }
.callout-title { display: block; font-weight: 600; font-size: 1.125rem; }
.callout-text { display: block; font-size: 1rem; }
.callout-arrow { margin-left: auto; }
@media (hover: hover) { .callout:hover { background: var(--brand); color: var(--on-brand); } }

@media (min-width: 768px) {
    .member-list { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1024px) {
    .council.has-photo { grid-template-columns: 8fr 4fr; }
    .council-photo img { aspect-ratio: 16 / 10; }
    .council-exec { padding: 32px; }
    .council-rest { grid-column: 1 / -1; margin-top: 48px; }
    .member-list { grid-template-columns: repeat(4, 1fr); }
    .callout { width: fit-content; min-width: 480px; }
}

/* ---------- Contact : la fiche posée sur la carte ---------- */
.contact { display: grid; gap: 24px; }
.contact-main { display: grid; gap: 16px; align-content: start; padding-inline: var(--gutter); }
.contact-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 88px;
    padding: 12px 6px;
    background: var(--brand);
    color: var(--on-brand);
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: transform .2s var(--ease), background-color .2s, color .2s;
}
.action:active { transform: scale(.97); }
.action .icon { width: 24px; height: 24px; }
.action-value { display: none; }
@media (hover: hover) { .action:hover { background: var(--brand-strong); } }

.hours-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.hours-head .info-label { margin: 0; }
.hours-head .info-label .icon { display: none; }
.hours-status { display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 999px; font-size: .9375rem; font-weight: 600; background: var(--bg); }
.hours-status[data-state="open"] { color: var(--open); }
.hours-status[data-state="soon"] { color: var(--accent); }
.hours-status[data-state="closed"] { color: var(--closed); }

.week li { display: flex; justify-content: space-between; gap: 16px; padding: 8px 10px; margin-inline: -10px; font-variant-numeric: tabular-nums; }
.week-day { font-weight: 600; }
.week-slots { text-align: right; }
.week li.is-closed .week-day { font-weight: 400; }
.week li.is-today { background: var(--brand-soft); }
.week li.is-today .week-day::after { content: " · aujourd’hui"; font-weight: 400; }

.hours > * { display: flex; justify-content: space-between; padding: 10px 0; }

.info { display: block; }
.info-icon { display: none; }
.info-label { margin-bottom: 4px; font-family: var(--font-serif); font-size: 1.375rem; font-weight: 500; }
.info-value { display: block; font-size: 1.0625rem; overflow-wrap: anywhere; }


@media (min-width: 768px) {
    .contact-actions { grid-template-columns: 1fr; gap: 0; }
    .action { flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 44px; padding: 6px 0; background: none; color: var(--ink); font-size: 1rem; text-align: left; }
    .action .icon { width: 20px; height: 20px; color: var(--brand); }
    .action-label { min-width: 76px; }
    .action-value { display: block; color: var(--brand); overflow-wrap: anywhere; }
    .action:hover { background: none; color: var(--brand); }
    .week li { padding: 4px 10px; }
    /* L'adresse figure déjà sur la ligne « Itinéraire ». */
    .contact-main > .info { display: none; }
}

/* ---------- Habillage : cartes, tuiles et accent du blason ---------- */
.section-title, .section-intro { padding-left: 0; margin-left: 0; }
.news-card, .event-card, .past-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
@media (hover: hover) {
    .news-card:hover, .event-card:hover, .past-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
}
.news-grid { gap: 12px; }
.news-card { padding: 12px 16px; overflow: hidden; }
.news-card .card-media { border-radius: var(--radius-sm); }
.news-card .card-meta, .news-card-featured .card-meta { color: var(--gules); font-weight: 600; }
.news-card-featured, .news-card-featured:has(.card-media-fallback) { padding: 0; }
.news-card-featured .card-media { aspect-ratio: 3 / 2; border-radius: 0; }
.news-card-featured .card-media img { object-position: center 25%; }
.news-card-featured .card-body { padding: 20px; }

.event-card { padding: 16px; }
.date-tile { align-items: center; padding: 10px 4px 12px; border-radius: 14px; background: var(--brand); color: var(--on-brand); }
.date-day { font-size: 2.125rem; }
.event-thumb { border-radius: var(--radius-sm); object-fit: contain; background: var(--surface-2); }
.chip-action { background: var(--brand-soft); }
.past-card .card-media { margin-bottom: 0; }
.past-card .card-media img { object-position: top; }
.past-card .card-body { padding: 14px 16px 10px; }
.past .sub-title { display: flex; align-items: center; gap: 10px; }
.past .sub-title .icon { color: var(--gules); }

.council-photo img { border-radius: var(--radius); }
.council-exec { position: relative; display: flex; flex-direction: column; justify-content: center; overflow: hidden; border-radius: var(--radius); }
.council-exec > * { position: relative; z-index: 1; }
.member-list li { padding: 12px 16px; background: var(--surface); border-radius: var(--radius-sm); }
.callout { background: var(--brand-soft); border-radius: var(--radius); }

.empty { border-radius: var(--radius); }
.action { border-radius: var(--radius-sm); }
.week li { border-radius: 8px; }

@media (min-width: 768px) {
    .event-card { padding: 20px; }
    .date-tile { align-self: stretch; justify-content: center; }
    .date-day { font-size: 2.75rem; }
    .event-thumb { width: 112px; height: 136px; }
    .action { border-radius: 0; }
}
@media (min-width: 1024px) {
    .section-head { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: end; gap: 48px; }
    .section-intro { justify-self: end; max-width: none; margin: 0; font-size: 1rem; text-align: right; }
    .news-card-featured .card-media { aspect-ratio: 16 / 10; }
    .news-card-featured .card-body { padding: 24px 28px; }
    .news-card { margin-left: calc(52% + 8px); padding: 16px 20px; margin-bottom: 12px; }
    .news-card-featured { float: left; width: 52%; margin: 0; padding: 0; }

    .btn-more { margin-left: calc(52% + 8px); }
    .agenda-layout { gap: 32px; }
    .agenda-picture { padding: 16px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
    .agenda-picture img { object-fit: contain; border-radius: var(--radius-sm); background: var(--surface-2); }
    .event-list { gap: 16px; }
    .agenda-layout:not(.has-picture) { display: block; }
}

/* ---------- Rythme : un trait de rivière sous chaque titre, l'agenda sur fond de nuit ---------- */
.news-card, .event-card, .past-card { border-radius: 24px; }
.news-card-featured .card-title { font-size: clamp(1.75rem, 2.8vw, 2.5rem); line-height: 1.08; letter-spacing: -.02em; }
.council-exec { background: var(--night); color: #FFFFFF; }
.member-list li { font-weight: 500; }
@media (prefers-color-scheme: dark) { .date-tile { background: var(--brand); color: var(--on-brand); } }

/* ---------- Actualités : cartes blanches sur la nuit, l'action toujours visible ---------- */
#actualites { background: var(--night); color: #FFFFFF; padding-top: clamp(32px, 5vw, 64px); }
#actualites :focus-visible { outline-color: #F7BE86; }
#actualites .section-intro { color: #BFE9DC; }
#actualites .news-grid { display: grid; gap: 10px; }
#actualites .news-card { margin: 0; padding: 0; min-height: 0; float: none; width: auto; display: block; overflow: hidden; background: #FFFFFF; color: var(--ink-fixed); border-radius: 20px; box-shadow: none; transition: transform .25s var(--ease); }
#actualites .news-card:active { transform: scale(.985); }
#actualites .news-card .card-title { text-decoration: none; }

/* Lignes : date, titre, flèche */
#actualites .news-card:not(.news-card-featured) .card-media { display: none; }
#actualites .news-card:not(.news-card-featured) .card-body { display: grid; grid-template-columns: 56px minmax(0, 1fr) 44px; align-items: center; column-gap: 12px; min-height: 76px; padding: 10px 12px; }
#actualites .news-date { grid-row: 1 / span 2; display: flex; flex-direction: column; align-items: center; justify-content: center; height: 56px; border-radius: 14px; background: #E2ECE7; color: var(--night); line-height: 1; }
#actualites .news-day { font-family: var(--font-serif); font-size: 1.5rem; font-weight: 600; }
#actualites .news-month { margin-top: 2px; font-size: .8125rem; font-weight: 600; }
#actualites .news-card:not(.news-card-featured) .card-title { grid-column: 2; font-size: 1rem; font-weight: 700; line-height: 1.25; }
#actualites .news-card:not(.news-card-featured) .card-excerpt { display: none; grid-column: 2; }
#actualites .news-card:not(.news-card-featured) .link-more { grid-column: 3; grid-row: 1 / span 2; display: grid; place-items: center; width: 44px; height: 44px; margin: 0; padding: 0; border-radius: 999px; background: var(--night); color: #FFFFFF; font-size: 0; transition: background-color .2s, transform .25s var(--ease); }
#actualites .news-card:not(.news-card-featured) .link-more .icon { width: 20px; height: 20px; }

/* La une */
#actualites .news-card-featured .card-media { display: block; aspect-ratio: 16 / 9; border-radius: 0; background: #E6EBE4; }
#actualites .news-card-featured .card-media:has(.card-media-fallback) { display: none; }
#actualites .news-card-featured .card-body { display: flex; padding: 16px 18px 18px; }
#actualites .news-card-featured .card-meta { color: var(--gules-fixed); font-weight: 600; }
#actualites .news-card-featured .card-title { font-family: var(--font-serif); font-weight: 500; font-size: 1.375rem; line-height: 1.15; letter-spacing: -.015em; }
#actualites .news-card-featured .link-more { align-self: flex-start; min-height: 44px; margin-top: 10px; padding: 0 18px; border-radius: 999px; background: var(--night); color: #FFFFFF; font-size: 1rem; text-decoration: none; }

#actualites .btn-more { width: 100%; margin-top: 12px; background: none; border-color: rgba(255, 255, 255, .5); color: #FFFFFF; font-size: .9375rem; }
#actualites .empty { background: rgba(255, 255, 255, .08); }

@media (hover: hover) {
    #actualites .news-card:hover { transform: translateY(-3px); }
    #actualites .news-card:hover .link-more { background: var(--gules-fixed); }
    #actualites .btn-more:hover { background: #FFFFFF; color: var(--night); }
}
@media (min-width: 1024px) {
    #actualites .news-grid { display: flow-root; }
    #actualites .news-card-featured { float: left; width: calc(50% - 8px); }
    #actualites .news-card-featured .card-media { aspect-ratio: 16 / 10; }
    #actualites .news-card-featured .card-body { padding: 24px 28px 26px; }
    #actualites .news-card-featured .card-title { font-size: clamp(1.5rem, 2vw, 2rem); }
    #actualites .news-card:not(.news-card-featured) { margin: 0 0 12px calc(50% + 8px); }
    #actualites .news-card:not(.news-card-featured) .card-body { grid-template-columns: 52px minmax(0, 1fr) 44px; column-gap: 16px; min-height: 100px; padding: 14px 20px 14px 16px; }
    #actualites .news-date { height: 52px; }
    #actualites .news-card:not(.news-card-featured) .card-title { font-size: 1.0625rem; }
    #actualites .news-card:not(.news-card-featured) .card-excerpt { display: -webkit-box; -webkit-line-clamp: 2; font-size: .9375rem; }
    #actualites .btn-more { width: auto; margin: 4px 0 0 calc(50% + 8px); }
}

/* ---------- Finitions communes ---------- */
.section-title { font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.75rem); letter-spacing: -.025em; }
#actualites .news-card:not(.news-card-featured) .link-more > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (min-width: 1024px) { .quick-actions { grid-template-columns: 1.5fr 1fr 1.15fr; max-width: 1000px; } }

/* ---------- Agenda : la couleur de la rivière, des dates d'affiche ---------- */
#agenda { background: #7FE7D6; color: var(--ink-fixed); }
#agenda .section-intro { color: var(--ink-fixed); }
#agenda :focus-visible { outline-color: var(--ink-fixed); }
#agenda .agenda-layout { display: block; }
#agenda .event-list { gap: 0; }
#agenda .event-card { display: grid; grid-template-columns: minmax(0, 1fr) 76px; gap: 10px; padding: 18px 0 22px; background: none; color: var(--ink-fixed); border-radius: 0; box-shadow: inset 0 3px 0 var(--ink-fixed); overflow: visible; }
#agenda .event-card:hover { transform: none; box-shadow: inset 0 3px 0 var(--ink-fixed); }
#agenda .event-card .date-tile { grid-column: 1; grid-row: 1; display: flex; flex-flow: row wrap; align-items: baseline; align-self: start; gap: 0 8px; padding: 0; background: none; color: inherit; border-radius: 0; }
#agenda .date-day { order: -1; font-size: clamp(3rem, 14vw, 3.75rem); font-weight: 500; line-height: .85; letter-spacing: -.04em; margin: 0 6px 0 0; }
#agenda .date-weekday, #agenda .date-month { font-size: .9375rem; font-weight: 600; }
#agenda .event-card .event-thumb { grid-column: 2; grid-row: 1; width: 76px; height: 96px; margin: 0; border-radius: 6px; object-fit: cover; object-position: top; background: #FFFFFF; transform: rotate(3deg); box-shadow: 0 10px 24px -8px rgba(18, 34, 29, .5); transition: transform .35s var(--ease); }
#agenda .event-card .event-main { grid-column: 1 / -1; grid-row: 2; }
#agenda .event-card:not(:has(.event-thumb)) .date-tile { grid-column: 1 / -1; }
#agenda .event-card .card-title { font-family: var(--font-serif); font-weight: 500; font-size: clamp(1.25rem, 1rem + 1vw, 1.75rem); line-height: 1.1; letter-spacing: -.02em; }
#agenda .event-facts { font-weight: 600; }
#agenda .event-facts .icon { color: inherit; }
#agenda .card-excerpt { color: inherit; font-size: 1rem; }
#agenda .event-card .event-actions { grid-column: 1 / -1; grid-row: 3; gap: 8px; justify-content: flex-start; margin-top: 6px; }
#agenda .event-actions .link-more { min-height: 44px; padding: 0 16px; border-radius: 999px; background: var(--night); color: #FFFFFF; font-size: .9375rem; text-decoration: none; transition: background-color .2s; }
#agenda .chip-action { min-height: 44px; padding: 0 14px; background: none; box-shadow: inset 0 0 0 1.5px var(--night); color: var(--ink-fixed); font-size: .9375rem; }
#agenda .past .sub-title, #agenda .past .sub-title .icon { color: var(--ink-fixed); }
#agenda .past { margin-top: 32px; padding-top: 24px; box-shadow: inset 0 3px 0 var(--ink-fixed); }
#agenda .past-grid { align-items: start; }
#agenda .past-card { background: #FFFFFF; color: var(--ink-fixed); }
#agenda .past-card .card-meta { color: inherit; }
#agenda .past-card .link-more { color: #2F5D50; font-weight: 700; }
#agenda .empty { background: rgba(18, 34, 29, .1); }
@media (hover: hover) {
    #agenda .event-card:hover .event-thumb { transform: rotate(0) scale(1.06); }
    #agenda .event-card:hover .link-more { background: var(--gules-fixed); }
    #agenda .chip-action:hover { background: var(--night); color: #FFFFFF; }
}
@media (min-width: 768px) {
    #agenda .event-card, #agenda .event-card:has(.event-thumb) { grid-template-columns: 84px minmax(0, 1fr) 96px; column-gap: 20px; padding: 22px 0 26px; align-items: start; }
    #agenda .date-tile { justify-content: flex-start; }
    #agenda .date-day { flex-basis: 100%; font-size: clamp(3.25rem, 5vw, 4.5rem); margin-bottom: 6px; }
    #agenda .event-card .date-tile, #agenda .event-card:not(:has(.event-thumb)) .date-tile { grid-column: 1; grid-row: 1 / span 2; }
    #agenda .event-card .event-main { grid-column: 2; grid-row: 1; }
    #agenda .event-card .event-actions { grid-column: 2; grid-row: 2; }
    #agenda .event-card .event-thumb { grid-column: 3; grid-row: 1 / span 2; width: 96px; height: 124px; }
}

/* ---------- Conseil : la photo bord à bord, les noms comme un générique ---------- */
#conseil { padding-top: 0; }
.council-hero { position: relative; background: var(--night); color: #FFFFFF; }
.council-hero img { display: block; width: 100%; height: clamp(260px, 50svh, 500px); object-fit: cover; object-position: center 35%; }
.council-hero.has-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10, 20, 16, 0) 25%, rgba(10, 20, 16, .72) 58%, rgba(10, 20, 16, .92) 100%); pointer-events: none; }
.council-hero.has-photo .section-head { text-shadow: 0 1px 14px rgba(10, 20, 16, .75); }
.council-hero .section-head { margin: 0 auto; padding-block: 40px 72px; }
.council-hero.has-photo .section-head { position: absolute; inset: auto 0 0; z-index: 1; }
.council-hero .section-title { font-size: clamp(2rem, 1.5rem + 2.4vw, 3.25rem); line-height: 1; }
.council-hero .section-intro { color: #FFFFFF; }
#conseil .council, #conseil .council.has-photo { display: block; }
.council-hero.has-photo .section-head { padding-bottom: 72px; }
#conseil .council-exec { position: relative; z-index: 2; display: block; margin-top: -40px; padding: 20px 22px; background: var(--surface); color: var(--ink); border-radius: 24px; overflow: visible; box-shadow: var(--shadow); }
#conseil .sub-title { margin-bottom: 12px; font-size: 1.125rem; }
#conseil .exec-list { grid-template-columns: 1fr; gap: 14px; }
#conseil .exec { display: flex; flex-direction: column; }
#conseil .exec-role { order: -1; color: var(--ink-2); font-weight: 500; font-size: .9375rem; }
#conseil .exec-name { font-size: 1.375rem; line-height: 1.15; letter-spacing: -.015em; }
/* L'écharpe tricolore distingue la maire. */
#conseil .exec:first-child::before { content: ""; order: -2; width: 48px; height: 5px; margin-bottom: 8px; border-radius: 3px; background: linear-gradient(90deg, #1F3F95 0 33.3%, #FFFFFF 33.3% 66.6%, #D0202E 66.6%); box-shadow: 0 0 0 1px rgba(23, 33, 29, .14); }
#conseil .exec:first-child .exec-name { font-size: 1.625rem; }
#conseil .council-rest { margin-top: 32px; }
#conseil .member-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
#conseil .member-list li { display: block; padding: 0; background: none; border-radius: 0; box-shadow: none; font-family: var(--font-sans); font-weight: 500; font-size: 1rem; line-height: 1.3; letter-spacing: 0; overflow-wrap: anywhere; }
#conseil .callout { width: 100%; min-width: 0; margin-top: 24px; padding: 14px 16px 14px 20px; background: var(--brand-soft); color: var(--ink); border-radius: 20px; box-shadow: none; }
#conseil .callout-title { font-family: var(--font-sans); font-weight: 700; font-size: 1.0625rem; line-height: 1.25; }
#conseil .callout-text { font-size: .9375rem; }
#conseil .callout-arrow { box-sizing: content-box; width: 18px; height: 18px; padding: 13px; border-radius: 999px; background: var(--night); color: #FFFFFF; flex-shrink: 0; transition: background-color .2s; }
@media (hover: hover) { #conseil .callout:hover { background: var(--brand-soft); color: var(--ink); transform: translateY(-3px); } #conseil .callout:hover .callout-arrow { background: var(--gules-fixed); } }
@media (min-width: 768px) {
    #conseil .council-exec { margin-top: -48px; padding: 24px 32px 26px; }
    #conseil .exec-list { grid-template-columns: repeat(3, 1fr); gap: 32px; align-items: end; }
    #conseil .council-rest { display: grid; grid-template-columns: 2fr 1fr; column-gap: 40px; align-items: start; margin-top: 40px; }
    #conseil .council-rest .sub-title { grid-column: 1; }
    #conseil .member-list { grid-column: 1; grid-template-columns: repeat(3, 1fr); }
    #conseil .callout { grid-column: 2; grid-row: 1 / span 2; margin-top: 0; }
}

@media (max-width: 767px) { .council-hero img { height: min(112vw, 460px); object-position: center 20%; } }

/* ---------- Contact : retour à la nuit, comme l'accueil ---------- */
#contact { background: var(--night); color: #FFFFFF; }
#contact .section-intro { color: #BFE9DC; }
#contact :focus-visible { outline-color: #F7BE86; }
#contact .action { background: #FFFFFF; color: var(--ink-fixed); border-radius: 18px; }
#contact .action .icon { color: var(--gules-fixed); }
#contact .hours-card { background: #FFFFFF; color: var(--ink-fixed); box-shadow: none; border-radius: 24px; }
#contact .hours-status { background: #E2ECE7; }
#contact .hours-status[data-state="open"] { color: #14603A; }
#contact .hours-status[data-state="soon"] { color: #7E3D12; }
#contact .hours-status[data-state="closed"] { color: #A32030; }
#contact .week li.is-today { background: #E2ECE7; }
@media (min-width: 768px) {
    #contact .contact-actions { padding: 12px 20px; background: #FFFFFF; color: var(--ink-fixed); border-radius: 24px; box-shadow: none; }
    #contact .action { background: none; border-radius: 0; }
    #contact .contact-main { align-items: stretch; }
    #contact .contact-actions { align-content: space-evenly; }
    #contact .action-value { color: #2F5D50; }
}

/* ---------- Mobile et tablette : le plan derrière le titre, l'essentiel en une vue ---------- */
@media (max-width: 1023px) {
    .hero { display: flex; flex-direction: column; justify-content: flex-end; min-height: calc(100svh - var(--tabbar-h) - var(--safe-bottom)); padding-top: 0; }
    .map { position: absolute; inset: 0 0 auto; height: 58svh; z-index: 0; }
    .map::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(18, 34, 29, .35) 0%, rgba(18, 34, 29, 0) 30%, rgba(18, 34, 29, 0) 55%, var(--night) 100%); pointer-events: none; }
    .valley-river { stroke-width: 9; }
    .valley-glow { stroke-width: 30; }
    .valley-road { stroke-width: 3.5; }
    .valley-road-s { stroke-width: 2; }
    .valley-labels text { font-size: 34px; }
    .valley-name { display: none; }
    .valley-dot { stroke-width: 9; }
    .valley-pin { transform: translate(1060px, 470px) scale(1.8); }
    .hero-panel { padding-top: calc(var(--header-h) + env(safe-area-inset-top, 0px) + 24px); padding-bottom: 36px; }
    .quick-actions { gap: 6px; }
    .quick-item { min-height: 56px; padding: 7px 14px; gap: 12px; border-radius: 14px; }
    .quick-item .icon { width: 20px; height: 20px; }
    .quick-label { font-size: .8125rem; }
    .quick-value { font-size: 1rem; }
    .site-header:not(.is-scrolled) { background: transparent; color: #FFFFFF; }
    .site-header:not(.is-scrolled) .header-call { background: #FFFFFF; color: var(--night); }

}

/* ---------- Pied de page : la fin de page, sur la couleur de la rivière ---------- */
.site-footer { padding-block: 40px 12px; background: #7FE7D6; color: var(--ink-fixed); }
.site-footer :focus-visible { outline-color: var(--ink-fixed); }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 24px; }
.footer-brand { grid-column: 1 / -1; display: flex; align-items: flex-start; gap: 16px; }
.footer-blason { display: block; width: 56px; flex-shrink: 0; }
.footer-name { font-family: var(--font-serif); font-weight: 500; font-size: 1.5rem; line-height: 1.15; letter-spacing: -.015em; }
.footer-address { margin-top: 4px; font-size: 1rem; }
.socials { display: flex; gap: 8px; margin-top: 12px; }
.socials a { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 999px; background: var(--night); color: #FFFFFF; text-decoration: none; transition: background-color .2s; }
.socials a:hover { background: var(--gules-fixed); }
.footer-heading { margin-bottom: 4px; font-size: .9375rem; font-weight: 700; }
.footer-list a { display: inline-flex; align-items: center; min-height: 44px; color: inherit; text-decoration: none; text-underline-offset: 4px; }
.footer-list a:hover { text-decoration: underline; }
.footer-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; margin-top: 16px; font-size: .9375rem; }
.admin-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: inherit; text-decoration: none; text-underline-offset: 4px; }
.admin-link:hover { text-decoration: underline; }
.admin-link .icon { width: 1em; height: 1em; }
@media (min-width: 1024px) {
    .site-footer { padding-block: 56px 12px; }
    .footer-grid { grid-template-columns: 2fr 1fr 1fr; gap: 48px; }
    .footer-brand { grid-column: auto; }
    .footer-blason { width: 72px; }
    .footer-name { font-size: 2rem; }
    .footer-bottom { margin-top: 32px; }
}

/* ---------- Contact : horaires complets ---------- */
.contact-main { max-width: calc(1296px + 2 * var(--gutter)); margin-inline: auto; width: 100%; }
.hours-card { padding: 16px 20px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
@media (min-width: 768px) {
    .contact-main { grid-template-columns: 1fr 1fr; align-items: start; }
    .contact-actions { padding: 16px 20px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
}

/* ---------- Pages légales ---------- */
.legal-header { padding-block: 12px; background: var(--bg); }
.legal-header .auth-back { margin-top: 0; }
.legal { padding-block: 40px 96px; }
.legal-prose { max-width: calc(72ch + 2 * var(--gutter)); }
.legal-prose h1 { font-family: var(--font-serif); font-weight: 500; font-size: clamp(2.5rem, 6vw, 4rem); line-height: 1.05; letter-spacing: -.02em; text-wrap: balance; }
.legal-prose h2 { margin-top: 1.8em; font-family: var(--font-serif); font-weight: 500; font-size: 1.75rem; line-height: 1.15; }
.legal-prose h3 { margin-top: 1.4em; font-size: 1.125rem; font-weight: 600; }
.auth-legal { margin-top: 4px; font-size: .9375rem; }
.auth-legal a { display: inline-flex; align-items: center; min-height: 44px; }

/* ---------- Fenêtres modales : feuille glissante sur mobile ---------- */
.modal {
    width: 100%;
    max-width: 100%;
    max-height: 92dvh;
    margin: auto 0 0;
    padding: 0;
    border: 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    background: var(--surface);
    color: var(--ink);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    overscroll-behavior: contain;
}
.modal[open] { animation: sheet-in .38s var(--ease); }
.modal.is-releasing { transition: transform .3s var(--ease); }
.modal::backdrop { background: rgba(8, 14, 12, .6); }
@keyframes sheet-in { from { transform: translateY(100%); } }
@keyframes modal-in { from { opacity: 0; transform: translateY(24px) scale(.98); } }

.modal-panel { position: relative; display: flex; flex-direction: column; max-height: 92dvh; }
.modal-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.sheet-grabber {
    position: absolute;
    inset: 0 0 auto;
    z-index: 3;
    display: grid;
    place-items: center;
    height: 28px;
    touch-action: none;
    cursor: grab;
}
.sheet-grabber span { width: 40px; height: 5px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 35%, transparent); }
.modal-close {
    position: absolute;
    top: 14px; right: 14px;
    z-index: 4;
    display: grid;
    place-items: center;
    width: 44px; height: 44px;
    border: 0;
    border-radius: 999px;
    background: rgba(10, 20, 16, .62);
    color: #FFFFFF;
}
.modal-close:hover { background: rgba(10, 20, 16, .8); }
.modal-cover { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.modal-body { display: flex; flex-direction: column; gap: 8px; padding: 24px 20px 20px; }
.modal-scroll > .modal-body:first-child { padding-top: 40px; }
.modal-scroll > .modal-body:first-child .card-meta { padding-right: 52px; }
.modal-title { font-family: var(--font-serif); font-weight: 600; font-size: clamp(1.5rem, 1.2rem + 1.6vw, 2.25rem); line-height: 1.15; letter-spacing: -0.01em; text-wrap: balance; }
.modal .event-facts { padding-bottom: 12px; }
.modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px calc(12px + var(--safe-bottom));
    background: var(--surface);
}
.modal-actions .btn { flex: 1 1 auto; min-height: 48px; padding: 0 16px; }
.modal-actions .btn .icon { width: 18px; height: 18px; }

@media (min-width: 768px) {
    .modal { width: min(100% - 48px, 760px); max-height: calc(100dvh - 64px); margin: auto; border-radius: var(--radius-lg); }
    .modal[open] { animation-name: modal-in; }
    .modal-panel { max-height: calc(100dvh - 64px); }
    .sheet-grabber { display: none; }
    .modal-body { padding: 36px 40px 28px; gap: 10px; }
    .modal-scroll > .modal-body:first-child { padding-top: 36px; }
    .modal-actions { justify-content: flex-end; padding: 16px 24px; }
    .modal-actions .btn { flex: 0 0 auto; }
}

.prose { font-size: 1.0625rem; line-height: 1.7; color: var(--ink); overflow-wrap: anywhere; }
.prose > * + * { margin-top: .8em; }
.prose > div > br:last-child { display: none; }
.prose a { color: var(--brand); text-underline-offset: 3px; }
.prose ul { list-style: disc; padding-left: 1.4em; }
.prose ol { list-style: decimal; padding-left: 1.4em; }
.prose strong { font-weight: 700; }
.prose img { height: auto; border-radius: 12px; }

/* Galerie */
.gallery { position: relative; background: var(--surface-2); }
.gallery-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-track img { flex: 0 0 100%; width: 100%; height: min(58dvh, 520px); object-fit: contain; scroll-snap-align: center; }
.gallery-btn {
    position: absolute;
    top: 50%;
    display: none;
    place-items: center;
    width: 44px; height: 44px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .92);
    color: #17211D;
    transform: translateY(-50%);
    box-shadow: var(--shadow);
}
.gallery-prev { left: 12px; }
.gallery-next { right: 12px; }
.gallery-count {
    position: absolute;
    left: 50%; bottom: 12px;
    padding: 2px 10px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .6);
    color: #FFFFFF;
    font-size: .875rem;
    font-weight: 600;
    transform: translateX(-50%);
}
@media (hover: hover) { .gallery-btn { display: grid; } }
@media (min-width: 768px) { .gallery-track img { height: min(52dvh, 480px); } }

/* ---------- Toast ---------- */
.toast {
    position: fixed;
    left: 50%;
    bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 16px);
    z-index: 200;
    padding: 12px 18px;
    border-radius: 999px;
    background: #17211D;
    color: #FFFFFF;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translate(-50%, 12px);
    pointer-events: none;
    transition: opacity .25s, transform .25s var(--ease);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast:empty { display: none; }

/* ---------- Apparition au défilement ---------- */
@media (prefers-reduced-motion: no-preference) {
    .js [data-reveal] { opacity: 0; transform: translateY(20px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
    .js [data-reveal].is-visible { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ==========================================================================
   Page de connexion
   ========================================================================== */
.auth-page { padding-bottom: 0; }
.auth {
    min-height: 100svh;
    display: grid;
    place-items: center;
    grid-template-columns: minmax(0, 420px);
    justify-content: center;
    padding: 24px var(--gutter);
    background: var(--surface-2);
}
.auth-card {
    width: 100%;
    max-width: 420px;
    padding: clamp(24px, 6vw, 44px);
    background: var(--surface);
}
.auth-card .brand { margin-bottom: 24px; }
.auth-card .brand-sub { display: block; }
.auth-title { font-family: var(--font-serif); font-weight: 600; font-size: 1.875rem; line-height: 1.1; letter-spacing: -0.01em; }
.auth-lead { margin-top: 8px; color: var(--ink-2); }
.form { display: grid; gap: 18px; margin-top: 24px; }
.form-hint { font-size: .9375rem; color: var(--ink-2); }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: .9375rem; }
.field input {
    width: 100%;
    min-width: 0;
    min-height: 52px;
    padding: 0 16px;
    border: 1.5px solid var(--ink-2); /* RGAA 3.3 : contour du champ contrasté à plus de 3:1 */
    border-radius: 12px;
    background: var(--bg);
    color: var(--ink);
    font: inherit;
    font-size: 1.0625rem; /* ≥ 16px : évite le zoom automatique d'iOS */
    transition: border-color .2s, box-shadow .2s;
}
.field input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 22%, transparent); }
.btn-block { width: 100%; background: var(--brand); color: var(--on-brand); border: 0; }
.btn-block:hover { background: var(--brand-strong); }
.alert { padding: 12px 16px; border-radius: 12px; background: #FDECEA; color: #8A1C12; font-weight: 500; border: 1px solid #F5C2BC; }
@media (prefers-color-scheme: dark) { .alert { background: #3A1A16; color: #FFC9C0; border-color: #6B2A22; } }
.auth-back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-top: 12px; color: var(--ink-2); font-size: .9375rem; text-decoration: none; }
.auth-back:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.auth-back .icon { width: 1em; height: 1em; }
