/* XEL — THE DAILY SHELL (news.html).
   old-newspaper-meets-cosmic-glass: a broadsheet typeset on a glass panel.
   thin rules, columned body copy, small-caps section labels, all in the
   token palette. builds on pages.css (page scaffold, reveal, footer).
   a full @media print block at the bottom turns the paper into paper. */

/* ---------- the sheet ---------- */

.np-main { width: min(94vw, 920px); }

.np-sheet {
  background: var(--panel-bg);
  backdrop-filter: blur(var(--panel-blur));
  -webkit-backdrop-filter: blur(var(--panel-blur));
  border: 1px solid var(--panel-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-pop);
  padding: 1.9rem clamp(1.1rem, 4vw, 2.6rem) 1.6rem;
  margin-bottom: 1.4rem;
}

/* ---------- masthead ---------- */

.np-masthead {
  text-align: center;
  border-bottom: 4px double rgba(157, 123, 255, 0.55);
  padding-bottom: 0.85rem;
  margin-bottom: 1.5rem;
}

.np-ears {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem;
  margin: 0 0 0.4rem;
}

.np-ear,
.np-eyebrow {
  font-family: var(--font-display);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.np-eyebrow { flex: 1; text-align: center; color: var(--ink-dim); }
.np-ear { flex: 0 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.np-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.2rem, 8vw, 4.1rem);
  line-height: 1.02;
  letter-spacing: 0.045em;
  margin: 0.1rem 0 0.35rem;
  color: var(--ink);
  text-shadow: 0 0 34px rgba(125, 249, 224, 0.22);
}

.np-dateline {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.15rem 0.6rem;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-dim);
  border-top: 1px solid rgba(157, 123, 255, 0.35);
  padding-top: 0.55rem;
  margin: 0;
}

.np-dl-sep { color: var(--ink-faint); }

/* ---------- sections & rules ---------- */

.np-sec { padding: 1.15rem 0 0.4rem; }

.np-sec-label {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: 0 0 0.85rem;
}

.np-sec-label::before,
.np-sec-label::after {
  content: '';
  flex: 1;
  border-top: 1px solid rgba(157, 123, 255, 0.35);
}

.np-sec-label-text {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--seafoam);
  white-space: nowrap;
}

.np-para { margin: 0.5rem 0; color: var(--ink-dim); font-size: 0.96rem; line-height: 1.65; }

.np-fine {
  margin: 0.7rem 0 0;
  font-size: 0.74rem;
  font-style: italic;
  color: var(--ink-faint);
  line-height: 1.5;
}

/* ---------- front page ---------- */

.np-lead-hed {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.5rem, 4.6vw, 2.3rem);
  line-height: 1.16;
  letter-spacing: 0.01em;
  color: var(--ink);
  margin: 0 0 0.45rem;
  text-wrap: balance;
}

.np-deck {
  font-size: 1.02rem;
  font-style: italic;
  color: var(--ink-dim);
  margin: 0 0 0.4rem;
  line-height: 1.5;
}

.np-byline {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border-top: 1px solid rgba(157, 123, 255, 0.25);
  border-bottom: 1px solid rgba(157, 123, 255, 0.25);
  padding: 0.3rem 0;
  margin: 0.5rem 0 0.8rem;
}

/* proper newspaper columns on desktop, single on mobile */
.np-columns {
  columns: 2;
  column-gap: 2.1rem;
  column-rule: 1px solid rgba(157, 123, 255, 0.25);
}

.np-columns .np-para { margin-top: 0; break-inside: avoid; }
.np-columns .np-para:first-child::first-letter {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.6em;
  line-height: 0.85;
  float: left;
  padding: 0.06em 0.14em 0 0;
  color: var(--seafoam);
}

.np-subheds {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  border-top: 1px solid rgba(157, 123, 255, 0.3);
  margin-top: 1.05rem;
  padding-top: 0.95rem;
}

