/* ------------------------------------------------------------------ */
/* Liseuse de folder                                                   */
/* ------------------------------------------------------------------ */
.viewer {
  --stage: #2a2623;
  --stage-hi: #3b3531;
  --bar: #1d1a18;
  --tool: rgba(255, 255, 255, 0.08);
  --tool-hover: rgba(255, 255, 255, 0.16);
  background: var(--stage);
  overflow: hidden;
  overscroll-behavior: none;
}
.v-app { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }

/* En-tête */
.v-top {
  flex: none; display: flex; align-items: center; gap: 16px;
  padding: 10px clamp(12px, 2.5vw, 28px); background: var(--white); min-height: 68px;
}
.v-back {
  flex: none; display: flex; align-items: center; gap: 10px; text-decoration: none;
  padding: 8px 10px 8px 6px; margin-left: -6px; border-radius: 10px;
}
.v-back:hover { background: var(--cream); }
.v-back svg { width: 22px; height: 22px; }
.v-back img { width: 140px; height: auto; }
.v-title { flex: 1; min-width: 0; padding-left: 16px; border-left: 2px solid var(--line); }
.v-title h1 {
  font-family: var(--font-display); font-weight: 800; text-transform: uppercase;
  font-size: clamp(20px, 2.2vw, 26px); line-height: 1.05;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.v-title p { font-size: 14px; color: var(--muted); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v-cta { flex: none; }
.v-cta-short { display: none; }
@media (max-width: 720px) {
  .v-top { gap: 10px; min-height: 60px; }
  .v-back img { display: none; }
  .v-title { padding-left: 10px; }
  .v-cta { padding: 0 12px; }
  .v-cta-long { display: none; }
  .v-cta-short { display: inline; }
}
@media (max-width: 380px) {
  .v-cta svg { display: none; }
}

/* Bandeau d'information (folder terminé, à venir, brouillon) */
.v-notice {
  flex: none; display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 6px 14px;
  padding: 9px 16px; background: var(--orange-soft); color: #5a2410; font-size: 15px; font-weight: 600; text-align: center;
}
.v-notice a { color: var(--green-dark); font-weight: 700; }
.v-notice.is-draft { background: #fff3c4; color: #5a4300; }

/* Scène */
.v-stage {
  position: relative; flex: 1; min-height: 0;
  padding: clamp(14px, 3vh, 32px) 84px;
  background: radial-gradient(ellipse at 50% 40%, var(--stage-hi), var(--stage) 70%);
  display: flex; align-items: center; justify-content: center;
  user-select: none; -webkit-user-select: none;
}
@media (max-width: 760px) { .v-stage { padding: 12px 10px; } }

.v-frame {
  position: relative; flex: none;
  transform: translateX(var(--shift, 0%));
  transition: transform 0.45s cubic-bezier(.3,.7,.3,1);
}
.v-frame::before {
  /* ombre portée du livre ouvert */
  content: ''; position: absolute; inset: 2% 1%; border-radius: 6px; pointer-events: none;
  box-shadow: 0 28px 60px -12px rgba(0, 0, 0, 0.6);
}
/* couverture seule (à droite) ou dernière page seule (à gauche) */
.v-frame[data-single='right']::before { left: 50%; }
.v-frame[data-single='left']::before { right: 50%; }

/* StPageFlip : on impose nos propres dimensions au livre */
.v-frame .book { width: 100% !important; min-width: 0 !important; max-width: none !important; min-height: 0 !important; }
.stf__parent { position: relative; display: block; box-sizing: border-box; transform: translateZ(0); touch-action: pan-y; }
.stf__wrapper { position: relative; width: 100%; box-sizing: border-box; }
.stf__block { position: absolute; width: 100%; height: 100%; box-sizing: border-box; perspective: 2000px; }
.stf__item { display: none; position: absolute; transform-style: preserve-3d; }
.stf__outerShadow, .stf__innerShadow, .stf__hardShadow, .stf__hardInnerShadow { position: absolute; left: 0; top: 0; }

.page { background: #f4f1eb; overflow: hidden; }
.page::before {
  /* indicateur de chargement */
  content: ''; position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px;
  border-radius: 50%; border: 3px solid rgba(0, 0, 0, 0.1); border-top-color: var(--orange);
  animation: spin 0.9s linear infinite;
}
.page > img {
  position: relative; width: 100%; height: 100%; object-fit: contain; background: var(--white);
  opacity: 0; transition: opacity 0.25s; pointer-events: none;
}
.page > img.is-loaded { opacity: 1; }
.page.--left::after, .page.--right::after {
  /* pli central */
  content: ''; position: absolute; top: 0; bottom: 0; width: 7%; pointer-events: none;
}
.page.--left::after { right: 0; background: linear-gradient(to left, rgba(0,0,0,0.16), rgba(0,0,0,0.04) 40%, transparent); }
.page.--right::after { left: 0; background: linear-gradient(to right, rgba(0,0,0,0.16), rgba(0,0,0,0.04) 40%, transparent); }
@keyframes spin { to { transform: rotate(360deg); } }

/* Dernière page : appel vers jardiland.be */
.page-end { background: var(--orange); container-type: size; }
.page-end::before { display: none; }
.end-inner {
  position: absolute; inset: 0; padding: 9cqw 8cqw; display: flex; flex-direction: column;
  justify-content: center; align-items: center; text-align: center; gap: 3.2cqw; color: #1d120d;
  background:
    radial-gradient(circle at 105% -5%, rgba(255,255,255,0.18) 0 30%, transparent 30.2%),
    radial-gradient(circle at -10% 108%, rgba(255,255,255,0.14) 0 26%, transparent 26.2%);
}
.end-logo { width: 52cqw; height: auto; margin-bottom: 4cqw; pointer-events: none; }
.end-eyebrow { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; font-size: 4.2cqw; }
.end-title { font-family: var(--font-display); font-weight: 800; text-transform: uppercase; font-size: 11.5cqw; line-height: 0.92; color: var(--white); }
.end-text { font-size: 4.6cqw; font-weight: 500; line-height: 1.35; max-width: 30ch; }
.end-btn {
  display: inline-block; margin-top: 3cqw; padding: 3.6cqw 7cqw; border-radius: 999px;
  background: var(--green); color: var(--white); text-decoration: none; font-weight: 700; font-size: 4.8cqw;
  box-shadow: 0 1.5cqw 4cqw rgba(0,0,0,0.18);
}
.end-btn:hover { background: var(--green-dark); }
.end-link { font-weight: 700; font-size: 4.2cqw; color: #1d120d; }
.end-stores { margin-top: 5cqw; font-size: 3.6cqw; line-height: 1.5; font-weight: 500; opacity: 0.85; }

/* Flèches latérales */
.v-nav {
  position: absolute; top: 50%; z-index: 5; transform: translateY(-50%);
  width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255, 255, 255, 0.94); color: var(--ink);
  display: grid; place-items: center; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s, opacity 0.2s, background-color 0.15s;
}
.v-nav svg { width: 26px; height: 26px; }
.v-nav:hover { background: var(--white); transform: translateY(-50%) scale(1.06); }
.v-nav:disabled { opacity: 0; pointer-events: none; }
.v-prev { left: 16px; }
.v-next { right: 16px; }
@media (max-width: 760px) { .v-nav { display: none; } }

.v-hint {
  position: absolute; left: 50%; bottom: 18px; z-index: 6; transform: translateX(-50%);
  background: rgba(20, 18, 16, 0.86); color: var(--white); padding: 10px 18px; border-radius: 999px;
  font-size: 14px; font-weight: 600; pointer-events: none; white-space: nowrap;
  transition: opacity 0.4s;
}
.v-hint.is-hidden { opacity: 0; }

/* Barre d'outils */
.v-bar {
  flex: none; display: flex; align-items: center; justify-content: center; gap: 10px 24px; flex-wrap: wrap;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--bar); color: var(--white);
}
.v-pager, .v-tools { display: flex; align-items: center; gap: 6px; }
.v-indicator { min-width: 92px; text-align: center; font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.v-tool {
  display: inline-flex; align-items: center; gap: 8px; min-height: 42px; min-width: 42px; padding: 0 12px;
  border: 0; border-radius: 999px; background: var(--tool); color: var(--white); cursor: pointer;
  text-decoration: none; font-size: 14px; font-weight: 600; justify-content: center;
}
.v-tool[hidden] { display: none; }
.v-tool:hover { background: var(--tool-hover); }
.v-tool:disabled { opacity: 0.35; cursor: default; background: var(--tool); }
.v-tool svg { width: 20px; height: 20px; flex: none; }
.v-pager .v-tool { padding: 0; }
@media (max-width: 760px) {
  .v-bar { gap: 8px; justify-content: space-between; flex-wrap: nowrap; padding-left: 10px; padding-right: 10px; }
  .v-pager, .v-tools { gap: 4px; }
  .v-tools .v-tool span { display: none; }
  .v-tool { min-width: 40px; min-height: 40px; }
  .v-tools .v-tool { padding: 0; width: 40px; }
  .v-indicator { min-width: 58px; font-size: 14px; }
}
@media (max-width: 480px) {
  .v-tools #btn-fs { display: none; }
}

/* Feuille « Toutes les pages » */
.v-sheet {
  position: fixed; inset: 0; z-index: 50; background: rgba(15, 13, 12, 0.6);
  display: flex; align-items: flex-end; justify-content: center;
}
.v-sheet[hidden], .v-zoom[hidden] { display: none; }
.v-sheet-card {
  width: min(100%, 1100px); max-height: 82vh; max-height: 82dvh; display: flex; flex-direction: column;
  background: var(--white); border-radius: 20px 20px 0 0; box-shadow: var(--shadow-md);
  animation: sheet-in 0.25s cubic-bezier(.2,.7,.2,1);
}
@keyframes sheet-in { from { transform: translateY(30px); opacity: 0; } }
.v-sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 12px; }
.v-sheet-head h2 { font-family: var(--font-display); font-weight: 800; text-transform: uppercase; font-size: 26px; }
.v-close {
  width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center;
  background: var(--cream); color: var(--ink);
}
.v-close:hover { background: var(--sand); }
.v-close svg { width: 22px; height: 22px; }
.v-thumbs {
  overflow-y: auto; padding: 4px 20px calc(24px + env(safe-area-inset-bottom));
  display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 18px 14px;
}
.v-thumb {
  border: 0; padding: 0; background: none; cursor: pointer; display: grid; gap: 6px; justify-items: center;
  font-weight: 700; font-size: 14px; color: var(--muted);
}
.v-thumb img {
  width: 100%; height: auto; border-radius: 4px; background: var(--sand);
  box-shadow: 0 1px 4px rgba(0,0,0,0.18); outline: 3px solid transparent; outline-offset: 2px;
}
.v-thumb:hover img { outline-color: var(--line); }
.v-thumb[aria-current='true'] { color: var(--orange-ink); }
.v-thumb[aria-current='true'] img { outline-color: var(--orange); }

/* Zoom */
.v-zoom { position: fixed; inset: 0; z-index: 60; background: #151311; display: flex; flex-direction: column; }
.z-bar {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px; padding-top: calc(10px + env(safe-area-inset-top)); color: var(--white); background: var(--bar);
}
.z-label { font-weight: 700; font-size: 15px; padding-left: 6px; }
.z-tools { display: flex; align-items: center; gap: 6px; }
.z-tools .v-tool { padding: 0; }
.z-level { min-width: 58px; text-align: center; font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.z-tools .v-close { margin-left: 8px; }
.z-scroller {
  flex: 1; min-height: 0; overflow: auto; display: flex; cursor: grab;
  touch-action: pan-x pan-y; overscroll-behavior: contain;
}
.z-scroller.is-dragging { cursor: grabbing; }
.z-inner { margin: auto; padding: 16px; display: flex; gap: 0; flex: none; }
.z-inner img {
  height: var(--h, 80vh); width: auto; max-width: none; flex: none; background-color: var(--white);
  background-size: cover; background-position: center; user-select: none; -webkit-user-drag: none;
}
.z-inner img + img { box-shadow: inset 10px 0 14px -10px rgba(0,0,0,0.25); }

body.has-overlay { overflow: hidden; }
