/* Gabaye Mycologie — feuille de style unique. Aucune police ni bibliothèque externe. */
:root {
  --bg: #f9f4f0;          /* fond de page */
  --entete: #eedfd3;      /* en-tête */
  --alerte: #eedfd3;      /* bandeau du bas (même couleur que l'en-tête) */
  --surface: #fffefa;
  --text: #22291f;
  --muted: #5b6556;
  --line: #e8d4c4;
  --accent: #2f5d3a;
  --accent-fort: #234a2e;
  --accent-texte: #ffffff;
  --ok: #1d6a34;      --ok-bg: #e5f2e8;
  --tox: #8a3c00;     --tox-bg: #fdeedb;
  --mort: #9b1616;    --mort-bg: #fde6e6;
  --marque: #fff0a6;
  --rayon: 10px;
  --large: 70rem;
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 9rem; scroll-padding-bottom: 8rem; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 1.0625rem/1.65 var(--sans);
  padding-bottom: var(--h-alerte, 7rem);   /* place pour le bandeau fixe du bas */
}
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: .18em; }
a:hover { color: var(--accent-fort); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.saut { position: absolute; left: -999px; top: .5rem; background: var(--accent); color: var(--accent-texte); padding: .5rem 1rem; z-index: 100; }
.saut:focus { left: .5rem; }
.wrap { max-width: var(--large); margin-inline: auto; padding-inline: 1rem; }

/* --- En-tête et menu --- */
.entete { position: sticky; top: 0; z-index: 50; background: var(--entete); border-bottom: 1px solid var(--line); }
.entete-int { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem; padding-block: .9rem; }
.identite { display: flex; flex-direction: column; gap: .15rem; }
.slogan { margin: 0; font-size: .88rem; line-height: 1.3; color: var(--muted); }
.nom-site {
  font: 700 1.9rem/1.1 var(--serif); color: var(--accent); text-decoration: none; letter-spacing: -.01em;
}
.nom-site span { font-weight: 400; font-style: italic; }
.recherche { display: flex; gap: .4rem; flex: 1 1 18rem; min-width: 0; max-width: 34rem; margin-left: auto; }
.recherche input[type=search] {
  flex: 1; min-width: 0; width: 100%; padding: .55rem .8rem; font: inherit; color: var(--text);
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--rayon);
}
.recherche button, .menu-bouton {
  padding: .55rem 1rem; font: inherit; font-weight: 600; cursor: pointer;
  background: var(--accent); color: var(--accent-texte); border: 0; border-radius: var(--rayon);
}
.recherche button:hover, .menu-bouton:hover { background: var(--accent-fort); }
.menu-bouton { display: none; }
.facebook { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; flex: none; color: var(--accent-texte); background: #1877f2; border-radius: 50%; text-decoration: none; }
.facebook:hover { background: #0f5fcc; }

.nav { border-top: 1px solid var(--line); }
.nav ul { list-style: none; margin: 0; padding: 0; }
.nav a { display: block; padding: .6rem .8rem; color: var(--text); text-decoration: none; }
.nav a:hover, .nav a.actif { color: var(--accent); }
.nav a.actif { font-weight: 700; }

@media (min-width: 56rem) {
  .nav ul.niveau0 { display: flex; flex-wrap: wrap; gap: .1rem; }
  .nav li { position: relative; }
  .nav ul.niveau0 > li > a { padding: .8rem .7rem; border-bottom: 3px solid transparent; }
  .nav ul.niveau0 > li > a.actif { border-bottom-color: var(--accent); }
  .nav li > ul {
    display: none; position: absolute; left: 0; top: 100%; z-index: 30; min-width: 17rem; width: max-content; max-width: 24rem;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--rayon);
    box-shadow: 0 10px 28px rgba(0, 0, 0, .18); padding: .35rem;
  }
  .nav li:hover > ul, .nav li:focus-within > ul { display: block; }
  .nav li li > ul { left: 100%; top: -.35rem; max-height: calc(100vh - 16rem); overflow-y: auto; }
  /* les derniers menus, près du bord droit de l'écran : les sous-menus s'ouvrent vers la gauche pour ne pas être coupés */
  .nav ul.niveau0 > li:nth-last-child(-n+3) li > ul { left: auto; right: 100%; }
  .nav ul.niveau0 > li:nth-last-child(-n+2) > ul { left: auto; right: 0; }
  .nav li li a { padding: .4rem .7rem; border-radius: 6px; }
  .nav li li a:hover { background: var(--bg); }
  .nav li li.a-sous-menu > a::after { content: "›"; float: right; margin-left: 1rem; color: var(--muted); }
}
@media (min-width: 56rem) and (max-width: 69rem) {     /* écrans moyens : menu resserré pour tenir sur une ligne */
  .nav ul.niveau0 > li > a { padding-inline: .45rem; font-size: .92rem; }
}
@media (max-width: 55.99rem) {
  .entete-int { flex-wrap: wrap; gap: .5rem .75rem; padding-block: .5rem .6rem; }
  .identite { flex: 1 1 auto; min-width: 0; }
  .nom-site { font-size: 1.5rem; }
  .slogan { display: none; }
  .menu-bouton { display: inline-grid; place-items: center; padding: .45rem .7rem; }
  .facebook { width: 2.4rem; height: 2.4rem; }
  .recherche button { padding-inline: .8rem; }
  .nav { display: none; }
  .nav.ouvert { display: block; max-height: calc(100vh - 7.5rem - var(--h-alerte, 7rem)); max-height: calc(100dvh - 7.5rem - var(--h-alerte, 7rem)); overflow-y: auto; }
  .nav li li { padding-left: 1rem; }
  .nav li li li { display: none; }          /* sur téléphone : deux niveaux suffisent */
  .recherche { max-width: none; flex-basis: 100%; order: 3; }
}

/* --- Accueil --- */
.contenu .galerie { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: 1rem 1.25rem; align-items: start; margin: .8rem auto 1.6rem; }
.contenu .galerie figure { margin: 0; text-align: center; }
.contenu .galerie img { display: block; width: 100%; height: auto; box-shadow: 0 2px 10px rgba(0, 0, 0, .18); }
.contenu .galerie figcaption { margin-top: .4rem; }
.contenu .photos-paire { display: flex; justify-content: center; align-items: flex-start; gap: 1rem 1.5rem; max-width: 36rem; margin: 1rem auto; }
.contenu .photos-paire img { flex: 1 1 0; min-width: 0; width: 50%; height: auto; }

/* --- Pages --- */
main { display: block; min-height: 55vh; }
.page { max-width: 62rem; margin-inline: auto; padding-block: 1.2rem 3rem; }
.page h1 { font: 700 clamp(1.7rem, 4vw, 2.4rem)/1.2 var(--serif); margin: .3rem 0 1rem; color: var(--accent); }
.fil ol { display: flex; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; font-size: .92rem; color: var(--muted); }
.fil li + li::before { content: "›"; margin: 0 .5rem; }
.fil a { color: var(--muted); }

.contenu-accueil { max-width: none; padding-block: 1rem 3rem; }
.contenu p { margin: .85em 0; }
.contenu h2 {
  font: 700 1.4rem/1.3 var(--serif); color: var(--accent); margin: 1.9em 0 .5em;
  padding-bottom: .25em; border-bottom: 1px solid var(--line);
}
.contenu h3 { font: 700 1.15rem/1.3 var(--serif); margin: 1.5em 0 .4em; }
.contenu img { border-radius: 6px; vertical-align: middle; }
.contenu p > img:only-child, .contenu .c > img { box-shadow: 0 2px 10px rgba(0, 0, 0, .18); }
.contenu .c { text-align: center; }
/* Rangée de photos côte à côte, avec de l'air entre elles et une hauteur raisonnable */
.contenu .photos { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 1rem 1.25rem; }
.contenu .photos img { width: auto; max-width: 100%; max-height: 20rem; }
.contenu p > img:only-child { display: block; margin-inline: auto; }
.contenu table { border-collapse: collapse; max-width: 100%; display: block; overflow-x: auto; }
.contenu td, .contenu th { border: 1px solid var(--line); padding: .35rem .6rem; }
.contenu ul, .contenu ol { padding-left: 1.4rem; }
/* --- « Dans cette rubrique » : les pages filles, sous le titre --- */
.rubrique { margin: 0 0 1.4rem; padding: .7rem 1rem .85rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--rayon); }
.rubrique-titre { margin: 0 0 .45rem; font-size: .85rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.rubrique ul { display: flex; flex-wrap: wrap; gap: .4rem .6rem; list-style: none; margin: 0; padding: 0; }
.rubrique a {
  display: inline-block; padding: .25rem .8rem; color: var(--accent); background: var(--bg); border: 1px solid var(--line);
  border-radius: 999px; text-decoration: none; font-weight: 600; line-height: 1.5;
}
.rubrique a:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-texte); }

