/* Aba Notícias: Histórias (bolinhas e visualizador), cartão "Notícias em 20 s", folha da notícia e miniatura.
   views/news/stories.js, plantao.js, sheet.js e media.js. Cores sempre pelos tokens do app (o tema troca o --accent). */

/* ---------- gradientes por assunto / região ---------- */
.nw-g-time, .nw-g-cidade { --g: linear-gradient(160deg, var(--accent), var(--s3)); }
.nw-g-futebol { --g: linear-gradient(160deg, #2fb344, #0b3d1a); }
.nw-g-politica { --g: linear-gradient(160deg, #3b6bff, #12285e); }
.nw-g-economia { --g: linear-gradient(160deg, #f5c242, #5a3a00); }
.nw-g-cultura { --g: linear-gradient(160deg, #ff5d8f, #4a0a24); }
.nw-g-ciencia { --g: linear-gradient(160deg, #22d3ee, #06384a); }
.nw-r-cidade { background: linear-gradient(135deg, var(--accent), var(--s3)); }
.nw-r-estado { background: linear-gradient(135deg, #ff8a3d, #6b1f0a); }
.nw-r-br { background: linear-gradient(135deg, #27c26b, #073d22); }
.nw-r-mundo { background: linear-gradient(135deg, #a855f7, #2a0a52); }

/* ---------- miniatura / foto da notícia (media.js) ---------- */
.nw-th, .nw-th-img { position: absolute; inset: 0; width: 100%; height: 100%; }
.nw-th-img { object-fit: cover; background: var(--s2); }
.nw-th { display: grid; place-items: center; overflow: hidden; background: linear-gradient(135deg, hsl(var(--h) 45% 32%), hsl(calc(var(--h) + 40) 50% 14%)); }
.nw-th::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgb(0 0 0 / .22)); }
.nw-th span { position: relative; font: 800 26px/1 var(--ui); color: rgb(255 255 255 / .38); }

/* ---------- folha da notícia (sheet.js) ---------- */
.nw-sh { display: grid; gap: 12px; align-content: start; } /* na janela de baixo as linhas não esticam */
.nw-sh-photo { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-md); overflow: hidden; background: var(--s2); }
.nw-sh-meta { display: flex; gap: 8px; align-items: baseline; font-size: 12px; color: var(--muted); }
.nw-sh-meta b { color: var(--accent-text); }
.nw-sh h2, .pg .nw-sh h2 { margin: 0; font-size: 22px; font-weight: 700; line-height: 1.25; letter-spacing: -.01em; }
.nw-sh-sum { margin: 0; font-size: 17px; line-height: 1.5; color: var(--text); }
.nw-sh-btn { display: flex; align-items: center; justify-content: center; font: 700 14px var(--ui); cursor: pointer; min-height: 48px; padding: 0 18px; border-radius: 24px; background: var(--s2); border: 1px solid var(--line); color: var(--text); }
.nw-sh-btn.acc { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.nw-sh-btn { flex-direction: column; gap: 2px; padding: 8px 18px; }
.nw-sh-btn small { display: block; font-weight: 500; font-size: 12px; color: var(--muted); }
.nw-sh-btn.acc small { color: inherit; opacity: .8; }
.nw-sh-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.nw-sh-note { margin: 0; font-size: 12px; line-height: 1.5; color: var(--muted); }

/* ---------- bolinhas (stories.js) ---------- */
.nw-stories { display: flex; gap: 12px; overflow-x: auto; padding: 6px 16px 10px; scrollbar-width: none; scroll-snap-type: x proximity; }
.nw-stories::-webkit-scrollbar { display: none; }
.nw-st { flex: none; width: 72px; min-height: 44px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0; background: none; border: 0; border-radius: 14px; color: var(--text); font: 600 11px/1.2 var(--ui); text-align: center; cursor: pointer; scroll-snap-align: start; -webkit-tap-highlight-color: transparent; }
.nw-st:active { opacity: .7; }
.nw-st:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.nw-ring { width: 68px; height: 68px; border-radius: 50%; padding: 3px; display: block; background: conic-gradient(var(--accent), var(--win), rgb(var(--accent-rgb) / .45), var(--accent)); }
.nw-st.seen .nw-ring { background: var(--line); }
.nw-face { width: 100%; height: 100%; border-radius: 50%; border: 3px solid var(--bg); background: var(--g); display: grid; place-items: center; font-size: 24px; }
.nw-st-l { max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- visualizador em tela cheia ---------- */
dialog.nw-story { background: #000; color: #fff; overflow: hidden; user-select: none; -webkit-user-select: none; }
dialog.nw-story::backdrop { background: #000; }
dialog.nw-story[open] { animation: nw-in .26s cubic-bezier(.2, .8, .2, 1); }
@keyframes nw-in { from { opacity: 0; transform: scale(.96); } }
dialog.nw-story > .nw-sv { position: relative; max-width: none; min-height: 100%; height: 100dvh; margin: 0; touch-action: manipulation; }
.nw-sv-bg { position: absolute; inset: 0; background: #0e0e0f; overflow: hidden; }
.nw-sv-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(rgb(0 0 0 / .5), transparent 24%, rgb(0 0 0 / .45) 42%, rgb(0 0 0 / .9) 72%); }
.nw-sv-capa { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.nw-sv-team { position: absolute; inset: 0; --tc: var(--accent); background: linear-gradient(160deg, color-mix(in srgb, var(--tc) 72%, #000), color-mix(in srgb, var(--tc) 22%, #000)); }
.nw-sv-crest { position: absolute; top: 18%; left: 50%; width: 78%; max-width: 340px; aspect-ratio: 1; object-fit: contain; transform: translateX(-50%); opacity: .28; filter: drop-shadow(0 8px 24px rgb(0 0 0 / .35)); }
.nw-sv-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.nw-sv-bars { position: absolute; top: calc(var(--safe-t) + 12px); left: 12px; right: 12px; display: flex; gap: 4px; z-index: 3; }
.nw-sv-bars i { flex: 1; height: 3px; border-radius: 3px; background: rgb(255 255 255 / .3); overflow: hidden; }
.nw-sv-bars b { display: block; height: 100%; width: 0; background: #fff; }
.nw-sv-bars i.done b { width: 100%; }
.nw-sv-bars i.run b { animation: nw-fill 5s linear forwards; }
.nw-story.paused .nw-sv-bars i.run b { animation-play-state: paused; }
@keyframes nw-fill { from { width: 0; } to { width: 100%; } }
.nw-sv-hd { position: absolute; top: calc(var(--safe-t) + 22px); left: 14px; right: 8px; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.nw-sv-ttl { font: 700 14px var(--ui); text-shadow: 0 1px 6px rgb(0 0 0 / .5); }
.nw-sv-x { display: grid; place-items: center; flex: none; padding: 0; line-height: 0; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgb(0 0 0 / .4); color: #fff; font-size: 18px; cursor: pointer; }
.nw-sv-x:focus-visible, .nw-sv-b:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.nw-sv-zl, .nw-sv-zm, .nw-sv-zr { position: absolute; top: calc(var(--safe-t) + 76px); bottom: calc(112px + var(--safe-b)); z-index: 2; }
.nw-sv-zl { left: 0; width: 34%; }
.nw-sv-zm { left: 34%; right: 34%; }
.nw-sv-zr { right: 0; width: 34%; }
.nw-sv-body { position: absolute; left: 20px; right: 20px; bottom: calc(112px + var(--safe-b)); z-index: 3; pointer-events: none; }
.nw-sv-body h2 { margin: 10px 0; font: 800 29px/1.1 var(--ui); letter-spacing: -.03em; text-shadow: 0 2px 12px rgb(0 0 0 / .4); }
dialog.nw-story .nw-sv-body h2, dialog.nw-story .nw-sv-body p, dialog.nw-story .nw-sv-badge, dialog.nw-story .nw-sv-ttl { color: #fff; }
dialog.nw-story .nw-sv-body p { color: rgb(255 255 255 / .94); }
.nw-sv-txt { display: grid; gap: 12px; max-height: 40dvh; overflow: hidden; }
.nw-sv-body p { margin: 0; font-size: 16px; line-height: 1.5; color: rgb(255 255 255 / .94); text-shadow: 0 1px 8px rgb(0 0 0 / .45); }
.nw-sv-badge { display: inline-block; font: 700 11px var(--ui); letter-spacing: .06em; text-transform: uppercase; background: rgb(0 0 0 / .4); padding: 5px 11px; border-radius: 99px; }
.nw-sv-meta { display: block; margin-top: 12px; font-size: 12px; color: rgb(255 255 255 / .78); }
.nw-sv-empty { text-align: center; font-size: 16px; opacity: .85; }
.nw-sv-body:has(.nw-sv-empty) { top: 40%; bottom: auto; }
.nw-sv-acts { position: absolute; left: 16px; right: 16px; bottom: calc(20px + var(--safe-b)); z-index: 5; display: flex; gap: 10px; }
.nw-sv-b { flex: 1; min-height: 48px; padding: 0 12px; border: 0; border-radius: 16px; font: 700 14px var(--ui); cursor: pointer; background: rgb(255 255 255 / .18); color: #fff; }
.nw-sv-b.acc { background: var(--accent); color: var(--accent-ink); flex: 1.4; }
.nw-sv-b:active, .nw-sv-x:active { opacity: .75; }
.nw-sv-skel { display: grid; gap: 12px; }
.nw-sv-skel i { display: block; height: 22px; border-radius: 8px; background: rgb(var(--ov) / .18); animation: nw-sk 1.2s ease-in-out infinite; }
.nw-sv-skel i:nth-child(1) { width: 90%; height: 30px; }
.nw-sv-skel i:nth-child(2) { width: 70%; }
.nw-sv-skel i:nth-child(3) { width: 45%; }
@keyframes nw-sk { 50% { opacity: .4; } }

/* ---------- cartão "Notícias em 20 s" (plantao.js) ---------- */
.nw-pl { position: relative; margin: 8px 16px 0; height: 236px; border-radius: 28px; overflow: hidden; color: #fff; cursor: pointer; user-select: none; -webkit-user-select: none; box-shadow: 0 14px 40px rgb(0 0 0 / var(--nav-sh, .6)); -webkit-tap-highlight-color: transparent; }
.nw-pl:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.nw-pl-bg { position: absolute; inset: 0; }
.nw-pl-bg::after { content: ""; position: absolute; inset: 0; background: radial-gradient(90% 70% at 90% 0, rgb(var(--ov) / .2), transparent 60%), linear-gradient(transparent 25%, rgb(0 0 0 / .72)); }
.nw-pl-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.nw-pl-seg { position: absolute; top: 10px; left: 14px; right: 14px; display: flex; gap: 4px; z-index: 3; }
.nw-pl-seg i { flex: 1; height: 3px; border-radius: 3px; background: rgb(var(--ov) / .28); overflow: hidden; }
.nw-pl-seg b { display: block; height: 100%; width: 100%; background: #fff; transform-origin: left; transform: scaleX(var(--p, 0)); }
.nw-pl-top { position: absolute; top: 20px; left: 16px; right: 8px; z-index: 4; display: flex; justify-content: space-between; align-items: center; }
.nw-pl-chip { font: 700 11px var(--ui); letter-spacing: .07em; text-transform: uppercase; background: rgb(0 0 0 / .4); padding: 6px 11px; border-radius: 99px; }
.nw-pl-vz { width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgb(var(--ov) / .2); display: grid; place-items: center; color: #fff; cursor: pointer; }
.nw-pl-vz svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nw-pl-vz[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.nw-pl-vz[aria-pressed="true"] svg { fill: currentColor; }
.nw-pl-vz:focus-visible, .nw-pl-tx:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.nw-pl-tx { position: absolute; left: 18px; right: 52px; bottom: 16px; z-index: 3; display: block; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; border-radius: 10px; animation: nw-up .45s; }
@keyframes nw-up { from { opacity: 0; transform: translateY(10px); } }
.nw-pl-tag { display: block; font: 700 11px var(--ui); letter-spacing: .06em; text-transform: uppercase; opacity: .9; }
.nw-pl-h { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin: 6px 0; font: 800 21px/1.16 var(--ui); letter-spacing: -.02em; text-shadow: 0 2px 10px rgb(0 0 0 / .4); }
.nw-pl-meta { display: block; font-size: 12px; color: rgb(255 255 255 / .8); }
.nw-pl-cnt { position: absolute; right: 16px; bottom: 16px; z-index: 3; font: 600 11px var(--mono); opacity: .85; }

@media (prefers-reduced-motion: reduce) {
  dialog.nw-story[open], .nw-pl-tx, .nw-sv-skel i { animation: none; }
}

/* =====================================================================================================
   Repaginada de vidro (12/11): histórias com ícone 3D e anel que gira, "Notícias em 20 s" em vidro.
   ===================================================================================================== */
.nw-stories { gap: 10px; padding: 8px 16px 12px; scroll-padding: 0 16px; }
.nw-st { width: 80px; gap: 7px; font-weight: 600; font-size: 13px; line-height: 1.2; }
.nw-ring { position: relative; isolation: isolate; width: 80px; height: 80px; padding: 2.5px; background: none; transition: transform .2s; }
.nw-ring::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: 50%; animation: nw-spin .9s cubic-bezier(.2, .8, .2, 1) 1;
  background: linear-gradient(45deg, #ffd166 0%, #ff9f1c 28%, #ff5a1f 55%, #e10600 85%); } /* "Fogo MUSYOU": amarelo → laranja → vermelho da marca */
.nw-st:active .nw-ring { transform: scale(.94); }
.nw-st.seen { color: var(--muted); }
.nw-st.seen .nw-ring { background: none; }
.nw-st.seen .nw-ring::before { background: var(--g-line); animation: none; }
.nw-face { border: 3px solid var(--bg); background: linear-gradient(160deg, #2a2a30, #141418); box-shadow: inset 0 1px 0 rgb(255 255 255 / .1); }
:root[data-app='light'] .nw-face { background: linear-gradient(160deg, #f4f4f7, #e6e6ec); box-shadow: inset 0 0 0 1px rgb(0 0 0 / .08), inset 0 1px 0 rgb(255 255 255 / .9); }
/* a foto do assunto ocupa a bolinha toda, com um leve escurecido nas bordas (como no Instagram) */
.nw-face { position: relative; overflow: hidden; padding: 0; }
.nw-face-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.nw-face::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 50% 70%, transparent 40%, rgb(0 0 0 / .35)); pointer-events: none; }
.nw-st.seen .nw-face-img { filter: saturate(.85); }
.nw-st-l { max-width: 80px; }
@keyframes nw-spin { to { transform: rotate(360deg); } }

/* "Notícias em 20 s": cantos de 30 e texto no tom do título */
.nw-pl { border-radius: 30px; height: 300px; box-shadow: var(--g-sh); }
.nw-pl-chip { background: rgb(0 0 0 / .3); border: 1px solid rgb(255 255 255 / .2); }
.nw-pl-vz { background: rgb(0 0 0 / .3); border: 1px solid rgb(255 255 255 / .2); }
.nw-pl-h { font: 600 23px/1.18 var(--title); letter-spacing: 0; }

@media (prefers-reduced-motion: reduce) { .nw-ring::before { animation: none; } }

/* X da história: ícone de 20 px no centro exato do círculo (13/11, o ✕ de texto saía torto no Android) */
.nw-sv-x svg { width: 20px; height: 20px; display: block; }
