/*
  guide-viewer.css
  Shared viewer system for Family Guide and Executor Guide preview pages.
  Page-specific intro styles and :root overrides live in each page file.
*/

:root {
  --gold: #C6B08A;
  --bg-base: #09111d;
  --guide-gold: #b89a66;
  --guide-ink: #2c3440;
  --guide-ink-muted: rgba(44,52,64,0.70);
  --guide-ink-faint: rgba(44,52,64,0.40);
  --guide-divider: rgba(44,52,64,0.11);
  --rail-active: #b89a66;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
html { font-size: 16px; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-base);
  color: rgba(235,239,245,0.92);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { border: none !important; }

/* ── PAGE INTRO (shared base) ──────────────────────────── */
.gv-intro {
  padding: 56px 2rem 72px;
  text-align: center;
}
.gv-eyebrow {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.17em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 12px;
}
.gv-headline {
  font-family: 'Poppins', sans-serif; font-weight: 700;
  font-size: clamp(1.55rem, 2.8vw, 2.15rem);
  color: rgba(235,239,245,0.96); line-height: 1.22; margin-bottom: 14px;
}
.gv-subhead {
  font-size: 1rem; color: rgba(214,223,238,0.56);
  max-width: 52ch; margin: 0 auto; line-height: 1.65;
}

/* ── GUIDE VIEWER SHELL ────────────────────────────────── */
.guide-viewer {
  display: flex;
  min-height: calc(100vh - 96px);
}

/* ── LEFT NAVIGATION RAIL ──────────────────────────────── */
.guide-rail {
  width: 172px;
  flex-shrink: 0;
  background: rgba(6,12,22,0.96);
  border-right: 1px solid rgba(255,255,255,0.034);
  padding: 32px 0 28px;
  display: flex;
  flex-direction: column;
  gap: 0;
  position: sticky;
  top: 96px;
  height: calc(100vh - 96px);
  overflow-y: auto;
}
.guide-rail-label {
  font-size: 0.52rem; font-weight: 600; letter-spacing: 0.22em;
  text-transform: uppercase; color: rgba(214,223,238,0.14);
  padding: 0 20px 20px;
}
.rail-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 12px 18px 12px 20px;
  background: none; border: none; cursor: pointer;
  color: rgba(214,223,238,0.34);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.76rem; font-weight: 400; text-align: left;
  border-left: 2px solid transparent;
  transition: color 0.28s ease, border-color 0.28s ease;
  line-height: 1.35;
  letter-spacing: 0.01em;
}
.rail-item:hover { color: rgba(214,223,238,0.68); }
.rail-item.active {
  color: rgba(184,154,102,0.82);
  border-left-color: rgba(184,154,102,0.48);
  font-weight: 500;
}
.rail-num {
  font-size: 0.52rem; color: rgba(214,223,238,0.14);
  font-weight: 600; letter-spacing: 0.05em;
  flex-shrink: 0; min-width: 16px;
}
.rail-item.active .rail-num { color: rgba(184,154,102,0.36); }

/* ── GUIDE STAGE ───────────────────────────────────────── */
.guide-stage {
  flex: 1;
  padding: 36px 44px 72px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(20,40,68,0.9) 0%, transparent 52%),
    radial-gradient(ellipse at 0% 50%, rgba(4,10,20,0.48) 0%, transparent 36%),
    radial-gradient(ellipse at 100% 50%, rgba(4,10,20,0.48) 0%, transparent 36%),
    radial-gradient(ellipse at 20% 100%, rgba(8,16,28,0.6) 0%, transparent 40%),
    radial-gradient(ellipse at 80% 100%, rgba(8,16,28,0.6) 0%, transparent 40%),
    linear-gradient(180deg, #0d1d30 0%, #09111d 40%);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}
.guide-stage::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(ellipse at 50% 30%, rgba(184,154,102,0.062) 0%, transparent 52%);
  pointer-events: none;
}
.guide-sections {
  width: 100%;
  max-width: 940px;
  position: relative;
  z-index: 1;
}

/* ── SPREAD TRANSITIONS ────────────────────────────────── */
.guide-spread { display: none; }
.guide-spread.active { display: flex; }

