/* Carnet Touraine — léger & doux */

@import url("https://fonts.googleapis.com/css2?family=Caveat:wght@600;700&display=swap");

:root {
  --bg: #fffaf7;
  --surface: #fffefe;
  --border: #ecdcd2;
  --rule: #f1e8e1;
  --text: #443731;
  --muted: #85756b;
  --accent: #bc5b77;
  --accent-soft: #e8afbf;
  --accent-2: #f0c98c;
  --font-serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, "Times New Roman", serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, monospace;
  --font-sans: "Avenir Next", "Avenir", "Segoe UI", "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-cursive: "Caveat", "Segoe Script", "Apple Chancery", "Brush Script MT", "Snell Roundhand", cursive;
  --shadow-card: 0 8px 24px rgba(105, 76, 61, 0.08);
  --shadow-soft: 0 18px 38px rgba(186, 130, 154, 0.14);
  --radius-card: 18px;
  --dur-fast: 180ms;
  --dur-base: 320ms;
  --dur-slow: 720ms;
  --ease-spring: cubic-bezier(0.2, 0.78, 0.2, 1);
  --ease-smooth: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 1rem;
  background: radial-gradient(circle at 12% -10%, #edf7ff 0%, rgba(237, 247, 255, 0) 46%),
    radial-gradient(circle at 88% 8%, #f1eefc 0%, rgba(241, 238, 252, 0) 42%),
    radial-gradient(circle at 52% 118%, #eef8f2 0%, rgba(238, 248, 242, 0) 44%),
    linear-gradient(180deg, #fcfeff 0%, #f9fbff 52%, #fbfffd 100%);
  color: var(--text);
  line-height: 1.58;
  transition: background var(--dur-slow) var(--ease-smooth), opacity var(--dur-base) var(--ease-smooth),
    filter var(--dur-base) var(--ease-smooth);
}

body.page-hidden .shell {
  opacity: 0;
  transform: translateY(24px) scale(0.985);
  filter: blur(6px);
}

body.page-revealed .shell {
  animation: appReveal 900ms var(--ease-spring) both;
}

.shell {
  max-width: 42rem;
  margin: 0 auto;
  padding: 2rem clamp(1rem, 4.5vw, 1.85rem) 4rem;
}

body.home-page .shell {
  max-width: 68rem;
}

body.home-page header.intro {
  max-width: 54rem;
  margin-left: auto;
  margin-right: auto;
}

header.intro {
  margin-bottom: 1.5rem;
}

header.intro h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.65rem, 2.7vw, 2.2rem);
  font-weight: 600;
  margin: 0 0 0.4rem;
  line-height: 1.16;
  letter-spacing: 0.01em;
  color: var(--text);
}

.hero-title {
  text-align: center;
  margin-bottom: 0.6rem;
  text-wrap: balance;
  color: #5a3a45;
  text-shadow: 0 6px 20px rgba(188, 91, 119, 0.16);
}

.hero-title span {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.78em;
  font-weight: 500;
  color: #8c6170;
}

header.intro .lede {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0;
}

.nav-back {
  margin-bottom: 0.75rem;
}

.nav-back a {
  color: var(--accent);
  font-size: 0.9rem;
  text-decoration: none;
}

.nav-back a:hover {
  text-decoration: underline;
}

.toolbar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 0.85rem 1rem;
  margin-bottom: 1.15rem;
  font-size: 0.85rem;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(2px);
}

.toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.9rem;
  margin-bottom: 0.55rem;
}

.toolbar-row:last-child {
  margin-bottom: 0;
}

.toolbar-row label.row-label {
  color: var(--muted);
  min-width: 5rem;
  font-size: 0.82rem;
}

.toolbar select {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.3rem 0.45rem;
  border-radius: 8px;
  font-size: 0.84rem;
}

.toolbar .toggle-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
}

.toolbar .toggle-group label.chk {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  font-size: 0.8rem;
}

.toolbar .toggle-group input {
  accent-color: var(--accent);
}

.progress {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 1.15rem;
  padding: 0.8rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  font-size: 0.92rem;
  box-shadow: var(--shadow-card);
}

body.home-page .progress,
body.home-page .status {
  max-width: 54rem;
  margin-left: auto;
  margin-right: auto;
}

.progress-top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
}

