/* ============================================================
   Chapters of Courage — Shared design system
   Canonical styles for every volume. Values are sourced from
   Volume 2 (Connor's story), the reference the series matches.

   Each story links this file first, then its own styles.css,
   which holds ONLY that volume's section layout + asset-backed
   backgrounds (CSS url() resolves relative to the story dir, so
   background images must stay in the per-story stylesheet).
   ============================================================ */

:root {
  --dark-blue: #0a054a;
  --berry: #ce0037;
  --berry-border: #a00730;
  --earth: #f9fbf7;
  --white: #ffffff;
  --ink: #000000;
  --muted-accent: #1a1a5a;
  --muted-accent-hover: #0f0f3f;
  --icon-neutral: #5a7a8f;
  --icon-neutral-hover: #4a6a7f;
  --sidebar-divider: #c7d3bd;

  --font-body: "Open Sans", system-ui, -apple-system, sans-serif;
  --font-display: "Roboto Condensed", "Open Sans", system-ui, -apple-system, sans-serif;
  --font-heading: "Roboto Condensed", "Open Sans", system-ui, -apple-system, sans-serif;
  --font-eyebrow: "Roboto", "Open Sans", system-ui, -apple-system, sans-serif;
  --font-quote: "Libre Baskerville", Georgia, serif;

  --page-max: 1600px;
  /* Shared gutter for 2/3 + 1/3 sidebar rows. The sidebar's border-left
     sits at the gutter's midpoint because its padding-left matches this. */
  --sidebar-gutter: clamp(32px, 5vw, 64px);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--white);
  font-family: var(--font-body);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
picture { display: contents; }

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--muted-accent);
  outline-offset: 3px;
}

/* -------------------- Page wrapper -------------------- */
.page {
  position: relative;
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  background: var(--white);
  overflow: hidden; /* contain full-bleed section backgrounds */
}

/* ============================================================
   Typography
   ============================================================ */
.sec-title {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(38px, 5.6vw, 80px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: var(--ink);
}

.body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(16px, 1.25vw, 18px);
  line-height: 1.55;
  color: var(--ink);
}
.body p { margin: 0; }
.body p + p { margin-top: 20px; }
.body strong { font-weight: 700; }

.pull-quote {
  margin: 0;
  font-family: var(--font-quote);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(20px, 2.5vw, 32px);
  line-height: 1.3;
  color: var(--ink);
}

.signoff {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: clamp(20px, 2.2vw, 26px);
  line-height: 1;
  color: var(--dark-blue);
}

.divider {
  width: 100%;
  height: 0;
  margin: 0;
  border: none;
  border-top: 1px solid var(--dark-blue);
}

/* ============================================================
   Resource / text-link component
   ============================================================ */
.rlink {
  display: flex;
  width: fit-content; /* clickable area hugs the text + arrow, not the full column */
  max-width: 100%;
  align-items: flex-start;
  justify-content: flex-start; /* arrow sits right next to the link text */
  gap: 10px;
  text-decoration: none;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: clamp(16px, 1.25vw, 18px);
  line-height: 1.25;
  color: var(--dark-blue);
}
.rlink + .rlink { margin-top: clamp(14px, 1.6vw, 22px); }
.rlink__text {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.rlink__arrow { width: 13.943px; height: 14.4px; flex: none; margin-top: 4px; }
.rlink:hover .rlink__text { text-decoration-color: transparent; }

.resource-lead {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.12;
  color: var(--dark-blue);
}
.resource-sub {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(16px, 1.25vw, 18px);
  line-height: 1.34;
  color: var(--ink);
}
.resource-sub strong { font-weight: 700; color: var(--dark-blue); }

.card-heading {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: clamp(16px, 1.3vw, 18px);
  line-height: 1.28;
  color: var(--dark-blue);
}

/* Bulleted lists — never bold (bold only via inline <strong>) */
.bullets,
.lessons,
.resource-list {
  margin: clamp(14px, 1.6vw, 20px) 0;
  padding-left: 1.2em;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(16px, 1.25vw, 18px);
  line-height: 1.5;
  color: var(--ink);
}
.bullets li,
.lessons li,
.resource-list li { padding-left: 4px; }
.bullets strong,
.lessons strong,
.resource-list strong { font-weight: 700; }

/* ============================================================
   Buttons + footer CTA
   ============================================================ */
.pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: clamp(12px, 1.5vw, 16px) clamp(28px, 4vw, 40px);
  border: none;
  border-radius: 50px;
  background: var(--muted-accent);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: clamp(14px, 1.1vw, 16px);
  line-height: normal;
  color: var(--white);
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
  text-decoration: none;
  text-align: center;
}
/* Leading glyph inside a pill — mirrors the cover's download / share icons.
   Sits alongside a .pill-btn__label span so the Share button's textContent
   swap ("Link copied!") only touches the label and never wipes the icon. */
