/* ============================================================
   LE REPÈRE — La Carte (livret unique feuilletable)
   v3 — full-screen, auto-fit, layouts denses 2 colonnes
   ============================================================ */

.page-carte body { background: var(--beige); overflow-x: hidden; }
.page-carte main { padding-top: 70px; min-height: 100vh; }

:root {
  --paper: #fbf6dd;
  --paper-edge: #ebe2b9;
  --bleu-page: #B7E0F9;
  --jaune-page: #FBDA68;
  --vert-page: #307159;
  --orange-page: #e78e50;
  --marron-gelato: #6b3a1f;
  --scallop-pink: #ec5b8a;
}

/* ============================================================
   1. COVER PAGE — Livret fermé GROS centré
   ============================================================ */
.cover-page {
  position: relative;
  padding: clamp(2rem, 5vw, 4rem) 0 clamp(4rem, 8vw, 6rem);
  background: var(--beige);
  min-height: calc(100vh - 70px);
  display: flex;
  align-items: center;
}
.cover-page__inner {
  text-align: center;
  position: relative;
  z-index: 1;
}
.cover-page .eyebrow { display: inline-flex; }
.cover-page .display {
  margin: 1.2rem auto 1.2rem;
  max-width: 14ch;
}
.cover-page__lede {
  font-size: 1.05rem;
  color: var(--ink-soft);
  font-style: italic;
  margin: 0 auto 2.5rem;
  max-width: 46ch;
}

/* BOOK TRIGGER — bien plus grand */
.book-trigger {
  position: relative;
  display: inline-block;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  margin: 0;
  transition: transform .5s var(--ease);
}
.book-trigger:hover {
  transform: translateY(-10px) rotate(-1.5deg);
}
.book-trigger:hover .book-trigger__cover {
  box-shadow:
    0 40px 80px rgba(27,20,16,.3),
    0 8px 20px rgba(27,20,16,.18);
}
.book-trigger:hover .book-trigger__hint {
  background: var(--terracotta);
  color: var(--beige);
}

.book-trigger__cover {
  position: relative;
  width: clamp(300px, 36vw, 460px);
  aspect-ratio: 3 / 4;
  border-radius: 6px 12px 12px 6px;
  overflow: hidden;
  box-shadow:
    0 26px 60px rgba(27,20,16,.22),
    0 6px 14px rgba(27,20,16,.12);
  transition: box-shadow .5s var(--ease);
  background: var(--paper);
}
.book-trigger__stripes {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 240' preserveAspectRatio='xMidYMid slice'><g fill='%23B7E0F9'><path d='M 14 0 Q 18 60, 16 120 T 14 240 L 26 240 Q 30 180, 28 120 T 26 0 Z'/><path d='M 48 0 Q 54 70, 50 140 T 48 240 L 60 240 Q 64 170, 60 100 T 58 0 Z'/><path d='M 82 0 Q 88 60, 84 120 T 82 240 L 96 240 Q 100 175, 96 115 T 92 0 Z'/><path d='M 116 0 Q 122 75, 118 145 T 116 240 L 130 240 Q 134 165, 130 95 T 126 0 Z'/><path d='M 150 0 Q 156 65, 152 130 T 150 240 L 164 240 Q 168 180, 164 120 T 160 0 Z'/><path d='M 184 0 Q 190 80, 186 150 T 184 240 L 196 240 Q 200 170, 196 105 T 192 0 Z'/></g></svg>");
  background-size: 200px 240px;
  background-repeat: repeat;
}
.book-trigger__content {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: clamp(1.5rem, 3vw, 2.5rem);
}
.book-trigger__symbol {
  width: clamp(120px, 16vw, 200px);
}
.book-trigger__symbol svg {
  width: 100%;
  height: auto;
  display: block;
  color: var(--terracotta);
}
.book-trigger__script {
  font-family: var(--font-script);
  font-size: clamp(2.6rem, 5.5vw, 4rem);
  line-height: 1;
  color: var(--terracotta);
  margin: 0;
  padding: .15em 0;
  text-align: center;
}
.book-trigger__spine {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 10px;
  background: linear-gradient(to right, rgba(27,20,16,.22), rgba(27,20,16,0));
  pointer-events: none;
}
.book-trigger__hint {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  margin-top: 2rem;
  padding: .9rem 1.8rem;
  border-radius: 999px;
  background: var(--terracotta-10);
  color: var(--terracotta);
  font-family: var(--font-ui);
  font-size: .82rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  font-weight: 500;
  transition: all .3s var(--ease);
}
.book-trigger__arrow {
  display: inline-block;
  transition: transform .3s var(--ease);
}
.book-trigger:hover .book-trigger__arrow {
  transform: translate(2px, -2px);
}

