/* Rethinking Our Future | Site shell
   Shared header, navigation, footer, buttons and theme tokens.
   Loaded on every page. Inner pages also load rof-v2.css (the client's approved
   reading-page standard), so every rule here is class-scoped and sets its own
   fonts/margins rather than styling bare elements.

   Themes (set on <html data-theme>):
     v1 = Homepage Mockup (navy on white)
     v2 = Homepage Mockup Variation 1 (navy + gold on cream)
*/

:root {
  --serif: Georgia, 'Times New Roman', serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;

  /* v1 tokens (default) */
  --c-canvas: #f3f6fa;
  --c-surface: #ffffff;
  --c-surface-alt: #f7f9fc;
  --c-heading: #14285c;
  --c-ink: #26313f;
  --c-ink-soft: #4a5566;
  --c-line: #dbe2ec;
  --c-brand: #0d4596;
  --c-brand-dark: #0a3573;
  --c-brand-pale: #e8f0fb;
  --c-eyebrow: #14285c;
  --c-accent-line: #0d4596;
  --c-on-brand: #ffffff;

  --c-header-bg: #ffffff;
  --c-header-ink: #14285c;
  --c-header-sub: #0d4596;
  --c-nav: #14285c;
  --c-nav-active: #0d4596;

  --c-footer-bg: #ffffff;
  --c-footer-ink: #14285c;
  --c-footer-soft: #4a5566;

  --radius-sm: 6px;
  --radius: 10px;
  --shadow-card: 0 1px 2px rgba(16, 32, 64, .05), 0 6px 20px rgba(16, 32, 64, .06);
  --container: 1200px;
  --page-max: 1920px;  /* whole page stops growing here, so zoomed-out/ultra-wide views stay one unit */
  --gutter: clamp(16px, 4vw, 48px);
  --gutter-wide: clamp(16px, 4vw, 64px);  /* header + homepage hero run full-bleed, like the mockups */
  --header-h: 72px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

:root[data-theme="v2"] {
  --c-canvas: #fbf8f1;
  --c-surface: #fffdf8;
  --c-surface-alt: #f6f0e2;
  --c-heading: #0f1f3d;
  --c-ink: #1f2633;
  --c-ink-soft: #444b57;
  --c-line: #e8dfcb;
  --c-brand: #0f2847;
  --c-brand-dark: #091a30;
  --c-brand-pale: #f3e8cf;
  --c-eyebrow: #8a5f0f;        /* gold text, 4.9:1 on cream */
  --c-accent-line: #c9a14a;    /* decorative gold */
  --c-on-brand: #ffffff;

  --c-header-bg: #0c1a33;
  --c-header-ink: #ffffff;
  --c-header-sub: #e9d7a8;
  --c-nav: #ffffff;
  --c-nav-active: #e2b552;

  --c-footer-bg: #0c1a33;
  --c-footer-ink: #ffffff;
  --c-footer-soft: #c9cfdb;
}

/* ---------- Utilities ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }

/* Page frame: up to 1920px the header and hero run edge to edge; beyond that
   (big monitors, browser zoomed out) the page is centred on a soft frame. */
html { background: #e9e3d6; }
body { max-width: var(--page-max); margin-inline: auto; box-shadow: 0 0 80px rgba(15, 30, 60, .10); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 1000; padding: 10px 16px; border-radius: var(--radius-sm); background: var(--c-brand); color: var(--c-on-brand); font: 600 .95rem/1 var(--sans); text-decoration: none; transition: top .2s var(--ease); }
.skip-link:focus { top: 12px; }
.icon { width: 1.1em; height: 1.1em; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 100; background: var(--c-header-bg); border-bottom: 1px solid var(--c-line); font-family: var(--sans); }
:root[data-theme="v2"] .site-header { border-bottom-color: transparent; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: var(--header-h); max-width: none; padding-inline: var(--gutter-wide); }

.brand { display: inline-flex; flex-direction: column; text-decoration: none; color: var(--c-header-ink); line-height: 1; padding: 8px 0; }
.brand:hover { color: var(--c-header-ink); }
.brand-name { font: 700 clamp(1.3rem, 2.4vw, 1.6rem)/1.1 var(--serif); letter-spacing: -.01em; }
.brand-tag { margin-top: 5px; font: 500 .72rem/1.2 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--c-header-sub); }
:root[data-theme="v2"] .brand-tag { display: flex; align-items: center; gap: 10px; text-transform: none; letter-spacing: .01em; font: italic 400 1rem/1.2 var(--serif); }
:root[data-theme="v2"] .brand-tag::before,
:root[data-theme="v2"] .brand-tag::after { content: ""; flex: 1; height: 1px; background: var(--c-accent-line); }

.nav-toggle { display: none; align-items: center; justify-content: center; width: 44px; height: 44px; margin-right: -8px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--c-header-ink); cursor: pointer; touch-action: manipulation; }
.nav-toggle .icon { width: 26px; height: 26px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

.site-nav ul { display: flex; align-items: center; gap: clamp(4px, 1.2vw, 14px); margin: 0; padding: 0; list-style: none; }
.site-nav a { position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; color: var(--c-nav); font: 600 .95rem/1 var(--sans); text-decoration: none; border-radius: var(--radius-sm); transition: color .2s var(--ease); }
.site-nav a::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 6px; height: 2px; background: var(--c-nav-active); transform: scaleX(0); transform-origin: left; transition: transform .25s var(--ease); }
.site-nav a:hover { color: var(--c-nav-active); }
.site-nav a:hover::after, .site-nav a[aria-current="page"]::after { transform: scaleX(1); }
.site-nav a[aria-current="page"] { color: var(--c-nav-active); }

