/* CharityChannel Press shared chrome for the aardvark Worker's pages: the masthead,
   the primary nav and the footer, lifted from ccsite's site.css (the design-system
   source; mirror any change there into this file). Loaded by the four app pages
   and the /framework page in place of the July transplant of the WordPress
   masthead, which went with WordPress on 2026-09-13. The links in the markup are
   absolute (this Worker's pages serve on two hosts), so the current-page marks
   match on the end of the href. The header sits at z-index 40 here: the app's
   Getting-around panel and email gate dim the page at 50 and 60 and must cover
   it. Fonts and tokens: the app's site.css and the framework page's own style
   block define the same faces; the tokens are repeated here so the file stands
   alone on the framework page. */

: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;
}

.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: 40;
  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>; links here are absolute, so the
   match is on the end of the href; page-aardvark is the app's own pages) */
.page-aardvark .cc-nav a[href$="/aardvark/"],
.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); }

/* Sign Our Letter: the one button in the nav (2026-09-13). */
.cc-nav-list > li.cc-sign-li { margin-left: 10px; }
.cc-nav-list > li.cc-sign-li > a.cc-sign {
  background: var(--orange);
  color: var(--white);
  border-radius: 6px;
  padding: 9px 16px;
}
.cc-nav-list > li.cc-sign-li > a.cc-sign:hover,
.cc-nav-list > li.cc-sign-li > a.cc-sign:focus-visible {
  background: var(--orange-hover);
  color: var(--white);
}

.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 two sub-links serve at top level
     (since 2026-09-13 there is no catalog line, so /books/ is reachable on
     phones only through the footer). */
  .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-nav-list > li.cc-sign-li { margin: 12px 26px 4px; }
  .cc-nav-list > li.cc-sign-li > a.cc-sign { display: inline-block; padding: 12px 20px; }
  .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; }
}