.np-subhed-hed {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.12rem;
  line-height: 1.3;
  color: var(--ink);
  margin: 0 0 0.3rem;
  text-wrap: balance;
}

.np-subhed-deck { font-size: 0.86rem; margin: 0; color: var(--ink-faint); }

/* ---------- the lower grid ---------- */

.np-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  column-gap: 2.1rem;
  border-top: 3px double rgba(157, 123, 255, 0.45);
  margin-top: 1.1rem;
}

.np-grid .np-sec { border-top: 1px solid rgba(157, 123, 255, 0.22); }
.np-grid .np-sec:nth-child(-n + 2) { border-top: none; }

/* ---------- the local desk ---------- */

.np-local-tag {
  font-family: var(--font-display);
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-align: center;
  color: var(--bg-deep);
  background: linear-gradient(135deg, var(--seafoam), var(--cyan));
  border-radius: var(--r-pill);
  padding: 0.26rem 0.8rem;
  margin: -0.2rem 0 0.8rem;
}

.np-local-lede { color: var(--ink-dim); }
.np-local-empty, .np-local-archival { font-style: italic; color: var(--ink-faint); }

.np-briefs { list-style: none; margin: 0.6rem 0 0; padding: 0; }

.np-brief {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  padding: 0.42rem 0;
  border-top: 1px dashed rgba(157, 123, 255, 0.2);
  font-size: 0.9rem;
  color: var(--ink-dim);
  line-height: 1.5;
}

.np-brief-icon {
  flex: 0 0 auto;
  filter: drop-shadow(0 0 6px rgba(125, 249, 224, 0.4));
}

.np-mini-label {
  font-family: var(--font-display);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0.9rem 0 0.2rem;
}

.np-wx-line { margin: 0.25rem 0; font-size: 0.88rem; }

/* ---------- classifieds ---------- */

.np-ad-list { list-style: none; margin: 0; padding: 0; }

.np-ad {
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--ink-dim);
  padding: 0.5rem 0.1rem;
  border-top: 1px dotted rgba(157, 123, 255, 0.3);
}

.np-ad:first-child { border-top: none; padding-top: 0.1rem; }

.np-ad::first-line {
  font-family: var(--font-display);
  letter-spacing: 0.02em;
}

/* ---------- the jazz charts ---------- */

.np-chart-note { font-size: 0.84rem; font-style: italic; color: var(--ink-faint); margin: 0 0 0.6rem; line-height: 1.5; }

.np-chart { list-style: none; margin: 0; padding: 0; counter-reset: none; }

.np-chart-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.1rem;
  border-top: 1px dashed rgba(157, 123, 255, 0.2);
}

.np-chart-row:first-child {
  border-top: none;
  background: linear-gradient(90deg, rgba(255, 214, 107, 0.09), transparent 80%);
  border-radius: var(--r-sm);
}

.np-chart-pos {
  flex: 0 0 1.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  text-align: center;
  color: var(--gold);
  text-shadow: 0 0 14px rgba(255, 214, 107, 0.4);
}

.np-chart-meta { display: flex; flex-direction: column; min-width: 0; }

.np-chart-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
  overflow-wrap: anywhere; /* taught words are user input */
}

.np-chart-artist { font-size: 0.76rem; color: var(--ink-faint); }

.np-chart-move {
  margin-left: auto;
  flex: 0 0 auto;
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--cyan);
  white-space: nowrap;
}

/* ---------- weather in the void ---------- */

.np-wx-days { display: flex; flex-direction: column; }

.np-wx-day {
  display: grid;
  grid-template-columns: 5.2rem 1fr auto;
  gap: 0.7rem;
  align-items: baseline;
  padding: 0.5rem 0.1rem;
  border-top: 1px dashed rgba(157, 123, 255, 0.2);
}

.np-wx-day:first-child { border-top: none; }

.np-wx-when {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--seafoam);
}

.np-wx-cond { font-size: 0.88rem; color: var(--ink-dim); line-height: 1.45; }