/* --- Précédent / suivant entre les pages d'une série --- */
.serie { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin: 1.2rem 0; }
.serie a {
  display: inline-flex; flex-direction: column; padding: .45rem 1rem; line-height: 1.3; text-decoration: none; font-weight: 700;
  color: var(--accent-texte); background: var(--accent); border-radius: var(--rayon); min-width: 7.5rem;
}
.serie a small { font-weight: 400; font-size: .85em; opacity: .9; }
.serie a:hover { background: var(--accent-fort); color: var(--accent-texte); }
.serie-prec { align-items: flex-start; } .serie-suiv { align-items: flex-end; text-align: right; }
.serie-vide { min-width: 7.5rem; }
.serie-pos { color: var(--muted); font-size: .92rem; text-align: center; }
@media (max-width: 30rem) { .serie a { min-width: 0; padding: .45rem .7rem; } .serie-vide { min-width: 0; } }

/* --- Carte OpenStreetMap --- */
.carte { position: relative; isolation: isolate; height: 26rem; max-width: 100%; margin: .6rem auto 1.4rem;
         background: var(--surface); border: 1px solid var(--line); border-radius: var(--rayon); overflow: hidden; }
.carte:not(.carte-active) { height: auto; }
.carte-repli { margin: 0; padding: 1rem; text-align: center; }
.carte-nom { font: 700 .85rem var(--sans); color: #6b1010; background: rgba(255, 255, 255, .92); border: 1px solid #b33; border-radius: 4px; box-shadow: none; padding: .05rem .4rem; }
.carte-nom::before { display: none; }
@media (max-width: 40rem) { .carte { height: 22rem; } }

/* Quand on arrive sur un passage précis d'une page (lien avec « # »), on le met en évidence */
.contenu [id]:target { background: var(--marque); border-radius: var(--rayon); box-shadow: 0 0 0 .35rem var(--marque); }

/* Petite flèche sur les liens qui s'ouvrent dans un nouvel onglet (sauf les photos cliquables) */
.contenu a[target="_blank"]:not(:has(img))::after {
  content: "\2197"; content: "\2197" / " (nouvel onglet)";
  display: inline-block; margin-left: .2em; font-size: .8em; font-weight: 400; text-decoration: none; opacity: .75;
}
.dev-note { background: #fff3cd; color: #5c4700; border: 1px dashed #b38b00; padding: .6rem 1rem; border-radius: var(--rayon); }

/* --- Comestibilité : jamais la couleur seule, toujours le mot --- */
.marque {
  display: inline-block; padding: 0 .55em; margin-inline: .1em; border: 1.5px solid; border-radius: 999px;
  font: 600 .82em/1.6 var(--sans); white-space: nowrap; vertical-align: .08em;
}
.m-ok   { color: var(--ok);   background: var(--ok-bg); }
.m-tox  { color: var(--tox);  background: var(--tox-bg); }
.m-mort { color: var(--mort); background: var(--mort-bg); border-width: 2.5px; font-weight: 800; }

.legende { display: flex; flex-wrap: wrap; gap: .4rem .6rem; list-style: none; margin: .4rem 0 0; padding: 0; }

.contenu a.bouton { display: inline-block; padding: .7rem 1.3rem; font-weight: 700; line-height: 1.35; color: var(--accent-texte); background: var(--accent); border-radius: var(--rayon); text-decoration: none; }
.contenu a.bouton:hover { background: var(--accent-fort); }

/* --- Pages de rubrique presque vides : cartes illustrées --- */
.rubrique-cartes { margin: 1rem 0 1.6rem; }
.rubrique-cartes ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: 1rem; list-style: none; margin: .6rem 0 0; padding: 0; }
.rubrique-cartes a { display: flex; flex-direction: column; height: 100%; overflow: hidden; color: var(--text); text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--rayon); }
.rubrique-cartes a:hover { border-color: var(--accent); box-shadow: 0 4px 14px rgba(0, 0, 0, .14); }
.rubrique-cartes img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--bg); }
.rubrique-cartes .carte-titre { padding: .6rem .8rem .2rem; font: 700 1.05rem/1.3 var(--serif); color: var(--accent); }
.rubrique-cartes .carte-texte { padding: 0 .8rem .8rem; font-size: .9rem; line-height: 1.4; color: var(--muted); }

