/* CharityChannel Press site — shared stylesheet (ccsite)
   Design tokens, base register, the B2 site chrome (header, nav, footer,
   the View Transitions and reduced-motion foundation), and the front-door
   page register. The chrome partials live in src/partials/. */

/* ---------- Fonts (self-hosted, latin subset) ---------- */

@font-face {
  font-family: "Lora";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/lora-v37-latin-600.woff2") format("woff2");
}
@font-face {
  font-family: "Lora";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/lora-v37-latin-700.woff2") format("woff2");
}
@font-face {
  font-family: "Lora";
  font-style: italic;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/lora-v37-latin-600italic.woff2") format("woff2");
}
@font-face {
  font-family: "Lora";
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/lora-v37-latin-700italic.woff2") format("woff2");
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/source-sans-3-v19-latin-regular.woff2") format("woff2");
}
@font-face {
  font-family: "Source Sans 3";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/source-sans-3-v19-latin-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/source-sans-3-v19-latin-600.woff2") format("woff2");
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/source-sans-3-v19-latin-700.woff2") format("woff2");
}

/* ---------- Tokens ---------- */

:root {
  --deep-blue: #1F4D80;
  --brand-blue: #336699;
  --orange: #E8751A;
  --orange-hover: #c5610f;
  --ink: #1A1A1A;
  --muted: #666666;
  --tint: #F0F5FA;
  --soft-blue: #B8D4F0;
  --border: #E0E0E0;
  --white: #FFFFFF;
  --serif: "Lora", Georgia, serif;
  --sans: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ---------- Base ---------- */

* { box-sizing: border-box; }

html {
  height: 100%;
  /* Anchor targets clear the sticky header. */
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--white);
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  color: var(--deep-blue);
  line-height: 1.2;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

p {
  margin: 0 0 1em;
  text-wrap: pretty;
}

a { color: var(--brand-blue); }
a:hover, a:focus-visible { color: var(--deep-blue); }

img { max-width: 100%; }

:focus-visible {
  outline: 3px solid var(--brand-blue);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  padding: 13px 30px;
  border-radius: 4px;
  border: 0;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.btn-primary {
  background: var(--orange);
  color: var(--white);
}
.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--orange-hover);
  color: var(--white);
}

.btn-secondary {
  background: var(--white);
  color: var(--brand-blue);
  border: 2px solid var(--brand-blue);
  padding: 11px 28px;
}
.btn-secondary:hover,
.btn-secondary:focus-visible {
  background: var(--brand-blue);
  color: var(--white);
}

/* ---------- Site chrome: header and primary nav (B2, design system) ---------- */
/* Shared across every page via src/partials/header.html, injected by the
   Worker. This is the clean design-system masthead that replaces the
   transplanted WordPress header in the new build; the live interim pages
   keep the transplant untouched until the B8 cutover. Nav spine per the
   Site Cohesion Plan. Current-page marking is CSS-only: each page carries a
   page-<slug> class on <body>, so the shared partial needs no per-page
   aria-current edits. */

.skip-link {
  position: absolute;
  left: 12px;
  top: -52px;
  z-index: 100;
  background: var(--deep-blue);
  color: var(--white);
  padding: 10px 18px;
  border-radius: 0 0 6px 6px;
  text-decoration: none;
  font-weight: 600;
}
.skip-link:focus-visible { top: 0; color: var(--white); }

.cc-header {
  position: sticky;
  top: 0;
  z-index: 90;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}

.cc-header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.cc-brand { display: inline-flex; flex-shrink: 0; }
.cc-brand img { display: block; width: 112px; height: 52px; }

.cc-menu-button { display: none; }

.cc-nav { margin-left: auto; }

.cc-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 2px;
}

.cc-nav-list > li { position: relative; }

.cc-nav-list > li > a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 12px;
  font-weight: 600;
  font-size: 16px;
  color: var(--ink);
  text-decoration: none;
  border-radius: 6px;
}
.cc-nav-list > li > a:hover,
.cc-nav-list > li > a:focus-visible {
  color: var(--deep-blue);
  background: var(--tint);
}

