/* home — hero, LATEST list (home.js; index.hbs + home-row.hbs) */

/* the shared mono-label voice: row keys and the LATEST head */
.b-latest .row-key,
.b-latest > header h2 {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

/* the hero stands on every width */
@scope (.b-home-hero) {
  :scope {
    padding-block: clamp(3rem, 8vi, 5.5rem) 0;
    text-align: center;
    /* small phones: tighter top padding */
    @media (width <= 360px) {
      padding-block-start: 2.5rem;
    }
  }
  h1 {
    color: var(--text-primary);
    font-size: clamp(2.25rem, 5.5vi, 3.5rem);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -0.02em;
    text-wrap: balance;
    @media (width <= 360px) {
      font-size: 2rem;
    }
    /* a hyphenated compound stays whole where the line wraps */
    span {
      white-space: nowrap;
    }
  }
  /* the subtitle: a 52ch measure centered under the h1, balanced into two even lines */
  p {
    max-inline-size: 52ch;
    margin-block-start: 1.5rem;
    margin-inline: auto;
    font-size: 1.125rem;
    color: var(--text-tertiary);
    text-wrap: balance;
  }
}

/*** index.hbs + home-row.hbs — the LATEST list ***/
@scope (.b-latest) {
  :scope {
    /* the list sits in the hero's 48rem measure: two cells at full width left the end edge empty */
    inline-size: 100%;
    max-inline-size: 48rem;
    margin-inline: auto;
    /* the bottom is the sections' shared footer clamp */
    margin-block: clamp(3.5rem, 8vi, 5.5rem) clamp(4rem, 8vi, 6rem);
  }
  :scope > header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding-block-end: 0.875rem;
    border-block-end: 1px solid var(--border-secondary);
  }
  /* the head word stands in brand: the list's one label, no control */
  :scope > header h2 {
    color: var(--text-brand-secondary);
  }
  /* the list owns the tracks; rows are subgrid items, so columns align down the list */
  ol {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    /* a fixed key gutter and the title; both tracks are content-independent, so columns hold still across views */
    grid-template-columns: 10.5rem minmax(0, 1fr);
    column-gap: 1.5rem;
  }
  /* one row per container page; the whole row is the door: the title link's ::after covers it, so a right click and a new-tab click reach the link */
  .latest-row {
    position: relative;
    --row-pad: 1.25rem;
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: subgrid;
    align-items: center;
    padding-block: var(--row-pad);
    /* pill wings for the hover ground; zeroed on phones */
    padding-inline: 0.5rem;
    margin-inline: -0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.15s ease;
  }
  .latest-row .row-title a::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
  }
  /* ONE ground for the WHOLE row — never per-column pieces */
  .latest-row:hover {
    background-color: color-mix(in srgb, var(--fg-quaternary) 7%, transparent);
  }
  /* the key cell holds the SOLUTIONS label, a plain word */
  .row-key {
    color: var(--text-tertiary);
    min-inline-size: 0;
    display: flex;
    align-items: baseline;
  }
  .row-title {
    font-size: 1.0625rem;
    font-weight: 700;
    line-height: 1.35;
  }
  .row-title a {
    display: inline-block;
    padding-block: 0.25rem;
    margin-block: -0.25rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.15s ease;
  }
  /* the title lifts on its own hover only; the row's ground answers everywhere */
  .row-title a:hover {
    color: var(--text-brand-secondary);
  }
  /* ---- the key label ---- */
  .row-entity {
    display: inline-block;
    max-inline-size: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  /* phones: key over title; the head stays, the first row's own line stands in for its hairline */
  @media (width <= 44rem) {
    :scope {
      margin-block: 1.25rem 3rem;
    }
    :scope > header {
      border-block-end: 0;
      padding-block-end: 0.5rem;
    }
    /* every row draws its own top line */
    .latest-row {
      border-block-start: 1px solid var(--border-secondary);
    }
    .latest-row {
      --row-pad: 1rem;
      display: flex;
      flex-wrap: wrap;
      align-items: baseline;
      row-gap: 0.375rem;
      column-gap: 0.5rem;
      /* the stacked rows carry no pill wings */
      padding-inline: 0;
      margin-inline: 0;
    }
    /* the key leads on its own line, the title owns the next */
    .row-key,
    .row-title {
      flex-basis: 100%;
    }
  }
}