.hub-summary-label {
  color: var(--muted);
  font-size: 0.92rem;
}

.hub-summary-count {
  font-size: 0.92rem;
}

.hub-summary-count strong {
  color: var(--accent);
  font-weight: 700;
}

.progress strong {
  color: var(--accent);
  font-weight: 700;
}

.progress .hint {
  color: var(--muted);
  font-size: 0.82rem;
}

.progress-track {
  height: 10px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
  width: 100%;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-soft), var(--accent));
  transition: width var(--dur-base) var(--ease-spring), filter var(--dur-base) var(--ease-smooth);
}

.progress-track--compact {
  height: 6px;
  margin-top: 0.15rem;
}

section.block > h2 {
  font-family: var(--font-cursive);
  font-size: clamp(1.45rem, 4.2vw, 1.85rem);
  font-weight: 700;
  letter-spacing: 0.01em;
  margin: 0 0 1rem;
  color: var(--text);
}

section.block #list {
  display: flex;
  flex-direction: column;
  gap: 1.05rem;
}

/* Réagit à la largeur réelle du carnet (iframe, split view, téléphone) — pas seulement au viewport. */
body.guide-page:not(.home-page) section.block {
  container-type: inline-size;
  container-name: guide-main;
}

.status {
  padding: 0.9rem 1.05rem;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}

.status code {
  font-size: 0.88em;
}

article.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.15rem 1.25rem 1.2rem;
  margin-bottom: 0;
  box-shadow: var(--shadow-card);
  transition: transform var(--dur-base) var(--ease-smooth), box-shadow var(--dur-base) var(--ease-smooth),
    border-color var(--dur-base) var(--ease-smooth), background var(--dur-base) var(--ease-smooth);
}

article.card[hidden] {
  display: none !important;
}

.card-head {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding-bottom: 0.85rem;
  margin-bottom: 0.85rem;
  border-bottom: 1px solid var(--rule);
}

.card-head input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.15rem;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
  transition: transform var(--dur-fast) var(--ease-spring), filter var(--dur-fast) ease;
}

.card-head input[type="checkbox"]:active {
  transform: scale(1.14);
}

.card-head .titles {
  flex: 1;
  min-width: 0;
}

.card-head h3 {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: -0.015em;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-top: 0.45rem;
}

.card-meta .card-tags {
  margin-top: 0;
}

.card-alt-names {
  margin: 0.2rem 0 0;
  width: 100%;
  font-size: 0.76rem;
  line-height: 1.35;
  color: #9b9088;
}

.card-category {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #5f564e;
  line-height: 1.35;
}

.card-subline {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--muted);
}

.titles > .card-subline {
  margin-top: 0.45rem;
}

.desc + .card-subline {
  margin-top: 0.45rem;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-width: 0;
}

.card-copy {
  min-width: 0;
}

.card-copy > .desc:last-child {
  margin-bottom: 0;
}

@media (min-width: 42rem) {
  .card-body--split {
    display: grid;
    grid-template-columns: minmax(9rem, 11.5rem) minmax(0, 1fr);
    gap: 1rem 1.2rem;
    align-items: start;
  }

  .card-body--split .gallery {
    flex-direction: column;
    flex-wrap: nowrap;
    margin-bottom: 0;
    gap: 0.45rem;
  }

  .card-body--split .gallery img {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: min(220px, 42vw);
    object-fit: cover;
  }

  .card-body--split .gallery--solo img {
    max-height: min(240px, 38vw);
  }
}