/* --- Listes des espèces par marque de comestibilité --- */
a.marque { text-decoration: none; }
a.marque:hover { box-shadow: 0 0 0 2px currentColor; }
.marque.choisie { box-shadow: 0 0 0 3px currentColor; }
.note-marques { padding: .7rem 1rem; background: var(--tox-bg); border-left: 4px solid var(--tox); border-radius: 6px; }
.choix-marques { display: flex; flex-wrap: wrap; gap: .5rem .7rem; list-style: none; margin: 1rem 0; padding: 0; }
.choix-marques .marque { font-size: .95rem; }
.liste-especes { columns: 19rem; column-gap: 2rem; margin: .8rem 0 2rem; padding-left: 1.1rem; }
.liste-especes li { break-inside: avoid; margin: .3rem 0; }

/* --- Recherche --- */
.muet { color: var(--muted); }
.resultats { list-style: none; margin: 1rem 0; padding: 0; }
.resultats li { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.resultat-titre { font: 700 1.2rem var(--serif); }
.resultats p { margin: .25rem 0 0; color: var(--muted); }
mark { background: var(--marque); color: inherit; padding: 0 .1em; border-radius: 3px; }

/* --- Flèche « remonter en haut » --- */
.haut {
  position: fixed; right: 1rem; bottom: calc(var(--h-alerte, 7rem) + .9rem); z-index: 55;
  width: 3rem; height: 3rem; display: grid; place-items: center; padding: 0; cursor: pointer;
  color: var(--accent-texte); background: var(--accent); border: 2px solid var(--surface); border-radius: 50%;
  box-shadow: 0 3px 12px rgba(0, 0, 0, .3); opacity: .92; transition: transform .15s, background .15s;
}
.haut:hover { background: var(--accent-fort); transform: translateY(-2px); opacity: 1; }
.haut[hidden] { display: none; }

/* --- Bandeau d'alerte fixe (bas de l'écran, sur toutes les pages) --- */
.alerte {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: var(--alerte); color: var(--text); border-top: 0;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, .15); font-size: .9rem; line-height: 1.4;
  max-height: 70vh; overflow-y: auto;
}
.alerte .wrap { padding-block: .5rem .6rem; }
.alerte p { margin: 0; }
.alerte-haut { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem 1rem; }
.alerte-court { flex: 1 1 24rem; }
.alerte-plus summary { cursor: pointer; color: var(--accent-fort); font-weight: 600; white-space: nowrap; }
.alerte-plus p { margin-top: .4rem; }
.alerte-plus { flex: 0 1 auto; }
.alerte-plus[open] { flex-basis: 100%; }
.alerte .legende { margin: .4rem 0 0; font-size: .95em; }
.alerte-bas { display: flex; flex-wrap: wrap; align-items: center; gap: 0 1.2rem; }
.alerte-bas .legende { flex: 1 1 auto; min-width: 0; }
.alerte-liens { margin-top: .4rem; white-space: nowrap; }
.alerte-liens a { color: var(--accent-fort); font-weight: 700; }
.alerte-liens-haut { display: none; }
@media (max-width: 55.99rem) {
  .alerte { font-size: .82rem; }
  /* toute la légende reste visible (T toxique, † mortel compris), sur deux lignes, sans défilement */
  .alerte .legende { gap: .25rem .35rem; }
  .alerte .legende .marque { font-size: .78rem; padding-inline: .45em; }
  .alerte .legende .cm { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .alerte-bas .legende { flex-basis: 100%; }
  .alerte-haut { column-gap: .5rem; }
  .alerte-liens-haut { display: block; margin: 0 0 0 auto; font-size: .74rem; }
  .alerte-bas .alerte-liens { display: none; }
}

@media print {
  .entete, .recherche, .rubrique, .serie, .carte { display: none; }
  .alerte { position: static; box-shadow: none; }
  .haut { display: none; }
  body { padding-bottom: 0; }
  body { background: #fff; color: #000; font-size: 11pt; }
}

/* Texte en rouge dans les textes de l'auteur (ex. « en rouge le nom actuel ») */
.rouge { color: #b3261e; }