/* ============================================================
   2. BOOK MODAL — Full screen
   ============================================================ */
.book-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  background:
    radial-gradient(ellipse at center, rgba(151,56,21,.12) 0%, transparent 70%),
    rgba(27,20,16,.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  animation: modalIn .4s var(--ease);
  overflow: hidden;
}
@keyframes modalIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.book-modal__close {
  position: absolute;
  top: 5px;
  right: 18px;
  z-index: 10;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(248,244,224,.12);
  color: var(--beige);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  border: 0;
  padding: 0;
  transition: all .3s var(--ease);
}
.book-modal__close:hover {
  background: rgba(248,244,224,.25);
  transform: rotate(90deg);
}

.book-modal__header {
  padding: .7rem clamp(1rem, 3vw, 2rem);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  color: var(--beige);
  flex-shrink: 0;
}
.book-modal__title {
  font-family: var(--font-script);
  font-size: 1.2rem;
  margin: 0;
  color: var(--beige);
  padding: .1em 0;
}
.book-modal__toc-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem 1.1rem;
  border-radius: 999px;
  font-family: var(--font-ui);
  font-size: .7rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  font-weight: 500;
  background: transparent;
  color: var(--beige);
  border: 1px solid rgba(248,244,224,.4);
  cursor: pointer;
  transition: all .3s var(--ease);
}
.book-modal__toc-btn:hover {
  background: rgba(248,244,224,.15);
  border-color: var(--beige);
}

/* ============================================================
   3. BOOK — Le livret physique (FULL SCREEN)
   ============================================================ */
.book {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .5rem clamp(56px, 7vw, 90px);
  perspective: 2400px;
  perspective-origin: center;
  min-height: 0; /* important pour flex shrink */
}

.book__spine {
  position: absolute;
  top: 4%;
  bottom: 4%;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  background: linear-gradient(to right,
    rgba(27,20,16,.5) 0%,
    rgba(27,20,16,.85) 50%,
    rgba(27,20,16,.5) 100%);
  border-radius: 3px;
  box-shadow:
    inset 0 0 6px rgba(27,20,16,.6),
    0 0 20px rgba(0,0,0,.4);
  pointer-events: none;
  z-index: 5;
}

/* Le livret occupe toute la zone disponible */
.book__spread {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  width: 100%;
  height: 100%;
  max-width: 1500px;
  max-height: 100%;
  position: relative;
}

/* Une page individuelle - prend toute la hauteur disponible */
.book__page {
  position: relative;
  background: var(--paper);
  overflow: hidden;
  box-shadow:
    inset 0 0 60px rgba(0,0,0,.06),
    0 8px 30px rgba(0,0,0,.3);
  transition: opacity .35s var(--ease), transform .5s var(--ease);
  min-height: 0;
}
.book__page--left {
  border-radius: 6px 0 0 6px;
  box-shadow:
    inset -8px 0 30px rgba(27,20,16,.16),
    inset 0 0 60px rgba(0,0,0,.05),
    0 8px 30px rgba(0,0,0,.3);
}
.book__page--right {
  border-radius: 0 6px 6px 0;
  box-shadow:
    inset 8px 0 30px rgba(27,20,16,.16),
    inset 0 0 60px rgba(0,0,0,.05),
    0 8px 30px rgba(0,0,0,.3);
}

.book__spread.is-flipping .book__page {
  pointer-events: none;
}
.book__spread.is-flipping .book__page--right {
  animation: flipPage .5s var(--ease);
  transform-origin: left center;
}
@keyframes flipPage {
  0% { transform: rotateY(0); }
  50% { transform: rotateY(-90deg); opacity: .3; }
  100% { transform: rotateY(0); }
}

