/* Design system « Rendez-vous en Forez — Guide des hébergements » — préfixe fh-
   Origine de chaque jeton : RAPPORT.md (section Jetons). Aucune couleur ni taille hors jetons. */

@import url('https://fonts.googleapis.com/css2?family=Abril+Fatface&family=Lexend:wght@300;400;600;800&display=swap');

:root {
  /* Couleurs exactes du PDF (source/analyse.json) */
  --fh-or: #c59d60;            /* aplat or de toutes les pages, titre de couverture */
  --fh-encre: #085661;         /* texte du dos (bleu canard) : texte courant du site */
  --fh-blanc: #ffffff;
  /* Couleurs de la brochure dans Mongo (config des sections et de la légende) */
  --fh-or-theme: #cca25b;      /* themeColor des sections et des groupes « ville » */
  --fh-ardoise: #33505b;       /* textColor des fiches mises en avant (Hôtels), thème des Gîtes */
  --fh-legende: #172b49;       /* icon_color de la légende */
  /* Dérivées (absentes du PDF) : même teinte que l'or, assombrie pour le contraste */
  --fh-or-fonce: #86672b;      /* pastille de ville (texte blanc 5,2:1), titres en couleur du thème */
  --fh-or-pale: #f6efe2;       /* fond des fiches mises en avant et de la barre du haut (or à 15 %) */
  --fh-trait: #e7dcc8;         /* filets de séparation (or à 35 %) */

  /* Polices */
  --fh-police-texte: 'Lexend', system-ui, sans-serif;            /* Lexend : celle du PDF */
  --fh-police-titre: 'Abril Fatface', Georgia, serif;            /* Aguila (commerciale) → reconnue à l'œil */

  /* Échelle de texte : 8 tailles, 13 px au minimum, texte courant 15–17 px */
  --fh-t-xs: 13px;
  --fh-t-s: 15px;
  --fh-t-m: 17px;
  --fh-t-l: 19px;
  --fh-t-xl: 24px;
  --fh-t-2xl: clamp(30px, 3.4vw, 44px);
  --fh-t-3xl: clamp(40px, 5.6vw, 76px);
  --fh-t-titre: clamp(40px, 6.6vw, 92px);

  /* Espaces */
  --fh-e-1: 4px;
  --fh-e-2: 8px;
  --fh-e-3: 12px;
  --fh-e-4: 16px;
  --fh-e-5: 24px;
  --fh-e-6: 40px;
  --fh-e-7: 64px;
  --fh-e-8: 96px;

  --fh-largeur: 1240px;
  --fh-marge: clamp(16px, 4vw, 48px);
  --fh-barre: 60px;
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--fh-police-texte); font-weight: 300;
  font-size: var(--fh-t-m); line-height: 1.5; color: var(--fh-encre); background: var(--fh-blanc);
}
img { max-width: 100%; display: block; }
a { color: inherit; }
sup { line-height: 0; }
h1, h2, h3, p, figure, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
strong { font-weight: 600; }
[id] { scroll-margin-top: 72px; }
.fh-nowrap { white-space: nowrap; }
.fh-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fh-dedans { width: 100%; max-width: var(--fh-largeur); margin: 0 auto; padding: 0 var(--fh-marge); }

/* ---------------------------------------------------------------- barre du haut (ajout web, modèle art-shopping) */
.fh-outils {
  position: sticky; top: 0; z-index: 20; height: var(--fh-barre); padding: 0 var(--fh-e-4);
  display: flex; align-items: center; justify-content: flex-end; gap: var(--fh-e-2);
  background: var(--fh-blanc); border-bottom: 1px solid var(--fh-trait);
}
.fh-pdf {
  display: inline-flex; align-items: center; gap: var(--fh-e-2); min-height: 44px; padding: 0 var(--fh-e-4);
  border-radius: 999px; background: var(--fh-encre); color: var(--fh-blanc); text-decoration: none;
  font-weight: 600; font-size: var(--fh-t-s);
}
.fh-pdf svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 699px) { .fh-pdf span { display: none; } }
.fh-langues { display: flex; border: 2px solid var(--fh-encre); border-radius: 999px; overflow: hidden; }
.fh-langues a {
  display: inline-block; min-width: 44px; padding: var(--fh-e-2) var(--fh-e-3); text-align: center; text-decoration: none;
  font-weight: 600; font-size: var(--fh-t-s); color: var(--fh-encre);
}
.fh-langues a[aria-current] { background: var(--fh-encre); color: var(--fh-blanc); }
.fh-langues a:not([aria-current]):hover, .fh-langues a:not([aria-current]):focus-visible { background: var(--fh-or-pale); }