.site-header a:focus-visible, .nav-toggle:focus-visible, .sitefoot a:focus-visible, .btn:focus-visible, .text-link:focus-visible { outline: 3px solid #5b9bf0; outline-offset: 3px; border-radius: 4px; }

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .site-nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--c-header-bg); border-bottom: 1px solid var(--c-line); box-shadow: 0 16px 32px rgba(10, 20, 40, .12); opacity: 0; visibility: hidden; transform: translateY(-8px); transition: opacity .2s var(--ease), transform .2s var(--ease), visibility 0s linear .2s; }
  .site-nav.is-open { opacity: 1; visibility: visible; transform: none; transition: opacity .2s var(--ease), transform .2s var(--ease); }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: 0; padding: 8px var(--gutter) 16px; }
  .site-nav a { width: 100%; min-height: 48px; padding: 0 4px; font-size: 1.05rem; border-bottom: 1px solid var(--c-line); border-radius: 0; }
  .site-nav li:last-child a { border-bottom: 0; }
  .site-nav a::after { display: none; }
  .site-nav a[aria-current="page"] { color: var(--c-nav-active); }
  :root[data-theme="v2"] .site-nav a { border-bottom-color: rgba(255, 255, 255, .12); }
}

/* ---------- Review bar (beta only; remove before launch) ---------- */

