/* PrepBuddy shared: News module (news). The story lead and the story row (Adda ▸ News, Saved stories, More on this), the pattern cover,
   the source badge, Today's brief card, the AI label, the key-date box, the story page (summary, why it matters, full coverage, the two-column
   layout from 1024 dp) and the brief progress. Tokens only; classes prefixed nw-. Flutter: StoryLead, StoryRow, StoryCover, SourceBadge,
   BriefCard, AiLabel, KeyDateBox, CoverageRow. */

/* ---------- the cover: the source's licensed image (credited) or, without one, the section's pattern (its icon on its accent) ---------- */
.nw-cover { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 38%, var(--surface)), color-mix(in srgb, var(--accent) 12%, var(--surface))); }
.nw-cover > .mi { font-size: 48px; color: var(--accent); }
.nw-thumb { width: 64px; height: 64px; border-radius: 16px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 34%, var(--surface)), color-mix(in srgb, var(--accent) 10%, var(--surface))); }
.nw-thumb .mi { font-size: 28px; color: var(--accent); }

/* ---------- the photo: only a licensed image, credited under it (the source's or an official one); no image, no cover ---------- */
.nw-photo { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.nw-photo-ph { width: 100%; aspect-ratio: 16 / 9; border-radius: 16px; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--text-secondary) 14%, var(--surface)); }
.nw-photo-ph .mi { font-size: 32px; color: var(--text-secondary); }
.nw-photo figcaption { font-size: calc(12px * var(--font-scale)); color: var(--text-secondary); }
.nw-cat { display: inline-flex; align-items: center; gap: 8px; font-size: calc(12px * var(--font-scale)); font-weight: 700; color: var(--accent-text, var(--accent)); }
.nw-cat .mi { font-size: 16px; }

/* ---------- the source: a round badge (the publisher's logo; initials here; a seal for an official notice), the name, the age ---------- */
.nw-src { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; min-width: 0; font-size: calc(12px * var(--font-scale)); color: var(--text-secondary); }
.nw-src b { font-weight: 700; color: var(--text-primary); overflow-wrap: anywhere; }
.nw-badge { width: 20px; height: 20px; border-radius: 999px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; font-size: calc(10px * var(--font-scale)); font-weight: 800; color: var(--on-primary); background: var(--accent-text, var(--accent, var(--primary))); }   /* the -text role, so the initials hold 4.5:1 in light and dark */
.nw-badge .mi { font-size: 14px; }
.nw-src .nw-n { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: var(--primary-text); }   /* "4 sources": the story has full coverage */
.nw-src .nw-n .mi { font-size: 14px; }

