/* A daily issue of MindPattern, copied into the site by tools/newsletter/import.mjs. The front is the date, the note
   that says who wrote it, and the five top stories as a numbered list. Below that the section list stays put on the
   left and the issue reads down the right, as the privacy policy does. */

.ni-front { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: clamp(28px, 4vw, 72px); align-items: start; padding-bottom: clamp(40px, 5vw, 80px); }
.ni-head { --gap: 18px; }
/* The date stays on one line, so it reads as a dateline and not as a headline. */
.ni-head h1 { font-size: clamp(33px, 4vw, 72px); white-space: nowrap; }
.ni-head .kicker a { color: inherit; text-decoration-color: var(--faint); text-underline-offset: 0.2em; }
.ni-source { max-width: 38em; }
.ni-source a { color: var(--ink); text-underline-offset: 0.2em; }

/* The five top stories. Each row jumps to its story. */
.ni-lead .k-row { --cols: 2.6em minmax(0, 1fr); --cols-s: 2.4em minmax(0, 1fr); padding-block: clamp(12px, 1.1vw, 16px); }
.ni-lead .k-row b { font-size: clamp(18px, 1.45vw, 24px); font-weight: 500; line-height: 1.12; letter-spacing: -0.02em; text-wrap: balance; }
.ni-lead .k-row:hover { background: var(--raise); margin-inline: -12px; padding-inline: 12px; }

.ni-doc { padding-top: clamp(32px, 4vw, 64px); border-top: 1px solid var(--rule); }
.ni-prose h2 { margin-top: 2.2em; padding-top: 1em; border-top: 1px solid var(--rule); scroll-margin-top: 96px; }
.ni-prose h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.ni-prose h3 { scroll-margin-top: 96px; }
/* The issues are full of long names, paths and flags with no space to break at. They break wherever they must,
   so a phone never scrolls sideways. */
.ni-prose, .ni-lead, .ni-head { overflow-wrap: anywhere; }
.ni-prose code { font: 400 0.86em/1.3 var(--mono); }
/* Room for a two-digit number in front of a list item. */
.ni-prose ol { padding-left: 2.1em; }

.ni-pager { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; margin-top: clamp(48px, 6vw, 96px); padding-top: 18px; border-top: 1px solid var(--rule); }
.ni-pager > :last-child { justify-self: end; }

/* Narrow: the top stories sit under the date, and the section list sits above the issue with rows a thumb can hit. */
@media (max-width: 899px) {
  .ni-front { grid-template-columns: minmax(0, 1fr); }
  .ni-doc .k-toc a { align-items: center; min-height: 44px; font-size: 13px; }
}
@media (min-width: 600px) and (max-width: 899px) {
  .ni-doc .k-toc { grid-template-rows: repeat(6, auto); grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); column-gap: clamp(24px, 4vw, 48px); }
}
@media (max-width: 599px) {
  .ni-pager { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .ni-pager > :last-child { justify-self: start; }
}
