/* M3DC — Page /book/ : lecteur du book Réalisations 2018-2026 */

.page-book { background: var(--noir); }
.page-book .m3dc-floating-cta { display: none !important; }

/* ── Intro ─────────────────────────────────────── */
.book-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px 64px;
  align-items: end;
  max-width: 1400px;
  margin: 0 auto;
  padding: calc(var(--header-h) + 72px) 48px 48px;
}
.book-overline {
  display: block;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--or);
  margin-bottom: 20px;
}
.book-intro h1 {
  font-family: var(--font-heading);
  font-size: clamp(52px, 8vw, 104px);
  font-weight: 400;
  line-height: 1;
  color: var(--blanc);
  margin: 0 0 24px;
}
.book-intro h1 em { color: var(--or); font-style: italic; }
.book-intro p {
  max-width: 620px;
  margin: 0;
  font-family: var(--font-accent);
  font-size: 22px;
  line-height: 1.5;
  color: var(--texte);
}
.book-intro-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
  padding-bottom: 6px;
}
.book-textlink {
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--texte);
  padding-bottom: 5px;
  border-bottom: 1px solid var(--or-muted);
  transition: color var(--speed-fast) var(--ease), border-color var(--speed-fast) var(--ease);
}
.book-textlink:hover { color: var(--or); border-color: var(--or); }

/* ── Lecteur ───────────────────────────────────── */
.book-reader {
  --r: 1.3942;
  --w: min(calc(100vw - 168px), calc((100vh - 200px) * 2 * var(--r)), 1760px);
  position: relative;
  padding: 56px 0 28px;
  border-top: 1px solid var(--card-border);
  border-bottom: 1px solid var(--card-border);
  background: radial-gradient(ellipse 72% 70% at 50% 42%, #2e2923 0%, #1a1815 58%, #0d0d0d 100%);
  scroll-margin-top: var(--header-h-scrolled);
}
.book-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  perspective: 2800px;
  touch-action: pan-y pinch-zoom;
}
.book-volume {
  position: relative;
  flex: none;
  width: var(--w);
  aspect-ratio: calc(2 * var(--r));
  transition: transform .8s cubic-bezier(.45, .05, .35, 1), opacity .18s linear;
  transform-style: preserve-3d;
}
.book-volume > img { width: 50%; height: 100%; margin-left: 50%; display: block; }
.book-volume[data-closed="front"] { transform: translateX(-25%); }
.book-volume[data-closed="back"] { transform: translateX(25%); }
.book-volume.is-fading { opacity: 0; }

.book-page,
.book-leaf {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
}
.book-page-left { left: 0; }
.book-page-right, .book-leaf { left: 50%; }
.book-page:not(.is-empty) {
  background: #0b0b0b;
  box-shadow: 0 26px 60px rgba(0, 0, 0, .6);
}
/* Tranche du livre : quelques feuilles visibles sur le bord extérieur */
.book-page-right:not(.is-empty)::before,
.book-page-left:not(.is-empty)::before {
  content: '';
  position: absolute;
  top: 2px;
  bottom: 2px;
  width: 4px;
  background: repeating-linear-gradient(90deg, #4a443a 0 1px, #1c1a17 1px 2px);
}
.book-page-right::before { right: -4px; }
.book-page-left::before { left: -4px; }

.book-face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #0b0b0b;
  cursor: zoom-in;
}
.book-face.is-blank { cursor: default; }
.book-face img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
}
/* Ombre de la reliure */
.book-face::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.book-page-right .book-face::after,
.book-leaf .book-face-front::after { background: linear-gradient(90deg, rgba(0, 0, 0, .42), rgba(0, 0, 0, 0) 7%); }
.book-page-left .book-face::after,
.book-leaf .book-face-back::after { background: linear-gradient(270deg, rgba(0, 0, 0, .42), rgba(0, 0, 0, 0) 7%); }

.book-leaf {
  display: none;
  z-index: 3;
  transform-origin: left center;
  transform-style: preserve-3d;
}
.book-leaf.is-turning { display: block; }
.book-leaf .book-face { backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.book-leaf .book-face-back { transform: rotateY(180deg); }
.book-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: #000;
  opacity: 0;
  pointer-events: none;
}

/* Page unique (téléphone, tablette en portrait) */
.book-reader.is-single { --w: calc(100vw - 32px); padding-top: 28px; }
.book-reader.is-single .book-volume { aspect-ratio: var(--r); }
.book-reader.is-single .book-arrow { display: none; }
.book-reader.is-single .book-page { left: 0; width: 100%; }
.book-reader.is-single .book-page-left { display: none; }
.book-reader.is-single .book-page .book-face::after { background: none; }
.book-reader.is-single .book-page::before { display: none; }
.book-slide-out { position: absolute; inset: 0; z-index: 2; }

/* Flèches */
.book-arrow {
  flex: none;
  width: 56px;
  height: 56px;
  padding: 0;
  display: grid;
  place-items: center;
  background: none;
  border: 1px solid transparent;
  border-radius: 50%;
  color: var(--or);
  cursor: pointer;
  transition: border-color var(--speed-fast) var(--ease), opacity var(--speed-fast) var(--ease);
}
.book-arrow:hover:not(:disabled) { border-color: var(--or-muted); }
.book-arrow:disabled { opacity: .2; cursor: default; }
.book-arrow svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
}
.book-arrow:focus-visible,
.book-tool:focus-visible,
.book-range:focus-visible,
.book-textlink:focus-visible,
.book-toc a:focus-visible {
  outline: 1px solid var(--or);
  outline-offset: 3px;
}