/* ---------- Buttons & links ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 46px; padding: 0 22px; border: 1.5px solid var(--c-brand); border-radius: var(--radius-sm); font: 600 1rem/1 var(--sans); text-decoration: none; cursor: pointer; touch-action: manipulation; transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), transform .15s var(--ease); }
.btn:active { transform: scale(.98); }
.btn .icon { transition: transform .2s var(--ease); }
.btn:hover .icon-arrow { transform: translateX(3px); }
.btn-primary { background: var(--c-brand); color: var(--c-on-brand); }
.btn-primary:hover { background: var(--c-brand-dark); border-color: var(--c-brand-dark); color: var(--c-on-brand); }
.btn-outline { background: transparent; color: var(--c-brand); }
.btn-outline:hover { background: var(--c-brand-pale); color: var(--c-brand-dark); }
.btn[aria-disabled="true"] { opacity: .6; cursor: not-allowed; }
:root[data-theme="v2"] .btn { border-radius: 8px; min-height: 50px; font-size: 1.05rem; }
:root[data-theme="v2"] .btn-outline { border-color: var(--c-brand); }

.text-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--c-brand); font: 650 .98rem/1.2 var(--sans); text-decoration: none; }
.text-link:hover { color: var(--c-brand-dark); text-decoration: underline; text-underline-offset: 4px; }
.text-link .icon { transition: transform .2s var(--ease); }
.text-link:hover .icon { transform: translateX(3px); }

/* ---------- Footer ---------- */
.sitefoot { background: var(--c-footer-bg); color: var(--c-footer-ink); border-top: 1px solid var(--c-line); font-family: var(--sans); }
:root[data-theme="v2"] .sitefoot { border-top: 3px solid var(--c-accent-line); }
.sitefoot .footer-main { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 32px; padding-block: 28px; }
.sitefoot .brand { color: var(--c-footer-ink); }
.sitefoot .footer-nav ul { display: flex; flex-wrap: wrap; gap: 4px 6px; margin: 0; padding: 0; list-style: none; }
.sitefoot .footer-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; color: var(--c-footer-ink); font-size: .92rem; font-weight: 500; text-decoration: none; }
.sitefoot .footer-nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.sitefoot .footer-legal { margin: 0; padding-block: 16px 22px; border-top: 1px solid var(--c-line); color: var(--c-footer-soft); font-size: .82rem; line-height: 1.5; }
.sitefoot .footer-legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 24px; }
.sitefoot .footer-legal p { margin: 0; font: inherit; color: inherit; }
.sitefoot .footer-credit a { color: var(--c-footer-ink); font-weight: 600; text-decoration: none; }
.sitefoot .footer-credit a:hover { color: var(--c-accent-line); text-decoration: underline; text-underline-offset: 3px; }
.sitefoot .footer-social { display: flex; gap: 10px; margin: 0; padding: 0; list-style: none; }
.sitefoot .footer-social a { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid rgba(255, 255, 255, .24); border-radius: 50%; color: var(--c-footer-ink); transition: color .2s var(--ease), border-color .2s var(--ease); }
.sitefoot .footer-social a:hover { color: var(--c-accent-line); border-color: var(--c-accent-line); }
.sitefoot .footer-social svg { width: 18px; height: 18px; fill: currentColor; }
:root[data-theme="v2"] .sitefoot .footer-legal { border-top-color: rgba(255, 255, 255, .14); }
:root[data-theme="v2"] .sitefoot .brand-tag { color: var(--c-header-sub); }

@media (max-width: 640px) {
  .sitefoot .footer-main { flex-direction: column; align-items: flex-start; }
  .sitefoot .footer-nav a { padding: 0 8px 0 0; }
}

/* Book that turns from front to back cover (homepage + Book page).
   Hover on mouse devices, keyboard focus, or a tap (JS adds .is-flipped). */