.np-wx-temp {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gold);
  white-space: nowrap;
}

/* ---------- corrections ---------- */

.np-corr {
  border-top: 3px double rgba(157, 123, 255, 0.45);
  margin-top: 0.4rem;
}

.np-corr .np-para { font-size: 0.92rem; }

/* ---------- tomorrow: embargoed ---------- */

.np-embargo { text-align: center; padding-bottom: 1.2rem; }

.np-embargo-stamp {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 6vw, 2.6rem);
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--red);
  border: 3px solid rgba(255, 92, 122, 0.75);
  border-radius: var(--r-sm);
  padding: 0.35rem 1.1rem 0.35rem 1.44rem; /* extra left pad rebalances the tracking */
  margin: 0.4rem 0 0.9rem;
  transform: rotate(-4deg);
  box-shadow: 0 0 26px rgba(255, 92, 122, 0.25), inset 0 0 18px rgba(255, 92, 122, 0.12);
}

.np-embargo-note { text-align: center; font-style: italic; }

.np-lead-redacted {
  text-align: left;
  max-width: 620px;
  margin: 1.1rem auto 0;
}

.np-lead-redacted .np-lead-hed { color: var(--ink-dim); }

.np-redaction { display: flex; flex-direction: column; gap: 0.45rem; margin-top: 0.8rem; }

.np-redact-bar {
  display: block;
  height: 0.72rem;
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(185, 176, 220, 0.28), rgba(185, 176, 220, 0.18));
}

/* ---------- colophon ---------- */

.np-colophon {
  border-top: 4px double rgba(157, 123, 255, 0.55);
  margin: 1.4rem 0 0;
  padding-top: 0.7rem;
  text-align: center;
  font-size: 0.7rem;
  font-style: italic;
  color: var(--ink-faint);
  line-height: 1.6;
}

/* ---------- pager ---------- */

.np-pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem;
}

.np-page-btn {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  color: var(--ink);
  background: rgba(22, 13, 52, 0.7);
  border: 1px solid var(--panel-border);
  border-radius: var(--r-pill);
  padding: 0.55rem 1.25rem;
  cursor: pointer;
  transition: transform 0.25s var(--ease-boing), border-color 0.25s, box-shadow 0.25s;
}

.np-page-btn:hover:not(:disabled),
.np-page-btn:focus-visible {
  border-color: rgba(125, 249, 224, 0.6);
  box-shadow: var(--glow-seafoam);
  transform: translateY(-2px);
}

.np-page-btn:active:not(:disabled) { transform: translateY(0) scale(0.97); }

.np-page-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.np-page-today {
  color: var(--bg-deep);
  background: linear-gradient(135deg, var(--seafoam), var(--cyan));
  border-color: transparent;
}

.np-pager-note {
  text-align: center;
  font-size: 0.74rem;
  font-style: italic;
  color: var(--ink-faint);
  margin: 0.6rem 0 0;
}

/* ---------- utilities ---------- */