/* ---------------------------------------------------------------- couverture */
.fh-couv { background: var(--fh-or); position: relative; overflow: hidden; }
.fh-couv__grille {
  margin: 0 auto;
  display: grid; grid-template-columns: 1.15fr 1fr; grid-template-rows: auto 1fr auto;
  height: clamp(560px, calc(100svh - var(--fh-barre)), 820px);
}
.fh-couv__photo { grid-column: 1; grid-row: 1 / 4; position: relative; margin: 0; overflow: hidden; }
.fh-couv__photo img { width: 100%; height: 100%; object-fit: cover; object-position: 30% 50%; }
.fh-couv__credit {
  position: absolute; left: var(--fh-e-1); bottom: var(--fh-e-5); writing-mode: vertical-rl; transform: rotate(180deg);
  font-size: var(--fh-t-xs); color: var(--fh-blanc);
}
.fh-couv__logo { grid-column: 2; grid-row: 1; justify-self: end; padding: var(--fh-e-6) var(--fh-marge) var(--fh-e-5); }
.fh-couv__logo img { width: min(360px, 100%); }
.fh-couv__panneau {
  grid-column: 1 / 3; grid-row: 2 / 4; align-self: end; justify-self: end; position: relative; z-index: 1;
  width: 58%; background: var(--fh-blanc); border-top-left-radius: 240px;
  padding: var(--fh-e-7) var(--fh-marge) 0 var(--fh-e-7);
  display: flex; flex-direction: column; align-items: flex-end;
}
.fh-couv h1 {
  font-family: var(--fh-police-titre); font-weight: 400; font-size: var(--fh-t-3xl); line-height: 1.02;
  color: var(--fh-or); text-align: right;
}
.fh-couv h1 span { display: block; }
.fh-couv__site {
  align-self: stretch; margin: var(--fh-e-6) calc(-1 * var(--fh-marge)) 0 calc(-1 * var(--fh-e-7));
  background: var(--fh-or); border-top-right-radius: 180px; padding: var(--fh-e-5) var(--fh-e-7) var(--fh-e-5);
}
.fh-couv__site a { display: inline-block; padding: var(--fh-e-1) 0; color: var(--fh-blanc); font-weight: 600; font-size: var(--fh-t-l); text-decoration: none; letter-spacing: 0.01em; }
.fh-couv__site a:hover { text-decoration: underline; }
.fh-couv__voile { position: absolute; right: 0; top: 28%; height: 46%; width: auto; max-width: none; z-index: 0; pointer-events: none; }

/* ---------------------------------------------------------------- navigation (ajout web) */
.fh-nav {
  background: var(--fh-blanc); border-bottom: 2px solid var(--fh-or);
}
.fh-nav ul {
  max-width: var(--fh-largeur); margin: 0 auto; padding: var(--fh-e-1) var(--fh-marge);
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0 var(--fh-e-5);
}
.fh-nav a {
  display: inline-block; padding: var(--fh-e-2) 0; text-decoration: none;
  font-weight: 600; font-size: var(--fh-t-s); color: var(--fh-encre);
}
.fh-nav a:hover, .fh-nav a:focus-visible { color: var(--fh-or-fonce); text-decoration: underline; }

