/* Writing index in three tiers (design/evolution/README.md, Writing 2; no
   frames since Writing 3). The newest two pieces lead; the next four
   are smaller, their gardens lit at dusk; everything older is words only, by year. Each piece is the
   Writing piece in site.css: its picture on the page with no frame, its caption below. */

.writing-index { max-width: 1440px; }
.wi-rows .tag { padding: 0 6px; border: 1px dashed var(--hair-2); border-radius: 3px; }

/* Tier 1: the newest two. */
.wi-lead { display: grid; gap: 56px; margin-top: 56px; }
.wi-lead .wi-piece .t { font-size: 24px; line-height: 1.2; font-weight: 350; letter-spacing: -0.012em; }
.wi-lead .wi-piece .s { font-size: 15px; max-width: 34em; }
.wi-lead .wi-piece.over .t { font-family: var(--font-display); font-size: 32px; line-height: 1.08; font-weight: 300; letter-spacing: -0.024em; }
.wi-lead .wi-piece.over .s { font-size: 16px; }
@media (min-width: 1100px) {
  /* The two pieces line up on their words, not their pictures: each piece takes two rows of the lead's
     grid (picture, caption) by subgrid, the smaller picture sits on the latest's bottom edge, and both
     captions start on one line, flush with their pictures. The pictures fade before every edge, so
     their tops not matching does not show; the words are the only hard edge. */
  .wi-lead { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); grid-template-rows: auto auto; gap: 0 48px; margin-top: 48px; }
  /* The latest's render keeps a quarter of empty ground below its garden, made for a caption over
     it; with the caption below, that band is cropped, so its title and standfirst finish inside
     the first screen at 1440 by 900. The mask still fades every edge. */
  .wi-lead .wi-piece.over .wi-pic { aspect-ratio: 1200 / 454; }
  .wi-lead .wi-piece.over .wi-pic img { object-position: 50% 14%; }
  .wi-lead .wi-piece.over .wi-pic.is-card { aspect-ratio: 1200 / 630; }
  .wi-lead .wi-piece { display: grid; grid-row: span 2; grid-template-rows: subgrid; }
  .wi-lead .wi-piece .wi-pic { align-self: end; }
  .wi-lead .wi-piece .wi-cap { align-self: start; margin-top: 8px; }
  .wi-lead .wi-piece.over .wi-pic::after { display: none; }
  .wi-lead .wi-piece.over .wi-cap { margin-top: 8px; padding: 0 12% 0 0; }
  /* The latest's title takes the Apps lead's size and holds to two lines: at most about 60 characters. */
  .wi-lead .wi-piece.over .t { font-size: 48px; max-width: 17em; }
  .wi-lead .wi-piece.over .s { font-size: 18px; }
}

/* Tier 2: the next four, smaller, their gardens at dusk. */
.wi-earlier { margin-top: 104px; }
.wi-grid { display: grid; gap: 40px; margin-top: 20px; }
.wi-grid .t { font-size: 19px; line-height: 1.22; font-weight: 380; letter-spacing: -0.01em; }

/* Light: dark type on the light page reads thinner, so every title takes about 100 more weight. */
:root[data-theme="light"] .wi-lead .wi-piece .t { font-weight: 440; }
:root[data-theme="light"] .wi-lead .wi-piece.over .t { font-weight: 400; }
:root[data-theme="light"] .wi-grid .t { font-weight: 460; }
/* On hover a title takes the Line colour, but on bone Line is all but Ink and the change does not show;
   Ink with a third of Ink 2 moves about as far to the eye as the dark's does (13.3:1 on the page). */
@media (hover: hover) { :root[data-theme="light"] a.wi-piece:hover .t { color: color-mix(in srgb, var(--ink) 65%, var(--ink-2)); } }
.wi-grid .s { font-size: 14px; }
@media (min-width: 700px) { .wi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; } }
@media (min-width: 1100px) { .wi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ------------------------------------------------------------------ tier 3: by year, words only */
.wi-archive { margin-top: 104px; display: grid; gap: 56px; }
.wi-year { display: grid; gap: 14px; }
.wi-year > h2 { margin: 0; }
.wi-rows { border-top: 1px solid var(--hair); }
.wi-rows .row { display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 16px; row-gap: 4px; padding: 18px 0 20px; border-bottom: 1px solid var(--hair); }
.wi-rows time { grid-row: 1 / span 3; font-family: var(--font-label); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); padding-top: 5px; }
.wi-rows .t { font-size: 18px; line-height: 1.3; }
.wi-rows .s { font-size: 14px; color: var(--ink-2); text-wrap: pretty; }
.wi-rows .am { display: flex; flex-wrap: wrap; gap: 4px 0; margin-top: 4px; font-family: var(--font-label); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.wi-rows .am > :not(:first-child)::before { content: "·"; margin: 0 0.6em; }
.wi-rows .am .tag { margin-left: 0.8em; }
.wi-rows .am .tag::before { content: none; }
/* Revised: the one mark an older piece can carry, on its own line. Ink, not blue: it is a fact
   about the page, not data. */
.wi-rows .am .rev { order: 9; flex-basis: 100%; margin-top: 2px; color: var(--ink); }
.wi-rows .am .rev::before { content: none; }
@media (min-width: 900px) {
  .wi-year { grid-template-columns: 160px minmax(0, 1fr); column-gap: 32px; align-items: start; max-width: 1060px; }
  .wi-year > h2 { padding-top: 21px; }
  .wi-rows .row { grid-template-columns: 72px minmax(0, 1fr) 260px; column-gap: 28px; padding: 20px 0 22px; }
  .wi-rows time { grid-row: 1 / span 2; }
  .wi-rows .t { grid-column: 2; font-size: 20px; }
  .wi-rows .s { grid-column: 2; font-size: 15px; max-width: 38em; }
  .wi-rows .am { grid-column: 3; grid-row: 1 / span 2; margin-top: 0; padding-top: 5px; align-content: start; }
}

.writing-index .page-next { margin-top: 96px; }

