/* Opens on --space-xl, the site-wide opening inset above the LOCKED 4.5rem
   header clearance.

   Do not zero this padding. .main-content under-reserves clearance for
   this page, so the last of this padding sits behind the fixed header — cut
   past --space-xl and the issue line starts losing air from the top rather
   than the visible gap closing. If the deck needs rebalancing, move
   the gap BELOW it (.home-hero's own padding) rather than cutting here. */
.home-main {
  max-width: 80rem;
  margin: 0 auto;
  padding: var(--space-xl) 1.5rem 4rem;
  color: var(--color-text);
}

/* The column ABOVE the full-bleed band: the masthead and the longform
   sections. No bottom padding: the band pays its own 3.5rem top margin plus
   3.5rem top padding, so the column's 4rem would stack into ~7.5rem of dead
   space. Same reasoning as --lower, mirrored. */
.home-main--upper {
  padding-bottom: 0;
}

/* The column below the full-bleed band. The band supplies its own generous
   vertical padding, so this side doesn't re-pay for it at the top. */
.home-main--lower {
  padding-top: 0;
}

/* The section label bar is a SHARED component and now lives in
   base_styles/components.css (.section-bar) — the artist page's influence
   ledger uses it too, and page_styles/index.css is not loaded there. */

/* First section sits right under the short hero deck, so it needs less
   breathing room above than the section-to-section rhythm below. Keep this
   gap tighter than the space above the deck so the deck reads as balanced. */
.home-hero + section .section-bar {
  margin-top: 1.25rem;
}

/* Small-caps label above individual pieces of content */
.home-kicker {
  display: block;
  font-family: var(--font-content);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  color: var(--color-heading-muted);
  margin: 0 0 0.5rem;
}

/* === HERO / MASTHEAD DECK ===
   The site name lives in the nav masthead; the hero is a single quiet
   deck line. No headline, no CTA button here. */
.home-hero {
  text-align: center;
  padding: 0.5rem 1rem 0;
  max-width: 46rem;
  margin: 0 auto;
}

/* Issue line: small-caps accent credit above the masthead. */
.home-hero-issue {
  text-wrap: balance;
  font-family: var(--font-ui);
  font-size: 0.6875rem;
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps-wide);
  color: var(--color-accent);
  margin: 0 0 var(--space-md);
}

/* Newsreader runs lighter than the Playfair this replaced, so the masthead is
   set a step larger and tracked tighter to keep the same presence. */
