/* ==========================================================================
   Campagnu — socle CSS partagé (tokens, reset, éléments communs).
   Les lots n'écrivent PAS ici : public.css, pro.css, admin.css.
   Mobile-first : les media queries montent en largeur, jamais l'inverse.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Polices de la charte, AUTO-HÉBERGÉES (la CSP est en 'self' : pas de Google
   Fonts possible). Variables (un seul fichier par style couvre 400→700).
   Fraunces = titres & logo ; Figtree = texte courant. Sous-ensembles latin +
   latin-ext (le français pioche dans les deux). font-display: swap.
   -------------------------------------------------------------------------- */
@font-face {
  font-family: 'Fraunces'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url('../vendor/fonts/fraunces-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Fraunces'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url('../vendor/fonts/fraunces-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Fraunces'; font-style: italic; font-weight: 400 700; font-display: swap;
  src: url('../vendor/fonts/fraunces-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Fraunces'; font-style: italic; font-weight: 400 700; font-display: swap;
  src: url('../vendor/fonts/fraunces-italic-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Figtree'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url('../vendor/fonts/figtree-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Figtree'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url('../vendor/fonts/figtree-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* L'attribut hidden gagne toujours : sans ça, un .bouton (display:inline-flex)
   caché par le script restait visible (bouton « Ajouter la photo » de la liste
   des établissements, 01/12/2026). */
[hidden] { display: none !important; }

:root {
  /* Palette — charte : le VERT porte l'interface (titres, liens, boutons,
     états actifs) sur un fond crème ; le rouge brique est gardé pour le seul
     symbole de la marque, et l'or pour les mises en avant. */
  --vert-maquis:  #28613d;   /* vert campagne — ACTION : liens, boutons, actif */
  --vert-clair:   #6d9254;   /* vert olive — survol, secondaire */
  --vert-pale:    #e8eddf;   /* fond discret d'un état actif */
  --or:           #e5aa3d;   /* jaune soleil — mise en avant */

  /* Rouge brique : réservé au SYMBOLE de la marque (le C) et à la
     signalétique d'erreur. Il ne sert pas de couleur d'interface — c'est ce
     qui lui garde sa force sur le logo et sur le ruban des badges. */
  --rouge:        #bd3d30;

  --mer:          #1f6f8b;
  --creme:        #f5efe3;
  --pierre:       #f5efe3;   /* fond de page, crème */
  --sable:        #eee8da;
  --chataigne:    #8a5a2b;
  --corail:       #c2502f;

  --texte:        #253329;   /* encre, légèrement verte */
  --texte-doux:   #697568;
  --bord:         rgba(37, 51, 41, .13);
  --fond:         #fffdf8;
  --fond-doux:    var(--pierre);

  --succes:       #2f7a4d;
  --erreur:       #b03a2e;
  --info:         var(--mer);
  --alerte:       #b5791a;

  /* Typographie */
  --police: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --police-titre: "Fraunces", Georgia, "Iowan Old Style", "Times New Roman", serif;

  --t-xs: 0.78rem;
  --t-sm: 0.88rem;
  --t-md: 1rem;
  --t-lg: 1.2rem;
  --t-xl: 1.55rem;
  --t-2xl: 2.1rem;
  --t-3xl: 2.8rem;

  /* Espacements */
  --e1: 0.25rem;
  --e2: 0.5rem;
  --e3: 0.75rem;
  --e4: 1rem;
  --e5: 1.5rem;
  --e6: 2rem;
  --e7: 3rem;
  --e8: 4rem;

  --rayon:    10px;
  --rayon-sm: 6px;
  --ombre:    0 1px 2px rgba(34, 38, 42, .06), 0 4px 16px rgba(34, 38, 42, .08);
  --ombre-sm: 0 1px 3px rgba(34, 38, 42, .10);

  --largeur: 1180px;
  --gouttiere: 16px;
}

/* --- Reset mesuré ------------------------------------------------------- */

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

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

body {
  margin: 0;
  font-family: var(--police);
  font-size: var(--t-md);
  line-height: 1.6;
  color: var(--texte);
  background: var(--pierre);   /* crème : le fond de la charte */
}

h1, h2, h3, h4 {
  font-family: var(--police-titre);
  line-height: 1.22;
  margin: 0 0 var(--e3);
  font-weight: 700;
}
/* Les titres portent le vert de la marque ; h4 reste en encre, c'est un
   sous-niveau de texte plutôt qu'un titre de section. */
h1, h2, h3 { color: var(--vert-maquis); }
h1 { font-size: var(--t-2xl); }
h2 { font-size: var(--t-xl); }
h3 { font-size: var(--t-lg); }

p, ul, ol { margin: 0 0 var(--e4); }

a { color: var(--vert-maquis); text-underline-offset: 2px; }
a:hover { color: var(--vert-clair); }

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

:focus-visible {
  outline: 3px solid var(--mer);
  outline-offset: 2px;
  border-radius: 3px;
}

/* --- Utilitaires -------------------------------------------------------- */

.conteneur {
  width: 100%;
  max-width: var(--largeur);
  margin-inline: auto;
  padding-inline: var(--gouttiere);
}

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

.saut-contenu {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--vert-maquis); color: #fff;
  padding: var(--e2) var(--e4);
}
.saut-contenu:focus { left: 0; }

.grille {
  display: grid;
  gap: var(--e4);
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

/* --- Boutons ------------------------------------------------------------ */

.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--e2);
  min-height: 44px;                   /* confort tactile */
  padding: var(--e2) var(--e5);
  border: 1px solid transparent;
  border-radius: var(--rayon-sm);
  background: var(--vert-maquis);
  color: #fff;
  font: inherit; font-weight: 600;
  text-decoration: none; cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.bouton:hover { background: var(--vert-clair); color: #fff; }
.bouton[disabled], .bouton--inactif { opacity: .55; pointer-events: none; }

.bouton--fin {
  background: transparent;
  color: var(--vert-maquis);
  border-color: var(--bord);
}
.bouton--fin:hover { background: var(--vert-pale); color: var(--vert-maquis); }

.bouton--danger { background: var(--erreur); }
.bouton--danger:hover { background: #91301f; }

.bouton--petit { min-height: 36px; padding: var(--e1) var(--e3); font-size: var(--t-sm); }

/* --- Formulaires -------------------------------------------------------- */

.champ { margin-bottom: var(--e4); }

.champ > label,
.champ__libelle {
  display: block;
  margin-bottom: var(--e1);
  font-weight: 600;
  font-size: var(--t-sm);
}

.champ__aide { display: block; color: var(--texte-doux); font-size: var(--t-sm); margin-top: var(--e1); }
.champ__erreur { display: block; color: var(--erreur); font-size: var(--t-sm); margin-top: var(--e1); }

input[type="text"], input[type="email"], input[type="tel"], input[type="url"],
input[type="number"], input[type="date"], input[type="datetime-local"],
input[type="search"], input[type="password"], select, textarea {
  width: 100%;
  min-height: 44px;
  padding: var(--e2) var(--e3);
  border: 1px solid var(--bord);
  border-radius: var(--rayon-sm);
  background: var(--fond);
  font: inherit; color: inherit;
}
textarea { min-height: 140px; resize: vertical; line-height: 1.55; }

input:invalid:not(:placeholder-shown) { border-color: var(--erreur); }

fieldset { border: 1px solid var(--bord); border-radius: var(--rayon); padding: var(--e4); margin: 0 0 var(--e5); }
legend { font-weight: 700; padding-inline: var(--e2); }

/* Code à usage unique : gros, espacé, clavier numérique */
.champ-code {
  font-size: var(--t-2xl);
  letter-spacing: .4em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* --- Messages ----------------------------------------------------------- */

.message {
  padding: var(--e3) var(--e4);
  border-left: 4px solid var(--info);
  border-radius: var(--rayon-sm);
  background: var(--fond-doux);
  margin-block: var(--e4);
}
.message--succes { border-color: var(--succes); background: var(--vert-pale); }
.message--erreur { border-color: var(--erreur); background: #fbeceb; }
.message--alerte { border-color: var(--alerte); background: #fdf6e6; }
.message--info   { border-color: var(--info);   background: #ecf4f7; }

/* --- Étiquettes & pastilles --------------------------------------------- */

.etiquette {
  display: inline-block;
  padding: 2px var(--e2);
  border-radius: 999px;
  background: var(--sable);
  color: var(--texte);
  font-size: var(--t-xs);
  font-weight: 600;
}
.etiquette--aop  { background: var(--chataigne); color: #fff; }
.etiquette--bio  { background: var(--vert-clair); color: #fff; }
.etiquette--neuf { background: var(--corail); color: #fff; }

.pastille {
  display: inline-block; min-width: 20px;
  padding: 0 6px; border-radius: 999px;
  background: var(--corail); color: #fff;
  font-size: var(--t-xs); font-weight: 700; text-align: center;
}

/* --- Cartes de contenu --------------------------------------------------- */

.carte {
  display: flex; flex-direction: column;
  border: 1px solid var(--bord);
  border-radius: var(--rayon);
  overflow: hidden;
  background: var(--fond);
  box-shadow: var(--ombre-sm);
  transition: box-shadow .15s ease, transform .15s ease;
}
.carte:hover { box-shadow: var(--ombre); transform: translateY(-2px); }
.carte__image { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; background: var(--sable); }
.carte__corps { padding: var(--e3) var(--e4) var(--e4); flex: 1; }
.carte__titre { margin-bottom: var(--e1); font-size: var(--t-lg); }
.carte__titre a { text-decoration: none; }
.carte__meta  { color: var(--texte-doux); font-size: var(--t-sm); margin-bottom: var(--e2); }

/* --- Erreur -------------------------------------------------------------- */

.erreur { padding-block: var(--e8); text-align: center; }
.erreur__code { font-size: var(--t-3xl); font-weight: 700; color: var(--bord); margin: 0; }
.erreur__texte { color: var(--texte-doux); }

/* --- Tableaux (back-office) ---------------------------------------------- */

.tableau { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
.tableau th, .tableau td { padding: var(--e2) var(--e3); text-align: left; border-bottom: 1px solid var(--bord); }
.tableau th { background: var(--fond-doux); font-weight: 700; white-space: nowrap; }
.tableau tr:hover td { background: var(--fond-doux); }

/* Sous 760 px, les tableaux deviennent des blocs lisibles. */
@media (max-width: 760px) {
  .tableau, .tableau tbody, .tableau tr, .tableau td { display: block; width: 100%; }
  .tableau thead { display: none; }
  .tableau tr { border: 1px solid var(--bord); border-radius: var(--rayon-sm); margin-bottom: var(--e3); padding: var(--e2); }
  .tableau td { border: 0; padding: var(--e1) var(--e2); }
  .tableau td::before { content: attr(data-libelle) " : "; font-weight: 700; color: var(--texte-doux); }
}

/* --- Menu repliable (public, pro, admin) --------------------------------- */

.menu-bouton {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px;
  border: 1px solid var(--bord); border-radius: var(--rayon-sm);
  background: transparent; cursor: pointer;
}
.menu-bouton__trait,
.menu-bouton__trait::before,
.menu-bouton__trait::after {
  display: block; width: 20px; height: 2px; background: var(--texte); content: "";
}
.menu-bouton__trait { position: relative; }
.menu-bouton__trait::before { position: absolute; top: -6px; }
.menu-bouton__trait::after  { position: absolute; top: 6px; }

@media (min-width: 900px) {
  .menu-bouton { display: none; }
}

/* --- Impression ---------------------------------------------------------- */

@media print {
  .entete, .pied, .menu-bouton, .bouton { display: none !important; }
  body { color: #000; }
}