/* Étroit au sens « conteneur » : fiches type liste, moins de chrome, une image seule en vignette à côté du texte. */
@container guide-main (max-width: 36rem) {
  body.guide-page:not(.home-page) section.block > h2 {
    margin-bottom: 0.65rem;
  }

  body.guide-page:not(.home-page) section.block #list {
    gap: 0.55rem;
  }

  body.guide-page:not(.home-page) article.card {
    padding: 0.72rem 0.6rem 0.8rem;
    border-radius: 11px;
    box-shadow: 0 1px 0 rgba(105, 76, 61, 0.05);
    background: var(--surface);
    border: 1px solid rgba(232, 218, 208, 0.85);
  }

  body.guide-page:not(.home-page) .card-head {
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
    gap: 0.5rem;
    border-bottom-color: rgba(241, 232, 225, 0.85);
  }

  body.guide-page:not(.home-page) .card-head h3 {
    font-size: 1.01rem;
    letter-spacing: -0.02em;
  }

  body.guide-page:not(.home-page) .card-meta {
    margin-top: 0.32rem;
    gap: 0.35rem 0.65rem;
  }

  /* Conteneur étroit : pas d’image+texte en grille (même flux qu’une fiche à plusieurs photos). */
  body.guide-page:not(.home-page) .card-body--split {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    align-items: stretch;
  }

  body.guide-page:not(.home-page) .card-body--split .gallery.gallery--solo {
    flex-wrap: nowrap;
    margin-bottom: 0.45rem;
  }

  body.guide-page:not(.home-page) .card-body--split .card-copy {
    min-width: 0;
  }

  body.guide-page:not(.home-page) .gallery.gallery--swipe {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.45rem;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 2px;
    margin-bottom: 0.45rem;
    padding-bottom: 2px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }

  body.guide-page:not(.home-page) .gallery.gallery--swipe img {
    flex: 0 0 min(72cqw, 220px);
    width: min(72cqw, 220px);
    max-width: none;
    height: auto;
    max-height: min(168px, 46vw);
    aspect-ratio: 4 / 3;
    object-fit: cover;
    scroll-snap-align: start;
    border-radius: 9px;
  }

  body.guide-page:not(.home-page) .desc {
    font-size: 0.9rem;
    line-height: 1.55;
  }

  @media (prefers-reduced-motion: reduce) {
    body.guide-page:not(.home-page) .gallery.gallery--swipe {
      scroll-snap-type: none;
    }
  }
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.4rem;
}

.tag {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 550;
  line-height: 1.25;
  letter-spacing: 0.02em;
}

.tag--frequency {
  background: #f5efea;
  color: #6f655d;
  border: 1px solid #e4d6cd;
}

.tag--frequency-warn {
  background: #fcefd6;
  color: #825211;
  border-color: #e8c488;
  font-weight: 620;
}

.tag--frequency-critical {
  background: #ffd8df;
  color: #7d2032;
  border-color: #e5a0af;
  font-weight: 650;
  box-shadow: 0 0 0 1px rgba(125, 32, 50, 0.08);
}

.tag--context-tourism {
  background: #eaf4ff;
  color: #1f4f7a;
  border-color: #bbd6f2;
}

.tag--context-cultural {
  background: #f6edff;
  color: #5a347a;
  border-color: #d9c3ef;
}

.tag--context-local {
  background: #eef8ea;
  color: #3c6732;
  border-color: #c8dfbd;
}

.tag--context-nature {
  background: #ecf6ef;
  color: #2d5f44;
  border-color: #bfddc9;
}

/* Spécialités culinaires (thème gourmand) : pastilles discrètes et neutres. */
body[data-page-theme="gourmand"] .card-meta .card-tags .tag.tag--frequency.tag--gourmand-meta {
  background: #f7f5f3;
  color: rgba(78, 70, 64, 0.82);
  border: 1px solid #e6e2de;
  font-weight: 500;
  font-size: 0.68rem;
  letter-spacing: 0.01em;
}

.gallery {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0;
}

.card-body:not(.card-body--split) .gallery {
  margin-bottom: 0.7rem;
}

.gallery img {
  max-height: 136px;
  width: min(100%, 180px);
  max-width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  border: 1px solid var(--border);
  object-fit: cover;
}

.gallery img,
.hub-map img,
.hub-card-image {
  cursor: zoom-in;
}

body.lightbox-open {
  overflow: hidden;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(20, 16, 14, 0.92);
  padding: clamp(0.9rem, 4vw, 1.8rem);
}

.image-lightbox.is-open {
  display: flex;
}

.image-lightbox[aria-hidden="true"] {
  pointer-events: none;
}