.cc-caret { color: var(--muted); }

/* Current-page marker (body carries page-<slug>) */
.page-holding-fire .cc-nav a[href="/holding-fire/"],
.page-personalized-philanthropy .cc-nav a[href="/personalized-philanthropy/"],
.page-books .cc-nav a[href="/books/"],
.page-framework .cc-nav a[href="/framework/"],
.page-tuesday .cc-nav a[href="/tuesday-with-stephen/"],
.page-about .cc-nav a[href="/about/"],
.page-contact .cc-nav a[href="/contact/"],
.page-holding-fire .cc-nav-list > li.has-sub > a,
.page-personalized-philanthropy .cc-nav-list > li.has-sub > a,
.page-books .cc-nav-list > li.has-sub > a {
  color: var(--deep-blue);
}

/* Books dropdown: pure CSS on hover and keyboard focus; site.js adds an
   .is-open path for desktop-layout touch screens. */
.cc-sub {
  list-style: none;
  margin: 0;
  padding: 8px 0;
  position: absolute;
  top: calc(100% + 12px);
  left: 8px;
  min-width: 250px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(31, 77, 128, 0.14);
  display: none;
}
/* Invisible hover bridge across the gap between the nav link and the card. */
.cc-sub::before {
  content: "";
  position: absolute;
  top: -14px;
  left: 0;
  right: 0;
  height: 14px;
}
.cc-nav-list > li.has-sub:hover > .cc-sub,
.cc-nav-list > li.has-sub:focus-within > .cc-sub,
.cc-nav-list > li.has-sub.is-open > .cc-sub { display: block; }

.cc-sub a {
  display: block;
  padding: 10px 18px;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}
.cc-sub a:hover,
.cc-sub a:focus-visible { background: var(--tint); color: var(--deep-blue); }

/* The catalog line sits apart from the two titles. */
.cc-sub li:last-child {
  border-top: 1px solid var(--border);
  margin-top: 6px;
  padding-top: 6px;
}

.cc-subscribe {
  padding: 10px 20px;
  font-size: 15px;
  margin-left: 6px;
}

/* Elevation once the page scrolls: a state cue, not motion, so it stays
   outside the reduced-motion gate. Browsers without scroll-driven
   animations keep the plain bottom border. */
@keyframes cc-header-elevate {
  to { box-shadow: 0 3px 14px rgba(31, 77, 128, 0.12); }
}
@supports (animation-timeline: scroll()) {
  .cc-header {
    animation: cc-header-elevate linear both;
    animation-timeline: scroll(root);
    animation-range: 0 90px;
  }
}

/* Squeeze zone just above the mobile flip. */
@media (max-width: 1120px) and (min-width: 961px) {
  .cc-header-inner { gap: 14px; }
  .cc-nav-list > li > a { font-size: 15px; padding: 9px 8px; }
  .cc-subscribe { padding: 9px 16px; font-size: 14px; }
}

/* Mobile nav: one consistent flip at 960px, matching the site's sections. */
@media (max-width: 960px) {
  .cc-header-inner { padding: 10px 18px; gap: 16px; }
  .cc-brand img { width: 95px; height: 44px; }

  .cc-menu-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 14px;
    font: 600 15px var(--sans);
    color: var(--deep-blue);
    cursor: pointer;
  }

  .cc-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-left: 0;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 14px 30px rgba(31, 77, 128, 0.14);
    max-height: calc(100vh - 66px);
    max-height: calc(100dvh - 66px);
    overflow-y: auto;
  }
  .cc-nav.is-open { display: block; }

  .cc-nav-list { display: block; padding: 8px 0 16px; }
  .cc-nav-list > li > a { display: block; padding: 12px 26px; border-radius: 0; }
  .cc-caret { display: none; }

  /* The Books parent link collapses; its three sub-links serve at top
     level (All Books We Publish carries the /books/ destination). */
  .cc-nav-list > li.has-sub > a { display: none; }
  .cc-sub {
    display: block;
    position: static;
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .cc-sub::before { display: none; }
  .cc-sub a { padding: 12px 26px; font-size: 16px; }
  .cc-sub li:last-child { border-top: 0; margin-top: 0; padding-top: 0; }
  .cc-nav-list > li.has-sub {
    border-bottom: 1px solid var(--border);
    margin-bottom: 6px;
    padding-bottom: 6px;
  }

  .cc-nav-cta { padding: 12px 26px 4px; }
  .cc-subscribe { margin-left: 0; }
}