.home-hero-headline {
  font-family: var(--font-heading);
  font-weight: var(--font-weight-bold);
  color: var(--color-heading);
  font-size: clamp(2rem, 6.5vw, 4.125rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin: 0 0 var(--space-md);
}

/* Each sentence gets its own line so the second sentence never dangles a
   single word onto its own wrapped row. */
.home-hero-headline-line {
  display: block;
}

.home-hero-deck {
  font-style: italic;
  color: var(--color-subtle-text);
  font-size: clamp(1.15rem, 2.2vw, 1.4rem);
  line-height: 1.4;
  margin: 0;
}

/* Masthead signup: the page's one ask, directly under the deck. Kept to a
   modest width so the form reads as part of the masthead, not a banner.
   Mobile (below) releases it to full width. */
.home-hero-signup {
  max-width: 30rem;
  margin: var(--space-lg) auto 0;
}

/* The shared form row is left-aligned; in the centered masthead the button
   (which wraps under the input on a phone) centers with everything else. */
.home-hero-signup .nl-form-row {
  justify-content: center;
}

.home-hero-signup-line {
  text-wrap: balance;
  font-family: var(--font-ui);
  font-size: var(--font-size-sm);
  color: var(--color-subtle-text);
  margin: 0 0 var(--space-xs);
}

/* Empty-section note (e.g. before the first recommendation or interview). */
.home-section-note {
  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: 40rem;
  margin: 0 0 var(--space-sm);
}

/* === DAILY GAME HOOK === */
.home-game-deck {
  color: var(--color-subtle-text);
  font-size: 1.1rem;
  line-height: 1.5;
  margin: 0 0 1.25rem;
  max-width: 40rem;
}

/* Squared, not pill-rounded: a printed block of ink rather than a web button.
   Overrides .button's radius and sizing from components.css. */
.home-game-cta {
  display: inline-block;
  border-radius: 0;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  padding: 0.8rem 1.6rem;
}

/* === GENRE-FIRST INFLUENCE GRAPH (FULL-BLEED BAND) ===
   The one place the homepage changes ground. It is a SIBLING of .home-main,
   not a child, so it is full-width structurally: no 100vw (which counts the
   scrollbar and causes horizontal scroll) and no negative margins to unwind at
   each breakpoint. The inner wrapper re-establishes the reading column. */
.genre-hero {
  background: var(--palette-ink);
  color: var(--text-light);
  padding: 3.5rem 0 3rem;
  margin: 3.5rem 0 0;
}

/* Same fix as the artist page's ledger band: the .section-bar that opens this
   band carries a shared 3.5rem TOP margin for separating sections on the paper
   ground, which stacked on the band's own 3.5rem padding into ~7rem of black
   above the rule. The band's padding is the separation; the bar's bottom margin
   stays so the rule keeps its gap above the headline. */
.genre-hero .section-bar {
  margin-top: 0;
}

.genre-hero-inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* The shared .section-bar carries a 3.5rem top margin to separate sections on
   the paper ground. Inside the band that stacks on the band's own 3.5rem top
   padding, leaving ~7rem of empty black above the red rule. The band's padding
   already does that job, so the bar's margin is dropped here. */
.genre-hero .section-bar {
  margin-top: 0;
}

/* Headline + deck on the left, the citation credential on the right. */
.genre-hero-lede {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20rem;
  gap: var(--space-2xl);
  align-items: start;
  margin-bottom: var(--space-xl);
}

.genre-hero-headline {
  font-family: var(--font-heading);
  font-weight: var(--font-weight-bold-heading);
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  line-height: 1.06;
  letter-spacing: -0.015em;
  color: var(--text-light);
  margin: 0 0 var(--space-sm);
}

.genre-hero-deck {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.55;
  margin: 0;
  max-width: 36rem;
}

/* The citation credential. Set as a figure, not a footnote: this is the claim
   that separates a hand-built, sourced graph from a scrape. */
.genre-hero-stat {
  border-left: 1px solid var(--palette-neutral-700);
  padding-left: var(--space-xl);
}

.genre-hero-stat-figure {
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: var(--font-weight-bold);
  line-height: 1;
  color: var(--text-light);
  margin: 0;
}

.genre-hero-stat-label {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  color: var(--text-muted);
  margin: var(--space-xs) 0 0;
}

.genre-hero-stat-note {
  font-family: var(--font-content);
  font-style: italic;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin: var(--space-md) 0 0;
}

/* The absolute claim gets the accent tint; the partial fallback stays muted. */
.genre-hero-stat-note--complete {
  font-style: normal;
  color: var(--color-accent-on-dark);
}

.genre-hero-stat-note-figure {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-accent-on-dark);
}

/* === THE LINEAGE LEDGER (the band's body) ===
   Replaced .genre-network-graph (a d3 force layout) and .genre-hero-readout
   (its sr-only genre fallback). Rows stack, so a subject with 73 connections
   reads the same as one with 7 and overlap is impossible by construction. This
   is the homepage's crawlable influence content: it is never hidden, clamped,
   or injected. See docs/homepage-ledger-plan.md. */
.lineages {
  border-top: 1px solid var(--palette-neutral-700);
  margin-top: var(--space-xl);
}

/* Each lineage is a three-part row: the anchored subject block, then the two
   sides. The sides share a track so the "influenced by" and "influenced"
   columns line up down the whole band rather than per row. */
.lineage {
  display: grid;
  grid-template-columns: minmax(0, 14rem) minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-md) var(--space-xl);
  align-items: start;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--palette-neutral-800);
}

.lineage:last-child {
  border-bottom: none;
}

/* The subject block: name and degree together behind one accent rule. The rule
   is what gives the row a head — the three columns otherwise read as equals,
   because every one of them is a list of names. */
.lineage-subject {
  grid-row: 1;
  grid-column: 1;
  border-left: 2px solid var(--color-accent);
  padding-left: var(--space-md);
}

.lineage-name {
  font-family: var(--font-heading);
  font-weight: var(--font-weight-bold-heading);
  font-size: 1.875rem;
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin: 0;
}

/* On the dark band, links take the light colour rather than the page-ground
   link colour they would otherwise inherit. */
.lineage-name .heading-link {
  color: var(--text-light);
}

.lineage-name .heading-link:hover,
.lineage-name .heading-link:focus-visible {
  color: var(--color-accent-on-dark);
}

/* The degree sits under the name, not beside it: it is context for the row,
   and the sides are capped, so this is what keeps the row honest about how
   much is not being shown. */
.lineage-degree {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  color: var(--text-muted);
  margin: var(--space-xs) 0 0;
}

.lineage-degree-figure {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-accent-on-dark);
  letter-spacing: 0;
}

/* Placed by an explicit modifier, never :nth-of-type. The subject block is a
   sibling div, so a positional selector counts it and silently swaps the two
   columns — which reverses the meaning of every row on the page. */
.lineage-side {
  grid-row: 1;
}

.lineage-side--in {
  grid-column: 2;
}

.lineage-side--out {
  grid-column: 3;
}

