/* Book page — page-specific styles only.
   Shared tokens, utilities, and buttons live in epi-shared.css */

/* ─── HERO — full background image ── */
.book-hero {
  position: relative;
  min-height: max(580px, 82vh);
  display: flex;
  align-items: center;
  padding-top: max(96px, 11vh);
  padding-bottom: 80px;
  overflow: hidden;
}

/* Book cover on the right — contained so full cover shows without upscale blur */
.book-hero__bg { position: absolute; inset: 0; z-index: 0; }
.book-hero__bg-img {
  position: absolute;
  /* keep the cover within the standard container width on wide screens */
  right: max(0px, calc((100% - 1120px) / 2)); top: 0;
  height: 100%; width: 42%;
  object-fit: contain; object-position: right center;
}
/* Gradient strong enough to keep left text fully legible + bottom fade erases book-cover hard edge */
.book-hero__bg-gradient {
  position: absolute; inset: 0;
  background:
    linear-gradient(to top, #0b1121 0%, rgba(11,17,33,0.96) 14%, transparent 44%),
    linear-gradient(to right,
      #0b1121 0%,
      #0b1121 40%,
      rgba(11,17,33,0.97) 50%,
      rgba(11,17,33,0.80) 60%,
      rgba(11,17,33,0.30) 76%,
      transparent 90%);
}

.book-hero .container { position: relative; z-index: 2; }
.book-hero__copy { max-width: 460px; }
.book-hero__headline {
  font-family: var(--font-display);
  font-size: var(--text-3xl); font-weight: 400;
  line-height: 1.15; color: var(--text-bright);
  margin-bottom: 1.5rem;
}
.book-hero__sub {
  font-size: var(--text-lg); color: var(--text-secondary);
  line-height: 1.65; margin-bottom: 1.75rem;
}

.book-hero__facts { list-style: none; display: flex; flex-direction: column; gap: 12px; margin-bottom: 2.25rem; }
.book-hero__facts li { display: flex; align-items: center; gap: 10px; font-size: var(--text-sm); color: var(--text-secondary); line-height: 1.5; }
.book-hero__facts li svg { color: var(--accent-gold); flex-shrink: 0; width: 16px; height: 16px; stroke: var(--accent-gold); align-self: center; vertical-align: middle; }

.book-hero__cta-group { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.book-hero__peek {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.875rem; color: var(--text-accent);
  text-decoration: none; opacity: 0.8; transition: opacity 0.2s;
}
.book-hero__peek:hover { opacity: 1; }

/* ── Shimmer dividers between book sections ── */
.book-hook::before, .book-chapters::before, .book-guide::before, .book-buy::before {
  content: '';
  position: absolute;
  top: 0; left: 50%; transform: translateX(-50%);
  width: min(560px, 85%); height: 1px;
  background: linear-gradient(90deg, transparent, rgba(200,162,78,0.55) 35%, rgba(255,249,224,0.78) 50%, rgba(200,162,78,0.55) 65%, transparent);
  pointer-events: none;
}
.book-hook, .book-chapters, .book-guide, .book-buy { position: relative; }

/* ─── HOOK ── */
.book-hook { padding: 72px 0; }
.book-hook__inner {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 56px 64px; max-width: 800px; margin: 0 auto;
  text-align: center;  /* title centred; .book-hook__passages overrides to left */
}
/* "Selected Passages" — heading that names the section */
.book-hook__title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 400;
  color: var(--text-accent);
  font-style: normal;
  margin-top: 0.5rem;
  margin-bottom: 4rem;
}
/* Three equal passages — open editorial style, ruled bottom border */
.book-hook__passages { text-align: left; margin-top: 3.5rem; }
.book-hook__passage {
  padding-bottom: 3rem;
  margin-bottom: 3rem;
  border-bottom: 1px solid rgba(200, 162, 78, 0.25);
}
.book-hook__passage:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}
.book-hook__text {
  font-family: var(--font-display);
  font-size: clamp(0.95rem, 1.4vw, 1.15rem);
  font-style: italic;
  color: #e8d5a3;
  line-height: 1.95;
  margin-bottom: 0.875rem;
}
.book-hook__cite {
  display: block;
  text-align: right;
  font-family: var(--font-body);
  font-size: 0.72rem;
  color: var(--accent-gold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.85;
}

/* ─── FRAMEWORK ── */
.book-framework { padding: 80px 0; background: var(--bg-secondary); }
.book-framework__header { text-align: center; margin-bottom: 56px; }
.book-framework__title { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 400; color: var(--text-bright); margin-bottom: 4rem; }
.book-framework__sub { color: var(--text-secondary); max-width: 560px; margin: 0 auto; line-height: 1.65; }

/* ─── CHAPTERS ── */
.book-chapters { padding: 100px 0 88px; }
.book-chapters__header { text-align: center; margin-bottom: 56px; }
.book-chapters__title { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 400; color: var(--text-bright); margin-bottom: 0.75rem; }
.book-chapters__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.book-chapter-card {
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl); padding: 28px 28px 24px;
  transition: border-color 0.2s, box-shadow 0.2s;
  position: relative; overflow: hidden;
}
.book-chapter-card::before {
  content: ''; position: absolute; top: 0; left: 10%; right: 10%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212,168,76,0.4) 40%, rgba(255,249,224,0.6) 50%, rgba(212,168,76,0.4) 60%, transparent);
}
.book-chapter-card:hover { border-color: var(--border-accent); box-shadow: 0 4px 24px rgba(0,0,0,0.3); }
.book-chapter-num { font-family: var(--font-display); font-size: 1.5rem; color: rgba(200,162,78,0.35); line-height: 1; display: block; margin-bottom: 8px; }
.book-chapter-title { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 400; color: var(--accent-gold); margin-bottom: 10px; }
.book-chapter-desc { font-size: var(--text-sm); color: var(--text-secondary); line-height: 1.65; margin-bottom: 16px; }
.book-chapter-topics { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.book-chapter-topics span {
  font-size: 0.6875rem; font-weight: 500; color: var(--text-accent);
  background: rgba(200,162,78,0.07); border: 1px solid rgba(200,162,78,0.2);
  border-radius: 4px; padding: 3px 8px; letter-spacing: 0.04em;
}

/* ─── GUIDE ── */
.book-guide { padding: 80px 0; background: var(--bg-secondary); }
.book-guide__inner { max-width: 820px; margin: 0 auto; }
.book-guide__header { text-align: center; margin-bottom: 24px; }
.book-guide__title { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 400; color: var(--text-bright); margin-bottom: 1.25rem; }
.book-guide__sub { color: var(--text-secondary); line-height: 1.65; }
/* Diagnostic card grid — 2 columns, each card is condition → prescription */
.book-guide__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 2rem;
}
.book-guide__card {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 18px 22px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--accent-gold);
  border-radius: var(--radius-md);
  transition: background 0.18s;
}
.book-guide__card:hover { background: var(--bg-card-hover); }
/* Question that triggers self-recognition — gold, prominent */
.book-guide__trigger {
  font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
  color: #c8a24e;
  font-style: italic;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 10px;
  text-shadow: 0 0 18px rgba(200, 162, 78, 0.35);
}
/* Chapter answer — DM Serif, steps up in size, gold */
.book-guide__destination {
  font-family: var(--font-display);
  font-size: var(--text-base);
  color: var(--text-accent);
  line-height: 1.35;
  font-weight: 400;
}
.book-guide__note { text-align: center; margin-top: 20px; font-size: var(--text-sm); color: var(--text-muted); font-style: italic; }