.image-lightbox__image {
  display: block;
  max-width: min(96vw, 1300px);
  max-height: 92vh;
  width: auto;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.image-lightbox__close {
  position: absolute;
  top: max(env(safe-area-inset-top), 0.5rem);
  right: max(env(safe-area-inset-right), 0.5rem);
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.gallery.empty {
  margin-bottom: 0.35rem;
}

.no-photo {
  font-size: 0.84rem;
  color: var(--muted);
  font-style: italic;
  margin: 0 0 0.65rem;
  line-height: 1.5;
}

.desc {
  margin: 0 0 0.55rem;
  font-size: 0.94rem;
  line-height: 1.62;
  color: var(--text);
}

.meta {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.wiki {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.76rem;
  font-weight: 450;
  color: var(--muted);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 2px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.wiki:hover {
  color: var(--text);
  text-decoration-color: var(--border);
}

/* Pages guide (faune, flore, lieux, spécialités, vins) — desktop : flux normal */
@media (min-width: 42.0625rem) {
  body.guide-page:not(.home-page) .guide-scroll {
    display: contents;
  }
}

/* Mobile : coque plein viewport + défilement captif avec snap par fiche */
@media (max-width: 42rem) {
  body.guide-page:not(.home-page) .shell {
    min-height: 100dvh;
    min-height: 100svh;
    max-height: 100dvh;
    max-height: 100svh;
    margin: 0 auto;
    padding-top: max(0.75rem, env(safe-area-inset-top, 0px));
    padding-bottom: max(0.35rem, env(safe-area-inset-bottom, 0px));
    padding-left: clamp(1rem, 4.5vw, 1.85rem);
    padding-right: clamp(1rem, 4.5vw, 1.85rem);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
  }

  body.guide-page:not(.home-page) .nav-back,
  body.guide-page:not(.home-page) header.intro {
    flex-shrink: 0;
  }

  body.guide-page:not(.home-page) header.intro {
    margin-bottom: 0.85rem;
  }

  body.guide-page:not(.home-page) header.intro h1 {
    text-wrap: balance;
    text-shadow: 0 4px 18px rgba(188, 91, 119, 0.12);
  }

  body.guide-page:not(.home-page) .guide-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    scroll-snap-type: y proximity;
    scroll-padding-top: 0.35rem;
    scroll-padding-bottom: max(0.5rem, env(safe-area-inset-bottom, 0px));
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
  }

  body.guide-page:not(.home-page) .guide-slide {
    scroll-snap-align: start;
    scroll-snap-stop: normal;
  }

  body.guide-page:not(.home-page) #main {
    flex: 1 1 auto;
    min-height: 0;
  }

  /* Cartes : discret sur petit écran (lisibilité > effet « carte levée ») */
  body.guide-page:not(.home-page) article.card {
    border-radius: 11px;
    box-shadow: 0 1px 0 rgba(105, 76, 61, 0.06);
    border-color: rgba(232, 218, 208, 0.88);
    background: var(--surface);
  }

  body.guide-page:not(.home-page) .card-head {
    gap: 0.75rem;
    align-items: center;
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
  }

  body.guide-page:not(.home-page) .card-head input[type="checkbox"] {
    width: 1.65rem;
    height: 1.65rem;
    min-width: 2.75rem;
    min-height: 2.75rem;
    margin: 0;
    flex-shrink: 0;
    align-self: center;
    cursor: pointer;
    accent-color: var(--accent);
  }

  /* Galerie multi-images : bandeau horizontal borné (évite 3× hauteur d’écran) */
  body.guide-page:not(.home-page) .gallery.gallery--swipe {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 2px;
    margin-bottom: 0.55rem;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  body.guide-page:not(.home-page) .gallery.gallery--swipe img {
    flex: 0 0 min(78vw, 280px);
    width: min(78vw, 280px);
    max-width: none;
    height: auto;
    max-height: min(40vh, 220px);
    aspect-ratio: 4 / 3;
    object-fit: cover;
    scroll-snap-align: start;
    border-radius: 14px;
  }

  /* Une seule image : héros plus présent */
  body.guide-page:not(.home-page) .gallery.gallery--solo {
    flex-wrap: nowrap;
    margin-bottom: 0.6rem;
  }

  body.guide-page:not(.home-page) .gallery.gallery--solo img {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: min(48vh, 320px);
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-radius: 14px;
  }

  body.guide-page:not(.home-page) .card-body--split .gallery.gallery--solo img {
    max-height: min(48vh, 320px);
  }
}

@media (max-width: 42rem) and (prefers-reduced-motion: reduce) {
  body.guide-page:not(.home-page) .guide-scroll {
    scroll-snap-type: none;
  }

  body.guide-page:not(.home-page) .gallery.gallery--swipe {
    scroll-snap-type: none;
  }
}

/* Accueil */
.hub-map {
  padding: 0;
  margin-bottom: 1.15rem;
  max-width: 54rem;
  margin-left: auto;
  margin-right: auto;
}

.hub-map-link {
  text-align: center;
  margin: 0 0 1.25rem;
}

.hub-map--regions {
  margin-top: 2.25rem;
}

.hub-summary-count {
  font-variant-numeric: tabular-nums;
}

.hub-map img {
  display: block;
  width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border: 1px solid rgba(188, 91, 119, 0.24);
  border-radius: 14px;
}

/* Portrait Chambord : toujours visible en entier (pas de rognage comme les cartes hub) */
.hub-map.hub-hero-photo .hub-hero__media {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border-radius: 14px;
}

.hub-map.hub-hero-photo img {
  border: none;
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(78vh, 52rem);
  margin-left: auto;
  margin-right: auto;
  object-fit: contain;
  object-position: center;
}

/* Accueil — téléphones : une « dalle » par écran (scroll snap), puis desktop inchangé via display:contents */
@media (max-width: 42rem) {
  body.home-page .shell {
    min-height: 100dvh;
    max-height: 100dvh;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
  }

  body.home-page .home-scroll {
    flex: 1;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    scroll-padding-top: env(safe-area-inset-top, 0px);
    scroll-padding-bottom: env(safe-area-inset-bottom, 0px);
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
  }

  body.home-page .hub-slide {
    min-height: 100dvh;
    min-height: 100svh;
    box-sizing: border-box;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    padding-left: clamp(1rem, 4.5vw, 1.85rem);
    padding-right: clamp(1rem, 4.5vw, 1.85rem);
    padding-top: max(0.85rem, env(safe-area-inset-top, 0px));
    padding-bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  }

  body.home-page .hub-slide--intro {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 1.8rem;
    padding-top: max(2.35rem, calc(env(safe-area-inset-top, 0px) + 0.75rem));
  }

  body.home-page .hub-slide--intro header.intro {
    margin-bottom: 0;
    flex-shrink: 0;
  }

  body.home-page .hub-slide--intro .hero-title {
    margin-bottom: 1.2rem;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.75), 0 10px 28px rgba(88, 58, 69, 0.1);
  }

  body.home-page .hub-slide--intro .hub-map.hub-hero-photo {
    flex: 0 1 auto;
    min-height: 0;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    overflow: visible;
  }

  body.home-page .hub-slide--intro .hub-map.hub-hero-photo .hub-hero__media {
    flex: 0 1 auto;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(188, 91, 119, 0.2);
    box-shadow: 0 10px 28px rgba(72, 48, 56, 0.08);
  }

  body.home-page .hub-slide--intro .hub-map.hub-hero-photo .hub-hero__media img {
    position: static;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: min(52vh, 520px);
    aspect-ratio: unset;
    border-radius: 0;
    object-fit: contain;
    object-position: center;
    margin: 0 auto;
    display: block;
  }

  body.home-page .hub-slide--intro .progress {
    flex-shrink: 0;
    margin-top: auto;
    margin-bottom: 0;
  }

  body.home-page .hub-slide--intro .status {
    flex-shrink: 0;
    margin-top: 0.25rem;
  }

  body.home-page nav.hub-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  body.home-page .hub-slide--guide {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 0;
    height: 100svh;
    min-height: 100svh;
    box-sizing: border-box;
  }

  body.home-page .hub-slide--guide .hub-card {
    width: 100%;
    max-width: 100%;
    flex: 1 1 0%;
    min-height: 0;
    align-self: stretch;
  }

  body.home-page .hub-slide--outro {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1rem;
  }

  body.home-page .hub-slide--outro .hub-map--regions {
    margin-top: 0;
    margin-bottom: 0;
  }

  body.home-page .hub-slide--outro .hub-map-link {
    margin: 0;
    text-align: center;
  }
}

@media (max-width: 42rem) and (prefers-reduced-motion: reduce) {
  body.home-page .home-scroll {
    scroll-snap-type: none;
  }

  body.home-page .hub-slide {
    scroll-snap-align: none;
    scroll-snap-stop: normal;
    min-height: 0;
  }

  body.home-page .hub-slide--guide {
    padding-left: clamp(1rem, 4.5vw, 1.85rem);
    padding-right: clamp(1rem, 4.5vw, 1.85rem);
    padding-top: max(0.85rem, env(safe-area-inset-top, 0px));
    padding-bottom: max(1rem, env(safe-area-inset-bottom, 0px));
    height: auto;
    min-height: 0;
    max-height: none;
  }

  body.home-page .shell {
    max-height: none;
    min-height: 0;
    overflow: visible;
    padding: 2rem clamp(1rem, 4.5vw, 1.85rem) 4rem;
  }

  body.home-page .hub-card.hub-card--immersive {
    border-radius: var(--radius-card);
  }

  body.home-page .hub-slide--intro .hub-map.hub-hero-photo .hub-hero__media {
    min-height: 0;
  }
}

@media (min-width: 42.0625rem) {
  body.home-page .home-scroll {
    display: contents;
  }

  body.home-page .hub-slide--intro,
  body.home-page .hub-slide--outro,
  body.home-page .hub-slide--guide {
    display: contents;
  }
}

.hub-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
  align-items: start;
}

body.home-page .hub-grid {
  align-items: stretch;
}

.hub-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.15rem 1.2rem;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: transform var(--dur-base) var(--ease-smooth), box-shadow var(--dur-base) var(--ease-smooth),
    border-color var(--dur-base) var(--ease-smooth);
}