/* ---------------------------------------------------------------- légende (section « legend » de Mongo) */
.fh-legende { padding: var(--fh-e-7) 0 var(--fh-e-6); }
.fh-legende__grille { display: grid; grid-template-columns: 1.1fr 1fr; gap: var(--fh-e-6); align-items: center; }
.fh-legende__carte img { width: 100%; height: auto; }
.fh-legende h2 {
  font-weight: 300; font-size: var(--fh-t-2xl); line-height: 1.2; color: var(--fh-legende);
  padding-bottom: var(--fh-e-3); border-bottom: 2px solid var(--fh-legende); margin-bottom: var(--fh-e-5);
}
.fh-legende ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--fh-e-4) var(--fh-e-5); }
.fh-legende li { display: grid; grid-template-columns: 76px minmax(0, 1fr); align-items: center; gap: var(--fh-e-3); font-size: var(--fh-t-s); line-height: 1.35; color: var(--fh-legende); }
.fh-legende .fh-picto--image { width: auto; max-width: 76px; }
.fh-legende .fh-picto--image img { width: auto; max-width: 76px; }
.fh-legende .fh-picto { --fh-picto: 34px; }

/* Picto (icône de tag, ou image de label) — commun aux fiches et à la légende */
.fh-picto { flex: none; width: var(--fh-picto, 30px); height: var(--fh-picto, 30px); display: inline-flex; align-items: center; justify-content: center; }
.fh-picto img { width: 100%; height: 100%; object-fit: contain; }
/* Image de label (épis, ANCV…) : à sa largeur, même hauteur que les pictos */
.fh-icones .fh-picto--image { width: auto; min-width: var(--fh-picto, 30px); }
.fh-icones .fh-picto--image img { width: auto; max-width: 96px; }
.fh-picto svg { width: 72%; height: 72%; }
.fh-picto--plein { background: var(--fh-or); color: var(--fh-blanc); }          /* iconStyle « solid » des sections */
.fh-picto--contour { border: 2px solid currentColor; border-radius: 6px; color: var(--fh-legende); }  /* légende : outline, small */

/* ---------------------------------------------------------------- ouverture de chapitre (pages 2 à 7 du PDF) */
.fh-ouv { position: relative; overflow: hidden; background: var(--fh-or); margin-top: var(--fh-e-7); }
.fh-ouv__dedans { min-height: clamp(220px, 24vw, 320px); display: flex; align-items: center; padding-top: var(--fh-e-6); padding-bottom: var(--fh-e-6); }
.fh-ouv h2 {
  position: relative; z-index: 1; padding-right: clamp(110px, 16vw, 230px);
  font-family: var(--fh-police-titre); font-weight: 400; font-size: var(--fh-t-titre); line-height: 1.06; color: var(--fh-blanc);
}
.fh-ouv h2 span { display: inline; }
.fh-ouv h2 span + span::before { content: " "; }
/* Voile du PDF (p. 2 à 7), proportions gardées, collée au bord droit comme sur la page */
.fh-ouv__voile { position: absolute; right: 0; bottom: 0; height: 100%; width: auto; max-width: none; }

/* ---------------------------------------------------------------- fiches (sections « activities ») */
.fh-fiches { padding: var(--fh-e-6) 0 0; }
.fh-grille {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-flow: row;
  gap: var(--fh-e-5) var(--fh-e-5);
}
.fh-cellule {
  grid-column: span 2;
  display: flex; flex-direction: column; gap: var(--fh-e-2); min-width: 0;
  padding: var(--fh-e-3) 0 var(--fh-e-4); border-top: 3px solid var(--fh-or-theme);
}
/* Fiche mise en avant (span 2 de la brochure) : toute la largeur de la grille.
   Ordinateur : photo (340 px, image handler 340/680) | tête (titre, description) | infos.
   Tablette : photo | tête, infos dessous. Téléphone : empilé. */
