/* ============================================================
   Essay detail — editorial longform layout
   Flat page, centered feature header, measure-controlled body.
   ============================================================ */

/* Container
 *
 * The page sits directly on the paper ground — no card, no panel. An essay is
 * the long read on this site, so it gets a full sheet rather than the bordered
 * correspondence card a dispatch gets. What it borrows from the dispatch card
 * is the discipline: a masthead rule, one measure, and rules instead of
 * guessed-at gaps. See docs/dispatches-plan.md for the card it echoes. */
.essay-article-wrapper {
  background: var(--color-bg);
  /* Top spacing is a SINGLE band on top of the shared .main-content clearance
     (LOCKED 4.5rem in layout.css). This used to add 6rem on the theory that the
     header was a two-row masthead ≈9rem tall and .main-content reserved only
     3.5rem; both stopped being true when the header went slim and the clearance
     was locked, and the two reservations stacked into a canyon above the kicker.
     Now --space-xl, the site-wide opening inset (2026-09-09) that every page
     container uses, the dispatch feed included. */
  padding: var(--space-xl) var(--space-md) var(--space-3xl);
}

/* One measure for the whole article. The header used to run to 740px over a
   660px body, so the deck and byline hung out past the column they introduce —
   a small misalignment that reads as carelessness down the whole page. */
.essay-article {
  max-width: 42rem;
  margin: 0 auto;
  font-family: var(--font-content);
}

/* === Feature header === */
.essay-header {
  margin: 0 auto;
  text-align: center;
}

/* The kicker is set in the UI sans, like every other rubric on the site, and
   flanked by hairlines so it reads as a standing department head — the essay's
   answer to the dispatch card's "DISPATCH NO. 9" masthead. */
.essay-kicker {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-family: var(--font-ui);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps-wide);
  color: var(--color-accent);
  text-decoration: none;
  margin-bottom: var(--space-lg);
}

.essay-kicker::before,
.essay-kicker::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-divider);
}

.essay-kicker:hover {
  color: var(--color-accent-hover);
}

.essay-kicker:hover::before,
.essay-kicker:hover::after {
  background: var(--color-accent);
}

.essay-headline {
  font-family: var(--font-heading);
  font-size: clamp(2.6rem, 6vw, 3.75rem);
  font-weight: var(--font-weight-bold);
  line-height: 1.06;
  letter-spacing: var(--tracking-display);
  color: var(--color-heading-text);
  margin: 0 0 var(--space-md);
  text-wrap: balance;
}

.essay-deck {
  font-family: var(--font-content);
  font-style: italic;
  font-size: var(--font-size-lg);
  line-height: var(--line-height-tight);
  color: var(--color-subtle-text);
  max-width: 32em;
  margin: 0 auto var(--space-lg);
  text-wrap: balance;
}

/* Byline + dateline. Closed up under a rule, the way the dispatch card signs
   itself under its masthead, rather than floating as three loose lines. */
.essay-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: var(--space-xs) var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-divider);
  margin-bottom: var(--space-md);
}

.essay-byline {
  font-family: var(--font-content);
  font-size: var(--font-size-md);
  color: var(--color-body-text);
  margin: 0;
}

.essay-byline a {
  color: var(--color-heading-text);
  font-weight: 700;
  text-decoration: none;
}

.essay-byline a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
  color: var(--color-accent);
}

.essay-dateline {
  font-family: var(--font-ui);
  font-size: var(--font-size-xs);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--color-subtle-text);
}

/* Bookmark + share row. The pair's geometry comes from .detail-actions in
   components.css — the same quiet-action treatment the artist, writer, and
   playlist pages use, so bookmark and share read as one set instead of a text
   link beside a boxed button. Only the essay's centering and closing rule
   belong here. */
.essay-actions {
  justify-content: center;
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--color-divider);
}

/* === Hero image === */
.essay-hero {
  margin: var(--space-2xl) auto;
  text-align: center;
}

.essay-main-image {
  display: block;
  margin: 0 auto;
  width: 100%;
  max-width: 640px;
  /* Letterbox the full image: cap the height and fit the whole photo inside
     (object-fit: contain) so a square album label or tall book cover is never
     cropped on the detail page. Tall/square images get side bars; wide images
     fill the band. The author's own crop in their photo editor is what shows.

     The cap is a viewport-independent 26rem rather than 70vh. A square album
     label under a 70vh cap rendered as a ~640px block that pushed the first
     paragraph below the fold on a laptop, so the reader met a wall of sleeve
     art before a word of prose. This keeps the whole image visible while
     holding the opening line in view. */
  max-height: 26rem;
  object-fit: contain;
}

/* === Body copy === */
/* The body runs slightly narrower than the header block, so the headline and
   deck frame the column instead of matching its edges exactly. */
.essay-content-longform {
  max-width: 38rem;
  margin: 0 auto;
  font-family: var(--font-content);
  font-size: 1.1875rem;
  line-height: var(--line-height-relaxed);
  color: var(--color-body-text);
}

.essay-content-longform p {
  margin: 0 0 1.5rem;
  text-indent: 0;
}

/* Drop cap on the opening paragraph: a two-line cap whose top aligns
   with the first line's cap height and whose baseline sits on the
   second line's baseline. Tuned to Playfair/Georgia metrics — avoid
   `initial-letter`, which Safari sizes with descender space and sinks
   round letters below the baseline. */
.essay-content-longform > p:first-of-type::first-letter {
  float: left;
  font-family: var(--font-heading);
  font-size: 3.47em;
  line-height: 1;
  font-weight: 700;
  padding: 0 0.12em 0 0;
  margin-top: -0.03em;
  color: var(--color-heading-text);
}