/* ---------- Footer (unified across all CharityChannel surfaces) ---------- */
/* Ported from the framework page; two book links added per the unified-footer
   decision. Reproduced, not shared; mirror any change in the Worker footer. */

.site-footer { margin-top: auto; }

.foot-nav {
  background: var(--brand-blue);
  text-align: center;
  padding: 24px 22px;
}

.foot-nav a {
  color: #fff;
  margin: 0 16px;
  font-size: 0.98rem;
  line-height: 2.1;
  white-space: nowrap;
  text-decoration: none;
}

.foot-nav a:hover {
  text-decoration: underline;
  color: #fff;
}

.foot-copy {
  background: #111;
  text-align: center;
  padding: 20px 22px;
}

.foot-copy p {
  color: #d2d8de;
  font-size: 1.05rem;
  margin: 0;
}

.foot-copy .foot-tm {
  font-size: 0.82rem;
  color: #8b939c;
  margin-top: 6px;
}

@media (max-width: 600px) {
  .foot-nav a { display: inline-block; margin: 4px 12px; }
}

/* ---------- Front-door register ---------- */

.front-door section {
  padding: 60px 24px;
}

.front-door .section-tint { background: var(--tint); }
.front-door .section-white { background: var(--white); }

.section-inner {
  max-width: 1040px;
  margin: 0 auto;
}

.section-prose {
  max-width: 780px;
  margin: 0 auto;
}

.front-door h1 {
  font-size: 42px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.front-door h2 {
  font-size: 34px;
  font-weight: 700;
  margin-bottom: 20px;
}

.front-door h3 {
  font-size: 21px;
  font-weight: 600;
  margin-bottom: 10px;
}

.subtitle {
  font-size: 24px;
  line-height: 1.45;
  color: var(--ink);
  text-wrap: balance;
}

.small-print {
  font-size: 14.5px;
  color: var(--muted);
}

.kicker {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--brand-blue);
  margin-bottom: 14px;
}

/* Hero */

.hero {
  text-align: center;
  border-bottom: 1px solid var(--border);
  padding-top: 68px;
  padding-bottom: 64px;
}

.hero .subtitle {
  max-width: 780px;
  margin: 0 auto;
}

/* World cards */

.section-heading,
.text-center {
  text-align: center;
}

.section-subtitle {
  text-align: center;
  max-width: 780px;
  margin: -6px auto 0;
  font-size: 19px;
  text-wrap: balance;
}

.world-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-top: 36px;
}

.world-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.world-card-header {
  padding: 26px 32px;
}

.world-card-header .kicker {
  color: var(--soft-blue);
  font-size: 13px;
  letter-spacing: 1.2px;
  margin-bottom: 8px;
}

.world-card-header h3 {
  color: var(--white);
  font-size: 28px;
  font-weight: 600;
  margin: 0;
}

.world-card-header-deep { background: var(--deep-blue); }
.world-card-header-brand { background: var(--brand-blue); }

.world-card-body {
  padding: 28px 32px 32px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.world-card-body p {
  flex: 1;
  margin-bottom: 24px;
}

.world-card-body .btn { align-self: flex-start; }

/* Three steps */

.step-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-top: 40px;
}

.step-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 32px;
}

