/* ==========================================================
   Fayngo : pages de ville (destinations/<slug>.html, générées par scripts/build-cities.mjs)
   Même monde que l'accueil (obsidienne, ivoire, safran) ; chaque ville a sa lumière :
   terre (ocre du Sud), jardin (vert des villes du Nord et des médinas), océan (côte atlantique).
   ========================================================== */

body.city {
  background: var(--c-obsidian);
  color: var(--c-ivory);
  font-family: var(--font-text);
  font-size: 1.0625rem;
  line-height: 1.6;
}
.city--terre { --city-field: var(--c-field-terre); --city-accent: var(--c-saffron); }
.city--jardin { --city-field: var(--c-field-jardin); --city-accent: var(--c-saffron); }
.city--ocean { --city-field: var(--c-field-ocean); --city-accent: var(--c-accent-ocean); }
body.city h1, body.city h2, body.city h3, body.city h4 { font-family: var(--font-display); font-weight: 600; color: inherit; text-wrap: balance; word-spacing: .14em; }
body.city h2 { font-size: clamp(2.1rem, 4.4vw, 4rem); line-height: 1.02; letter-spacing: -.02em; margin: 0 0 .45em; }
body.city h3 { font-size: 1.375rem; line-height: 1.15; letter-spacing: -.01em; margin: 0 0 .35em; }
body.city { --focus: var(--c-saffron); }
body.city section { scroll-margin-top: var(--header-h); }

/* Ligne de vérification : date et source, toujours visibles */
.city-verif { display: flex; gap: 10px; align-items: baseline; margin: 12px 0 0; font-size: .9375rem; line-height: 1.45; }
.city-verif__dot { flex: none; width: 9px; height: 9px; background: var(--c-emerald-text); transform: translateY(-1px); }
.city-verif--partial .city-verif__dot { background: var(--c-partial); }
.city-verif a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(242, 231, 213, .45); }
/* Grand texte sur petit écran : un domaine long (marchicaresort.com…) passe à la ligne au lieu d’élargir la page */
.city-verif > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.city-verif a:hover { text-decoration-color: currentColor; }

/* Favoris et itinéraire sur fond sombre */
body.city .fav-btn { position: static; flex: none; background: var(--c-surface-2); color: var(--c-ivory); }
body.city .fav-btn:hover { transform: none; background: var(--c-surface-3); }
body.city .fav-btn[aria-pressed="true"] { color: var(--c-saffron); }

/* ---------- Ouverture : la photo de la ville ---------- */
.city-hero { position: relative; isolation: isolate; min-height: min(92svh, 920px); display: flex; align-items: flex-end; padding-block: calc(var(--header-h) + 80px) clamp(48px, 7vw, 96px); overflow: hidden; }
.city-hero__img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
/* Voile neutre sous le texte, seule exception aux aplats */
/* Voile léger en haut (la couleur de la ville reste visible), dense seulement sous le texte */
.city-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(11, 11, 13, .38) 0%, rgba(11, 11, 13, 0) 22%, rgba(11, 11, 13, 0) 42%, rgba(11, 11, 13, .74) 70%, rgba(11, 11, 13, .92) 100%); }
.city-hero__inner { position: relative; width: 100%; }
/* Voile attaché au bloc de texte (et non à des pourcentages de la photo) : il s'épaissit juste au-dessus du titre
   et reste à 88 % d'obsidienne derrière le texte, quelle que soit la photo ou la hauteur de l'écran
   (titre ≥ 3:1, ligne de région ≥ 4,5:1 même sur un ciel clair ou un mur blanc) */