.pill-btn__icon {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}
.pill-btn:hover { background: var(--muted-accent-hover); }
.pill-btn:active { transform: translateY(1px); }
.pill-btn:focus-visible {
  outline: 3px solid var(--muted-accent);
  outline-offset: 3px;
}

/* Underlined text link — the closing "See next volume" action */
.text-link {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: clamp(15px, 1.2vw, 18px);
  line-height: 1.2;
  color: var(--dark-blue);
  text-decoration: none;
}
.text-link__text {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.text-link:hover .text-link__text { text-decoration-color: transparent; }

/* Footer CTA row — buttons + link on one line, wrapping on narrow screens */
.cta,
.closing__cta {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(14px, 2vw, 24px);
}

/* Cover icon buttons */
.hero__icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(40px, 5vw, 52px);
  height: clamp(40px, 5vw, 52px);
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.18);
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.hero__icon-btn svg {
  width: 60%;
  height: 60%;
  stroke: #fff;
  stroke-width: 2;
  fill: none;
}
.hero__icon-btn:hover { border-color: #fff; background: #fff; }
.hero__icon-btn:hover svg { stroke: var(--dark-blue, #0a054a); }
.hero__icon-btn:active { transform: scale(0.95); }
.hero__icon-btn:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

/* ============================================================
   Canonical sidebar  (2/3 body + 1/3 sidebar)
   Vertical divider centered in the gutter; horizontal dividers
   only BETWEEN multiple blocks. No background.
   ============================================================ */
.sidebar {
  flex: 1 1 0;
  min-width: 240px;
  max-width: 420px;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  padding-left: var(--sidebar-gutter);
  border-left: 1px solid var(--sidebar-divider);
}
.sidebar__icon {
  width: 32px;
  height: 32px;
  margin-bottom: clamp(20px, 2.5vw, 32px);
}
/* Plain-text resource block (no card chrome) */
.tid-bit {
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
  padding: 0;
  margin-top: clamp(24px, 4vw, 40px);
}
/* A sidebar IS its own column, so its resource block starts flush */
.sidebar > .tid-bit { margin-top: 0; }
/* When a divider already separates the block, don't double the space below it
   (keeps the rule vertically centered between the two text blocks) */
.divider + .tid-bit { margin-top: 0; }
.tid-bit .resource-lead,
.tid-bit .card-heading {
  font-size: clamp(16px, 1.8vw, 20px);
  font-weight: 600;
  margin-bottom: 8px;
}
.tid-bit .resource-sub { font-size: clamp(14px, 1.5vw, 18px); margin-bottom: 16px; }
.tid-bit .resource-sub:last-child { margin-bottom: 0; }
/* A .body lead-in inside a tid-bit gets a touch of breathing room before its links */
.tid-bit .body { margin-bottom: 12px; }
/* Sidebar paragraph text tracks the body copy size for a uniform read
   across every volume (overrides the .tid-bit sizing above). Headings
   (.resource-lead / .card-heading) intentionally keep the .tid-bit sizing
   — clamp(16px, 1.8vw, 20px), weight 600 — so every sidebar heading matches. */
.sidebar .resource-sub { font-size: clamp(16px, 1.25vw, 18px); }

.card__block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  width: 100%;
}
/* Horizontal divider between stacked blocks inside a sidebar */
.sidebar .divider,
.tid-bit .divider {
  margin: clamp(24px, 3vw, 36px) 0;
  border-top-color: var(--sidebar-divider);
}

/* ============================================================
   Sticky nav
   ============================================================ */
.nav-btn {
  display: none;
  position: fixed;
  top: clamp(16px, 2.5vw, 35px);
  right: clamp(16px, 2.5vw, 40px);
  width: clamp(46px, 5vw, 61px);
  height: clamp(46px, 5vw, 61px);
  z-index: 100;
}
.nav-btn img { width: 100%; height: 100%; }

/* ============================================================
   HERO — text/layout only. Each volume adds its own
   .hero { background-image } + .hero__overlay tint.
   ============================================================ */
.hero {
  position: relative;
  width: 100%;
  min-height: clamp(620px, 94vh, 1080px);
  padding: clamp(56px, 7vw, 120px) clamp(20px, 5vw, 80px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(30px, 4.5vw, 64px);
  text-align: center;
  overflow: hidden;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: 50% 50%;
}
@media (min-width: 768px) {
  .hero { min-height: max(100vh, 720px); min-height: max(100dvh, 720px); }
}
.hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(10, 5, 74, 0.34);
}
.hero__wordmark,
.hero__scroll,
.hero__headline-block,
.hero__cta { position: relative; z-index: 1; }

.hero__wordmark {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(6px, 1.2vw, 18px);
}
.hero__eyebrow {
  margin: 0;
  font-family: var(--font-eyebrow);
  font-weight: 400;
  font-size: clamp(19px, 3vw, 45px);
  line-height: 1;
  letter-spacing: clamp(8px, 2.1vw, 31.5px);
  text-indent: clamp(8px, 2.1vw, 31.5px); /* offset trailing letter-spacing for true centering */
  color: var(--white);
}
/* COURAGE wordmark stays Oswald across the series */
.hero__title {
  margin: 0;
  font-family: "Oswald", sans-serif;
  font-weight: 700;
  font-size: clamp(64px, 17vw, 250px);
  line-height: 0.9;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--white);
}
.hero__subtitle {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(14px, 2.5vw, 40px);
  line-height: 1.1;
  letter-spacing: clamp(3px, 0.55vw, 8px);
  text-indent: clamp(3px, 0.55vw, 8px);
  color: var(--white);
}
.hero__scroll {
  display: block;
  width: clamp(28px, 3vw, 36px);
  height: auto;
  transform: rotate(180deg);
  transition: opacity 0.2s ease;
}
.hero__scroll svg {
  width: 100%;
  height: 100%;
  stroke: var(--icon-neutral);
  stroke-width: 2;
  fill: none;
}
.hero__headline-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(14px, 2vw, 30px);
  width: 100%;
}
.hero__volume {
  margin: 0;
  font-family: var(--font-eyebrow);
  font-weight: 400;
  font-size: clamp(20px, 2.8vw, 42px);
  line-height: 1.1;
  color: var(--white);
}
.hero__rule {
  display: block;
  width: min(793px, 72%);
  height: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.85);
}
.hero__headline {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(40px, 7vw, 100px);
  line-height: 1;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--white);
}
.hero__cta {
  position: absolute;
  top: clamp(20px, 3vw, 40px);
  right: clamp(20px, 3vw, 40px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 10;
}

/* ============================================================
   Quote banners — typography only. Each volume supplies the
   .banner layout + .banner--x background image + quote color.
   ============================================================ */
.banner__quote {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
  font-family: var(--font-quote);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(24px, 4vw, 48px);
  line-height: 1.25;
  color: var(--white);
}

/* ============================================================
   Closing sign-off logo
   ============================================================ */
.closing__logo { width: auto; max-width: 200px; margin-top: clamp(40px, 5vw, 72px); }

/* ============================================================
   Responsive — sidebars stack and drop the vertical divider
   ============================================================ */
@media (max-width: 767px) {
  .sidebar {
    border-left: none;
    padding-left: 0;
    max-width: none;
  }
}

@media (max-width: 420px) {
  .hero { gap: 26px; min-height: 560px; }
  .hero__eyebrow { letter-spacing: 6px; text-indent: 6px; }
}

/* ============================================================
   Scroll reveal — gated on .motion so no-JS / reduced-motion
   users stay visible.
   ============================================================ */
.motion .reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s ease, transform 0.7s ease;
  will-change: opacity, transform;
}
.motion .reveal--fade { transform: none; }
.motion .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .motion .reveal { opacity: 1; transform: none; transition: none; }
}