/*
  perspective() used inside transform (not as CSS property on parent) so
  overflow:hidden on .guide-book cannot flatten the 3D context.
  Exit: old spread's page turns away (210ms).
  Enter: new spread's page settles in from turned position (320ms).
*/

/* Exit — right page turns away on forward navigation */
.guide-spread.is-leaving-forward .guide-page + .guide-page {
  animation: guidePageExitFwd 210ms cubic-bezier(0.4, 0, 0.6, 1) forwards;
  transform-origin: left center;
}
/* Exit — left page turns away on back navigation */
.guide-spread.is-leaving-back .guide-page--left {
  animation: guidePageExitBack 210ms cubic-bezier(0.4, 0, 0.6, 1) forwards;
  transform-origin: right center;
}
/* Enter — right page settles in on forward navigation */
.guide-spread.is-turning-forward .guide-page + .guide-page {
  animation: guidePageEnterFwd 320ms cubic-bezier(0.22, 1, 0.36, 1) both;
  transform-origin: left center;
}
/* Enter — left page settles in on back navigation */
.guide-spread.is-turning-back .guide-page--left {
  animation: guidePageEnterBack 320ms cubic-bezier(0.22, 1, 0.36, 1) both;
  transform-origin: right center;
}

@keyframes guidePageExitFwd {
  from { transform: perspective(1600px) rotateY(0deg) translateX(0); box-shadow: inset 0 0 0 rgba(0,0,0,0); opacity: 1; }
  to   { transform: perspective(1600px) rotateY(-7deg) translateX(-8px); box-shadow: inset 32px 0 40px rgba(0,0,0,0.12); opacity: 0.88; }
}
@keyframes guidePageExitBack {
  from { transform: perspective(1600px) rotateY(0deg) translateX(0); box-shadow: inset 0 0 0 rgba(0,0,0,0); opacity: 1; }
  to   { transform: perspective(1600px) rotateY(7deg) translateX(8px); box-shadow: inset -32px 0 40px rgba(0,0,0,0.12); opacity: 0.88; }
}
@keyframes guidePageEnterFwd {
  from { transform: perspective(1600px) rotateY(-7deg) translateX(-8px); box-shadow: inset 32px 0 40px rgba(0,0,0,0.12); opacity: 0.88; }
  to   { transform: perspective(1600px) rotateY(0deg) translateX(0); box-shadow: inset 0 0 0 rgba(0,0,0,0); opacity: 1; }
}
@keyframes guidePageEnterBack {
  from { transform: perspective(1600px) rotateY(7deg) translateX(8px); box-shadow: inset -32px 0 40px rgba(0,0,0,0.12); opacity: 0.88; }
  to   { transform: perspective(1600px) rotateY(0deg) translateX(0); box-shadow: inset 0 0 0 rgba(0,0,0,0); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .guide-spread.is-leaving-forward .guide-page + .guide-page,
  .guide-spread.is-leaving-back .guide-page--left,
  .guide-spread.is-turning-forward .guide-page + .guide-page,
  .guide-spread.is-turning-back .guide-page--left { animation: none; }
}

/* ── BOOK WRAPPER ──────────────────────────────────────── */
.guide-book {
  display: flex;
  width: 100%;
  border-radius: 6px;
  overflow: hidden;
  box-shadow:
    0 36px 80px rgba(0,0,0,0.46),
    0 14px 38px rgba(0,0,0,0.26),
    0 4px 12px rgba(0,0,0,0.16),
    0 0 0 1px rgba(0,0,0,0.18);
}

/* ── GUIDE PAGE ────────────────────────────────────────── */
.guide-page {
  flex: 1;
  background:
    radial-gradient(ellipse at 5% 3%, rgba(0,0,0,0.055) 0%, transparent 30%),
    radial-gradient(ellipse at 95% 4%, rgba(0,0,0,0.042) 0%, transparent 26%),
    radial-gradient(ellipse at 94% 97%, rgba(0,0,0,0.065) 0%, transparent 32%),
    radial-gradient(ellipse at 6% 96%, rgba(0,0,0,0.05) 0%, transparent 28%),
    radial-gradient(ellipse at 42% 22%, rgba(224,212,192,0.22) 0%, transparent 44%),
    linear-gradient(175deg, #e2d7c7 0%, #dacfbe 52%, #d4c6b1 100%);
  min-height: 630px;
  padding: 46px 42px 32px;
  display: flex;
  flex-direction: column;
  position: relative;
}
.guide-page + .guide-page {
  box-shadow: inset 6px 0 14px rgba(0,0,0,0.07), inset 1px 0 0 rgba(44,52,64,0.07);
}
.guide-page--left::after {
  content: '';
  position: absolute; top: 0; right: 0; bottom: 0; width: 14px;
  background: linear-gradient(to right, transparent, rgba(0,0,0,0.07), rgba(0,0,0,0.012));
  pointer-events: none;
}

/* ── PAGE COMPONENTS ───────────────────────────────────── */

.gp-eyebrow {
  font-size: 0.55rem; font-weight: 700; letter-spacing: 0.2em;
  text-transform: uppercase; color: rgba(184,154,102,0.8);
  margin-bottom: 20px;
  display: flex; align-items: center; gap: 10px;
}
.gp-eyebrow::after {
  content: ''; flex: 1; height: 1px;
  background: rgba(184,154,102,0.16);
}

.gp-title {
  font-family: 'Poppins', sans-serif;
  font-size: 1.48rem; font-weight: 600;
  color: var(--guide-ink); line-height: 1.22;
  letter-spacing: 0.01em; margin-bottom: 16px;
}
.gp-title-lg {
  font-family: 'Poppins', sans-serif;
  font-size: 1.88rem; font-weight: 600;
  color: var(--guide-ink); line-height: 1.18;
  letter-spacing: 0.005em; margin-bottom: 16px;
}

.gp-body {
  font-size: 0.91rem; color: var(--guide-ink-muted);
  line-height: 1.84; margin-bottom: 16px;
}
.gp-body--sm     { font-size: 0.875rem; }
.gp-body--italic { font-style: italic; color: rgba(44,52,64,0.6); }
.gp-body--strong { font-weight: 600; color: rgba(44,52,64,0.8); }

.gp-divider { height: 1px; background: var(--guide-divider); margin: 18px 0; }

.gp-callout {
  background: rgba(184,154,102,0.065);
  border-left: 2px solid rgba(184,154,102,0.4);
  border-radius: 0 4px 4px 0;
  padding: 13px 16px; margin: 16px 0;
}
.gp-callout-label {
  font-size: 0.54rem; font-weight: 700; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--guide-gold); margin-bottom: 6px;
}
.gp-callout-text { font-size: 0.82rem; color: var(--guide-ink); line-height: 1.6; }

.gp-section-label {
  font-size: 0.56rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--guide-ink-faint);
  margin: 16px 0 10px;
}
.gp-section-label:first-child { margin-top: 0; }