.city-hero__inner::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  left: -100vw; right: -100vw; top: -120px; bottom: -120px;
  background: linear-gradient(180deg, rgba(11, 11, 13, 0) 0, rgba(11, 11, 13, .88) 120px, rgba(11, 11, 13, .92) 100%);
}
.city-hero h1 { font-size: clamp(3.25rem, 9.5vw, 8.5rem); line-height: .92; letter-spacing: -.035em; margin: 0; }
.city-hero__where { margin: 14px 0 0; font-size: 1.125rem; font-weight: 600; }
.city-hero__lede { margin: 14px 0 0; max-width: 46ch; font-size: 1.25rem; line-height: 1.5; }
.city-hero__actions { margin-top: 28px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; }
.city-action { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 4px; font-weight: 600; }
.city-action svg { width: 20px; height: 20px; color: var(--c-saffron); }
/* Flèche « quitte Fayngo » des liens Google Maps (Itinéraire) */
.city-action .i-out, .place__route .i-out { width: 14px; height: 14px; flex: none; }
.city-action:hover span { text-decoration: underline; text-underline-offset: 4px; }
.city-hero__credit { position: absolute; right: max(24px, calc((100vw - 1200px) / 2 + 24px)); bottom: 12px; margin: 0; font-size: .75rem; color: var(--c-ivory-2); }
.city-hero__credit a { text-decoration: underline; }

/* ---------- Repères sourcés (quand data/cities.json en donne) ---------- */
.city-facts { background: var(--c-surface-1); padding-block: 36px; }
.city-facts dl { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px 40px; }
.city-facts dt { font-size: .9375rem; color: var(--c-ivory-2); }
.city-facts dd { margin: 4px 0 0; font: 500 1.375rem/1.25 var(--font-display); }
.city-facts small { font: 400 .875rem/1.4 var(--font-text); color: var(--c-ivory-2); }
.city-facts small a { text-decoration: underline; }

