/* Records and standards: three topics, each on a raised card with a radiant icon tile, a dated
   status chip, what works today and what comes next, and its public source. The three tiles are
   the page's one static radiant list (brand.md §2): nothing else on the page is radiant.
   Shared parts (header, footer, page-top rhythm, lead, card, icon tile, link, motion) are in styles.css. */

/* ---------- Intro ---------- */
.standards-intro { max-width: 44rem; }
.intro-lead { max-width: 40rem; }

/* ---------- Topic cards ---------- */
.topic-list { display: grid; gap: 1.25rem; margin-top: 2.5rem; }
.topic {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem;
  padding: 1.5rem 1.5rem .75rem;
  overflow-wrap: break-word;
}

.topic-head { display: grid; justify-items: start; gap: 0; }
.topic-head h2 { margin-top: 1.25rem; }

/* Status: the shared status chip from the homepage queue (.chip .chip-muted), flat and tinted so
   it never looks like a button. Each label has its own glyph (clinic, flask, clock), so it is
   read by its words and its shape. Plum lettering, because the status is the topic's key fact.
   The reserved state inks are not used: none of these labels means saved, needs review or error. */
.maturity {
  display: flex; flex-direction: column; align-items: flex-start; gap: .5rem; margin-top: .75rem;
  font-size: var(--type-small); line-height: var(--leading-small); color: var(--ink-muted);
}
.status { color: var(--plum); }
.maturity time { font-variant-numeric: tabular-nums; }

/* Today and Next: two marked steps on a dotted track. The labels carry the meaning; the Poppy
   dot marks the next position in the sequence (brand.md §2). */
.steps { display: grid; gap: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--hairline); }
.step { position: relative; padding-left: 1.375rem; }
.step dt {
  display: flex; align-items: center; gap: .625rem;
  font: 700 var(--type-small)/var(--leading-small) var(--font-body); color: var(--plum);
}
.step dt::before {
  content: ""; position: absolute; left: 0; top: .375rem;
  width: .5rem; height: .5rem; border-radius: 50%;
}
.step-today dt::before { background: var(--plum); box-shadow: 0 0 0 3px rgb(48 36 67 / .12); }
.step-next dt::before { background: var(--poppy); box-shadow: 0 0 0 3px rgb(243 107 83 / .18); }
.step dd { margin-top: .375rem; max-width: 36rem; }
/* Phones: the track runs down from Today's dot to Next's. */
.step-today::after {
  content: ""; position: absolute; left: calc(.25rem - 1px); top: 1.25rem; bottom: -1.375rem;
  width: 2px; border-radius: 2px;
  background: repeating-linear-gradient(180deg, var(--divider) 0 3px, rgb(203 194 205 / 0) 3px 7px);
}

/* Source: a quiet link out (the shared .link-inline, so a long title wraps like text and the last
   word and the glyph never part), marked with a smaller, muted external glyph. */
.topic-source { margin-top: -.75rem; }
.source-link .icon {
  vertical-align: -.125rem;
  width: 1rem; height: 1rem; color: var(--ink-muted);
  transition: transform var(--dur-base) var(--ease-out), color var(--dur-quick) ease;
}
@media (hover: hover) {
  .source-link:hover .icon { color: var(--plum); transform: translate(2px, -2px); }
}

/* ---------- Tablet and small laptop: head as a row, Today and Next side by side ---------- */
@media (min-width: 48rem) {
  .topic-list { gap: 1.5rem; margin-top: 3rem; }
  .topic { padding: 2rem 2rem 1.25rem; gap: 1.75rem; }

  .topic-head { grid-template-columns: auto minmax(0, 1fr); column-gap: 1.25rem; align-items: center; }
  .topic-head .icon-tile { grid-row: 1 / span 2; align-self: start; }
  .topic-head h2 { margin-top: 0; }
  .maturity { flex-direction: row; flex-wrap: wrap; align-items: center; gap: .5rem .875rem; margin-top: .5rem; }

  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 3rem; padding-top: 1.75rem; }
  .step { padding-left: 0; }
  .step dt::before { position: static; flex: none; }
  /* Wide: the track runs across from Today to the Next dot. */
  .step-today::after { content: none; }
  .step-today dt::after {
    content: ""; flex: 1; height: 2px; margin-right: calc(-3rem + .875rem); border-radius: 2px;
    background: repeating-linear-gradient(90deg, var(--divider) 0 3px, rgb(203 194 205 / 0) 3px 7px);
  }
  .step dd { margin-top: .5rem; }
}

/* ---------- Wide: the topic, its status and its source on the left; the steps on the right ---------- */
@media (min-width: 80rem) {
  .standards-intro { max-width: none; }
  .topic {
    grid-template-columns: 19rem minmax(0, 1fr); grid-template-rows: auto 1fr;
    column-gap: 4rem; row-gap: 1rem;
    padding: 2.5rem;
  }
  .topic-head {
    grid-column: 1; grid-row: 1 / span 2; position: relative;
    display: flex; flex-direction: column; align-items: flex-start;
  }
  .topic-head h2 { margin-top: 1.375rem; }
  /* The date sits at the foot of the column, so it always shares a line with the source link,
     whichever half of the card is taller. */
  .maturity { flex: 1 0 auto; flex-direction: column; align-items: flex-start; margin-top: .875rem; }
  .maturity time { margin-top: auto; }
  /* A hairline between the two halves, centred in the column gap. */
  .topic-head::after {
    content: ""; position: absolute; top: 0; bottom: 0; right: -2rem; width: 1px;
    background: var(--hairline);
  }

  .steps { grid-column: 2; grid-row: 1; padding-top: 0; border-top: 0; }
  /* The source link's text shares a line with the date opposite it. */
  .topic-source { grid-column: 2; grid-row: 2; align-self: end; margin: 0 0 -.75rem; }
}