.gp-checklist { margin: 0; padding: 0; list-style: none; }
.gp-check-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 7px 0; border-bottom: 1px solid var(--guide-divider);
  font-size: 0.83rem; color: var(--guide-ink); line-height: 1.45;
}
.gp-check-item:last-child { border-bottom: none; }
.gp-check-box {
  width: 13px; height: 13px; flex-shrink: 0;
  border: 1.5px solid rgba(184,154,102,0.4);
  border-radius: 3px; margin-top: 2px;
}

.gp-contact-card {
  border: 1px solid rgba(44,52,64,0.09);
  border-radius: 4px; padding: 13px 15px; margin-bottom: 8px;
  background: rgba(210,200,182,0.28);
}
.gp-contact-role {
  font-size: 0.54rem; font-weight: 700; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--guide-gold); margin-bottom: 3px;
}
.gp-contact-name { font-size: 0.88rem; font-weight: 600; color: var(--guide-ink); line-height: 1.3; }
.gp-contact-detail { font-size: 0.77rem; color: var(--guide-ink-muted); line-height: 1.45; margin-top: 3px; }
.gp-contact-note { font-size: 0.73rem; color: var(--guide-ink-faint); line-height: 1.4; margin-top: 4px; font-style: italic; }

.gp-field {
  display: flex; justify-content: space-between;
  align-items: baseline; gap: 14px;
  padding: 7px 0; border-bottom: 1px solid var(--guide-divider);
  font-size: 0.83rem;
}
.gp-field:last-child { border-bottom: none; }
.gp-field-key { font-weight: 600; color: var(--guide-ink); flex-shrink: 0; }
.gp-field-val { color: var(--guide-ink-muted); text-align: right; line-height: 1.35; }