/* ─── BUY — final CTA. The book cover that used to sit on the right was removed
   (it was unnecessary and only ever read as a faint/transparent backdrop); the
   section is now a clean left-aligned text + CTA block. ── */
.book-buy { padding: 120px 0; position: relative; min-height: 500px; display: flex; align-items: center; }
.book-buy .container { position: relative; z-index: 2; }
/* Book cover was removed, so this is now a CENTERED single-column CTA. (Left-
   aligned with an empty right half read as unfinished — design-audit C1.) */
.book-buy__inner {
  max-width: 620px;
  margin-left: auto; margin-right: auto;
  text-align: center;
  position: relative;
  z-index: 3;
}

/* A global !important reset (theme/Elementor) clobbers the max-width above to
   "none", so the copy stretches full-width. Re-assert with shell-scoped
   specificity: the hero copy stays clear of its book cover on the right; the
   buy copy is a centered readable column. */
body.epi-shell-page .book-hero__copy { max-width: 460px !important; }
body.epi-shell-page .book-buy__inner { max-width: 620px !important; margin-left: auto !important; margin-right: auto !important; }

/* Section label — centered gold rule + text */
.book-buy__inner .section-label { display: flex; justify-content: center; margin-bottom: 1.75rem; }
/* Main headline */
.book-buy__hook {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 400;
  color: var(--text-bright);
  line-height: 1.2;
  margin-bottom: 3.5rem;
}
/* Acronym — provenance, gold, clear space below */
.book-buy__title {
  font-family: var(--font-display); font-size: var(--text-xl);
  font-weight: 400; color: var(--text-accent);
  margin-bottom: 2rem;
  letter-spacing: 0.04em;
}
/* Tagline — brightened (was --text-secondary grey, the lowest-contrast line on
   the page despite being the positioning statement — design-audit C3). */