/* Section headings within the essay */
.essay-content-longform h2,
.essay-content-longform h3,
.essay-content-longform h4 {
  font-family: var(--font-heading);
  color: var(--color-heading-text);
  line-height: 1.25;
  margin: 2.75rem 0 1rem;
}

.essay-content-longform h2 {
  font-size: 1.65rem;
}

.essay-content-longform h3 {
  font-size: 1.35rem;
}

.essay-content-longform h4 {
  font-size: 1.15rem;
}

/* Pull quotes */
.essay-content-longform blockquote {
  margin: 3rem auto;
  padding: 0;
  border: 0;
  max-width: 32em;
  text-align: center;
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1.5rem;
  line-height: 1.45;
  color: var(--color-heading-text);
}

.essay-content-longform blockquote::before,
.essay-content-longform blockquote::after {
  content: '';
  display: block;
  width: 3rem;
  height: 1px;
  background: var(--color-heading-text);
  margin: 0 auto;
}

.essay-content-longform blockquote::before {
  margin-bottom: 1.5rem;
}

.essay-content-longform blockquote::after {
  margin-top: 1.5rem;
}

/* Consecutive quotes (e.g. back-to-back poems) share one divider */
.essay-content-longform blockquote + blockquote {
  margin-top: -1.5rem;
}

.essay-content-longform blockquote + blockquote::before {
  display: none;
}

/* Attribution caption: a wholly-italic paragraph immediately after a pull-quote
 * (e.g. "*— John le Carré, Call for the Dead*") reads as the quote's source.
 * Centered under the quote, smaller and muted so it sits below without competing,
 * and pulled up under the quote's lower rule rather than a full paragraph gap.
 * Authored as plain markdown — no special class needed. Scoped with :has() to a
 * paragraph that is only the <em>, so ordinary prose after a quote is untouched. */
.essay-content-longform blockquote + p:has(> em:only-child) {
  margin-top: -1.5rem;
  text-align: center;
  font-size: var(--font-size-small);
  color: var(--color-subtle-text);
  letter-spacing: 0.02em;
}

.essay-content-longform blockquote + p:has(> em:only-child) em {
  font-style: italic;
}

.essay-content-longform blockquote p {
  margin: 0;
}

/* Inline links */
.essay-content-longform a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--color-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.essay-content-longform a:hover {
  color: var(--color-accent);
}

/* Lists */
.essay-content-longform ul,
.essay-content-longform ol {
  margin: 0 0 1.5rem 1.5rem;
  padding: 0;
}

.essay-content-longform li {
  margin-bottom: 0.5rem;
}

/* Inline images */
.essay-content-longform img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 2.5rem auto;
}

/* Section break */
.essay-content-longform hr {
  border: 0;
  border-top: 1px solid var(--color-heading-text);
  width: 4rem;
  margin: 3rem auto;
}

/* === Responsive === */
@media (max-width: 54rem) { /* --bp-phone */
  .essay-article-wrapper {
    padding: var(--space-xl) var(--space-md) var(--space-2xl);
  }

  .essay-deck {
    font-size: var(--font-size-md);
  }

  .essay-hero {
    margin: var(--space-xl) auto;
  }

  .essay-main-image {
    max-width: 100%;
  }

  .essay-content-longform {
    font-size: 1.0625rem;
    line-height: 1.75;
  }

  .essay-content-longform blockquote {
    font-size: 1.25rem;
  }
}

/* === END MATTER (in-this-essay + read-next) ===
   Both rails are apparatus, not new articles. They share the body's measure so
   the page ends on one column, and their headings are set down to a rubric size
   — the shared .section-header display size read as a second headline competing
   with the essay's own. Scoped here; .section-header itself is site-wide. */
.essay-mentions,
.read-next {
  max-width: 38rem;
  margin-inline: auto;
}

.essay-mentions .section-header,
.read-next .section-header {
  font-size: var(--font-size-lg);
}

/* === IN THIS ESSAY (essay → artist/writer cross-links) === */
.essay-mentions {
  margin-top: var(--space-2xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-divider);
}

.essay-mentions-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-lg);
}

.essay-mentions-item {
  margin: 0;
}

/* === READ NEXT — end-of-article essay rail ===
   Closes the dead end at the bottom of an essay. Image-forward rows that lead
   the eye onward to topically-related (then latest) essays. */
.read-next {
  margin-top: var(--space-2xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-divider);
}

.read-next-list {
  list-style: none;
  margin: var(--space-md) 0 0;
  padding: 0;
}

.read-next-item {
  border-bottom: 1px solid var(--color-divider);
}

.read-next-item:first-child {
  border-top: 1px solid var(--color-divider);
}

.read-next-link {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-md) 0;
  text-decoration: none;
}

.read-next-image {
  flex: 0 0 auto;
  width: 5.5rem;
  height: 5.5rem;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.read-next-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-xxs);
  min-width: 0;
}

.read-next-kicker {
  font-family: var(--font-ui);
  font-size: var(--font-size-xs);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--color-accent);
}

.read-next-title {
  font-family: var(--font-heading);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  line-height: 1.25;
  color: var(--color-heading);
  transition: color var(--transition-fast);
}

.read-next-link:hover .read-next-title,
.read-next-link:focus-visible .read-next-title {
  color: var(--color-accent);
}

.read-next-deck {
  font-size: var(--font-size-sm);
  line-height: var(--line-height-body);
  color: var(--color-subtle-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