/* ---------- the lead story (Top for you): the cover, the headline (3 lines), the first line of the summary, the source; ⋯ for the story's actions ---------- */
.nw-lead { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.nw-open { display: flex; flex-direction: column; gap: 8px; color: var(--text-primary); text-decoration: none; border-radius: 16px; }
.nw-open:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.nw-lead .nw-h { font-size: calc(18px * var(--font-scale)); font-weight: 700; line-height: 1.35; letter-spacing: -0.01em; margin: 0; overflow-wrap: break-word; }   /* a headline wraps, never ends in an ellipsis (2026-11-15; it was clamped at three lines) */
.nw-dek { margin: 0; font-size: calc(14px * var(--font-scale)); line-height: 1.5; color: var(--text-secondary); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nw-foot { display: flex; align-items: center; gap: 8px; }
.nw-foot .nw-src { flex: 1; }

/* ---------- the story row: the thumb, the headline (3 lines), the source line, a key date or "4 sources"; the ⋯ round button outside the link ---------- */
.nw-rows { display: flex; flex-direction: column; }
.nw-box { padding: 4px 16px; }
.nw-box.nw-gap { margin-top: 12px; }
.nw-side-h { margin: 12px 0 4px;   /* 4 + 12: the card's 16 dp above its heading */ font-size: calc(16px * var(--font-scale)); }
.nw-count { margin: 0; }
.nw-gone { cursor: default; }
.nw-sheet-h { font-size: calc(16px * var(--font-scale)); line-height: 1.4; }
.nw-row { display: flex; align-items: flex-start; gap: 4px; padding: 12px 0; }
.nw-row + .nw-row { box-shadow: inset 0 1px 0 var(--border); }
.nw-row .nw-open { flex: 1; min-width: 0; flex-direction: row; align-items: flex-start; gap: 12px; }
.nw-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.nw-tx > b { font-size: calc(14px * var(--font-scale)); font-weight: 700; line-height: 1.4; display: block; overflow-wrap: break-word; }   /* the same rule in every row and in the Adda embed */
.nw-row .tbtn { color: var(--text-secondary); }
.nw-due { display: block; font-size: calc(12px * var(--font-scale)); font-weight: 700; line-height: 1.5; color: var(--warning-text); overflow-wrap: anywhere; }   /* a key date: one wrapping line (a pill broke inside itself at 360) */
.nw-due .mi { font-size: 14px; vertical-align: -2px; margin-inline-end: 4px; }
.nw-due [data-noloc] { white-space: nowrap; }   /* "Oct 10" never splits across lines */

/* ---------- 00 inside Adda: the header line, section headings with See all, the results line, the AI note ---------- */
.nw-head { display: flex; align-items: center; gap: 8px; margin: 16px 0 12px; }
.nw-head h2 { margin: 0; font-size: calc(20px * var(--font-scale)); font-weight: 700; letter-spacing: -0.01em; }
.nw-headtx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.nw-headtx .xs { overflow-wrap: anywhere; }
.nw-sec { margin-top: 24px; }
.nw-sh { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }   /* See all stays at the end: the heading shrinks and wraps instead */
.nw-sh h3 { margin: 0; flex: 1; min-width: 0; display: inline-flex; align-items: center; gap: 8px; font-size: calc(16px * var(--font-scale)); font-weight: 700; overflow-wrap: anywhere; }
.nw-sh h3 .mi { font-size: 20px; color: var(--accent); }
.nw-sh .link { white-space: nowrap; }
.nw-res { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0 8px; font-size: calc(14px * var(--font-scale)); color: var(--text-secondary); }
.nw-clear { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 12px; border-radius: 999px; font-weight: 700; color: var(--primary-text); }
.nw-clear .mi { font-size: 18px; }
.nw-note { display: flex; align-items: flex-start; gap: 8px; margin: 24px 0 8px; font-size: calc(12px * var(--font-scale)); line-height: 1.5; color: var(--text-secondary); }
.nw-note > .mi { font-size: 16px; flex-shrink: 0; margin-top: 2px; color: var(--primary-text); }
.nw-note button { display: inline-flex; align-items: center; min-height: 44px; vertical-align: middle; color: var(--primary-text); font-weight: 700; padding: 0; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Today's brief: five stories, about 2 minutes; the round filled Play, or a check once read today ---------- */
.nw-brief { display: flex; align-items: center; gap: 12px; padding: 16px; }   /* 2026-10-27: the card's 16 dp (one padding for every card on a canvas) */
.nw-brief .nw-bic { width: 48px; height: 48px; border-radius: 16px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--primary) 14%, transparent); }
.nw-brief .nw-bic .mi { font-size: 26px; color: var(--primary-text); }
.nw-brief .nw-btx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; color: var(--text-primary); text-decoration: none; }
.nw-brief .nw-btx b { font-size: calc(16px * var(--font-scale)); font-weight: 700; }
.nw-brief .nw-btx span { font-size: calc(12px * var(--font-scale)); color: var(--text-secondary); overflow-wrap: anywhere; }
.nw-brief.done .nw-bic { background: var(--success-container); } .nw-brief.done .nw-bic .mi { color: var(--success-text); }

/* ---------- the AI label: says the summary was written by AI; text, never the icon alone ---------- */
/* the AI label (.nw-ai) moved to ../../shared/ai.css on 2026-10-20: one recipe for the learner's screens and the portal's PB panel (every page that links this file links ai.css after it) */
.nw-off { margin-top: -8px; }   /* the key date's official notice link sits right under its card */

