/* =============================================================
   essays.css — The Essays hub (P09) + the shared essay template.
   4E rebuild (W6e2, docs/plan/4E-CHARITIFY-MAPPING.md §4/§7): both
   templates now sit on the .cw-band/.cw-sechead/.cw-card system
   (components.css). This file carries only the essay-specific
   additions that system doesn't already cover: the hand-authored
   essay feature card's sub-headline/meta lines (card.php has no
   subtitle slot for the --media variant), the roadmap rows, the
   band-hero meta row, the crumbs-only band wrapper, and the reading
   column internals (TOC, drop cap, sources, share) which are
   UNCHANGED — editorial by design.
   Loaded on is_page('essays') + the essay child pages, after pages.css.
   Tokens only; no new colours. base -> layout -> components -> pages -> essays.
============================================================= */

/* -------------------------------------------------------------
   Hub — feature essay cards (card.php has no subtitle slot for the
   --media variant, so these two lines are hand-authored additions
   sitting inside the same .cw-card--media markup; see page-essays.php).
------------------------------------------------------------- */
.cw-card__sub {
  margin: 0;
  font-family: var(--cw-font-heading);
  font-style: italic;
  font-size: var(--cw-fs-body-lg);
  color: var(--cw-heading);
}
.cw-card__meta {
  margin: 0;
  font-size: var(--cw-fs-small);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--cw-gold-deep);
}

/* -------------------------------------------------------------
   Hub — "further essays" roadmap (gold-marker rows on the --tint band)
------------------------------------------------------------- */
.cw-essays-roadmap {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 760px;
  margin-inline: auto;
}
.cw-essays-roadmap__row {
  position: relative;
  padding: 1.25rem 0 1.25rem 1.5rem;
  border-top: 1px solid var(--cw-border);
  display: grid;
  gap: 0.25rem;
}
.cw-essays-roadmap__row:first-child {
  border-top: 0;
}
.cw-essays-roadmap__marker {
  position: absolute;
  left: 0;
  top: 1.65rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cw-gold);
}
.cw-essays-roadmap__title {
  font-family: var(--cw-font-heading);
  font-size: var(--cw-fs-h3);
  color: var(--cw-heading);
}
.cw-essays-roadmap__gloss {
  color: var(--cw-ink-soft, var(--cw-text-muted));
  line-height: var(--cw-lh-body);
}
@media (min-width: 720px) {
  .cw-essays-roadmap__row {
    grid-template-columns: 16rem 1fr;
    gap: 1.5rem;
    align-items: baseline;
    padding-left: 1.75rem;
  }
  .cw-essays-roadmap__marker {
    top: 1.75rem;
  }
}

/* -------------------------------------------------------------
   Hub — onward band ghost link spacing (sits below cta-band.php's
   own centred column, inside the same .cw-band--navy).
------------------------------------------------------------- */
.cw-essays-onward__ghost {
  margin: 1.25rem 0 0;
  text-align: center;
}

/* -------------------------------------------------------------
   Essay template — banded masthead additions
------------------------------------------------------------- */
/* Crumbs-only band wrapper: reuses .cw-page-hero--band's on-dark
   breadcrumb colour override, but must not duplicate the component's
   own vertical padding — the real hero band directly below supplies
   that. Also needs no bottom text-align:center content shift. */
.cw-page-hero--band--crumbs-only {
  padding-block: 0;
}
.cw-page-hero--band--crumbs-only .cw-page-hero__inner {
  max-width: none;
  text-align: left;
}
.cw-page-hero--band--crumbs-only .cw-breadcrumbs {
  justify-content: flex-start;
  margin-bottom: 0;
}

/* The reading-time / sources / byline row, on-dark, directly below
   page-hero-band's own lead paragraph inside the same --navy band. */
.cw-essay__meta--band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 1.5rem 0 0;
  font-size: var(--cw-fs-small);
  color: var(--cw-on-dark-muted);
}
.cw-essay__meta-sep {
  color: var(--cw-gold-soft);
}
.cw-essay__byline a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--cw-gold);
  text-underline-offset: 3px;
}
.cw-essay__byline a:hover {
  color: var(--cw-gold-light, var(--cw-gold));
}

/* Sources band — narrow column inside the wider .cw-band--tint
   container (band CSS sets .cw-container to the mid width; the
   sources block keeps the reading measure). */
.cw-essay__sources-inner {
  margin-inline: auto;
}

/* -------------------------------------------------------------
   Essay template — reading column (the_content)
------------------------------------------------------------- */
.cw-essay__body {
  font-size: var(--cw-fs-body-lg);
  line-height: var(--cw-lh-reading, 1.75);
  color: var(--cw-ink);
}
.cw-essay__body > * + * {
  margin-top: 1.35em;
}
.cw-essay__body h2 {
  margin: 2.4em 0 0;
  padding-top: 1.2em;
  border-top: 1px solid var(--cw-border-soft);
  font-size: var(--cw-fs-h3);
}
.cw-essay__body a {
  color: var(--cw-ink);
  text-decoration: underline;
  text-decoration-color: var(--cw-gold);
  text-underline-offset: 2px;
}
.cw-essay__body a:hover {
  color: var(--cw-gold-deep);
}
/* in-body quote rendered as a pull-quote */
.cw-essay__body blockquote {
  margin: 1.8em 0;
  padding: 0.2em 0 0.2em 1.4rem;
  border-left: 3px solid var(--cw-gold);
  font-family: var(--cw-font-heading);
  font-style: italic;
  font-size: clamp(1.2rem, 2.2vw, 1.5rem);
  line-height: 1.45;
  color: var(--cw-heading);
}
.cw-essay__body blockquote p {
  margin: 0;
}