/* ---------- Situer et rejoindre : la carte en relief, dans la lumière de la ville ---------- */
.city-where { background: var(--city-field); padding-block: clamp(80px, 10vw, 150px); }
.city-where__inner { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: clamp(40px, 6vw, 96px); align-items: center; }
.city-map { position: relative; margin: 0; }
.city-map__frame { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--c-obsidian); }
.city-map__still, .city-map__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.city-map__still { object-fit: cover; }
.city-map__canvas { opacity: 0; transition: opacity .8s ease; cursor: grab; touch-action: pan-y; }
.city-map__canvas:active { cursor: grabbing; }
.city-map.is-live .city-map__canvas { opacity: 1; }
.city-map__labels { position: absolute; inset: 0; pointer-events: none; }
.city-map__labels a, .city-map__labels span {
  position: absolute; left: 0; top: 0; margin: -22px 0 0 4px; padding: 12px 8px; min-height: 44px; pointer-events: auto;
  font: 500 .875rem/1.2 var(--font-text); white-space: nowrap; color: var(--c-ivory);
  text-shadow: 0 0 6px var(--c-obsidian), 0 0 2px var(--c-obsidian);
}
.city-map__labels a:hover { color: var(--c-saffron); text-decoration: underline; }
.city-map__labels .is-left { margin-left: -4px; }
.city-map__labels span { color: var(--c-cyan); font-weight: 600; pointer-events: none; }
.city-map figcaption { margin-top: 10px; font-size: .75rem; line-height: 1.4; color: var(--c-ivory-2); }
.city-map figcaption a { text-decoration: underline; }
.city-where__text > p { max-width: 46ch; }
.road-list { list-style: none; padding: 0; margin: 24px 0; display: grid; gap: 4px; }
.road-list li { position: relative; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 2px 16px; min-height: 52px; padding: 6px 16px; background: rgba(11, 11, 13, .32); }
.road-list a { font: 500 1.25rem/1.2 var(--font-display); }
.road-list a:hover { color: var(--city-accent); }
.road-list a { min-width: 0; }
/* Toute la ligne mène à la ville (cible de 52 px de haut) */
.road-list a::after { content: ""; position: absolute; inset: 0; }
.road-list li:hover a { color: var(--city-accent); }
.road-list li:focus-within { outline: 3px solid var(--focus, var(--c-saffron)); outline-offset: 2px; }
.road-list a:focus-visible { outline: none; }
.road-list span { font-variant-numeric: tabular-nums; color: var(--c-ivory); font-weight: 500; }
.city-wc { display: flex; gap: 10px; align-items: baseline; margin: 0 0 12px; }
.city-wc__dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--c-saffron); transform: translateY(-1px); }
.city-wc a { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- À faire, dormir et manger ---------- */
.city-do, .city-stay, .city-tips { padding-block: clamp(80px, 10vw, 150px); }
.city-stay { background: var(--c-surface-1); padding-block: clamp(64px, 8vw, 120px); }
.city-head { display: flex; justify-content: space-between; align-items: end; gap: 12px 28px; flex-wrap: wrap; margin-bottom: 32px; }
.city-head h2 { margin: 0; }
.city-head__links { margin: 0; display: flex; gap: 24px; flex-wrap: wrap; }
.city-sub { margin: 48px 0 20px; }
.place-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.place { display: flex; gap: 16px; justify-content: space-between; padding: 22px 22px 20px; background: var(--c-surface-1); }
.city-stay .place { background: var(--c-surface-2); }
.place__body { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.place h3 a:hover { color: var(--c-saffron); }
.place__meta { margin: 0 0 10px; font-size: .9375rem; color: var(--c-ivory-2); }
.place__body > p:not([class]) { margin: 0; }
/* Actions d'une ligne : un favori carré et « Itinéraire » écrit, côte à côte sous le texte (même motif que les fiches des listes) */
/* Zone d'actions en bas de la fiche : dans une rangée de la grille (cases de même hauteur), les actions s'alignent ;
   dans une ligne d'actions, tous les boutons ont la même hauteur */
.place__actions { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; margin-top: auto; padding-top: 14px; }
.place__actions > * { min-height: 44px; }
.place__route { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; background: var(--c-surface-2); font-weight: 600; }
.place__route svg { width: 20px; height: 20px; color: var(--c-saffron); }
.place__route:hover { background: var(--c-surface-3); }
.city-stay .place__route, .city-stay .fav-btn { background: var(--c-obsidian); }
/* Lien vers un site externe (hôtel, réservation) : le domaine reste visible, la flèche dit qu'on quitte Fayngo */
/* Grand texte (200 %) : le bouton passe à la ligne (libellé, puis domaine) au lieu de déborder ; il garde 44 px au minimum */
.place__out { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; max-width: 100%; min-height: 44px; padding: 8px 14px; background: var(--c-obsidian); font-weight: 600; overflow-wrap: anywhere; }
.place__out:hover { background: var(--c-surface-3); }
.place__domain { font-weight: 400; font-size: .875rem; color: var(--c-ivory-2); }
.place__out svg { width: 16px; height: 16px; color: var(--c-saffron); flex: none; }
.city-empty { max-width: 52ch; margin: 0; font-size: 1.125rem; }
/* « Voir les autres » : la suite de la liste, sans script */
.city-more { margin-top: 8px; }
.city-more summary { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 18px; background: var(--c-surface-1); cursor: pointer; font-weight: 600; list-style: none; }
.city-more summary::-webkit-details-marker { display: none; }
.city-more summary::after { color: var(--c-saffron); transition: transform .2s var(--ease-out); }
.city-more[open] summary::after { transform: rotate(45deg); }
.city-more summary:hover { background: var(--c-surface-2); }
.city-more[open] summary { margin-bottom: 8px; }

/* ---------- Bons plans ---------- */
.city-tips__note { margin: 0 0 28px; color: var(--c-ivory-2); }
.tip-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tip-list li { padding: 24px 22px 20px; background: var(--c-surface-1); }
.tip-list p { margin: 0; }
.tip-list .city-verif { margin-top: 14px; }
.city-note { margin: 24px 0 0; max-width: 70ch; padding: 18px 20px; background: var(--c-surface-1); color: var(--c-ivory); }

/* ---------- Préparer : un champ de safran ---------- */
.city-end { --focus: var(--c-obsidian); background: var(--c-saffron); color: var(--c-obsidian); padding-block: clamp(72px, 9vw, 130px); }
.city-end p { max-width: 52ch; }
.city-end__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; margin-top: 24px; }
.city-end .home-link span { color: var(--c-obsidian); }

/* ---------- Adaptation ---------- */
@media (max-width: 1023px) {
  .city-where__inner { grid-template-columns: minmax(0, 1fr); }
  .place-list, .tip-list { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 759px) {
  .city-hero { min-height: 88svh; padding-bottom: 40px; }
  .city-hero__lede { font-size: 1.0625rem; }
  .city-hero__actions .atlas-btn { width: 100%; }
  .city-hero__credit { left: 16px; right: 16px; text-align: right; }
  .city-do, .city-tips, .city-where { padding-block: 72px; }
  /* La carte prend toute la largeur de l'écran, plus haute : davantage de villes voisines y trouvent leur étiquette */
  .city-where .city-map { margin-inline: -24px; }
  .city-where .city-map__frame { aspect-ratio: 1 / 1; }
  .city-where .city-map figcaption { padding-inline: 24px; }
  .place { padding: 18px 16px; }
  .road-list a { font-size: 1.125rem; }
  .city-end .atlas-btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .city-map__canvas { transition: none; }
}

/* Toute la ligne de lieu mène à sa fiche ; favori, itinéraire et sources restent au-dessus */
.place { position: relative; }
.place h3 a::after { content: ""; position: absolute; inset: 0; }
.place:focus-within { outline: 3px solid var(--focus, var(--c-saffron)); outline-offset: 2px; }
.place h3 a:focus-visible { outline: none; }
.place .place__actions, .place .city-verif { position: relative; z-index: 1; }
/* « Où dormir et manger » en deux parties : les sous-titres, et les restaurants d'hôtels cités avec un lien vers la fiche de l'hôtel */
.city-stay .city-sub { margin: 56px 0 20px; }
.city-stay .city-sub--first { margin-top: 0; }
.city-dining__lead { margin: 20px 0 8px; font-weight: 600; }
.city-dining { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.city-dining li { display: flex; flex-wrap: wrap; align-items: center; min-height: 44px; border-bottom: 1px solid var(--c-surface-3); color: var(--c-ivory-2); }
.city-dining a { display: inline-flex; align-items: center; min-height: 44px; color: var(--c-ivory); font-weight: 600; text-decoration: underline; text-decoration-color: var(--c-saffron); text-underline-offset: 4px; }
.city-stay .place:target { outline: 2px solid var(--c-saffron); outline-offset: 2px; }
/* Très grand texte sur petit écran : le titre de section se réduit et passe à la ligne à côté de ses liens */
.city-head > * { min-width: 0; }
/* Téléphone : les fiches avec des liens externes (hébergements) empilent leurs boutons sur toute la largeur,
   le favori reste un carré de 44 px au-dessus */
@media (max-width: 600px) {
  .place__actions:has(.place__out) { display: grid; grid-template-columns: minmax(0, 1fr); }
  .place__actions:has(.place__out) .fav-btn { justify-self: start; }
  /* Même hauteur pour les trois boutons empilés (56 px) : libellé en haut, domaine dessous, flèche « quitte Fayngo » à droite */
  .place__actions:has(.place__out) :is(.place__out, .place__route) { position: relative; width: 100%; min-height: 56px; padding-right: 40px; }
  .place__actions:has(.place__out) .place__out { flex-direction: column; align-items: flex-start; justify-content: center; gap: 0; padding-block: 6px; line-height: 1.3; }
  .place__actions:has(.place__out) .place__out > svg, .place__actions:has(.place__out) .place__route > .i-out { position: absolute; right: 14px; top: 50%; translate: 0 -50%; }
}