/* Barre */
.book-bar {
  display: grid;
  grid-template-columns: 1fr minmax(160px, 460px) 1fr;
  gap: 32px;
  align-items: center;
  width: var(--w);
  max-width: calc(100vw - 32px);
  margin: 32px auto 0;
}
.book-status {
  margin: 0;
  font-family: var(--font-accent);
  font-size: 19px;
  font-style: italic;
  color: var(--texte);
  white-space: nowrap;
}
.book-range {
  width: 100%;
  height: 24px;
  margin: 0;
  background: none;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.book-range::-webkit-slider-runnable-track { height: 1px; background: var(--or-muted); }
.book-range::-moz-range-track { height: 1px; background: var(--or-muted); }
.book-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 7px;
  margin-top: -3px;
  background: var(--or);
  border: 0;
  border-radius: 0;
}
.book-range::-moz-range-thumb {
  width: 22px;
  height: 7px;
  background: var(--or);
  border: 0;
  border-radius: 0;
}
.book-tools { display: flex; justify-content: flex-end; gap: 24px; }
.book-tool {
  padding: 8px 0;
  background: none;
  border: 0;
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--texte);
  cursor: pointer;
  transition: color var(--speed-fast) var(--ease);
}
.book-tool:hover { color: var(--or); }
.book-noscript { text-align: center; color: var(--texte); }
.book-noscript a { color: var(--or); }

/* Plein écran */
.book-reader:fullscreen {
  --w: min(calc(100vw - 144px), calc((100vh - 110px) * 2 * var(--r)));
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0;
  border: 0;
}
.book-reader.is-single:fullscreen { --w: min(calc(100vw - 32px), calc((100vh - 110px) * var(--r))); }

/* ── Sommaire ──────────────────────────────────── */
.book-toc-section { padding: var(--section-pad) 48px; scroll-margin-top: var(--header-h-scrolled); }
.book-toc-inner {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 72px;
  max-width: 1200px;
  margin: 0 auto;
}
.book-toc-preview {
  position: sticky;
  top: calc(var(--header-h-scrolled) + 32px);
  align-self: start;
  margin: 0;
  box-shadow: 0 26px 60px rgba(0, 0, 0, .55);
  border: 1px solid var(--card-border);
}
.book-toc-preview img { display: block; width: 100%; height: auto; }
.book-toc h2 {
  font-family: var(--font-heading);
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 400;
  color: var(--blanc);
  margin: 0 0 40px;
}
.book-toc h2 em { color: var(--or); font-style: italic; }
.book-toc-group { margin-bottom: 36px; }
.book-toc-group h3 {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--or);
  margin: 0 0 10px;
}
.book-toc ul { list-style: none; margin: 0; padding: 0; }
.book-toc a {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 7px 0;
  font-family: var(--font-accent);
  font-size: 20px;
  color: var(--texte);
  transition: color var(--speed-fast) var(--ease);
}
.book-toc a i { flex: 1; border-bottom: 1px dotted var(--or-muted); transform: translateY(-4px); }
.book-toc a b { font-weight: 400; font-variant-numeric: tabular-nums; color: var(--texte-muted); }
.book-toc a:hover, .book-toc a:focus-visible { color: var(--or-clair); }
.book-toc a:hover b { color: var(--or-clair); }

/* ── Page agrandie ─────────────────────────────── */
.book-zoom {
  width: 100vw;
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  padding: 0;
  border: 0;
  background: #070707;
  color: var(--texte);
  overflow: hidden;
}
.book-zoom[open] { display: flex; flex-direction: column; }
.book-zoom::backdrop { background: #070707; }
.book-zoom-bar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  border-bottom: 1px solid var(--card-border);
}
.book-zoom-bar p { margin: 0; font-family: var(--font-accent); font-size: 18px; font-style: italic; }
.book-zoom-nav { display: flex; gap: 6px; }
.book-zoom-nav button {
  width: 42px;
  height: 42px;
  background: none;
  border: 0;
  font-size: 28px;
  line-height: 1;
  color: var(--or);
  cursor: pointer;
}
.book-zoom-nav button:disabled { opacity: .25; cursor: default; }
.book-zoom-scroll {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: auto;
  touch-action: pan-x pan-y pinch-zoom;
}
.book-zoom-scroll img {
  display: block;
  margin: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  cursor: zoom-in;
}
.book-zoom-scroll.is-full img { max-width: none; max-height: none; width: 2400px; height: auto; cursor: zoom-out; }

/* ── Adaptations ───────────────────────────────── */
@media (max-width: 900px) {
  .book-intro { grid-template-columns: 1fr; padding: calc(var(--header-h) + 40px) 24px 32px; }
  .book-intro-actions { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 24px; }
  .book-intro p { font-size: 20px; }
  .book-toc-section { padding: 56px 24px; }
  .book-toc-inner { grid-template-columns: 1fr; gap: 0; }
  .book-toc-preview { display: none; }
  .book-bar { grid-template-columns: 1fr auto; gap: 8px 16px; margin-top: 20px; }
  .book-range { grid-column: 1 / -1; grid-row: 2; }
  .book-tools #book-fullscreen { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .book-volume { transition: none; }
}