/* -------------------------------------------------------------
   Essay template — sub-headings, pillars (Sources' own heading now
   comes from sechead.php on its --tint band; only the Pillars aside,
   which stays in the reading column, still uses .cw-essay__h).
------------------------------------------------------------- */
.cw-essay__h {
  font-size: var(--cw-fs-h3);
  margin: 0 0 1rem;
}
.cw-essay__pillars {
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  padding-top: 1.75rem;
  border-top: 1px solid var(--cw-border-soft);
}
.cw-essay__pillar-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}
.cw-essay__sources-list {
  margin: 0;
  padding-left: 1.4rem;
  display: grid;
  gap: 0.6rem;
  color: var(--cw-text-muted);
  line-height: var(--cw-lh-body);
}
.cw-essay__sources-list li {
  padding-left: 0.35rem;
}

/* -------------------------------------------------------------
   Essay template — share row (script-free; mirrors news.css)
------------------------------------------------------------- */
.cw-essay__share {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: clamp(2.5rem, 5vw, 3rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--cw-border-soft);
}
.cw-essay__share .cw-share__label {
  font-size: var(--cw-fs-small);
  font-weight: 700;
  letter-spacing: var(--cw-track-eyebrow);
  text-transform: uppercase;
  color: var(--cw-text-muted);
}
.cw-essay__share .cw-share__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  /* Whitespace (newline + indent) between each <li> and its <a> in the
     template injects a font-metric baseline strut into the flex row, which
     lands on the first flex item and lifts it out of alignment with its
     siblings (verified live on /book/'s share row — same markup pattern).
     font-size:0 collapses that whitespace's box; see .cw-share__btn .cw-icon
     below for the required icon-size counterpart. Do not remove. */
  font-size: 0;
}
.cw-essay__share .cw-share__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--cw-border);
  border-radius: var(--cw-radius-pill);
  color: var(--cw-navy);
  transition: border-color var(--cw-dur-fast) var(--cw-ease),
    color var(--cw-dur-fast) var(--cw-ease);
}
/* .cw-icon is em-sized (1.5em, base.css) — .cw-share__list's font-size:0
   above would shrink it to 0×0 without this. page-essay.php renders each
   icon via cw_icon(..., ['size' => 18]). */
.cw-essay__share .cw-share__btn .cw-icon {
  width: 18px;
  height: 18px;
}
.cw-essay__share .cw-share__btn:hover {
  border-color: var(--cw-gold);
  color: var(--cw-gold-deep);
}

/* -------------------------------------------------------------
   Essay + hub — onward-links row (sits below cta-band.php's own
   centred column, inside the same .cw-band--navy). The old
   .cw-essay__onward/-lead/-cta wrapper is retired — cta-band.php
   now owns that heading/lede/button markup+styling directly.
------------------------------------------------------------- */
.cw-essay__onward-links {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem 2rem;
}

/* -------------------------------------------------------------
   4D-W5c — essay reading aids: in-page contents + drop cap
------------------------------------------------------------- */
.cw-essay__toc {
  max-width: 66ch;
  margin: 0 auto 2.5rem;
  padding: 1.1rem 1.4rem 1.2rem;
  background: var(--cw-paper-tint, rgba(20, 40, 68, 0.04));
  border: 1px solid var(--cw-hairline, #d8c9a6);
  border-radius: 6px;
}
.cw-essay__toc-head {
  margin: 0 0 0.5rem;
  font-family: var(--cw-font-body);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cw-gold-deep, #9f7b2b);
}
.cw-essay__toc-list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: cw-toc;
}
.cw-essay__toc-list li {
  counter-increment: cw-toc;
  padding: 0.25rem 0;
}
.cw-essay__toc-list li::before {
  content: counter(cw-toc, decimal-leading-zero);
  margin-right: 0.7rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--cw-gold-deep, #9f7b2b);
}
.cw-essay__toc-list a {
  color: var(--cw-navy, #142844);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.cw-essay__toc-list a:hover,
.cw-essay__toc-list a:focus-visible {
  border-bottom-color: var(--cw-gold, #c8a24a);
}

/* Drop cap on the opening paragraph only (never on blockquotes/asides). */
.cw-essay__body > p:first-of-type::first-letter {
  float: left;
  font-family: var(--cw-font-heading);
  font-size: 3.4em;
  line-height: 0.82;
  padding: 0.06em 0.12em 0 0;
  color: var(--cw-navy, #142844);
}