.gp-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 14px 0; }
.gp-info-tile {
  background: rgba(210,200,182,0.32);
  border-radius: 4px; padding: 14px 13px 12px;
  border: 1px solid rgba(44,52,64,0.09);
}
.gp-info-tile-label {
  font-size: 0.54rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--guide-gold); margin-bottom: 6px;
}
.gp-info-tile-text { font-size: 0.79rem; color: var(--guide-ink-muted); line-height: 1.55; }

.gp-spacer { flex: 1; }

.gp-footer {
  margin-top: auto; padding-top: 20px;
  border-top: 1px solid rgba(44,52,64,0.09);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.58rem; color: rgba(44,52,64,0.32);
  letter-spacing: 0.04em;
}
.gp-footer-logo { font-weight: 600; color: rgba(44,52,64,0.38); letter-spacing: 0.06em; }

/* ── COVER PAGE ────────────────────────────────────────── */
.guide-cover {
  text-align: center; justify-content: center;
  background:
    radial-gradient(ellipse at 50% 28%, rgba(220,210,192,0.32) 0%, transparent 52%),
    linear-gradient(180deg, #e2d7c7 0%, #cdc0aa 100%);
}
.cover-logo-wrap { margin-bottom: 44px; }
.cover-llv-name {
  font-size: 0.56rem; font-weight: 600; letter-spacing: 0.28em;
  text-transform: uppercase; color: rgba(44,52,64,0.24);
}
.cover-title {
  font-family: 'Poppins', sans-serif;
  font-size: 2.45rem; font-weight: 600;
  color: var(--guide-ink); line-height: 1.12;
  letter-spacing: 0.028em; margin-bottom: 14px;
}
.cover-subtitle {
  font-size: 0.92rem; color: var(--guide-ink-muted);
  line-height: 1.75; max-width: 30ch; margin: 0 auto 32px;
}
.cover-divider {
  width: 36px; height: 1px;
  background: rgba(184,154,102,0.45);
  margin: 0 auto 32px;
}
.cover-prepared-for {
  font-size: 0.58rem; font-weight: 600; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--guide-ink-faint); margin-bottom: 7px;
}
.cover-family-name {
  font-family: 'Poppins', sans-serif;
  font-size: 1.4rem; font-weight: 600;
  color: var(--guide-ink); letter-spacing: 0.01em;
}
.cover-date { font-size: 0.72rem; color: var(--guide-ink-faint); margin-top: 22px; letter-spacing: 0.04em; }
.cover-quote {
  font-size: 0.79rem; color: rgba(44,52,64,0.52); font-style: italic;
  line-height: 1.72; padding: 18px 20px;
  border-top: 1px solid var(--guide-divider); margin-top: 32px;
}

/* ── TOC ───────────────────────────────────────────────── */
.toc-intro { font-size: 0.875rem; color: var(--guide-ink-muted); line-height: 1.8; margin-bottom: 16px; }
.toc-item {
  display: flex; align-items: baseline; gap: 0;
  padding: 8px 0; border-bottom: 1px solid var(--guide-divider);
  font-size: 0.83rem;
}
.toc-item:last-child { border-bottom: none; }
.toc-num { font-size: 0.6rem; color: var(--guide-gold); font-weight: 700; width: 22px; flex-shrink: 0; }
.toc-label { color: var(--guide-ink); font-weight: 500; flex-shrink: 0; }
.toc-dots { flex: 1; border-bottom: 1px dotted rgba(44,52,64,0.18); margin: 0 8px 3px; }
.toc-page { font-size: 0.68rem; color: var(--guide-ink-faint); flex-shrink: 0; }