/* Dernière rangée incomplète avant une mise en avant (data-reste*, page.js) : élargie pour la remplir */
.fh-cellule[data-reste3="2"] { grid-column: span 3; }
.fh-cellule[data-reste3="1"] { grid-column: 1 / -1; }
.fh-cellule[data-reste3="1"] .fh-cellule__corps, .fh-cellule[data-reste2="1"] .fh-cellule__corps { display: block; column-count: 3; column-gap: var(--fh-e-6); }
.fh-cellule[data-reste3="1"] .fh-cellule__corps > *, .fh-cellule[data-reste2="1"] .fh-cellule__corps > * { break-inside: avoid; margin-bottom: var(--fh-e-2); }
.fh-cellule--large {
  grid-column: 1 / -1; display: grid; grid-template-columns: 340px minmax(0, 1.15fr) minmax(0, 1fr);
  grid-template-areas: "photo tete infos"; align-items: start; gap: var(--fh-e-3) var(--fh-e-6);
  border-top: 3px solid var(--fh-or-theme); padding: var(--fh-e-4) 0;
}
.fh-cellule--large.fh-cellule--sans-photo { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); grid-template-areas: "tete infos"; }
/* Sans description : un seul bloc à côté de la photo */
.fh-cellule--large.fh-cellule--un-bloc { grid-template-columns: 340px minmax(0, 1fr); grid-template-areas: "photo tete"; }
.fh-cellule--large.fh-cellule--un-bloc.fh-cellule--sans-photo { grid-template-columns: minmax(0, 1fr); grid-template-areas: "tete"; }
.fh-cellule--large .fh-cellule__photo { grid-area: photo; }
.fh-cellule--large .fh-cellule__tete { grid-area: tete; }
.fh-cellule--un-bloc .fh-cellule__tete { max-width: 640px; }
.fh-cellule--large .fh-cellule__infos { grid-area: infos; padding-top: var(--fh-e-1); }
.fh-cellule__photo { position: relative; margin: 0; overflow: hidden; background: var(--fh-trait); aspect-ratio: 4 / 3; }
.fh-cellule__photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.fh-cellule__corps { display: flex; flex-direction: column; gap: var(--fh-e-2); min-width: 0; }
.fh-cellule[data-texte] { color: var(--fh-ardoise); }
.fh-pastilles { display: flex; flex-wrap: wrap; gap: var(--fh-e-1); }
.fh-pastille {
  display: inline-block; background: var(--fh-or-fonce); color: var(--fh-blanc);
  font-size: var(--fh-t-xs); font-weight: 600; letter-spacing: 0.04em; line-height: 1.3; padding: 3px var(--fh-e-2);
}
.fh-cellule__titre { font-size: var(--fh-t-l); line-height: 1.25; font-weight: 600; }
.fh-cellule--theme .fh-cellule__titre { color: var(--fh-or-fonce); }
.fh-etoiles { display: inline-flex; gap: 1px; vertical-align: 0.05em; margin-left: var(--fh-e-1); white-space: nowrap; }
.fh-etoiles svg { width: 15px; height: 15px; fill: var(--fh-or-theme); }
.fh-cellule__desc, .fh-suite p { font-size: var(--fh-t-s); line-height: 1.55; white-space: pre-line; }
.fh-suite summary {
  cursor: pointer; list-style: none; display: inline-block; padding: var(--fh-e-1) 0; min-height: 24px;
  font-size: var(--fh-t-s); font-weight: 600; color: var(--fh-or-fonce);
}
.fh-suite summary::-webkit-details-marker { display: none; }
.fh-suite summary::after { content: " +"; }
.fh-suite[open] summary { display: none; }
.fh-bloc:has(> .fh-suite[open]) > .fh-court { display: none; }
.fh-info { display: flex; gap: var(--fh-e-2); align-items: flex-start; font-size: var(--fh-t-s); line-height: 1.45; }
.fh-info > svg { flex: none; width: 17px; height: 17px; margin-top: 3px; fill: none; stroke: var(--fh-or-fonce); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fh-info .fh-bloc, .fh-info p, .fh-cellule__desc, .fh-tarifs { min-width: 0; overflow-wrap: anywhere; }
.fh-info .fh-court, .fh-info .fh-suite p { white-space: pre-line; font-size: var(--fh-t-s); }
.fh-contact { overflow: hidden; font-size: var(--fh-t-s); font-weight: 400; line-height: 1.45; }
.fh-contact__liste { display: flex; flex-wrap: wrap; align-items: center; margin-left: -1.2em; }
.fh-contact a { text-decoration: none; display: inline-flex; align-items: center; gap: var(--fh-e-1); min-height: 26px; overflow-wrap: anywhere; }
.fh-contact a:hover { text-decoration: underline; }
.fh-contact svg { flex: none; width: 15px; height: 15px; fill: none; stroke: var(--fh-or-fonce); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fh-contact__lien { position: relative; display: inline-flex; min-width: 0; padding-left: 1.2em; }
/* « | » entre deux contacts, comme la cellule de l'admin ; caché quand le contact ouvre une ligne. */
.fh-contact__lien::before { content: "|"; position: absolute; left: 0.4em; top: 0.12em; color: var(--fh-or-fonce); }
.fh-tarifs { font-size: var(--fh-t-s); line-height: 1.45; white-space: pre-line; }
.fh-icones { display: flex; flex-wrap: wrap; gap: var(--fh-e-1); margin-top: var(--fh-e-1); }
.fh-icone { display: inline-flex; align-items: center; gap: var(--fh-e-1); font-size: var(--fh-t-s); font-weight: 600; }
.fh-encart { margin: 0; grid-column: span 2; }

/* ---------------------------------------------------------------- dos (page 8) */
.fh-dos { position: relative; overflow: hidden; background: var(--fh-or); margin-top: var(--fh-e-8); padding: var(--fh-e-7) 0 var(--fh-e-7); }
.fh-dos__tete { display: flex; flex-direction: column; align-items: center; gap: var(--fh-e-5); }
.fh-dos__logo { width: min(380px, 80%); }
.fh-dos__site {
  display: block; min-width: min(420px, 100%); text-align: center; background: var(--fh-blanc); color: var(--fh-encre);
  font-weight: 800; font-size: var(--fh-t-s); letter-spacing: 0.03em; padding: var(--fh-e-2) var(--fh-e-5); text-decoration: none;
}
.fh-dos__site:hover { text-decoration: underline; }
.fh-dos h2 {
  margin: var(--fh-e-7) 0 var(--fh-e-5); font-weight: 800; font-size: var(--fh-t-l); letter-spacing: 0.05em;
  text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 2px;
}
.fh-bureaux { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--fh-e-6) var(--fh-e-6); position: relative; z-index: 1; }
.fh-bureau { font-size: var(--fh-t-s); line-height: 1.45; }
.fh-bureau h3 { font-size: var(--fh-t-s); font-weight: 600; }
.fh-bureau h3 span { display: block; }
.fh-bureau a { font-weight: 600; text-decoration: none; display: inline-block; padding: 2px 0; }
.fh-bureau a:hover { text-decoration: underline; }
.fh-dos__voile { position: absolute; right: 0; bottom: 0; width: clamp(80px, 11vw, 170px); }
.fh-dos__arc { position: absolute; left: 0; bottom: 0; width: clamp(60px, 8vw, 120px); height: clamp(130px, 17vw, 260px);
  background: var(--fh-blanc); border-top-right-radius: 100% 100%; }

/* ---------------------------------------------------------------- tablette */
@media (max-width: 1080px) {
  .fh-cellule, .fh-cellule[data-reste3] { grid-column: span 3; }
  .fh-cellule[data-reste2="1"], .fh-cellule.fh-cellule--large { grid-column: 1 / -1; }
  .fh-cellule[data-reste3="1"]:not([data-reste2="1"]) .fh-cellule__corps { display: flex; column-count: auto; }
  .fh-cellule[data-reste3="1"]:not([data-reste2="1"]) .fh-cellule__corps > * { margin-bottom: 0; }
  /* Tablette : photo flottante à gauche, tête à côté, infos dessous (pas de grille : 3 blocs sur 2 colonnes) */
  .fh-cellule--large, .fh-cellule--large.fh-cellule--sans-photo { display: flow-root; }
  .fh-cellule--large .fh-cellule__photo { float: left; width: 300px; margin: 0 var(--fh-e-5) var(--fh-e-4) 0; }
  .fh-cellule--large .fh-cellule__tete { overflow: hidden; margin-bottom: var(--fh-e-4); }
  .fh-cellule--large .fh-cellule__infos { clear: both; }
  /* Infos sur deux colonnes sous la photo : pas de bande vide à droite */
  .fh-cellule--large .fh-cellule__infos { display: block; column-count: 2; column-gap: var(--fh-e-6); }
  .fh-cellule--large .fh-cellule__infos > * { break-inside: avoid; margin-bottom: var(--fh-e-2); }
  .fh-bureaux { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fh-legende__grille { grid-template-columns: 1fr; }
  .fh-couv__panneau { width: 72%; border-top-left-radius: 180px; }
}

/* ---------------------------------------------------------------- téléphone */
@media (max-width: 640px) {
  .fh-couv__grille { display: flex; flex-direction: column; height: auto; }
  .fh-couv__logo { order: 0; align-self: stretch; justify-self: auto; padding: var(--fh-e-4) var(--fh-marge); display: flex; justify-content: center; }
  .fh-couv__logo img { width: min(260px, 80%); }
  .fh-couv__photo { order: 1; height: 44svh; min-height: 300px; max-height: 420px; }
  .fh-couv__panneau { order: 2; width: 100%; margin-top: -64px; border-top-left-radius: 120px; padding: var(--fh-e-6) var(--fh-marge) 0 var(--fh-e-6); }
  .fh-couv__site { margin: var(--fh-e-5) calc(-1 * var(--fh-marge)) 0 calc(-1 * var(--fh-e-6)); padding: var(--fh-e-4) var(--fh-e-5); border-top-right-radius: 90px; }
  .fh-couv__site a { font-size: var(--fh-t-s); }
  .fh-couv__voile { top: auto; bottom: 0; height: 120px; z-index: 2; }
  .fh-nav { position: static; }
  .fh-nav ul { gap: 0 var(--fh-e-4); justify-content: flex-start; }
  .fh-legende ul { grid-template-columns: 1fr; }
  .fh-ouv h2 { padding-right: 0; }
  .fh-ouv__voile { height: 80%; }
  .fh-ouv h2 span { display: block; }
  .fh-ouv h2 span + span::before { content: none; }
  .fh-grille { grid-template-columns: 1fr; gap: var(--fh-e-4); }
  .fh-cellule, .fh-cellule[data-reste3], .fh-cellule[data-reste2], .fh-cellule.fh-cellule--large { grid-column: auto; }
  .fh-cellule[data-reste2="1"] .fh-cellule__corps, .fh-cellule[data-reste3="1"] .fh-cellule__corps { display: flex; column-count: auto; }
  .fh-cellule[data-reste2="1"] .fh-cellule__corps > *, .fh-cellule[data-reste3="1"] .fh-cellule__corps > * { margin-bottom: 0; }
  .fh-cellule--large, .fh-cellule--large.fh-cellule--sans-photo { display: flex; flex-direction: column; align-items: stretch; gap: var(--fh-e-2); padding: var(--fh-e-3) 0 var(--fh-e-4); }
  .fh-cellule--large .fh-cellule__photo { float: none; width: auto; aspect-ratio: 2 / 1; margin: 0 0 var(--fh-e-1); }
  .fh-cellule--large .fh-cellule__tete { overflow: visible; margin-bottom: 0; }
  .fh-cellule--large .fh-cellule__infos { display: flex; column-count: auto; }
  .fh-cellule--large .fh-cellule__infos > * { margin-bottom: 0; }
  .fh-encart { grid-column: auto; }
  .fh-bureaux { grid-template-columns: 1fr; gap: var(--fh-e-5); }
  .fh-dos { padding-bottom: 120px; }
  .fh-dos__arc { width: 40px; height: 90px; }
}