.hub-card:not(.hub-card--immersive):hover {
  border-color: var(--accent-soft);
  box-shadow: var(--shadow-soft);
  transform: translateY(-4px);
}

.hub-card:not(.hub-card--immersive) h2 {
  margin: 0 0 0.3rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent);
}

.hub-card-image {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  height: auto;
  min-height: 10.5rem;
  max-height: 14rem;
  margin: 0.55rem 0 0.65rem;
  border-radius: calc(var(--radius-card) - 6px);
  object-fit: cover;
  object-position: center;
  border: 1px solid var(--border);
}

.hub-card:not(.hub-card--immersive) p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.hub-card-progress {
  margin-top: 0.75rem;
}

/* Accueil — hub immersif (photo plein cadre, texte en dégradé discret) */
body.home-page .hub-card.hub-card--immersive {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0;
  border: none;
  background: #171311;
  border-radius: 0;
  box-shadow: none;
  transition: transform var(--dur-base) var(--ease-smooth), box-shadow var(--dur-base) var(--ease-smooth),
    opacity var(--dur-fast) var(--ease-smooth);
}

body.home-page .hub-card.hub-card--immersive:active {
  opacity: 0.96;
}

body.home-page .hub-card__media {
  position: relative;
  flex: 1 1 0%;
  min-height: 0;
  overflow: hidden;
  /* Containment for future card-width–sensitive layout; art direction on hub cards uses <picture> + viewport. */
  container-type: inline-size;
  container-name: hub-card-media;
}