/* ── FINAL CTA ─────────────────────────────────────────── */
.guide-final-cta {
  padding: 88px 2rem 96px; text-align: center;
  background: linear-gradient(180deg, #09111d 0%, #0b1422 100%);
  border-top: 1px solid rgba(255,255,255,0.05);
}
.gfc-eyebrow {
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.17em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 18px;
}
.gfc-headline {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(1.55rem, 3vw, 2.2rem);
  font-weight: 700; color: rgba(235,239,245,0.96);
  line-height: 1.28; max-width: 44ch; margin: 0 auto 15px;
}
.gfc-subhead {
  font-size: 1.02rem; color: rgba(214,223,238,0.6);
  max-width: 52ch; margin: 0 auto 36px; line-height: 1.65;
}
.gfc-buttons {
  display: flex; gap: 12px; justify-content: center;
  flex-wrap: wrap; margin-bottom: 20px;
}
.gfc-btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 11px 26px; border-radius: 6px;
  background: linear-gradient(180deg, #c6b08a 0%, #b79f74 100%);
  color: #1a1a1a; font-weight: 600; font-size: 0.9rem;
  text-decoration: none; border: 1px solid rgba(0,0,0,0.12);
  transition: filter 0.2s;
}
.gfc-btn-primary:hover { filter: brightness(1.06); }
.gfc-btn-outline {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 11px 26px; border-radius: 6px;
  border: 1px solid rgba(198,176,138,0.24);
  color: var(--gold); font-weight: 500; font-size: 0.9rem;
  text-decoration: none; background: transparent;
  transition: border-color 0.2s, background 0.2s;
}
.gfc-btn-outline:hover { border-color: rgba(198,176,138,0.44); background: rgba(198,176,138,0.04); }
.gfc-trust { font-size: 0.78rem; color: rgba(214,223,238,0.38); letter-spacing: 0.05em; }

/* ── MOBILE NAV ────────────────────────────────────────── */
.guide-mobile-nav { display: none; }

/* ── RESPONSIVE ────────────────────────────────────────── */
@media (max-width: 900px) {
  .guide-viewer { flex-direction: column; min-height: auto; }

  .guide-rail {
    width: 100%; height: auto; position: static;
    flex-direction: row; overflow-x: auto; overflow-y: hidden;
    padding: 0; gap: 0;
    border-right: none; border-bottom: 1px solid rgba(255,255,255,0.05);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .guide-rail::-webkit-scrollbar { display: none; }
  .guide-rail-label { display: none; }
  .rail-item {
    padding: 12px 15px; white-space: nowrap; flex-shrink: 0;
    border-left: none; border-bottom: 2px solid transparent;
    font-size: 0.78rem;
  }
  .rail-item.active {
    border-left-color: transparent;
    border-bottom-color: var(--rail-active);
    background: rgba(184,154,102,0.06);
  }
  .rail-num { display: none; }

  .guide-stage { padding: 20px 14px 32px; }

  .guide-spread.active { flex-direction: column; }
  .guide-book { flex-direction: column; }
  .guide-page { min-height: auto; padding: 32px 24px 24px; }
  .guide-page + .guide-page { box-shadow: none; border-top: 1px solid rgba(44,52,64,0.09); }
  .guide-page--left::after { display: none; }

  .cover-title { font-size: 1.9rem; }
  .gp-title-lg { font-size: 1.6rem; }
  .gp-title { font-size: 1.25rem; }
  .gp-info-grid { grid-template-columns: 1fr; }

  .guide-mobile-nav {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 16px;
    background: rgba(12,26,44,0.9);
    border-top: 1px solid rgba(255,255,255,0.05);
  }
  .mobile-nav-btn {
    padding: 7px 15px; border-radius: 5px;
    border: 1px solid rgba(198,176,138,0.2);
    background: none; color: rgba(214,223,238,0.7);
    font-size: 0.8rem; font-weight: 500; cursor: pointer;
    font-family: 'Plus Jakarta Sans', sans-serif;
    transition: border-color 0.18s, color 0.18s;
  }
  .mobile-nav-btn:hover { border-color: rgba(198,176,138,0.4); color: rgba(214,223,238,0.95); }
  .mobile-nav-btn:disabled { opacity: 0.28; cursor: default; }
  .mobile-section-label { font-size: 0.78rem; color: rgba(214,223,238,0.5); font-weight: 500; }

  .gv-intro { padding: 36px 1.5rem 40px; }
  .guide-final-cta { padding: 60px 1.5rem 72px; }
}

@media (max-width: 580px) {
  .guide-page { padding: 22px 16px 18px; }
  .cover-title { font-size: 1.75rem; }
  .gfc-buttons { flex-direction: column; align-items: center; }
}