.book-buy__subtitle {
  font-size: var(--text-lg); color: var(--text-bright);
  margin-bottom: 3rem;
  line-height: 1.5;
}
/* Promise + pledge: centered (the old gold left-rail borders only worked in the
   former left-aligned layout). */
.book-buy__promise {
  font-size: var(--text-sm); color: var(--text-secondary); line-height: 1.9;
  margin: 0 auto 3.5rem; max-width: 560px;
}
.book-buy__pledge {
  font-size: var(--text-sm); color: var(--text-secondary); line-height: 1.9;
  font-style: italic; margin: 0 auto 4.5rem; max-width: 560px; opacity: 0.85;
}
/* Centered CTA stack; shared min-width tidies the ragged button rail (C5). */
.book-buy__actions { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.book-buy__actions .cta-button,
.book-buy__actions .cta-button--secondary { min-width: 300px; justify-content: center; }

/* Mobile-only visible book cover (desktop uses the background image instead) */
.book-hero__cover { display: none; }

/* ─── RESPONSIVE ── */
@media (max-width: 900px) {
  /* Tablet (e.g. iPad 768): the faint background cover reads as empty navy, so
     surface the real cover asset here — same treatment as phones. */
  .book-hero__bg-img { opacity: 0 !important; }
  .book-hero__bg-gradient { background: linear-gradient(to bottom, #0b1121 0%, rgba(11,17,33,0.94) 55%, rgba(11,17,33,0.82) 100%); }
  .book-hero__cover { display: flex; justify-content: center; margin-top: 2rem; }
  .book-hero__cover .book-cover-img {
    width: 62%; max-width: 320px; height: auto; display: block;
    border-radius: 10px; border: 1px solid rgba(200,162,78,0.28);
    box-shadow: 0 24px 60px rgba(0,0,0,0.55), 0 0 40px rgba(200,162,78,0.10);
  }
  /* 2-col on tablet — 8 cards in 1-col was too long on iPad */
  .book-chapters__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 601px) and (max-width: 900px) {
  /* Tablet: the desktop 2-col hero collapsed (bg image hidden), leaving the 460px
     copy column pinned left with empty space on the right — center the hero block. */
  body.epi-shell-page .book-hero__copy,
  .book-hero__copy { max-width: 620px !important; margin-left: auto !important; margin-right: auto !important; text-align: center !important; }
  .book-hero__facts { display: inline-block !important; text-align: left !important; }
  .book-hero__cta-group { justify-content: center !important; }
}
@media (max-width: 600px) {
  /* Less top padding on phones */
  .book-hero { padding: 80px 0 48px; min-height: auto; }
  /* Surface the real cover on phones; hide the faint background version so we
     don't show the same image twice. */
  .book-hero__bg-img { opacity: 0 !important; }
  .book-hero__cover { display: flex; justify-content: center; margin-top: 2.25rem; }
  .book-hero__cover .book-cover-img {
    width: 100%; max-width: 340px; height: auto; display: block;
    border-radius: 10px; border: 1px solid rgba(200,162,78,0.28);
    box-shadow: 0 24px 60px rgba(0,0,0,0.55), 0 0 40px rgba(200,162,78,0.10);
  }
  .book-hook__inner { padding: 40px 28px; }
  /* Chapter cards: back to 1-col on phones */
  .book-chapters__grid { grid-template-columns: 1fr; }
  .book-guide__grid { grid-template-columns: 1fr; }
  .book-hero__cta-group { flex-direction: column; align-items: flex-start; }
  .book-buy__actions { width: 100%; }
  .book-buy__actions .cta-button,
  .book-buy__actions .cta-button--secondary { width: 100%; justify-content: center; }
}
@media (max-width: 390px) {
  .book-hero__headline { font-size: clamp(1.75rem, 8vw, 2.25rem); }
}