body.home-page .hub-card__media > .hub-card-picture {
  display: block;
  width: 100%;
  height: 100%;
}

body.home-page .hub-card__media::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  opacity: 0.5;
  pointer-events: none;
  z-index: 2;
}

body.home-page .hub-card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(18, 14, 13, 0.82) 0%, rgba(18, 14, 13, 0.44) 36%, transparent 70%);
  pointer-events: none;
  z-index: 1;
}

body.home-page .hub-card__media .hub-card-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  border: none;
  border-radius: 0;
  aspect-ratio: unset;
  min-height: 0;
  max-height: none;
  object-fit: cover;
  object-position: center;
}

body.home-page .hub-card__overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  padding: 1.25rem clamp(1rem, 4vw, 1.5rem) max(1.1rem, env(safe-area-inset-bottom, 0px));
}

body.home-page .hub-card__overlay h2 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.08rem, 3.6vw, 1.32rem);
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

body.home-page .hub-card__overlay p {
  margin: 0;
  font-size: 0.91rem;
  line-height: 1.45;
  color: rgba(255, 247, 242, 0.9);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

body.home-page .hub-card__overlay .hub-card-progress {
  margin-top: 0.8rem;
}

body.home-page .hub-card__overlay .progress-track {
  background: rgba(255, 255, 255, 0.2);
}

body.home-page .hub-card__overlay .progress-fill {
  box-shadow: 0 0 12px rgba(232, 175, 191, 0.35);
}

body.home-page .hub-card--immersive:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
  box-shadow: 0 0 0 5px rgba(188, 91, 119, 0.55);
  z-index: 2;
}

