/* ============================================================
   P.S. notes: short, dated pieces written when news breaks.
   A note is an essay page without the opener: the same 640px column of Georgia, links, chart card and end notes
   from essay.css. This file adds only the plain header (label, date, title, dek), the Related line, the
   disclaimer line, the horizontal bars a note's one chart is drawn with, and the /notes index.
   Every colour is a theme token, so all the themes hold, light and dark. Built by ~/ps-release/notes/build.py.
   ============================================================ */

/* ---------- the header: a label, the date, the title, one line of dek ---------- */
.n-page .n-open { padding: clamp(40px, 6vw, 88px) 0 0; margin: 0 0 clamp(36px, 4.6vw, 56px); }
.n-page .n-folio {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin: 0 0 clamp(16px, 2vw, 22px);
  font: var(--lbl-w) var(--lbl-s)/1.4 var(--sans); letter-spacing: var(--trk-s); text-transform: uppercase;
  color: var(--ink-2); font-variant-numeric: lining-nums tabular-nums; hanging-punctuation: none;
}
.n-page .n-folio .n-k { color: var(--bronze); }
.n-page .n-folio .n-draft { color: var(--ink); padding: 4px 8px 3px; border: 1px solid var(--hair-strong); border-radius: var(--r-paper); }
.n-page .n-open h1 {
  margin: 0; font: 400 clamp(32px, 4.4vw, 50px)/1.08 var(--serif); letter-spacing: -.02em;
  color: var(--ink); text-wrap: balance;
}
.n-page .n-open .n-dek {
  margin: clamp(14px, 1.8vw, 20px) 0 0; max-width: 34em;
  font: italic 400 var(--fs-lede)/1.5 var(--serif); color: var(--ink-2); text-wrap: pretty;
}

/* ---------- the one chart: horizontal bars from a zero line, drawn by build.py ---------- */
.n-page .chart-card .n-bar { fill: color-mix(in srgb, var(--ink) 74%, var(--paper)); }
.n-page .chart-card .n-bar[data-hl] { fill: var(--e-tone); }
.n-page .chart-card .n-zero { stroke: var(--hair-strong); stroke-width: 1; }
.n-page .chart-card .n-nil { fill: var(--paper); stroke: var(--ink-2); stroke-width: 1.5; }
.n-page .chart-card .n-val-nil { font-weight: 400; fill: var(--ink-2); }
.n-page .chart-card svg.chart-phone .chart-cat { font-size: 14px; }
.n-page .chart-card svg.chart-phone .chart-value { font-size: 14px; }

/* ---------- Related: one quiet line of links to the deep pages ---------- */
.n-page .n-rel {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px;
  margin: clamp(40px, 5vw, 56px) 0 0; padding-top: 14px; border-top: var(--hair-w) solid var(--hair);
  font: 400 16px/1.5 var(--sans);
}
.n-page .n-rel-h {
  margin: 0; font: var(--lbl-w) var(--lbl-s)/1.5 var(--sans); letter-spacing: var(--trk-s); text-transform: uppercase; color: var(--ink-2);
}
.n-page .n-rel-l { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 0; margin: 0; padding: 0; list-style: none; }
.n-page .n-rel-l li + li::before { content: "\00B7"; margin: 0 .6em; color: var(--ink-2); }
.n-page .pxe-essay .n-rel a { color: var(--ink); text-decoration: underline 1px var(--hair-strong); text-underline-offset: 4px; }
@media (hover: hover) { .n-page .pxe-essay .n-rel a:hover { text-decoration-color: currentColor; } }
@media (pointer: coarse) { .n-page .pxe-essay .n-rel a { display: inline-flex; align-items: center; justify-content: center; min-height: var(--tap); min-width: var(--tap); } }

