/* The News page (news.html, js/newspage.js): the front page (computers) and threads (phones) shown
   when no filter is on; the filtered list's own styles are in home.css (.news-*). */
.news-page { background: #f7f6ff; }
.news-main { --nw-ink: #1e1a67; --nw-quiet: #4e4a7a; --nw-label: #7d78ab; --nw-lav: #f1effe; --nw-line: #efedfb; --spring: cubic-bezier(.34, 1.56, .64, 1); }
.news-main:has(#newsFeed[data-view="front"]) { width: min(100% - 32px, 1200px); }
.news-head { align-items: center; }
.news-head .page-heading { font-size: clamp(30px, 3.6vw, 44px); }

/* the filters: one quiet row (any of them shows the list) */
.news-filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.4fr); margin: 14px 0 16px; }
/* (the labels are for screen readers: the selects say what they are) */
.news-filter span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.news-filter select, .news-filter input { border: 0; background-color: #e9e5fd; color: var(--nw-ink); font-size: 14px; font-weight: 700; }
.news-item { border: 0; border-radius: 20px; box-shadow: 0 2px 4px rgba(38, 27, 143, .05), 0 8px 20px rgba(38, 27, 143, .08); }
.news-item.is-breaking { border: 0; box-shadow: 0 0 0 2px #f0b4f1, 0 8px 20px rgba(38, 27, 143, .08); }
.news-headline .news-tag { background: #fde9fb; color: #8a1f7c; }

/* shared pieces */
.nw-tile { padding: 20px 22px; border-radius: 26px; background: #fff; color: var(--nw-ink);
  box-shadow: 0 2px 4px rgba(38, 27, 143, .05), 0 10px 26px rgba(38, 27, 143, .10); animation: nw-pop .5s var(--spring) both; }
.nw-tile > h2 { margin: 0 0 12px; font-size: 18px; font-weight: 800; }
@keyframes nw-pop { from { opacity: 0; transform: scale(.95) translateY(8px); } }
.nw-kick { margin: 0 0 10px; color: var(--nw-label); font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.nw-face { position: relative; display: inline-grid; place-items: center; flex: none; width: var(--d); height: var(--d); border-radius: 50%; background: #fff center / cover no-repeat;
  box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--p, var(--party-other)); color: #8d86c2; font: 800 calc(var(--d) * .3) var(--font-read, system-ui, sans-serif); text-decoration: none; transition: transform .3s var(--spring); }
a.nw-face:hover, .nw-bub:hover .nw-face { transform: scale(1.06); }
.nw-face[data-party="democrat"] { --p: var(--party-democrat); } .nw-face[data-party="republican"] { --p: var(--party-republican); }
.nw-face em { position: absolute; right: -6px; bottom: -4px; min-width: 22px; padding: 1px 6px; border-radius: 999px; background: #21167c; box-shadow: 0 0 0 2px #fff; color: #fff;
  font: 900 13px/18px var(--font-fig, system-ui, sans-serif); font-style: normal; font-synthesis: none; text-align: center; }
.nw-faces { display: flex; gap: 14px; margin: 4px 0 14px 4px; }
.nw-hl { display: grid; gap: 3px; min-width: 0; color: inherit; text-decoration: none; }
.nw-hl:hover b { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.nw-hl b { font-size: 15.5px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.nw-hl small { color: var(--nw-label); font-size: 12.5px; font-weight: 600; }
.nw-hl.is-big b { font-size: clamp(22px, 2.4vw, 30px); font-weight: 800; line-height: 1.18; letter-spacing: -.01em; }
.nw-sum { color: var(--nw-quiet); font-size: 15px; line-height: 1.45; }
.nw-list { display: grid; gap: 14px; }
.nw-list.is-row { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--nw-line); }
.nw-withface { display: flex; align-items: flex-start; gap: 12px; }
.nw-withface .nw-face { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--p, var(--party-other)); }
.nw-dot { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--nw-lav); font-size: 16px; }
.nw-empty, .nw-note { margin: 0; color: var(--nw-label); font-size: 14px; line-height: 1.45; }
.nw-note { margin-top: 10px; font-size: 13px; }
.nw-more { justify-self: start; margin-top: 12px; padding: 0; border: 0; background: none; color: #4232d4; font: 800 14px var(--font-read, system-ui, sans-serif); cursor: pointer; }
.nw-more:hover { text-decoration: underline; }
.nw-vs { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: center; gap: 10px; min-width: 0; }
.nw-vs-p { display: grid; justify-items: center; gap: 8px; max-width: 90px; }
.nw-vs-p b { font-size: 14px; text-align: center; overflow-wrap: anywhere; }
.nw-vs-x { align-self: center; margin-top: -24px; color: #21167c; font: 900 22px var(--font-fig, system-ui, sans-serif); font-synthesis: none; }

/* computers: the front page */
.nw-front { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.nw-hero { grid-column: span 8; background: linear-gradient(180deg, #fff 55%, #f6f3ff); }
.nw-yours { grid-column: span 4; } .nw-cloud { grid-column: span 5; } .nw-races { grid-column: span 7; } .nw-level { grid-column: span var(--span, 3); display: grid; align-content: start; }
.nw-front > .nw-cloud:last-child, .nw-front > .nw-races:nth-child(3) { grid-column: 1 / -1; }
.nw-starrow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 8px; margin-top: 14px; }
.nw-starone { display: grid; justify-items: center; gap: 6px; }
.nw-bubbles { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 14px 16px; }
.nw-bub { display: grid; justify-items: center; gap: 6px; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer;
  animation: nw-pop .5s var(--spring) both, nw-bob 5s ease-in-out infinite; animation-delay: calc(var(--i) * 50ms), calc(var(--i) * -400ms); }
.nw-bub small { font-size: 12px; font-weight: 700; color: var(--nw-quiet); }
@keyframes nw-bob { 50% { transform: translateY(-3px); } }
.nw-race { display: grid; gap: 10px; padding: 14px 0; border-top: 1px solid var(--nw-line); }
.nw-race:first-of-type { border: 0; padding-top: 0; }
.nw-race h3 { margin: 0; font-size: 15px; } .nw-race .nw-more { margin-top: 0; }

/* phones: threads */
.nw-threads { display: grid; gap: 14px; }
.nw-count { display: flex; align-items: baseline; gap: 8px; padding: 12px 18px; border-radius: 22px; background: linear-gradient(120deg, #0022ff, #8a2be2 50%, #ff0000); color: #fff; }
.nw-count b { font: 900 38px/1 var(--font-fig, system-ui, sans-serif); font-synthesis: none; } .nw-count span { font-weight: 800; }
.nw-thread { display: grid; gap: 14px; min-width: 0; }
.nw-thread .nw-kick { margin: 0; color: #21167c; letter-spacing: 0; text-transform: none; font-size: 16px; }
.nw-thread .nw-list { padding-top: 12px; border-top: 1px solid var(--nw-line); }
.nw-thread .nw-more { margin-top: 0; }
.nw-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px; border-radius: 16px; background: var(--nw-lav); }
.nw-pick span { margin-right: 4px; color: var(--nw-quiet); font-size: 13px; font-weight: 800; }
.nw-pick button { flex: 1 1 auto; min-width: 0; padding: 8px 10px; border: 0; border-radius: 12px; background: #fff; color: #21167c; font: 800 13px var(--font-read, system-ui, sans-serif); cursor: pointer; transition: transform .25s var(--spring); }
.nw-pick button[aria-pressed="true"] { background: var(--party-other); color: #fff; transform: scale(1.04); }
.nw-pick button[data-party="democrat"][aria-pressed="true"] { background: var(--party-democrat); }
.nw-pick button[data-party="republican"][aria-pressed="true"] { background: var(--party-republican); }
.nw-office { display: flex; align-items: center; gap: 14px; }
.nw-office > div { display: grid; gap: 2px; flex: 1; min-width: 0; } .nw-office small { color: var(--nw-label); font-weight: 700; }
.nw-thread .rt { margin: 0; }

@media (max-width: 1000px) { .nw-front > * { grid-column: 1 / -1 !important; } .nw-level { grid-column: span 6 !important; } }
@media (max-width: 760px) {
  .news-filters { grid-template-columns: 1fr 1fr; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) { .nw-tile, .nw-bub { animation: none; } .nw-face, .nw-pick button { transition: none; } }
