/*
 * Feuille de style du site "Foire de la Saint-Martin" (Aramon).
 * Palette et typographie reprises fidelement du design fourni (fichiers .dc.html).
 */
:root {
    --sm-cream: #f3e7ce;
    --sm-cream-2: #fbf3df;
    --sm-cream-3: #e9d6ac;
    --sm-brown: #2e2016;
    --sm-brown-2: #4a3a24;
    --sm-brown-3: #7a5a2e;
    --sm-brown-4: #6b5636;
    --sm-brown-5: #5b4a30;
    --sm-orange: #a8432a;
    --sm-gold: #c1852f;
    --sm-gold-2: #e0b877;
    --sm-green: #5f6b3b;
    --sm-line: #cbb384;
    --sm-line-2: #d8c496;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--sm-cream);
    color: var(--sm-brown);
    font-family: 'Zilla Slab', serif;
}

a { color: inherit; }

h1, h2, h3, .font-display { font-family: 'Alfa Slab One', serif; }
.font-kicker { font-family: 'Marcellus SC', serif; }

input, select, textarea, button {
    font-family: 'Zilla Slab', serif;
    font-size: 16px;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 5vw; }

/* HEADER public */
.site-header {
    position: sticky; top: 0; z-index: 40;
    background: var(--sm-cream);
    display: flex; align-items: center; justify-content: space-between;
    gap: 24px; padding: 16px 5vw; border-bottom: 3px solid var(--sm-brown);
}
.site-header .brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.site-header .brand .logo { width: 92px; height: 92px; display: block; flex-shrink: 0; }
.site-header .brand .name { font-family: 'Alfa Slab One', serif; font-size: 24px; color: var(--sm-brown); }
.site-nav { display: flex; align-items: center; gap: 32px; font-size: 20px; letter-spacing: .04em; flex-wrap: wrap; }
.site-nav a { text-decoration: none; }
.site-nav .btn-cta { padding: 13px 24px; }
.site-nav a.active { border-bottom: 2px solid var(--sm-orange); padding-bottom: 2px; }
/* PC : les liens du menu sont des elements directs de .site-nav (display: contents), le burger est masque. */
.nav-menu { display: contents; }
.nav-toggle { display: none; }

/* PC (801 px et plus) : en-tete sur une seule ligne, tailles fluides entre 801 et 1280 px (valeurs fixes au-dela de 1280 px).
   Calcul de largeur, pire cas = police de secours large (0,64 em par caractere, espacement des lettres compris), 7 libelles = 55 caracteres, "Exposer" = 7 :
   - 801 px : disponible 801 - 2x14 = 773 px. Marque 48 + 10 + 9,5 em x 14 (nom sur 2 lignes) = 191. Menu 55 x 0,64 x 12 = 422, bouton 6,96 em = 84, 7 ecarts x 8 = 56, soit 562. Total 191 + 12 + 562 = 765 px.
   - 1024 px : disponible 949 px, necessaire environ 912 px. 1280 px : disponible 1152 px, necessaire environ 1090 px.
   Interpolation lineaire : police 12 a 16 px, ecart 8 a 20 px, logo 48 a 72 px, nom 14 a 18 px, marges 14 px a 5vw. */
@media (min-width: 801px) {
    .site-header { gap: 12px; padding: 12px clamp(14px, calc(10.5vw - 70px), 5vw); }
    .site-header .brand { gap: 10px; flex: 0 1 auto; min-width: 0; }
    .site-header .brand .logo { width: clamp(48px, calc(5.01vw + 7.9px), 72px); height: auto; aspect-ratio: 1; }
    .site-header .brand .name { font-size: clamp(14px, calc(.835vw + 7.31px), 18px); line-height: 1.15; max-width: 9.5em; }
    .site-nav { flex-wrap: nowrap; flex-shrink: 0; gap: clamp(8px, calc(2.505vw - 12.07px), 20px); font-size: clamp(12px, calc(.835vw + 5.31px), 16px); letter-spacing: .02em; }
    .site-nav a { white-space: nowrap; }
    .site-nav .btn-cta { padding: .65em 1.1em; }
}
.btn-cta {
    background: var(--sm-orange); color: var(--sm-cream); text-decoration: none;
    padding: 10px 18px; font-weight: 600; letter-spacing: .06em; display: inline-block; border: none; cursor: pointer;
}