.step-card .step-number {
  font-family: var(--serif);
  font-size: 44px;
  font-weight: 700;
  line-height: 1;
  color: var(--orange);
  margin: 0 0 12px;
}

.step-card p { margin: 0; font-size: 16px; }

/* Coach cards */

.coach-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-top: 40px;
  margin-bottom: 40px;
}

.coach-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 30px;
}

.coach-card h3 {
  font-size: 20px;
  margin: 0 0 12px;
}

.coach-card p { margin: 0; font-size: 16px; }

.coach-card-dark {
  background: var(--deep-blue);
  border-color: var(--deep-blue);
}

.coach-card-dark h3,
.coach-card-dark p {
  color: var(--white);
}

.framework-link {
  display: inline-block;
  color: var(--brand-blue);
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  border-bottom: 2px solid var(--orange);
  padding-bottom: 2px;
}

.framework-link:hover,
.framework-link:focus-visible {
  color: var(--deep-blue);
}

/* Book duo */

.book-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  max-width: 940px;
  margin: 40px auto 0;
  text-align: left;
}

.book-duo-item {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.book-duo-item > a {
  flex: none;
}

.book-duo-cover {
  display: block;
  height: 210px;
  width: auto;
  max-width: none;
  box-shadow: 0 8px 22px rgba(31, 77, 128, 0.28);
  border-radius: 3px;
}

.book-duo-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.book-duo-text h3 {
  font-size: 20px;
  margin-bottom: 2px;
}

.book-duo-byline {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 12px;
}

.book-duo-text p {
  font-size: 15px;
  margin-bottom: 16px;
}

.book-duo-text .btn {
  font-size: 14.5px;
  padding: 10px 24px;
}

.book-duo-text .small-print { margin: 12px 0 0; }

/* Orientation book feature (cover beside prose; stacks on phones) */

.book-feature {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  margin-top: 8px;
}

.book-feature > a { flex: none; }

.book-feature-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.book-feature-text p { margin-bottom: 16px; }

@media (max-width: 560px) {
  .book-feature { flex-direction: column; }
  .book-feature > a { align-self: center; }
}

/* World-page call to action */

.world-cta {
  margin-top: 36px;
}

.btn-large {
  font-size: 19px;
  padding: 17px 44px;
}

.world-cta .small-print {
  margin: 16px 0 0;
}

/* Orientation article */

.orientation-section .section-prose h2 { margin-bottom: 16px; }

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 8px;
}

/* Front-door responsive */

@media (max-width: 960px) {
  .front-door section { padding: 44px 20px; }
  .front-door h1 { font-size: 34px; }
  .front-door h2 { font-size: 28px; }
  .subtitle { font-size: 20px; }

  .world-cards,
  .step-cards,
  .coach-cards,
  .book-duo {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 560px) {
  .book-duo-item { flex-direction: column; }
  .book-duo-item > a { align-self: center; }
  .book-duo-text .btn { align-self: center; }

  /* At phone widths the subtitle exceeds text-wrap: balance's six-line
     limit and balance silently switches off; pretty still prevents a
     single stranded word. */
  .subtitle { text-wrap: pretty; }
}

/* ---------- Motion foundation (B2): View Transitions + reduced motion ---------- */
/* Every piece of motion on this site is opt-in behind
   prefers-reduced-motion: no-preference; reduced-motion readers get the
   clean, fast, plain page — the progressive-enhancement rule in the Site
   Cohesion Plan, baked in from the start. Cross-document View Transitions
   carry page-to-page continuity: the chrome holds still (view-transition-name
   below) while the rest cross-fades. Browsers without support simply
   navigate; nothing depends on the transition. B3 adds content-level
   transition names (covers, scene elements) on this same foundation. */

@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }

  .cc-header {
    view-transition-name: cc-header;
  }

  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 200ms;
  }

  html {
    scroll-behavior: smooth;
  }
}

/* Hard stop for anything animated elsewhere: collapse to a single instant
   frame. Belt to the opt-in suspenders above. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto !important; }
}