/* Label and count match the artist ledger's pair: the wider tracking on the
   label marks it as the heading of the two. */
.lineage-side-label {
  font-family: var(--font-ui);
  font-size: 0.66rem;
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps-wide);
  color: var(--text-muted);
  margin: 0 0 var(--space-xxs);
}

.lineage-side-count {
  font-family: var(--font-ui);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  color: var(--palette-neutral-650);
  margin: 0 0 var(--space-sm);
}

.lineage-names {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* A row, not a line of text. The hairline and the connector rule are what make
   each side read as a list of connections rather than a paragraph of names;
   both are lifted from the artist ledger's row, which is the treatment this
   band was missing. */
.lineage-name-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) 0;
  border-bottom: 1px solid var(--palette-neutral-800);
}

.lineage-name-item:last-child {
  border-bottom: none;
}

/* The connector: a short accent rule leading into the name. */
.lineage-name-rule {
  width: 1.375rem;
  height: 1px;
  background: var(--color-accent);
  flex: none;
}

/* Set in the headline serif, like the artist ledger's rows. A step smaller
   than that page's 1.25rem because the band runs two of these columns beside a
   subject rather than one. */
.lineage-name-link {
  font-family: var(--font-heading);
  color: var(--text-light);
  text-decoration: none;
  font-size: 1.1rem;
  line-height: 1.2;
}

.lineage-name-link:hover,
.lineage-name-link:focus-visible {
  color: var(--color-accent-on-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* The citation: a mark, not a word. Nearly every source is an "Article", so the
   type label repeated down 40 rows was noise; the artist page still spells it
   out, where there is one subject and the type varies. Drawn as a ring rather
   than a bullet glyph — a bare dot beside a name reads as a typo — and pushed
   to the row's end so the marks form their own column. */
.lineage-cite {
  flex: none;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  /* The mark is 7px; the padding is what makes it tappable. Negative vertical
     margin keeps that hit area from setting the row's height. */
  padding: var(--space-sm) var(--space-xs);
  margin-top: calc(var(--space-sm) * -1);
  margin-bottom: calc(var(--space-sm) * -1);
}

.lineage-cite-mark {
  width: 0.4375rem;
  height: 0.4375rem;
  border: 1px solid var(--palette-neutral-650);
  border-radius: var(--radius-round);
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.lineage-cite:hover .lineage-cite-mark,
.lineage-cite:focus-visible .lineage-cite-mark {
  border-color: var(--color-accent-on-dark);
  background: var(--color-accent-on-dark);
}

/* The overflow link points at the subject's own page, where the uncapped
   ledger lives, rather than expanding in place. Below the list, not a final
   row in it: wearing a connector rule and a hairline it read as a connection,
   which it is not. */
.lineage-more {
  display: inline-block;
  margin-top: var(--space-sm);
  font-family: var(--font-ui);
  font-size: 0.68rem;
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  color: var(--color-accent-on-dark);
  text-decoration: none;
}

.lineage-more:hover,
.lineage-more:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* === READING & LISTENING (lede + rail) === */
.lede-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
}

.lede-rail {
  border-left: 1px solid var(--color-light-gray);
  padding-left: 2.5rem;
}

.lede-image-link {
  display: block;
}

.lede-image {
  width: auto;
  max-width: 100%;
  max-height: 30rem;
  display: block;
  margin-bottom: 1rem;
}

.lede-headline {
  font-size: clamp(1.75rem, 3vw, 2.4rem);
  line-height: 1.15;
  margin: 0.25rem 0 0.75rem;
}

.lede-deck {
  font-style: italic;
  font-size: 1.1rem;
  color: var(--color-gray-text);
  margin: 0 0 0.75rem;
}

.lede-byline {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  color: var(--color-subtle-text);
  margin: 0 0 1rem;
}

.lede-main > p:last-child {
  margin-bottom: 0;
}

/* Rail: latest essays. No top border or margin: this is the first thing in
   the rail, whose own top border (phone) or left rule (desktop) separates it. */
.rail-latest {
  margin-top: 0;
}

.rail-latest-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rail-latest-item {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--color-divider);
}

.rail-latest-link {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.3;
  color: var(--color-heading);
  text-decoration: none;
}

.rail-latest-link:hover {
  text-decoration: underline;
  color: var(--color-accent);
}

.rail-latest-date {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  color: var(--color-subtle-text);
  margin-top: 0.3rem;
}

/* === PLAYLISTS (standalone homepage block) ===
   A simple cover-art row. The spotlight playlist leads; the view excludes it
   from `latest_playlists` so no cover appears twice. */
/* Wide and image-forward, separated by vertical rules rather than gutters:
   the newspaper convention. The rule sits on each item's left edge, suppressed on the first. */
.home-playlists-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
}