/* HERO */
.hero {
    padding: 56px 5vw 52px;
    background: linear-gradient(180deg, var(--sm-gold) 0%, var(--sm-orange) 100%);
    color: #f7ecd4;
}
.hero .kicker { font-family: 'Marcellus SC', serif; letter-spacing: .26em; font-size: 13px; opacity: .92; }
.hero h1 { margin: 12px 0; font-size: clamp(40px, 5.5vw, 64px); line-height: .95; text-shadow: 3px 3px 0 rgba(46,32,22,.35); }
.hero p { margin: 0; max-width: 600px; font-size: 18px; line-height: 1.55; color: #fbf1da; }

section.block { max-width: 1100px; margin: 0 auto; padding: 56px 5vw; }
.block h2 { margin: 0 0 6px; font-size: 32px; color: var(--sm-orange); }
.block .rule { width: 70px; height: 4px; background: var(--sm-green); margin-bottom: 26px; }

.card {
    border: 2px solid var(--sm-brown); background: var(--sm-cream-2); padding: 24px 22px;
}

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
@media (max-width: 800px) {
    .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

/* Page Contact : mobile first, une colonne puis deux colonnes (formulaire un peu plus large) */
.contact-layout { display: grid; grid-template-columns: 1fr; gap: 40px; align-items: start; max-width: 1500px; padding: 52px 4vw 60px; }
.contact-col { min-width: 0; }
@media (min-width: 801px) {
    .contact-layout { grid-template-columns: 1.3fr 1fr; gap: 56px; }
}

.placeholder-img {
    background: repeating-linear-gradient(45deg, #d8c091 0 14px, #e3cfa0 14px 28px);
    border: 1px solid var(--sm-brown);
}

.site-footer {
    background: var(--sm-brown); color: var(--sm-cream-3); padding: 40px 5vw;
    display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap;
}
.site-footer .col-title { font-family: 'Marcellus SC', serif; letter-spacing: .14em; color: var(--sm-gold); margin-bottom: 4px; display: block; }
.site-footer a { text-decoration: none; color: var(--sm-cream-3); }

.form-field { margin-bottom: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; letter-spacing: .04em; color: var(--sm-brown-5); }
.form-field input, .form-field select, .form-field textarea {
    padding: 12px 14px; border: 2px solid var(--sm-brown); background: var(--sm-cream);
}
.form-errors { color: var(--sm-orange); font-size: 13px; margin-top: 4px; }
.flash {
    border: 2px solid var(--sm-green); background: var(--sm-cream-2); padding: 20px 24px; margin-bottom: 20px;
}
.flash.error { border-color: var(--sm-orange); }

/* ADMIN */
.admin-layout { display: flex; min-height: 100vh; background: #ece1c6; }
.admin-sidebar {
    width: 250px; flex-shrink: 0; background: var(--sm-brown); color: var(--sm-cream-3);
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.admin-sidebar .brand { padding: 22px 22px 20px; border-bottom: 1px solid var(--sm-brown-2); display: flex; align-items: center; gap: 12px; }
.admin-sidebar .logo { width: 44px; height: 44px; display: block; flex-shrink: 0; }
.admin-nav { flex: 1; padding: 14px 12px; display: flex; flex-direction: column; gap: 4px; }
.admin-nav a {
    display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left;
    text-decoration: none; padding: 12px 14px; font-size: 15px; letter-spacing: .02em; color: var(--sm-cream-3);
}
.admin-nav a.active { background: var(--sm-orange); color: var(--sm-cream); }
.admin-bottom { padding: 14px 12px; border-top: 1px solid var(--sm-brown-2); display: flex; flex-direction: column; gap: 4px; }
.admin-bottom a { text-decoration: none; padding: 11px 14px; font-size: 14px; color: var(--sm-cream-3); }
.admin-main { flex: 1; min-width: 0; }
.admin-topbar {
    background: var(--sm-cream); border-bottom: 3px solid var(--sm-brown); padding: 18px 34px;
    display: flex; align-items: center; justify-content: space-between; gap: 20px; position: sticky; top: 0; z-index: 20;
}
.admin-topbar h1 { margin: 0; font-size: 24px; color: var(--sm-brown); }
.admin-topbar .subtitle { font-size: 13px; color: var(--sm-brown-3); margin-top: 2px; }
.admin-content { padding: 30px 34px 50px; }
.admin-table { background: var(--sm-cream); border: 2px solid var(--sm-brown); width: 100%; border-collapse: collapse; }
.admin-table th {
    text-align: left; font-family: 'Marcellus SC', serif; letter-spacing: .1em; font-size: 12px; color: var(--sm-brown-3);
    padding: 14px 22px; border-bottom: 2px solid var(--sm-brown);
}
.admin-table td { padding: 14px 22px; border-bottom: 1px solid var(--sm-line-2); font-size: 14px; }
.badge { font-family: 'Marcellus SC', serif; letter-spacing: .08em; font-size: 11px; padding: 4px 10px; }
.badge-green { background: #dfe4cb; color: #455024; }
.badge-amber { background: #f3e0be; color: #8a5a12; }
.badge-red { background: #f0d3c9; color: #8a2f12; }
.btn-primary {
    background: var(--sm-orange); color: var(--sm-cream); border: none; padding: 11px 20px;
    font-weight: 700; font-size: 14px; cursor: pointer; text-decoration: none; display: inline-block;
}
.btn-link { color: var(--sm-green); text-decoration: none; font-weight: 600; font-size: 14px; }
.btn-link.danger { color: var(--sm-orange); }
.stat-card { background: var(--sm-cream); border: 2px solid var(--sm-brown); border-bottom: 5px solid var(--sm-orange); padding: 20px 22px; }
.stat-card .label { font-family: 'Marcellus SC', serif; letter-spacing: .12em; font-size: 12px; color: var(--sm-brown-3); }
.stat-card .value { font-family: 'Alfa Slab One', serif; font-size: 38px; color: var(--sm-brown); margin-top: 4px; line-height: 1; }
.stat-card .hint { font-size: 13px; color: var(--sm-orange); margin-top: 6px; }

/* AFFICHE DE L'EDITION : bloc de droite du hero, agrandissement, page Archives */
.hero-affiche {
    display: flex; align-items: center; justify-content: center; padding: 16px;
    border-left: 3px solid var(--sm-brown); background: repeating-linear-gradient(45deg, #d8c091 0 14px, #e3cfa0 14px 28px); min-width: 0;
}
/* Colonne de gauche a 40 % de la largeur, affiche entiere (hauteur max 80vh) centree sur fond raye. */
.hero.hero-avec-affiche { grid-template-columns: 40% minmax(0, 1fr) !important; }
.hero-avec-affiche .affiche-lien { width: auto; max-width: 100%; }
.hero-avec-affiche .affiche-hero-img { width: auto; height: auto; max-width: 100%; max-height: 80vh; object-fit: contain; border: 2px solid var(--sm-brown); }
.affiche-lien { display: block; max-width: 100%; cursor: zoom-in; }
.affiche-hero-img { display: block; max-width: 100%; max-height: 80vh; width: auto; height: auto; object-fit: contain; border: 2px solid var(--sm-brown); }
.affiche-archive-img { display: block; width: 100%; height: 160px; object-fit: contain; background: var(--sm-cream); border: 1px solid var(--sm-brown); }
.affiche-archive-lien { margin-bottom: 10px; }
.affiche-zoom { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; overflow: visible; cursor: zoom-out; }
.affiche-zoom::backdrop { background: rgba(46,32,22,.88); }
.affiche-zoom img { display: block; max-width: 94vw; max-height: 94vh; max-height: 94dvh; width: auto; height: auto; object-fit: contain; }
.affiche-zoom-fermer {
    position: fixed; top: max(14px, env(safe-area-inset-top)); right: max(18px, env(safe-area-inset-right)); width: 44px; height: 44px; border: 2px solid var(--sm-cream);
    background: var(--sm-brown); color: var(--sm-cream); font-size: 28px; line-height: 1; cursor: pointer;
}
@media (max-width: 800px) {
    /* Mobile : le texte d'abord, l'affiche juste apres (colonne unique, seulement quand une affiche existe). */
    .hero.hero-avec-affiche { grid-template-columns: 1fr !important; }
    .hero-avec-affiche .hero-affiche { border-left: 0; border-top: 3px solid var(--sm-brown); padding: 24px; }
    .hero-avec-affiche .affiche-hero-img { width: auto; height: auto; min-height: 0; object-fit: contain; border: 2px solid var(--sm-brown); }
}

/* PAGE HISTOIRE : texte de l'association et photo ancienne cote a cote */
.histoire-grille { display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: start; }
@media (max-width: 800px) {
    .histoire-grille { grid-template-columns: 1fr; gap: 24px; }
}

/* ==========================================================================
 * MISE EN PAGE DES GABARITS PUBLICS (ex styles en ligne), regles PC identiques a l'ancien rendu.
 * Les ajustements smartphone et tablette sont regroupes en fin de fichier.
 * ========================================================================== */

/* Largeurs de section */
section.block.block-w1000 { max-width: 1000px; }
section.block.block-w1100 { max-width: 1100px; }
section.block.block-w1200 { max-width: 1200px; }
section.block.block-archives { max-width: 1500px; padding-left: 4vw; padding-right: 4vw; }
section.block.block-tarifs { padding-bottom: 8px; }
section.block.block-centre { text-align: center; }
.section-sable { background: var(--sm-cream-3); padding: 56px 5vw; }
.section-interieur { max-width: 1100px; margin: 0 auto; }

/* Textes et titres communs */
.surtitre { letter-spacing: .2em; font-size: 13px; color: var(--sm-orange); }
.surtitre.surtitre-large { letter-spacing: .24em; }
.etiquette { letter-spacing: .14em; font-size: 12px; color: var(--sm-orange); }
.etiquette.etiquette-vert { color: var(--sm-green); }
.etiquette.etiquette-majuscules { text-transform: uppercase; }
h2.titre-vert { margin: 0 0 6px; color: var(--sm-green); }
.texte-section { margin: 0 0 28px; max-width: 640px; font-size: 17px; color: var(--sm-brown-5); line-height: 1.55; }
.message-vide { font-size: 16px; color: var(--sm-brown-5); }
.lien-suite { margin-top: 22px; }
.lien-fort { color: var(--sm-orange); font-weight: 700; text-decoration: none; }

/* Accueil : hero */
.hero.hero-accueil { display: grid; grid-template-columns: 1.15fr .85fr; padding: 0; }
.hero-texte { padding: 64px 5vw 60px; }
.hero .hero-titre { margin: 14px 0 0; }
.hero-date { margin-top: 22px; display: inline-flex; align-items: baseline; gap: 14px; background: #2e2016; padding: 12px 20px; }
.hero-date-valeur { font-size: 26px; color: #f3e7ce; }
.hero-date-lieu { letter-spacing: .2em; font-size: 13px; color: #e0b877; }
.hero .hero-intro { margin: 24px 0 28px; max-width: 460px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.btn-hero-plein { background: #f3e7ce; color: #a8432a; text-decoration: none; padding: 15px 26px; font-weight: 700; letter-spacing: .04em; }
.btn-hero-contour { border: 2px solid #f3e7ce; color: #f3e7ce; text-decoration: none; padding: 13px 26px; font-weight: 600; letter-spacing: .04em; }
.hero-placeholder { position: relative; display: flex; align-items: center; justify-content: center; min-height: 420px; border-left: 3px solid #2e2016; }
.hero-placeholder-legende { position: absolute; top: 16px; left: 16px; font-size: 12px; letter-spacing: .1em; color: #8a6a34; background: #f3e7ce; padding: 4px 8px; }

/* Accueil : bandeau de la date, chiffres, programme */
.bandeau-date { background: #2e2016; color: #f3e7ce; padding: 26px 5vw; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.bandeau-date-titre { font-size: 22px; color: #e0b877; }
.bandeau-date-lieu { font-size: 16px; color: #c1852f; }
h2.titre-accroche { margin: 12px 0 16px; font-size: clamp(30px, 3.5vw, 42px); line-height: 1.05; color: var(--sm-brown); }
.texte-intro { margin: 0 auto; max-width: 680px; font-size: 18px; line-height: 1.6; color: var(--sm-brown-5); }
.chiffres { display: flex; gap: 44px; justify-content: center; flex-wrap: wrap; margin-top: 36px; }
.chiffre-valeur { font-size: 40px; color: var(--sm-orange); }
.chiffre-libelle { font-size: 14px; letter-spacing: .12em; color: var(--sm-brown-3); text-transform: uppercase; }
.programme-grille { display: grid; grid-template-columns: repeat(2, 1fr); border: 2px solid var(--sm-brown); }
.programme-ligne { display: flex; gap: 18px; padding: 22px 24px; border-bottom: 1px solid var(--sm-line); align-items: baseline; }
.programme-heure { font-size: 19px; color: var(--sm-gold); white-space: nowrap; }
.programme-libelle { font-size: 17px; font-weight: 500; }

/* Grilles de cartes (metiers, actualites, photos, infos pratiques) */
.grille-cartes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grille-cartes.grille-actualites { gap: 22px; }
.grille-cartes.grille-photos { margin-bottom: 24px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.infos-grille { padding: 44px 5vw 8px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.info-valeur { font-size: 22px; margin-top: 6px; }
.info-note { font-size: 14px; color: var(--sm-brown-4); margin-top: 2px; }
.metier-carte { background: var(--sm-cream); border-bottom: 4px solid var(--sm-gold); }
.metier-carte.metier-carte-simple { padding: 20px 22px; }
.placeholder-img.metier-visuel { height: 120px; border: none; }
.metier-corps { padding: 16px 20px 20px; }
.metier-nom { font-size: 20px; }
.metier-detail { font-size: 15px; color: var(--sm-brown-4); margin-top: 4px; }
.carte-colonne { display: flex; flex-direction: column; }
.actu-date { letter-spacing: .16em; font-size: 12px; color: var(--sm-orange); }
.actu-date.actu-date-page { margin-bottom: 8px; }
.actu-titre { font-size: 23px; margin: 6px 0 8px; }
h3.actu-titre-page { margin: 0 0 8px; font-size: 20px; line-height: 1.15; }
.actu-texte { margin: 0; font-size: 15px; color: var(--sm-brown-5); line-height: 1.5; flex: 1; }

/* Appel a devenir exposant (accueil, La Foire) */
.appel-exposant { background: var(--sm-orange); color: #f7ecd4; padding: 52px 5vw; text-align: center; }
.appel-exposant h2 { margin: 0 0 10px; font-size: clamp(28px, 3.5vw, 38px); }
.appel-exposant p { margin: 0 auto 24px; max-width: 560px; font-size: 18px; line-height: 1.55; color: #fbe9cf; }
.btn-appel { background: #f3e7ce; color: var(--sm-orange); text-decoration: none; padding: 15px 30px; font-weight: 700; letter-spacing: .04em; }

/* La Foire : deroule de la journee et plan */
.deroule { border-left: 3px solid var(--sm-brown); margin-left: 8px; }
.deroule-etape { position: relative; padding: 0 0 30px 30px; }
.deroule-point { position: absolute; left: -11px; top: 4px; width: 18px; height: 18px; background: var(--sm-gold); border: 3px solid var(--sm-brown); border-radius: 50%; }
.deroule-heure { font-size: 20px; color: var(--sm-orange); }
.deroule-titre { font-size: 19px; font-weight: 600; margin-top: 2px; }
.deroule-texte { margin: 6px 0 0; font-size: 16px; color: var(--sm-brown-5); line-height: 1.55; max-width: 640px; }
.placeholder-img.plan-placeholder { height: 420px; display: flex; align-items: center; justify-content: center; }
.plan-legende { font-size: 14px; color: var(--sm-brown-3); background: var(--sm-cream); padding: 8px 14px; }

/* Histoire */
.histoire-section { max-width: 1500px; margin: 0 auto; padding: 56px 4vw 32px; }
h2.titre-histoire { margin: 10px 0 24px; font-size: clamp(28px, 3.5vw, 38px); line-height: 1.1; }
.histoire-texte { margin: 0 0 16px; font-size: 18px; line-height: 1.7; color: #4b3c26; }
.histoire-texte:last-child { margin: 0; }
.histoire-figure { margin: 0; }
.histoire-photo { display: block; width: 100%; height: auto; border: 2px solid var(--sm-brown); }
.histoire-legende { margin-top: 8px; font-size: 14px; color: var(--sm-brown-3); font-style: italic; }
h2.titre-bureau { margin: 10px 0 6px; font-size: 30px; line-height: 1.1; }
.bureau-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.membre-carte { border-top: 4px solid var(--sm-gold); background: var(--sm-cream-2); padding: 20px 22px; }
.membre-nom { font-size: 19px; font-weight: 600; }
.etiquette-majuscules + .membre-nom { margin-top: 6px; }

/* Galerie */
details.galerie-annee { margin: 0 0 16px; }
.galerie-annee-titre {
    display: flex; align-items: center; min-height: 44px; padding: 8px 14px; font-size: 20px; color: var(--sm-orange);
    border: 2px solid var(--sm-brown); background: var(--sm-cream-2); cursor: pointer;
}
.galerie-annee-titre::after {
    content: ""; flex: none; width: 10px; height: 10px; margin-left: auto; margin-right: 4px;
    border-right: 3px solid currentColor; border-bottom: 3px solid currentColor; transform: rotate(45deg); transition: transform .15s;
}
.galerie-annee[open] > .galerie-annee-titre::after { transform: rotate(-135deg); }
.galerie-annee[open] > .galerie-annee-titre { margin-bottom: 16px; }
.photo-carte { margin: 0; border: 2px solid var(--sm-brown); background: var(--sm-cream-2); }
.photo-cadre { display: block; aspect-ratio: 4 / 3; overflow: hidden; }
.photo-image { width: 100%; height: 100%; object-fit: cover; }
.photo-legende { padding: 12px 16px; font-size: 15px; color: var(--sm-brown-5); border-top: 2px solid var(--sm-brown); }

/* Visionneuse de la galerie */
html.visionneuse-ouverte { overflow: hidden; }
.visionneuse { width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(46,32,22,.94); }
.visionneuse[open] { display: flex; align-items: center; justify-content: center; }
.visionneuse-cadre { margin: 0; padding: 64px 0; flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; box-sizing: border-box; }
.visionneuse-image { display: block; max-width: 100%; max-height: calc(100% - 28px); width: auto; height: auto; object-fit: contain; touch-action: pan-y; }
.visionneuse-compteur { margin-top: 8px; color: var(--sm-cream); font-size: 15px; }
.visionneuse-bouton {
    width: 44px; height: 44px; flex: none; border: 2px solid var(--sm-cream); background: var(--sm-brown); color: var(--sm-cream);
    font-size: 28px; line-height: 1; cursor: pointer; z-index: 1;
}
.visionneuse-bouton:disabled { opacity: .35; cursor: default; }
.visionneuse-fermer { position: fixed; top: max(14px, env(safe-area-inset-top)); right: max(14px, env(safe-area-inset-right)); }
.visionneuse-precedent { margin-left: max(6px, env(safe-area-inset-left)); }
.visionneuse-suivant { margin-right: max(6px, env(safe-area-inset-right)); }

/* Archives */
.archives-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.placeholder-img.archive-placeholder { height: 160px; margin-bottom: 10px; }
.archive-titre { font-weight: 600; font-size: 15px; }
.archive-annee { font-size: 13px; color: var(--sm-brown-3); }
.archive-lien-externe { color: var(--sm-orange); font-size: 13px; font-weight: 600; text-decoration: none; }

/* Contact */
.contact-col h2 { margin: 0 0 6px; font-size: 28px; color: var(--sm-orange); }
.flash.flash-note { font-size: 17px; }
.champ-piege { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-actions { margin-top: 24px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.btn-cta.btn-cta-large { padding: 15px 30px; font-size: 16px; }
.form-note { font-size: 14px; color: var(--sm-brown-3); }
.form-note.form-note-bloc { margin: 16px 0 0; }
.contact-infos { display: flex; flex-direction: column; gap: 18px; }
.card.card-compacte { padding: 16px 20px; }
.contact-valeur { font-size: 18px; font-weight: 500; margin-top: 4px; }
.contact-liens { display: flex; gap: 12px; margin-top: 22px; }
.btn-facebook { background: var(--sm-brown); color: #e0b877; text-decoration: none; padding: 10px 18px; font-size: 14px; }
.carte-osm { margin-top: 24px; }
.carte-osm iframe { width: 100%; height: auto; aspect-ratio: 4 / 3; display: block; border: 2px solid var(--sm-brown); }

/* Inscription */
.tarif-valeur { font-size: 34px; color: var(--sm-orange); margin: 8px 0 2px; }
.tarif-note { font-size: 14px; color: var(--sm-brown-4); }
.card.card-succes { border-color: var(--sm-green); text-align: center; padding: 32px; }
.succes-titre { font-size: 26px; color: var(--sm-green); }
.succes-texte { margin: 10px 0 0; font-size: 17px; color: var(--sm-brown-5); }

/* Pied de page */
.footer-apropos { max-width: 320px; }
.footer-nom { font-size: 18px; color: var(--sm-cream); }
.footer-adresse { font-size: 14px; margin-top: 8px; line-height: 1.5; }
.footer-colonnes { display: flex; gap: 48px; flex-wrap: wrap; }
.footer-colonne { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.site-footer a.footer-admin { margin-top: 8px; font-size: 13px; color: var(--sm-brown-3); }

/* ==========================================================================
 * SMARTPHONE ET TABLETTE (le PC, au-dessus de 800 px, n'est pas touche).
 * Seuils : 800 px (burger, une colonne, tablette incluse) et 480 px (smartphone, grilles en une colonne).
 * Les regles de formulaire et de cible tactile sont limitees au site public (.site-public), le back-office reste inchange.
 * Cible tactile minimale : 44 px.
 * ========================================================================== */
@media (max-width: 800px) {
    .site-public { overflow-wrap: break-word; }

    /* En-tete : logo et nom, bouton Exposer et burger sur une ligne, menu deroule dessous */
    .site-public .site-header { flex-wrap: wrap; gap: 8px 10px; padding: 10px 4vw; }
    .site-public .site-header .brand { order: 1; flex: 1 1 0; min-width: 0; gap: 10px; }
    .site-public .site-header .brand .logo { width: 48px; height: 48px; }
    .site-public .site-header .brand .name { font-size: 15px; line-height: 1.15; }
    .site-public .site-nav { display: contents; }
    .site-public .nav-cta {
        order: 2; display: inline-flex; align-items: center; justify-content: center;
        min-height: 44px; padding: 0 16px; font-size: 16px;
    }
    .site-public .nav-toggle {
        order: 3; display: inline-flex; align-items: center; justify-content: center;
        width: 44px; height: 44px; padding: 0; cursor: pointer;
        background: var(--sm-cream); border: 2px solid var(--sm-brown); color: var(--sm-brown);
    }
    .nav-toggle-barres,
    .nav-toggle-barres::before,
    .nav-toggle-barres::after { display: block; width: 22px; height: 3px; background: currentColor; }
    .nav-toggle-barres { position: relative; }
    .nav-toggle-barres::before,
    .nav-toggle-barres::after { content: ""; position: absolute; left: 0; }
    .nav-toggle-barres::before { top: -7px; }
    .nav-toggle-barres::after { top: 7px; }
    .site-public .nav-menu {
        order: 4; flex: 0 0 100%; display: none; flex-direction: column; font-size: 18px; letter-spacing: .04em;
        max-height: calc(100vh - 84px); max-height: calc(100dvh - 84px); overflow-y: auto;
    }
    .site-public .nav-menu.is-open { display: flex; }
    .site-public .nav-menu a {
        display: flex; align-items: center; min-height: 44px; padding: 0 4px; border-top: 1px solid var(--sm-line);
    }
    .site-public .nav-menu a.active { border-bottom: 0; padding-bottom: 0; color: var(--sm-orange); font-weight: 700; }

    /* Blocs et titres */
    .site-public .hero { padding: 36px 5vw 32px; }
    .site-public .hero .kicker { font-size: 14px; }
    .site-public .hero h1 { font-size: clamp(30px, 9vw, 40px); }
    .site-public .hero p { font-size: 17px; }
    .site-public section.block { padding: 36px 5vw; }
    .site-public section.block.block-archives { padding-left: 4vw; padding-right: 4vw; }
    .site-public .block h2 { font-size: 26px; }
    .site-public .surtitre,
    .site-public .etiquette,
    .site-public .actu-date,
    .site-public .archive-annee,
    .site-public .form-errors,
    .site-public .hero-placeholder-legende,
    .site-public .hero-date-lieu { font-size: 14px; }
    .section-sable { padding: 36px 5vw; }
    .site-public .appel-exposant { padding: 40px 5vw; }
    .site-public .appel-exposant h2 { font-size: 26px; }
    .appel-exposant p { font-size: 17px; }

    /* Accueil */
    .hero.hero-accueil { grid-template-columns: minmax(0, 1fr); }
    .hero-texte { padding: 36px 5vw 32px; min-width: 0; }
    .hero-date { flex-wrap: wrap; gap: 4px 14px; }
    .hero-date-valeur { font-size: 24px; }
    .hero .hero-intro { margin: 20px 0 24px; max-width: none; }
    .btn-hero-plein, .btn-hero-contour, .btn-appel, .lien-fort, .archive-lien-externe, .btn-facebook {
        display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
    }
    .btn-hero-plein, .btn-hero-contour { padding-top: 0; padding-bottom: 0; }
    .hero-placeholder { min-height: 220px; border-left: 0; border-top: 3px solid #2e2016; }
    .bandeau-date { padding: 22px 5vw; }
    .bandeau-date-titre { font-size: 20px; }
    .chiffres { gap: 24px; margin-top: 28px; }
    .chiffre-valeur { font-size: 32px; }
    .programme-grille { grid-template-columns: minmax(0, 1fr); }
    h2.titre-accroche { font-size: clamp(26px, 7vw, 34px); }

    /* Grilles : deux colonnes en tablette, une seule sur smartphone (voir 480 px) */
    .grille-cartes, .infos-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .infos-grille { padding-top: 32px; }

    /* La Foire, histoire, galerie */
    .deroule-etape { padding-left: 22px; }
    .placeholder-img.plan-placeholder { height: 240px; }
    .histoire-section { padding: 36px 5vw 24px; }
    h2.titre-bureau { font-size: 26px; }

    /* Archives */
    .archives-grille { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

    /* Contact et carte */
    .contact-layout { padding: 32px 5vw 40px; gap: 32px; }
    .contact-valeur, .footer-adresse { overflow-wrap: anywhere; }
    .carte-osm iframe { aspect-ratio: 4 / 3; min-height: 280px; }

    /* Formulaires : champs et boutons tactiles (la police de 16 px des champs evite le zoom automatique d'iOS) */
    .site-public .form-field input,
    .site-public .form-field select,
    .site-public .form-field textarea { min-height: 44px; max-width: 100%; }
    .site-public .btn-cta { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; }
    .site-public .btn-cta.btn-cta-large { padding-top: 0; padding-bottom: 0; }
    .site-public .form-actions { flex-direction: column; align-items: stretch; gap: 12px; }
    .site-public .form-actions .btn-cta { width: 100%; }
    .site-public .card.card-succes { padding: 24px 16px; }
    .site-public .flash { padding: 16px; }

    /* Pied de page : colonnes empilees, liens de 44 px */
    .site-public .site-footer { padding: 32px 5vw; gap: 24px; }
    .footer-colonnes { gap: 24px 40px; }
    .footer-colonne { gap: 0; }
    .site-public .site-footer a { display: flex; align-items: center; min-height: 44px; }
    .site-public .site-footer a.footer-admin { margin-top: 0; font-size: 14px; }
}

@media (max-width: 480px) {
    .grille-cartes, .infos-grille { grid-template-columns: minmax(0, 1fr); }
    .programme-ligne { flex-direction: column; gap: 4px; padding: 18px 16px; }
    .tarif-valeur { font-size: 28px; overflow-wrap: anywhere; }
    .site-public .card { padding: 20px 16px; }
    .site-public .card.card-compacte { padding: 14px 16px; }
}