@media (min-width: 42.0625rem) {
  body.home-page .hub-card.hub-card--immersive {
    flex: none;
    min-height: 0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 36px rgba(48, 36, 34, 0.07);
    background: var(--surface);
    transition: transform var(--dur-base) var(--ease-smooth), box-shadow var(--dur-base) var(--ease-smooth);
  }

  body.home-page .hub-card.hub-card--immersive:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 46px rgba(48, 36, 34, 0.11);
  }

  body.home-page .hub-card__media {
    flex: none;
    width: 100%;
    aspect-ratio: 16 / 10;
    min-height: clamp(12.5rem, 26vw, 19rem);
  }

  body.home-page .hub-card__media::after {
    background: linear-gradient(to top, rgba(18, 14, 13, 0.76) 0%, rgba(18, 14, 13, 0.32) 42%, transparent 76%);
  }

  body.home-page .hub-card__overlay {
    padding: 1.15rem 1.2rem 1.2rem;
    padding-bottom: max(1.15rem, env(safe-area-inset-bottom, 0px));
  }

  body.home-page .hub-card--immersive:focus-visible {
    outline-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.98), 0 0 0 6px rgba(188, 91, 119, 0.35);
  }

  body.home-page .hub-map.hub-hero-photo .hub-hero__media {
    border-radius: 16px;
    max-height: min(78vh, 52rem);
  }
}

@media (min-width: 56rem) {
  .hub-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.35rem;
  }

  body.home-page .hub-card__media {
    aspect-ratio: 16 / 9;
    min-height: clamp(13rem, 22vw, 18rem);
  }

  body.home-page .hub-card__overlay h2 {
    font-size: clamp(1.05rem, 1.35vw, 1.22rem);
  }
}

.card.is-celebrating {
  animation: cardCelebrate 980ms var(--ease-spring);
}

@media (prefers-reduced-motion: reduce) {
  .card.is-celebrating {
    animation: none;
  }
}

.fx-layer {
  position: fixed;
  pointer-events: none;
  z-index: 1200;
}

.fx-particle {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--fx-color, #ff6b9a);
  transform: translate(-50%, -50%);
  opacity: 0;
  animation: particleBurst 960ms var(--ease-spring) forwards;
}

.fx-particle.is-round { border-radius: 999px; }
.fx-particle.is-diamond { border-radius: 2px; width: 9px; height: 9px; transform: translate(-50%, -50%) rotate(45deg); }
.fx-particle.is-pill { width: 13px; height: 7px; border-radius: 999px; }
.fx-particle.is-trail { animation-duration: 1020ms; width: 7px; height: 7px; }

.fx-ring {
  position: fixed;
  width: 14px;
  height: 14px;
  border: 2px solid var(--ring-color, #ff6b9a);
  border-radius: 999px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 1190;
  animation: ringPulse 840ms var(--ease-spring) forwards;
}

/* Full-screen celebration layers (checkbox) */
.fx-screen {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1192;
  overflow: hidden;
}

.fx-glitter {
  position: absolute;
  top: -8vh;
  width: 5px;
  height: 9px;
  border-radius: 2px;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.95) 0%, var(--fx-color, #ffb6d9) 55%, rgba(255, 255, 255, 0.35) 100%);
  opacity: 0;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.55);
  /* duration/delay overridden inline from JS */
  animation: fxGlitterFall 2s linear forwards;
}

.fx-glitter--wide {
  width: 7px;
  height: 5px;
  border-radius: 999px;
}