/* Boutons flip */
.book__flip {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: clamp(38px, 4.5vw, 56px);
  height: clamp(64px, 8vw, 100px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(248,244,224,.1);
  color: var(--beige);
  font-size: clamp(1.4rem, 2.6vw, 2.2rem);
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid rgba(248,244,224,.2);
  padding: 0;
  transition: all .3s var(--ease);
  z-index: 6;
}
.book__flip:hover:not([disabled]) {
  background: var(--beige);
  color: var(--terracotta);
  transform: translateY(-50%) scale(1.05);
}
.book__flip[disabled] {
  opacity: .2;
  cursor: not-allowed;
}
.book__flip--prev { left: clamp(8px, 1.2vw, 16px); }
.book__flip--next { right: clamp(8px, 1.2vw, 16px); }

/* ============================================================
   4. CONTENU DES PAGES — auto-fit sans scroll
   ============================================================ */
.page-content {
  position: relative;
  width: 100%;
  height: 100%;
  padding: clamp(1rem, 2vw, 1.8rem);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  --fit-scale: 1;  /* piloté par fitPage (JS) : échelle des polices */
  --fit-gap: 1;    /* échelle amortie des marges/interlignes verticaux */
}

.page-content__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.page-content__bg.bg-organic-bleu {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 240' preserveAspectRatio='xMidYMid slice'><g fill='%23B7E0F9'><path d='M 14 0 Q 18 60, 16 120 T 14 240 L 26 240 Q 30 180, 28 120 T 26 0 Z'/><path d='M 48 0 Q 54 70, 50 140 T 48 240 L 60 240 Q 64 170, 60 100 T 58 0 Z'/><path d='M 82 0 Q 88 60, 84 120 T 82 240 L 96 240 Q 100 175, 96 115 T 92 0 Z'/><path d='M 116 0 Q 122 75, 118 145 T 116 240 L 130 240 Q 134 165, 130 95 T 126 0 Z'/><path d='M 150 0 Q 156 65, 152 130 T 150 240 L 164 240 Q 168 180, 164 120 T 160 0 Z'/><path d='M 184 0 Q 190 80, 186 150 T 184 240 L 196 240 Q 200 170, 196 105 T 192 0 Z'/></g></svg>");
  background-size: 200px 240px;
  background-repeat: repeat;
}
.page-content__bg.bg-organic-jaune {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 240' preserveAspectRatio='xMidYMid slice'><g fill='%23FBDA68'><path d='M 14 0 Q 18 60, 16 120 T 14 240 L 26 240 Q 30 180, 28 120 T 26 0 Z'/><path d='M 48 0 Q 54 70, 50 140 T 48 240 L 60 240 Q 64 170, 60 100 T 58 0 Z'/><path d='M 82 0 Q 88 60, 84 120 T 82 240 L 96 240 Q 100 175, 96 115 T 92 0 Z'/><path d='M 116 0 Q 122 75, 118 145 T 116 240 L 130 240 Q 134 165, 130 95 T 126 0 Z'/><path d='M 150 0 Q 156 65, 152 130 T 150 240 L 164 240 Q 168 180, 164 120 T 160 0 Z'/><path d='M 184 0 Q 190 80, 186 150 T 184 240 L 196 240 Q 200 170, 196 105 T 192 0 Z'/></g></svg>");
  background-size: 200px 240px;
  background-repeat: repeat;
}
.page-content__bg.bg-organic-orange {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 240' preserveAspectRatio='xMidYMid slice'><g fill='%23e78e50'><path d='M 14 0 Q 18 60, 16 120 T 14 240 L 26 240 Q 30 180, 28 120 T 26 0 Z'/><path d='M 48 0 Q 54 70, 50 140 T 48 240 L 60 240 Q 64 170, 60 100 T 58 0 Z'/><path d='M 82 0 Q 88 60, 84 120 T 82 240 L 96 240 Q 100 175, 96 115 T 92 0 Z'/><path d='M 116 0 Q 122 75, 118 145 T 116 240 L 130 240 Q 134 165, 130 95 T 126 0 Z'/><path d='M 150 0 Q 156 65, 152 130 T 150 240 L 164 240 Q 168 180, 164 120 T 160 0 Z'/><path d='M 184 0 Q 190 80, 186 150 T 184 240 L 196 240 Q 200 170, 196 105 T 192 0 Z'/></g></svg>");
  background-size: 200px 240px;
  background-repeat: repeat;
}
.page-content__bg.bg-organic-vert {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 240' preserveAspectRatio='xMidYMid slice'><g fill='%23307159'><path d='M 14 0 Q 18 60, 16 120 T 14 240 L 26 240 Q 30 180, 28 120 T 26 0 Z'/><path d='M 48 0 Q 54 70, 50 140 T 48 240 L 60 240 Q 64 170, 60 100 T 58 0 Z'/><path d='M 82 0 Q 88 60, 84 120 T 82 240 L 96 240 Q 100 175, 96 115 T 92 0 Z'/><path d='M 116 0 Q 122 75, 118 145 T 116 240 L 130 240 Q 134 165, 130 95 T 126 0 Z'/><path d='M 150 0 Q 156 65, 152 130 T 150 240 L 164 240 Q 168 180, 164 120 T 160 0 Z'/><path d='M 184 0 Q 190 80, 186 150 T 184 240 L 196 240 Q 200 170, 196 105 T 192 0 Z'/></g></svg>");
  background-size: 200px 240px;
  background-repeat: repeat;
}
.page-content__bg.bg-straight-jaune {
  background: repeating-linear-gradient(to right, transparent 0, transparent 28px, var(--jaune-page) 28px, var(--jaune-page) 56px);
  opacity: .75;
}

/* Container blanc central de la page */
.page-content__paper {
  position: relative;
  z-index: 2;
  flex: 1;
  background: var(--paper);
  /* Coins doux mais à FAIBLE rayon vertical (≤16px) : l'arrondi reste sous le
     padding, donc il ne rogne jamais le contenu (prix en bas, listes inline).
     Asymétrie horizontale 30/20 pour garder un côté organique. */
  border-radius: 30px 20px 30px 20px / 16px 16px 16px 16px;
  padding: clamp(1.4rem, 2vw, 1.9rem);
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 16px rgba(151,56,21,.05);
  min-height: 0;
  overflow: hidden;
}
/* Dernier recours (cf. fitPage en JS) : page trop dense pour tenir même au
   niveau de compaction maxi sur petit écran -> on défile plutôt que de couper. */
.page-content__paper--scroll { overflow-y: auto; }

.page-content__scallop {
  position: absolute;
  inset: 10px;
  pointer-events: none;
  z-index: 3;
}

/* ============================================================
   5. TITRES + ITEMS (auto-fit)
   ============================================================ */
.page-title {
  font-family: var(--font-script);
  font-size: calc(clamp(1.4rem, 2.4vw, 1.9rem) * var(--fit-scale));
  line-height: 1.32;              /* script swashé (Côte Lumière) : jambages bas amples */
  font-weight: 400;
  margin: 0 0 calc(.3rem * var(--fit-gap));
  padding: .12em 0 .26em;         /* garde les swashes du « B », « g »… hors du bord de coupe,
                                     et fiabilise la mesure d'auto-fit (boîte = encre réelle) */
  text-align: center;
  flex-shrink: 0;
}
.page-title--terracotta { color: var(--terracotta); }
.page-title--bleu { color: var(--bleu-fonce); }
.page-title--marron { color: var(--marron-gelato); }

.page-subtitle {
  font-family: var(--font-ui);
  font-size: calc(.6rem * var(--fit-scale));
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-align: center;
  margin: 0 0 calc(.5rem * var(--fit-gap));
  flex-shrink: 0;
}
.page-price-note {
  font-family: var(--font-display);
  font-style: italic;
  font-size: calc(.85rem * var(--fit-scale));
  font-weight: 600;
  text-align: center;
  margin: 0 0 calc(.7rem * var(--fit-gap));
  flex-shrink: 0;
}
.page-price-note--terracotta { color: var(--terracotta); }
.page-price-note--bleu { color: var(--bleu-fonce); }
.page-price-note--marron { color: var(--marron-gelato); }

.page-item {
  text-align: center;
  margin-bottom: calc(.5rem * var(--fit-gap));
}
.page-item:last-child { margin-bottom: 0; }
.page-item__name {
  font-family: var(--font-display);
  font-size: calc(clamp(.78rem, 1vw, .9rem) * var(--fit-scale));
  font-weight: 500;
  line-height: 1.25;
  margin: 0 0 .08rem;
  padding: 0 .2rem;
}
.page-item__name--terracotta { color: var(--ink); }
.page-item__name--bleu { color: var(--bleu-fonce); }
.page-item__name--marron { color: var(--marron-gelato); }

.page-item__desc {
  font-family: var(--font-display);
  font-style: italic;
  font-size: calc(.72rem * var(--fit-scale));
  line-height: 1.25;
  opacity: .82;
  margin: 0 0 .1rem;
  max-width: 48ch;
  margin-left: auto;
  margin-right: auto;
}
.page-item__price {
  font-family: var(--font-display);
  font-size: calc(.82rem * var(--fit-scale));
  font-weight: 600;
  margin: 0;
}
.page-item__price--terracotta { color: var(--terracotta); }
.page-item__price--bleu { color: var(--bleu-fonce); }
.page-item__price--marron { color: var(--marron-gelato); }
.page-item--highlight .page-item__name::after {
  content: " ★";
  color: var(--jaune);
  font-size: .85em;
}

/* Groupes */
.page-group {
  margin-bottom: calc(.9rem * var(--fit-gap));
}
.page-group:last-child { margin-bottom: 0; }
.page-group__label {
  font-family: var(--font-ui);
  font-size: calc(.58rem * var(--fit-scale));
  letter-spacing: .25em;
  text-transform: uppercase;
  font-weight: 600;
  text-align: center;
  margin: 0 0 calc(.4rem * var(--fit-gap));
  padding-bottom: .25rem;
  border-bottom: 1px dotted rgba(151,56,21,.25);
}
.page-group__label--terracotta { color: var(--terracotta); }
.page-group__label--bleu { color: var(--bleu-fonce); }

.page-inline {
  text-align: center;
  font-family: var(--font-display);
  font-size: calc(.82rem * var(--fit-scale));
  line-height: 1.6;
  margin: 0;
  padding: 0 .3rem;
}

/* ============================================================
   6. AUTO-FIT — échelle continue mesurée (cf. fitPage en JS)
   Chaque page choisit la PLUS GRANDE taille de texte qui tient : elle grossit
   pour remplir l'espace vide, ne rétrécit que si nécessaire. --fit-scale pilote
   les polices, --fit-gap les marges (amorties). Colonnes en repli pour les pages
   longues ; défilement en tout dernier recours.
   ============================================================ */

/* Corps « flottant » d'une page (entre l'en-tête de catégorie et les notes). */
.page-flow { min-width: 0; }

/* 2 colonnes (repli pour pages longues) : décidé par mesure dans fitPage. */
.fit-cols .page-flow {
  column-count: 2;
  column-gap: calc(1.4rem * var(--fit-gap));
  column-rule: 1px dotted rgba(151,56,21,.15);
}
/* Seul l'en-tête de la 1re section s'étale pleine largeur ; les sections
   suivantes restent SOLIDAIRES (titre + items jamais séparés entre 2 colonnes
   => fin de l'incohérence type « Bières » détachée de ses bières). */
.fit-cols .page-flow > .page-lead-head { column-span: all; }
.fit-cols .page-item,
.fit-cols .page-group,
.fit-cols .page-section { break-inside: avoid; }
.fit-cols .page-title,
.fit-cols .page-group__label { break-after: avoid; }

/* Notes en bas */
.page-notes {
  margin-top: auto;
  padding-top: .5rem;
  border-top: 1px dotted rgba(151,56,21,.2);
  text-align: center;
  flex-shrink: 0;
}
.page-notes p {
  font-family: var(--font-display);
  font-style: italic;
  font-size: .68rem;
  color: var(--ink-soft);
  margin: 0 0 .15rem;
}

/* ============================================================
   7. PAGES SPÉCIALES — Cover, TOC, Back cover
   ============================================================ */
.page-cover {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 100%;
  position: relative;
  padding: 1.5rem;
}
.page-cover__symbol {
  width: clamp(110px, 18vw, 200px);
  margin-bottom: 1.4rem;
}
.page-cover__symbol svg {
  width: 100%;
  height: auto;
  display: block;
  color: var(--terracotta);
}
.page-cover__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 500;
  color: var(--terracotta);
  margin: 0 0 .3rem;
  letter-spacing: -.02em;
  line-height: .95;
}
.page-cover__script {
  font-family: var(--font-script);
  font-size: clamp(1.8rem, 3.6vw, 2.6rem);
  color: var(--terracotta);
  margin: 0 0 1.4rem;
  padding: .1em 0;
  line-height: 1;
}
.page-cover__addr {
  font-family: var(--font-ui);
  font-size: .65rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0;
}