/* ---------- Sources: the essay's numbered end notes, kept to the column ---------- */
.n-page .e-end.n-end { width: auto; margin: clamp(36px, 4.4vw, 48px) 0 0; }
.n-page .n-end .e-notes { columns: auto; }
.n-page .n-end .e-notes li { margin-bottom: 12px; }
/* the title of each source is the link; the date sits under it, so nothing trails a wrapped link */
.n-page .n-end .n-src-d { display: block; margin-top: 2px; font-size: 13px; color: var(--ink-2); }
/* on touch screens the link is a 44px band (the padding is taken back, so the list keeps its spacing) */
@media (pointer: coarse) {
  .n-page .n-end .e-notes li { display: flow-root; } /* keeps the link's negative margin inside, so the number stays level */
  .n-page .n-end .e-notes a { display: block; padding-block: 11px; margin-block: -11px; }
}

/* ---------- the disclaimer: one line, last ---------- */
.n-page .pxe-essay > .n-adv, .n-ix .n-adv {
  margin: clamp(28px, 3.6vw, 40px) 0 0; font: 400 14px/1.5 var(--sans); color: var(--ink-2);
  font-variant-numeric: lining-nums;
}

/* ============================================================
   THE INDEX (/notes): newest first, set like the essay contents, without plates or numbers
   ============================================================ */
.n-ix { max-width: 920px; margin: 0 auto; padding: clamp(40px, 6vw, 88px) var(--gutter) clamp(64px, 8vw, 112px); }
.n-ix-head h1 { margin: 0; font: 400 var(--fs-d2)/1.02 var(--serif); letter-spacing: -.026em; color: var(--ink); }
.n-ix-head .n-dek {
  margin: clamp(14px, 1.8vw, 20px) 0 0; max-width: 34em;
  font: italic 400 var(--fs-lede)/1.5 var(--serif); color: var(--ink-2); text-wrap: pretty;
}
.n-ix-bar {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 24px;
  margin-top: clamp(44px, 6vw, 72px); padding-bottom: 14px; border-bottom: 1px solid var(--ink);
  font: var(--lbl-w) var(--lbl-m)/1.4 var(--sans); letter-spacing: var(--trk-m); text-transform: uppercase; color: var(--ink-2);
  font-variant-numeric: lining-nums tabular-nums;
}
.n-list { margin: 0; padding: 0; list-style: none; }
.n-row {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: clamp(20px, 3vw, 40px);
  align-items: baseline; padding: 28px 0 30px; border-bottom: var(--hair-w) solid var(--hair);
  color: inherit; text-decoration: none;
}
.n-row::before {
  content: ""; position: absolute; inset: 0 calc(-1 * min(var(--gutter), 16px)); border-radius: var(--r-paper);
  pointer-events: none; box-shadow: inset 0 0 0 2px var(--focus); opacity: 0;
}
.n-row:focus-visible { outline: none; }
.n-row:focus-visible::before { opacity: 1; }
.n-row-t {
  font: 400 clamp(23px, 2.6vw, 30px)/1.18 var(--serif); letter-spacing: -.012em; color: var(--ink); text-wrap: balance;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; padding-bottom: .04em;
  box-decoration-break: clone; -webkit-box-decoration-break: clone;
  transition: background-size var(--d-2) var(--ease-out);
}
.n-row:hover .n-row-t, .n-row:focus-visible .n-row-t { background-size: 100% 1px; }
.n-row-k {
  display: block; margin-top: 10px; max-width: 60ch;
  font: italic 400 17px/1.55 var(--serif); color: var(--ink-2); text-wrap: pretty;
}
.n-row-d {
  white-space: nowrap; font: var(--lbl-w) var(--lbl-m)/1.6 var(--sans); letter-spacing: var(--trk-m); text-transform: uppercase;
  color: var(--ink); font-variant-numeric: lining-nums tabular-nums;
}
.n-empty { margin: clamp(36px, 4.6vw, 56px) 0 0; padding-top: 18px; border-top: var(--hair-w) solid var(--hair); font: italic 400 18px/1.5 var(--serif); color: var(--ink-2); }
@media (max-width: 640px) {
  .n-row { grid-template-columns: minmax(0, 1fr); row-gap: 8px; padding: 22px 0 24px; }
  .n-row-d { order: -1; }
  .n-row-k { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .n-row-t { transition: none; }
}