/* The rule is drawn as a left border on each item. A wrapped row would leave a
   stray rule hanging at the start of the new line, so instead of :first-child
   the grid is given an explicit 4-up track at desktop (the homepage shows the
   spotlight plus three) and the 1st/5th/9th item clears its border. Below
   --bp-phone the rules are dropped entirely; see the responsive block. */
.home-playlist-item {
  padding: 0 var(--space-lg);
  border-left: 1px solid var(--color-divider);
}

/* The row-leading item drops its rule and its left padding so the block starts
   flush with the section bar. The tracks are equal width, so that reclaimed
   gutter moves to the right padding: otherwise the first cover renders one
   gutter wider than the other three. */
.home-playlist-item:nth-child(4n + 1) {
  padding-left: 0;
  padding-right: calc(var(--space-lg) * 2);
  border-left: none;
}

.home-playlist-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.home-playlist-image {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  margin-bottom: var(--space-sm);
}

.home-playlist-title {
  display: block;
  font-family: var(--font-heading);
  font-weight: var(--font-weight-bold-heading);
  font-size: 1.05rem;
  line-height: var(--line-height-tight);
  color: var(--color-heading);
}

.home-playlist-link:hover .home-playlist-title {
  text-decoration: underline;
}

/* === RESPONSIVE === */
@media (max-width: 54rem) { /* --bp-phone */
  /* Two-up covers with the vertical rules dropped: at this width the rules
     read as clutter, and gutters separate the covers perfectly well. */
  .home-playlists-grid {
    grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
    gap: var(--space-md);
  }

  .home-playlist-item,
  .home-playlist-item:nth-child(4n + 1) {
    padding: 0;
    border-left: none;
  }

  /* Wide tracking eats the line on a narrow screen and forces an ugly wrap. */
  .home-hero-issue {
    font-size: 0.625rem;
    letter-spacing: 0.16em;
  }

  /* The band keeps its full-bleed ground but tightens vertically, and the
     lede stacks so the credential sits under the text rather than beside it. */
  .genre-hero {
    padding: 2rem 0;
    margin-top: 2.5rem;
  }

  .genre-hero-inner {
    padding: 0 1rem;
  }

  .genre-hero-lede {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .genre-hero-stat {
    border-left: none;
    border-top: 1px solid var(--palette-neutral-700);
    padding-left: 0;
    padding-top: var(--space-lg);
  }

  .genre-hero-stat-figure {
    font-size: 2.5rem;
  }

  .home-main {
    padding: 1.75rem 1rem 3rem;
  }

  /* The shorthand above re-sets all four sides, so both modifiers have to be
     restated here or the desktop rules lose to it at phone width. */
  .home-main--upper {
    padding-bottom: 0;
  }

  .home-main--lower {
    padding-top: 0;
  }

  .home-hero-signup {
    max-width: none;
  }

  .home-hero {
    padding-top: 1rem;
  }

  /* .section-bar's own phone rules live with the component in
     base_styles/components.css. */

  .lede-grid {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  .lede-rail {
    border-left: none;
    padding-left: 0;
    border-top: 1px solid var(--color-light-gray);
    padding-top: 1.75rem;
  }

  /* Lineages stack to one column. The three-track desktop grid puts the two
     sides side by side, which is unreadable at phone width; stacked, the row
     reads top to bottom as the subject block, then each side in turn. No
     special handling beyond this, which is the whole reason a ledger beat a
     graph. */
  .lineage {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  .lineage-subject,
  .lineage-side,
  .lineage-side--in,
  .lineage-side--out {
    grid-row: auto;
    grid-column: 1;
  }

  /* Compact band on phones: stacked in full, the lineages run about six
     screens, so each row shows only its subject and connection count, which
     links to the full ledger on that subject's page.

     Hidden with CSS, NEVER sliced: every name stays in the DOM at every
     viewport, so crawlers and desktop readers get the same links. Do not
     "simplify" this by trimming the list in the template or the service.
     Rows are not cut either, because the writer rows come last and cutting
     them would undo the equal weighting of music and books. */
  .lineage-side {
    display: none;
  }

  .lineage {
    gap: 0;
  }

  /* The subject name drops a step: 1.875rem is a desktop size, and at 390px it
     wraps a long name onto three lines. */
  .lineage-name {
    font-size: 1.625rem;
  }

  .lineage-subject {
    padding-left: 0.875rem;
  }

  /* The connector shortens so a long name keeps its own width on a narrow
     column, and the rows grow to a comfortable tap target. */
  .lineage-name-rule {
    width: 1rem;
  }

  .lineage-name-item {
    gap: var(--space-xs);
    padding: 0.5rem 0;
  }

  /* The overflow link is a real tap target on a phone. */
  .lineage-more {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
}