/* TOC interne au livret — toujours en 2 colonnes */
.page-toc {
  padding: 1.2rem;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.page-toc__title {
  font-family: var(--font-script);
  font-size: clamp(1.6rem, 3.2vw, 2.2rem);
  color: var(--terracotta);
  margin: 0 0 1rem;
  text-align: center;
  padding: .1em 0;
  flex-shrink: 0;
}
.page-toc__list {
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: .25rem;
  align-content: start;
  column-count: 1;
}
.page-toc__item {
  display: flex;
  align-items: baseline;
  gap: .5rem;
  cursor: pointer;
  padding: .35rem .5rem;
  border-radius: 6px;
  transition: background .3s var(--ease);
  background: transparent;
  border: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  width: 100%;
}
.page-toc__item:hover {
  background: rgba(151,56,21,.06);
}
.page-toc__num {
  font-family: var(--font-ui);
  font-size: .6rem;
  letter-spacing: .12em;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.page-toc__name {
  font-family: var(--font-display);
  font-size: .85rem;
  color: var(--terracotta);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.page-toc__page-num {
  font-family: var(--font-ui);
  font-size: .68rem;
  font-weight: 600;
  color: var(--terracotta);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

/* TOC compact : on récupère ~200px verticaux en rognant les marges
   et coins organiques, sans toucher au rendu des items eux-mêmes. */
.page-content--toc {
  padding: clamp(.3rem, .8vw, .7rem);          /* A : padding extérieur réduit */
}
.page-content--toc .page-content__paper {
  padding: clamp(.6rem, 1.2vw, 1rem);          /* A : padding intérieur réduit */
  border-radius: 20px 14px 20px 14px / 9px 9px 9px 9px;  /* B : coins doux, faible rayon vertical */
}
.page-content--toc .page-toc__title {
  margin: 0 0 .5rem;                           /* C : marge du titre Sommaire réduite */
}
.page-content--toc .page-toc__list {
  gap: 0;                                      /* D : plus d'espace entre items */
}
.page-content--toc .page-toc__item {
  padding: .15rem .35rem;                      /* D : padding des items réduit */
}

.page-back-cover {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 100%;
  padding: 2rem;
}
.page-back-cover__symbol {
  width: clamp(90px, 14vw, 140px);
  margin-bottom: 1.4rem;
}
.page-back-cover__symbol svg {
  width: 100%; height: auto;
  color: var(--terracotta);
}
.page-back-cover p {
  font-family: var(--font-ui);
  font-size: .7rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: .25rem 0;
}
.page-back-cover .script {
  font-family: var(--font-script);
  font-size: 1.6rem;
  color: var(--terracotta);
  text-transform: none;
  letter-spacing: 0;
  margin: .8rem 0 .4rem;
  padding: .1em 0;
}

/* ============================================================
   8. GELATO GRID
   ============================================================ */
.page-gelato-section { margin-bottom: calc(1.4rem * var(--fit-gap)); }
.page-gelato-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: calc(clamp(.5rem, 1vw, .9rem) * var(--fit-gap));
}
.gelato-tub {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: calc(.25rem * var(--fit-gap));
}
.gelato-tub__visual {
  width: 100%;
  max-width: calc(70px * var(--fit-scale));
  aspect-ratio: 1;
}
.gelato-tub__visual svg {
  width: 100%;
  height: 100%;
  display: block;
}
.gelato-tub__name {
  font-family: var(--font-display);
  font-size: calc(.7rem * var(--fit-scale));
  color: var(--marron-gelato);
  line-height: 1.2;
  margin: 0;
}

/* ============================================================
   9. FOOTER LIVRET
   ============================================================ */
.book-modal__footer {
  padding: .6rem clamp(1rem, 3vw, 2rem);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  color: var(--beige);
  flex-shrink: 0;
}
.book-progress {
  flex: 1;
  height: 2px;
  background: rgba(248,244,224,.18);
  border-radius: 1px;
  overflow: hidden;
}
.book-progress__bar {
  height: 100%;
  background: var(--jaune);
  transition: width .5s var(--ease);
  width: 0;
}
.book-progress__counter {
  font-family: var(--font-ui);
  font-size: .75rem;
  letter-spacing: .15em;
  margin: 0;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ============================================================
   10. SOMMAIRE OVERLAY
   ============================================================ */
.book-toc {
  position: fixed;
  inset: 0;
  z-index: 220;
  background: rgba(27,20,16,.7);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 3vw, 3rem);
  animation: modalIn .3s var(--ease);
}
.book-toc__inner {
  position: relative;
  background: var(--paper);
  border-radius: 20px;
  padding: clamp(2rem, 4vw, 3rem);
  max-width: 640px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 30px 60px rgba(0,0,0,.5);
}
.book-toc__close {
  position: absolute;
  top: 14px;
  right: 18px;
  width: 36px;
  height: 36px;
  font-size: 1.6rem;
  background: transparent;
  border: 0;
  color: var(--ink);
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.book-toc__close:hover { background: rgba(0,0,0,.06); }
.book-toc .display {
  text-align: center;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin: 1rem 0 1.6rem;
}
.book-toc .eyebrow {
  display: inline-flex;
  margin-bottom: 0;
}
.book-toc__list {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: toc;
  columns: 2;
  column-gap: 1.5rem;
}
.book-toc__list li {
  counter-increment: toc;
  break-inside: avoid;
}
.book-toc__link {
  display: flex;
  align-items: baseline;
  gap: .5rem;
  width: 100%;
  padding: .5rem .6rem;
  border-radius: 6px;
  background: transparent;
  border: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .3s var(--ease);
}
.book-toc__link:hover {
  background: rgba(151,56,21,.08);
}
.book-toc__link::before {
  content: counter(toc, decimal-leading-zero);
  font-family: var(--font-ui);
  font-size: .65rem;
  letter-spacing: .12em;
  color: var(--ink-soft);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.book-toc__link-name {
  font-family: var(--font-display);
  font-size: .9rem;
  color: var(--terracotta);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.book-toc__link-pages {
  font-family: var(--font-ui);
  font-size: .68rem;
  color: var(--ink-soft);
  flex-shrink: 0;
}

/* ============================================================
   11. LOADING & ERROR
   ============================================================ */
.carte-loading {
  text-align: center;
  padding: 6rem 2rem;
  color: var(--ink-soft);
  font-style: italic;
}
.carte-loading__spinner {
  width: 36px; height: 36px;
  border: 3px solid rgba(151,56,21,.15);
  border-top-color: var(--terracotta);
  border-radius: 50%;
  margin: 0 auto 1rem;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.carte-error {
  padding: 4rem 0;
  text-align: center;
  background: #fff4f0;
  color: var(--terracotta);
}

/* ============================================================
   12. RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .book__spread {
    grid-template-columns: 1fr;
  }
  .book__spine { display: none; }
  .book__page--left { display: none; }
  .book__page--right { border-radius: 6px; }
  .book-toc__list { columns: 1; }
}

@media (max-width: 600px) {
  .page-carte main { padding-top: 60px; }
  .cover-page { padding: 2rem 1rem 4rem; min-height: auto; }
  .book-trigger__cover { width: clamp(260px, 80vw, 360px); }
  .book-trigger__hint { font-size: .7rem; padding: .7rem 1.3rem; }

  .book-modal__close { top: 2px; right: 10px; width: 36px; height: 36px; font-size: 1.4rem; }
  .book-modal__header { padding: .5rem .8rem; }
  .book-modal__title { font-size: 1rem; }
  .book-modal__toc-btn { padding: .35rem .8rem; font-size: .6rem; }
  .book { padding: .3rem 50px; }
  .book__flip {
    width: 34px;
    height: 46px;
    font-size: 1.2rem;
  }
  .book__flip--prev { left: 4px; }
  .book__flip--next { right: 4px; }

  .page-content { padding: .6rem; }
  .page-content__paper {
    padding: 1rem .8rem;
    border-radius: 18px 14px 18px 14px / 12px 12px 12px 12px;
  }
  .page-gelato-grid { grid-template-columns: repeat(3, 1fr); }
  .gelato-tub__visual { max-width: 55px; }
  .gelato-tub__name { font-size: .62rem; }
  .book-modal__footer { padding: .5rem .8rem; gap: .8rem; }
  .book-progress__counter { font-size: .65rem; letter-spacing: .08em; }

  /* Mobile : pas de 2 colonnes (trop étroit) — l'auto-fit compacte/réduit à la place. */
  .fit-cols .page-flow { column-count: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .book-trigger:hover { transform: none; }
  .book__spread.is-flipping .book__page--right { animation: none; }
}