.book-flip { display: block; perspective: 1400px; }
.flip-inner { position: relative; display: block; transform-style: preserve-3d; transition: transform .7s var(--ease); }
.book-flip img { display: block; width: 100%; height: auto; border-radius: 10px; box-shadow: 0 2px 6px rgba(0, 0, 0, .18), 0 18px 40px rgba(15, 30, 60, .22); -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.book-flip .flip-back { position: absolute; inset: 0; transform: rotateY(180deg); }
.flip-trigger:focus-visible .flip-inner, .flip-trigger.is-flipped .flip-inner { transform: rotateY(180deg); }
.flip-trigger:focus-visible { outline: 3px solid #5b9bf0; outline-offset: 4px; border-radius: 12px; }
@media (hover: hover) { .flip-trigger:hover .flip-inner { transform: rotateY(180deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
@media print {
  html { background: none; }
  body { max-width: none; box-shadow: none; }
  .site-header, .nav-toggle { display: none !important; }
}

/* Content parked with the hidden attribute (e.g. Buy the Book) stays hidden even on flex/grid elements */
[hidden] { display: none !important; }

/* Book images are transparent cut-outs: shadow follows the book, not a box */
.book-flip img { border-radius: 0; box-shadow: none; filter: drop-shadow(0 16px 22px rgba(15, 30, 60, .28)); }

/* Book trailer pop-up (js/site.js builds the dialog on first open) */
.trailer-play { display: block; border-radius: 12px; cursor: pointer; transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
.trailer-play:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(15, 30, 60, .22); }
.trailer-play:focus-visible { outline: 3px solid #5b9bf0; outline-offset: 4px; }
.video-modal { width: min(1100px, calc(100vw - 32px)); max-width: none; padding: 0; border: 0; border-radius: 12px; background: #000; overflow: visible; }
.video-modal::backdrop { background: rgba(6, 12, 26, .86); }
.video-modal .video-frame { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; }
.video-modal iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-modal .video-close { position: absolute; top: -48px; right: 0; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; cursor: pointer; }
.video-modal .video-close:hover, .video-modal .video-close:focus-visible { background: rgba(255, 255, 255, .28); outline: 2px solid #fff; outline-offset: 2px; }
.video-modal .video-close svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
@media (prefers-reduced-motion: reduce) { .trailer-play { transition: none; } .trailer-play:hover { transform: none; } }

/* "Coming Soon" badge-button: highlighted gold, not clickable */
.btn-soon { position: relative; gap: 10px; border-color: #d9ad4f; background: linear-gradient(135deg, #f3cf7a, #d9a640); color: #0c1a33; font-weight: 700; letter-spacing: .02em; cursor: default; box-shadow: 0 6px 18px rgba(201, 161, 74, .35); }
.btn-soon:active { transform: none; }
.btn-soon .soon-dot { position: relative; width: 9px; height: 9px; border-radius: 50%; background: #0c1a33; }
.btn-soon .soon-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: #0c1a33; animation: soon-ping 1.6s ease-out infinite; }
@keyframes soon-ping { from { transform: scale(1); opacity: .55; } to { transform: scale(2.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .btn-soon .soon-dot::after { animation: none; } }
.soon-row { margin-top: 22px; }

/* ---------- Book launch: buy button, introductory offer, sharing ----------
   Shown or hidden by js/site.js from the BOOK settings at the top of that file. */
.btn-buy { border-color: #d9ad4f; background: linear-gradient(135deg, #f3cf7a, #d9a640); color: #0c1a33; font-weight: 700; box-shadow: 0 6px 18px rgba(201, 161, 74, .35); }
.btn-buy:hover { border-color: #c99a3c; background: linear-gradient(135deg, #f0c560, #cf9a32); color: #0c1a33; }

/* Slim announcement above the header, every page, only while the offer runs */
.offer-bar { background: linear-gradient(90deg, #f3cf7a, #e2b552); color: #0c1a33; font: 500 .92rem/1.45 var(--sans); }
.offer-bar p { margin: 0; padding: 9px var(--gutter); text-align: center; text-wrap: balance; }
.offer-bar strong { font-weight: 700; }
.offer-bar a { margin-left: 6px; color: #0c1a33; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.offer-bar a:hover { color: #0c1a33; text-decoration-thickness: 2px; }
.offer-bar a:focus-visible { outline: 3px solid #0c1a33; outline-offset: 2px; border-radius: 3px; }
@media (max-width: 640px) { .offer-bar { font-size: .85rem; } .offer-bar .offer-bar-extra { display: none; } }

.offer-note { max-width: 560px; margin: 16px 0 0; padding: 12px 16px; border-left: 3px solid #c9a14a; border-radius: 0 8px 8px 0; background: #fbf1d9; color: #1f2633; font: 400 .95rem/1.55 var(--sans); }
.offer-note .offer-kicker { display: block; margin-bottom: 2px; color: #8a5f0f; font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.offer-note strong { color: #0f1f3d; font-weight: 700; }
.formats-note { margin: 14px 0 0; color: var(--c-heading); font: 600 .95rem/1.5 var(--sans); }

.share { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-family: var(--sans); }
.share-label { color: var(--c-ink-soft); font-size: .9rem; font-weight: 600; }
.share-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1px solid var(--c-line); border-radius: 99px; background: var(--c-surface); color: var(--c-heading); font: 600 .92rem/1 var(--sans); text-decoration: none; cursor: pointer; touch-action: manipulation; transition: border-color .2s var(--ease), background-color .2s var(--ease), color .2s var(--ease); }
.share-btn:hover { border-color: var(--c-accent-line); background: var(--c-surface-alt); color: var(--c-heading); }
.share-btn:focus-visible { outline: 3px solid #5b9bf0; outline-offset: 2px; }
.share-btn .icon { width: 18px; height: 18px; }
.share-status { color: #2e6b3a; font-size: .88rem; font-weight: 600; }
.share-status:empty { display: none; }
.share-compact { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--c-line); }
.share-compact .share-btn { min-height: 40px; padding: 0 14px; font-size: .88rem; }