.fx-star {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: radial-gradient(circle at 35% 35%, #fff 0%, var(--fx-color, #ffd57e) 45%, transparent 70%);
  box-shadow: 0 0 10px 3px rgba(255, 220, 180, 0.55);
  opacity: 0.35;
  transform: scale(var(--star-scale, 1));
  animation: fxStarTwinkle 1.25s ease-in-out infinite;
}

.fx-star--plus {
  border-radius: 0;
  background: var(--fx-color, #ffd57e);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  box-shadow: 0 0 12px 4px rgba(255, 210, 160, 0.5);
}

body.fx-screen-flash {
  animation: fxScreenFlashVignette 420ms ease-out forwards;
}

.intro-gate {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: grid;
  place-items: center;
  background: #000;
  overflow: hidden;
}

.intro-gate__bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(145deg, rgba(9, 6, 12, 0.65), rgba(30, 9, 25, 0.44)),
    url("image-optimized/full/lieux/foret-de-chambord-3.webp") center / cover no-repeat;
  filter: saturate(1.08) contrast(1.02);
  transform: scale(1.05);
  opacity: 0;
  animation: gateImageFadeIn 1100ms var(--ease-smooth) forwards, gateBreath 6.2s ease-in-out 1.1s infinite alternate;
}

@media (min-width: 64rem) {
  .intro-gate__bg {
    /* Desktop: fit by height first (avoid width-fit look). */
    background-size: auto 118%;
    background-position: center 44%;
  }
}

.intro-gate__reveal {
  position: relative;
  z-index: 1;
  width: min(72vw, 300px);
  min-height: 84px;
  padding: 0.9rem 1.25rem;
  border: 0;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 26%, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.08) 65%, transparent 70%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.44), 0 0 0 12px rgba(255, 255, 255, 0.08),
    0 14px 46px rgba(0, 0, 0, 0.38);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  opacity: 0;
  transform: translateY(10px) scale(0.97);
  animation: gateCtaFadeIn 680ms var(--ease-smooth) 480ms forwards, revealPulse 1.6s var(--ease-smooth) 1.2s infinite;
}

.intro-gate__cta {
  color: #fff;
  font-size: 1.08rem;
  font-weight: 640;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.intro-gate__cta-pulse {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.6);
  animation: ctaDotPulse 1.4s ease-out infinite;
}

.intro-gate.is-opening {
  animation: gateOut 980ms var(--ease-spring) forwards;
}

@keyframes appReveal {
  from { opacity: 0; transform: translateY(24px) scale(0.985); filter: blur(6px); }
  to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

@keyframes particleBurst {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.15) rotate(0deg); }
  16% { opacity: 1; }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.12) rotate(var(--rot));
  }
}

@keyframes ringPulse {
  0% { opacity: 0.9; transform: translate(-50%, -50%) scale(0.26); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(14.5); }
}

@keyframes cardCelebrate {
  0% { transform: scale(1) rotate(0deg); }
  16% {
    transform: translateY(-7px) scale(1.04) rotate(-1.4deg);
    box-shadow: 0 20px 44px rgba(196, 95, 114, 0.32);
  }
  38% { transform: translateY(-3px) scale(1.022) rotate(0.9deg); }
  58% { transform: translateY(-5px) scale(1.034) rotate(-0.55deg); }
  82% { transform: translateY(-1px) scale(1.01) rotate(0.2deg); }
  100% { transform: scale(1) rotate(0deg); }
}

@keyframes fxGlitterFall {
  0% {
    transform: translate3d(0, -5vh, 0) rotate(0deg) scale(0.5);
    opacity: 0;
  }
  7% { opacity: 1; }
  82% { opacity: 0.92; }
  100% {
    transform: translate3d(var(--drift, 0px), 112vh, 0) rotate(var(--spin, 200deg)) scale(1);
    opacity: 0;
  }
}

@keyframes fxStarTwinkle {
  0%,
  100% {
    opacity: 0.28;
    transform: scale(calc(var(--star-scale, 1) * 0.82));
    filter: brightness(0.92);
  }
  50% {
    opacity: 1;
    transform: scale(var(--star-scale, 1));
    filter: brightness(1.2);
  }
}

@keyframes fxScreenFlashVignette {
  0% { box-shadow: inset 0 0 50px 24px transparent; }
  42% { box-shadow: inset 0 0 120px 72px rgba(255, 200, 220, 0.4); }
  100% { box-shadow: inset 0 0 50px 24px transparent; }
}

@keyframes gateBreath {
  from { transform: scale(1.04); }
  to { transform: scale(1.12); }
}

@keyframes gateImageFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes gateCtaFadeIn {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes revealPulse {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.08); filter: brightness(1.08); }
}

@keyframes ctaDotPulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.52); }
  100% { box-shadow: 0 0 0 14px rgba(255, 255, 255, 0); }
}

@keyframes gateOut {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.08); }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .fx-screen {
    display: none !important;
  }

  body.fx-screen-flash {
    animation: none !important;
  }
}