/* ---------- 01 the story: the column, then from 1024 dp two columns (the story; Read at the source and Full coverage in a sticky side column) ---------- */
.nw-lay { display: flex; flex-direction: column; gap: 16px; }
.nw-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.nw-kick { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; font-size: calc(12px * var(--font-scale)); font-weight: 700; color: var(--accent-text, var(--accent)); text-decoration: none; min-height: 44px; margin: -8px 0; }
.nw-kick .mi { font-size: 16px; }
.nw-title { margin: 0; font-size: calc(24px * var(--font-scale)); font-weight: 800; line-height: 1.3; letter-spacing: -0.01em; overflow-wrap: break-word; }
.nw-by { display: flex; flex-direction: column; gap: 4px; }
.nw-by .nw-read { font-size: calc(12px * var(--font-scale)); color: var(--text-secondary); }
.nw-credit { margin: -8px 0 0; font-size: calc(12px * var(--font-scale)); color: var(--text-secondary); }
.nw-card { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.nw-card > h2 { margin: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: calc(16px * var(--font-scale)); font-weight: 700; }
.nw-sum ul { margin: 0; padding-inline-start: 20px; display: flex; flex-direction: column; gap: 8px; }
.nw-sum li { font-size: calc(16px * var(--font-scale)); line-height: 1.55; overflow-wrap: break-word; }

.nw-tog { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0; font-size: calc(14px * var(--font-scale)); font-weight: 700; color: var(--primary-text); }
.nw-tog .mi { font-size: 18px; }
.nw-key { display: flex; align-items: center; gap: 12px; padding: 12px; }
.nw-dt { width: 48px; height: 52px; border-radius: 12px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; background: color-mix(in srgb, var(--accent, var(--warning)) 16%, transparent); color: var(--text-primary); }
.nw-dt b { font-size: calc(18px * var(--font-scale)); font-weight: 800; font-variant-numeric: tabular-nums; }
.nw-dt span { font-size: calc(10px * var(--font-scale)); font-weight: 700; color: var(--accent-text, var(--accent, var(--warning-text))); }
.nw-key .nw-tx > span { font-size: calc(12px * var(--font-scale)); color: var(--text-secondary); }
.nw-why p { margin: 0; font-size: calc(14px * var(--font-scale)); line-height: 1.55; overflow-wrap: break-word; }
.nw-why h2 .mi { font-size: 20px; color: var(--primary-text); }
.nw-links { display: flex; flex-direction: column; gap: 2px; }
.nw-links a { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 4px 0; color: var(--text-primary); text-decoration: none; border-radius: 12px; }
.nw-links a .pf-ic, .nw-links a .nw-li { width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--accent) 14%, transparent); }
.nw-links a .nw-li .mi { font-size: 20px; color: var(--accent); }
.nw-links a .nw-tx b { font-size: calc(14px * var(--font-scale)); }
.nw-links a .nw-tx span { font-size: calc(12px * var(--font-scale)); color: var(--text-secondary); }
.nw-links a > .mi { font-size: 18px; color: var(--text-secondary); }
.nw-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.nw-tags a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 999px; font-size: calc(14px * var(--font-scale)); font-weight: 600; color: var(--primary-text); background: color-mix(in srgb, var(--primary) 10%, transparent); text-decoration: none; }
.nw-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.nw-side .nw-readbtn { display: none; }
.nw-cov { display: flex; flex-direction: column; }
.nw-cov button { display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 12px 0; text-align: start; color: var(--text-primary); font: inherit; border-radius: 12px; }
.nw-cov button + button { box-shadow: inset 0 1px 0 var(--border); }
.nw-cov .nw-tx b { font-size: calc(14px * var(--font-scale)); font-weight: 600; line-height: 1.4; }
.nw-cov .nw-tx span { font-size: calc(12px * var(--font-scale)); color: var(--text-secondary); }
.nw-cov button > .mi { font-size: 18px; color: var(--text-secondary); flex-shrink: 0; margin-top: 2px; }
.nw-bar { gap: 8px; flex-direction: row; align-items: center; }
.nw-readic { width: 48px; height: 48px; box-shadow: inset 0 0 0 1px var(--outline); color: var(--primary-text); }   /* the brief: Read at {source} as a round outlined icon, Next story keeps the label */
/* the saved bookmark is the shared .tog.on (components.css; was .nw-unsave until 2026-10-19) */
.nw-secl { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px 0; text-align: start; color: var(--text-primary); font: inherit; text-decoration: none; border-radius: 12px; }
.nw-secl + .nw-secl { box-shadow: inset 0 1px 0 var(--border); }
.nw-secl .nw-li { width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--accent) 14%, transparent); }
.nw-secl .nw-li .mi { font-size: 20px; color: var(--accent); }
.nw-secl .nw-tx b { font-size: calc(14px * var(--font-scale)); } .nw-secl .nw-tx span { font-size: calc(12px * var(--font-scale)); color: var(--text-secondary); }
.nw-secl > .mi { font-size: 18px; color: var(--text-secondary); }
.nw-bar .btn { flex: 1; min-width: 0; }
.nw-bar .btn .mi { flex-shrink: 0; }
.nw-bar .btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 1024px) {
  .nw-lay { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; align-items: start; }
  .nw-side { position: sticky; top: 80px; }
  .nw-side .nw-readbtn { display: inline-flex; width: 100%; }
  .nw-main .nw-photo-ph { aspect-ratio: auto; height: 320px; }   /* a wide photo is cropped (cover), so the headline stays in the first screen */
  .nw-pin.nw-read-only { display: none; }   /* the pinned Read at the source moves into the side column; the brief keeps its bar */
}

/* ---------- Today's brief on the story page: the progress segments under the page bar ---------- */
.nw-segs { display: flex; gap: 4px; align-items: center; }
.nw-segs i { flex: 1; height: 4px; border-radius: 999px; background: color-mix(in srgb, var(--text-secondary) 24%, transparent); }
.nw-segs i.on { background: var(--primary); }
.nw-prog { display: flex; align-items: center; gap: 12px; font-size: calc(12px * var(--font-scale)); font-weight: 700; color: var(--text-secondary); }
.nw-prog .nw-segs { flex: 1; }

/* ---------- the Adda embed (an Around-you story in the For you feed): the row, linked ---------- */
.nw-embed { display: flex; align-items: center; gap: 12px; padding: 16px; color: var(--text-primary); text-decoration: none; }

/* ---------- the How News works sheet ---------- */
.nw-how { display: flex; flex-direction: column; gap: 12px; margin: 8px 0 16px; }
.nw-how > div { display: flex; align-items: flex-start; gap: 12px; }
.nw-how .ic-tile, .nw-how .nw-li { width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--primary) 12%, transparent); }
.nw-how .nw-li .mi { font-size: 20px; color: var(--primary-text); }
.nw-how p { margin: 0; font-size: calc(14px * var(--font-scale)); line-height: 1.5; }
.nw-how b { display: block; }
/* 2026-10-09 (proposed): Remind me beside Add to calendar on a key date; the chosen reminder's check */
.nw-key #nw-rem { margin-inline-start: auto; }
.nw-ck { margin-inline-start: auto; color: var(--primary-text); }