/* visually hidden, still announced (the edition-change live region) */
.np-vh {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- responsive ---------- */

@media (max-width: 720px) {
  .np-columns { columns: 1; column-rule: none; }
  .np-subheds { grid-template-columns: 1fr; gap: 0.9rem; }
  .np-grid { grid-template-columns: 1fr; column-gap: 0; }
  .np-grid .np-sec:nth-child(-n + 2) { border-top: 1px solid rgba(157, 123, 255, 0.22); }
  .np-grid .np-sec:first-child { border-top: none; }
  /* the ears fold in; the eyebrow keeps the masthead. the edition number
     lives on in the dateline, where it always was anyway */
  .np-ear { display: none; }
  .np-ears { justify-content: center; }
  .np-wx-day { grid-template-columns: 4.2rem 1fr; }
  .np-wx-temp { grid-column: 2; justify-self: start; }
  /* nine tracked-out capitals barely fit a phone: rein the stamp in */
  .np-embargo-stamp {
    font-size: 1.15rem;
    letter-spacing: 0.2em;
    padding: 0.3rem 0.8rem 0.3rem 1rem;
    max-width: 100%;
  }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .np-page-btn,
  .np-page-btn:hover:not(:disabled),
  .np-page-btn:focus-visible,
  .np-page-btn:active:not(:disabled) { transform: none; transition: none; }
  .np-embargo-stamp { transform: none; }
}

/* =====================================================================
   PRINT — newspapers print. same approach as report.css: flip the token
   palette to ink-on-paper, drop the screen chrome, force reveals visible,
   keep the columns (they are the whole point), and let the masthead be
   the letterhead it always wanted to be.
   ===================================================================== */

@page {
  margin: 12mm 12mm 16mm;
  @bottom-center {
    content: "the daily shell · one (1) perception · no one reads page " counter(page);
    font-family: 'Nunito', system-ui, sans-serif;
    font-size: 8pt;
    color: #5f5987;
  }
}

@media print {

  /* ---- flip the palette: every var() consumer turns ink-on-white ---- */
  :root {
    --bg-deep: #ffffff;
    --bg-1: #ffffff;
    --bg-2: #ffffff;
    --ink: #17102e;
    --ink-dim: #3b3560;
    --ink-faint: #5f5987;
    --seafoam: #0c8f74;
    --cyan: #0b7fae;
    --pink: #c9308f;
    --gold: #a87b12;
    --violet: #6a48d7;
    --green: #1f9e4d;
    --red: #d61f47;
    --orange: #b26a15;
    --panel-bg: #ffffff;
    --panel-border: #d5cfee;
    --panel-blur: 0px;
    --shadow-pop: none;
    --glow-seafoam: none;
    --glow-violet: none;
    --glow-gold: none;
  }

  html, body {
    background: #fff !important;
    color: var(--ink);
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* ---- screen chrome does not make the morning edition ---- */
  #bg-canvas,
  #site-nav,
  #audio-toggle-root,
  .noscript-banner,
  .np-pager,
  .np-pager-note,
  .page-footer { display: none !important; }

  .page-main { width: 100%; max-width: none; padding: 0; }

  /* ---- paper does not scroll: force every reveal visible ---- */
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }

  /* ---- the sheet becomes the page itself ---- */
  .np-sheet {
    background: #fff;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    margin: 0;
  }

  .np-masthead { border-bottom-color: var(--ink); break-after: avoid; page-break-after: avoid; }
  .np-title { text-shadow: none; color: var(--ink); }
  .np-dateline { border-top-color: #b9b2da; }

  /* ---- rules turn to honest ink ---- */
  .np-sec-label::before,
  .np-sec-label::after,
  .np-byline,
  .np-subheds,
  .np-grid,
  .np-grid .np-sec,
  .np-corr,
  .np-colophon,
  .np-brief,
  .np-ad,
  .np-chart-row,
  .np-wx-day { border-color: #cfc9e8; }

  .np-columns { column-rule-color: #cfc9e8; }

  /* ---- keep stories whole across page breaks ---- */
  .np-lead, .np-subhed, .np-sec.np-local, .np-sec.np-ads,
  .np-sec.np-jazz, .np-sec.np-wx, .np-sec.np-corr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .np-lead-hed, .np-subhed-hed, .np-sec-label { break-after: avoid; page-break-after: avoid; }

  /* ---- glow off, ink on ---- */
  .np-chart-pos { text-shadow: none; }
  .np-brief-icon { filter: none; }
  .np-chart-row:first-child { background: rgba(168, 123, 18, 0.06); }
  .np-local-tag {
    color: var(--ink);
    background: none;
    border: 1px solid #cfc9e8;
  }

  /* ---- embargo stamp & redactions must reach the paper ---- */
  .np-embargo-stamp {
    color: var(--red);
    border-color: var(--red);
    box-shadow: none;
    transform: rotate(-4deg);
  }
  .np-redact-bar {
    background: #3b3560;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
