/* ===========================================================================
   assets/css/news.css — News module.
   An editorial wire board: hairline rules instead of boxes, one uniform cell
   shape for every story, mono metadata, publisher-hue artwork when a feed
   ships no image. Loaded by news/*.php and admin/news.php.
   =========================================================================== */

.nw-te, .te { font-family: "Noto Sans Telugu", "DM Sans", system-ui, sans-serif; }

/* ---------------- masthead strip ---------------- */
.nw-bar {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem 2.5rem;
  padding: 0 0 1.15rem;
  border-bottom: 2px solid var(--bs-emphasis-color);
  margin-bottom: 1.1rem;
}
.nw-bar-id { flex: 1 1 420px; min-width: 0; }
.nw-eyebrow {
  display: block; font-family: "JetBrains Mono", monospace;
  font-size: .66rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--page-accent, var(--md-accent));
}
.nw-h1 {
  font-size: clamp(1.9rem, 4.4vw, 3rem); line-height: 1.02; margin: .35rem 0 0;
  font-family: "Noto Sans Telugu", "Bricolage Grotesque", sans-serif; font-weight: 700;
}
.nw-h1-sub {
  font-family: "JetBrains Mono", monospace; font-size: .42em; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft);
  vertical-align: .55em; margin-left: .5rem;
}
.nw-lede { margin: .6rem 0 0; max-width: 68ch; color: var(--ink-soft); font-size: .95rem; line-height: 1.6; }
.nw-lede b { color: var(--bs-emphasis-color); font-weight: 600; }

.nw-bar-live { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; padding-bottom: .3rem; }
.nw-status {
  display: inline-flex; align-items: center; gap: .45rem;
  font-family: "JetBrains Mono", monospace; font-size: .7rem;
  letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft);
}
.nw-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--page-accent, var(--md-accent)); animation: nwBeat 2.4s cubic-bezier(.22,1,.36,1) infinite; }
.nw-dot[data-state="demo"]   { background: #ffb347; animation-duration: 4s; }
.nw-dot[data-state="paused"] { background: var(--ink-soft); animation: none; }
@keyframes nwBeat {
  0%        { box-shadow: 0 0 0 0 rgba(240,180,41,.5); }
  60%, 100% { box-shadow: 0 0 0 9px rgba(240,180,41,0); }
}
.nw-timer {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .3rem .7rem .3rem .4rem; border-radius: 999px;
  border: 1px solid var(--glass-border); background: var(--glass-bg);
  color: var(--bs-body-color); cursor: pointer;
  transition: border-color .2s ease, color .2s ease;
}
.nw-timer:hover { border-color: var(--page-accent, var(--md-accent)); color: var(--bs-emphasis-color); }
.nw-timer span { font-size: .72rem; min-width: 4.2ch; text-align: left; }
.nw-ring-bg { fill: none; stroke: var(--glass-border); stroke-width: 2.5; }
.nw-ring-fg {
  fill: none; stroke: var(--page-accent, var(--md-accent)); stroke-width: 2.5; stroke-linecap: round;
  transform: rotate(-90deg); transform-origin: center; stroke-dasharray: 56.5; stroke-dashoffset: 0;
}
.nw-newpill {
  border: 0; border-radius: 999px; padding: .32rem .7rem;
  background: var(--page-accent, var(--md-accent)); color: var(--page-accent-ink, #10151f);
  font-family: "JetBrains Mono", monospace; font-size: .7rem; font-weight: 700; letter-spacing: .06em;
  cursor: pointer; animation: nwPop .3s cubic-bezier(.22,1,.36,1);
}
@keyframes nwPop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.nw-updated { font-size: .68rem; color: var(--ink-soft); letter-spacing: .06em; }

/* ---------------- admin diagnostics notice ---------------- */
.nw-notice {
  display: flex; gap: .75rem; align-items: baseline; flex-wrap: wrap;
  padding: .7rem 1rem; margin-bottom: 1rem; border-radius: 12px;
  border: 1px solid rgba(255,179,71,.35); background: rgba(255,179,71,.10);
  font-size: .88rem;
}
.nw-notice b {
  font-family: "JetBrains Mono", monospace; font-size: .64rem; letter-spacing: .12em;
  text-transform: uppercase; color: #ffb347;
}

/* ---------------- filter strip ---------------- */
.nw-strip { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .75rem; }
.nw-langs { display: flex; border: 1px solid var(--glass-border); border-radius: 999px; overflow: hidden; flex: 0 0 auto; }
.nw-langs a {
  padding: .42rem .95rem; font-size: .78rem; color: var(--ink-soft); text-decoration: none;
  font-family: "JetBrains Mono", monospace; letter-spacing: .05em;
  transition: background .18s ease, color .18s ease;
}
.nw-langs a.te { font-family: "Noto Sans Telugu", sans-serif; letter-spacing: 0; }
.nw-langs a + a { border-left: 1px solid var(--glass-border); }
.nw-langs a:hover { color: var(--bs-emphasis-color); }
.nw-langs a.is-on { background: var(--bs-emphasis-color); color: var(--bs-body-bg); }

.nw-search {
  flex: 1 1 260px; display: flex; align-items: center; gap: .55rem; min-width: 0;
  padding: .42rem .9rem; border-radius: 999px;
  border: 1px solid var(--glass-border); background: var(--glass-bg);
}
.nw-search i { color: var(--ink-soft); }
.nw-search input {
  border: 0; background: transparent; outline: none; width: 100%;
  color: var(--bs-emphasis-color); font-size: .92rem; min-height: 32px;
  font-family: "Noto Sans Telugu", "DM Sans", sans-serif;
}
.nw-select {
  flex: 0 1 240px; max-width: 100%; padding: .45rem .8rem; border-radius: 999px;
  border: 1px solid var(--glass-border); background: var(--glass-bg);
  color: var(--bs-body-color); font-size: .82rem; min-height: 38px;
}

.nw-chips { display: flex; gap: .35rem; flex-wrap: wrap; margin-bottom: 1rem; }
.nw-chip {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .38rem .8rem; border-radius: 999px; text-decoration: none;
  font-size: .84rem; color: var(--ink-soft);
  border: 1px solid transparent;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.nw-chip i { font-size: .82em; color: var(--nw-cat, var(--page-accent, var(--md-accent))); }
.nw-chip:hover { background: var(--glass-bg); color: var(--bs-emphasis-color); border-color: var(--glass-border); }
.nw-chip.is-on { background: var(--bs-emphasis-color); color: var(--bs-body-bg); }
.nw-chip.is-on i { color: var(--bs-body-bg); }
.nw-chip .c { opacity: .6; font-size: .72rem; }

/* ---------------- breaking ticker ---------------- */
.nw-ticker {
  display: flex; align-items: center; gap: 1rem; overflow: hidden;
  padding: .55rem 0; margin-bottom: 1.2rem;
  border-top: 1px solid var(--glass-border); border-bottom: 1px solid var(--glass-border);
}
.nw-ticker-tag {
  flex: 0 0 auto; font-family: "JetBrains Mono", monospace; font-size: .64rem;
  letter-spacing: .18em; text-transform: uppercase; color: #ff6b6b;
}
.nw-ticker-view { overflow: hidden; width: 100%; }
.nw-ticker-track { display: flex; gap: 1.4rem; min-width: max-content; animation: nwTick 64s linear infinite; }
.nw-ticker:hover .nw-ticker-track { animation-play-state: paused; }
@keyframes nwTick { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.nw-ticker-track a {
  white-space: nowrap; font-size: .86rem; color: var(--bs-body-color); text-decoration: none;
  font-family: "Noto Sans Telugu", "DM Sans", sans-serif;
}
.nw-ticker-track a:hover { color: var(--page-accent, var(--md-accent)); }
.nw-ticker-sep { color: var(--glass-border); font-size: .6rem; }

.nw-count {
  font-size: .7rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-soft); margin-bottom: .5rem;
}

/* ---------------- the wire grid ---------------- */
.nw-grid {
  list-style: none; margin: 0 0 1.5rem; padding: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(1.4rem, 2.2vw, 2.1rem) clamp(1rem, 1.6vw, 1.6rem);
}
.nw-cell {
  position: relative; display: flex; flex-direction: column;
  border-top: 1px solid var(--glass-border); padding-top: .7rem;
}
.nw-cell:nth-child(-n+4) { border-top: 2px solid var(--bs-emphasis-color); }
.nw-cell > a { display: flex; flex-direction: column; height: 100%; text-decoration: none; color: inherit; }
.nw-slot {
  position: absolute; top: .7rem; right: 0; font-size: .6rem; letter-spacing: .08em;
  color: var(--ink-soft); opacity: .7; line-height: 1;
}

.nw-shot {
  position: relative; overflow: hidden; border-radius: 3px; margin-bottom: .7rem;
  aspect-ratio: 3 / 2; background: var(--glass-bg); display: block;
}
.nw-shot img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .7s cubic-bezier(.22,1,.36,1), filter .4s ease;
}
.nw-cell:hover .nw-shot img { transform: scale(1.045); }
.nw-art, .nw-shot.nw-noart::after, .nw-strip-art.nw-noart::after {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: "Bricolage Grotesque", sans-serif; font-size: 1.6rem; font-weight: 700;
  letter-spacing: .02em; color: rgba(255,255,255,.92);
  background:
    radial-gradient(120% 120% at 12% 8%, hsl(var(--nw-hue, 210) 72% 58% / .95), transparent 62%),
    linear-gradient(135deg, hsl(var(--nw-hue, 210) 58% 34%), hsl(calc(var(--nw-hue, 210) + 38) 52% 22%));
}
.nw-shot.nw-noart::after, .nw-strip-art.nw-noart::after { content: attr(data-ini); }
.nw-strip-art.nw-noart::after { font-size: 1.05rem; }
/* artwork keeps its slot while it loads, so the grid never jumps */
.nw-shot img, .nw-strip-art img { background: var(--glass-bg); }
.nw-wm {
  position: absolute; left: 0; bottom: 0; z-index: 2; max-width: calc(100% - 10px);
  padding: .22rem .5rem; background: var(--bs-emphasis-color); color: var(--bs-body-bg);
  font-family: "Noto Sans Telugu", "JetBrains Mono", monospace; font-size: .62rem;
  letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.nw-title {
  margin: 0; font-size: 1rem; line-height: 1.3; font-weight: 600;
  color: var(--bs-emphasis-color); letter-spacing: -.01em;
  background-image: linear-gradient(var(--page-accent, var(--md-accent)), var(--page-accent, var(--md-accent)));
  background-repeat: no-repeat; background-position: 0 100%; background-size: 0% .12em;
  transition: background-size .45s cubic-bezier(.22,1,.36,1);
}
.nw-title.te { font-family: "Noto Sans Telugu", sans-serif; font-size: .95rem; line-height: 1.42; font-weight: 500; }
.nw-cell:hover .nw-title { background-size: 100% .12em; }
.nw-deck {
  margin: .45rem 0 0; font-size: .82rem; line-height: 1.5; color: var(--ink-soft);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.nw-deck.te { font-family: "Noto Sans Telugu", sans-serif; font-size: .8rem; line-height: 1.62; }
.nw-foot {
  margin-top: auto; padding-top: .65rem; display: flex; align-items: center; gap: .6rem;
  font-family: "JetBrains Mono", monospace; font-size: .62rem; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-soft); overflow: hidden;
}
.nw-cat {
  display: inline-flex; align-items: center; gap: .35rem; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: "Noto Sans Telugu", "JetBrains Mono", monospace; text-transform: none; letter-spacing: 0;
}
.nw-cat i { color: var(--nw-cat, var(--page-accent, var(--md-accent))); }
.nw-when { margin-left: auto; white-space: nowrap; text-transform: none; letter-spacing: .02em; color: var(--page-accent, var(--md-accent)); font-family: "Noto Sans Telugu", "JetBrains Mono", monospace; }

.nw-cell.is-fresh::before {
  content: ""; position: absolute; inset: -4px -6px; pointer-events: none; z-index: 4;
  box-shadow: inset 0 0 0 2px var(--page-accent, var(--md-accent));
  background: rgba(240,180,41,.10); animation: nwFade 2.2s cubic-bezier(.25,1,.5,1) forwards;
}
@keyframes nwFade { to { opacity: 0; } }

/* ---------------- pager / empty / footnote ---------------- */
.nw-pager {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem 0; border-top: 1px solid var(--glass-border); margin-bottom: 2rem;
  font-size: .8rem;
}
.nw-pager a { text-decoration: none; color: var(--bs-emphasis-color); font-weight: 600; }
.nw-pager a:hover { color: var(--page-accent, var(--md-accent)); }
.nw-pager span { font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }

.nw-empty { border-top: 2px solid var(--bs-emphasis-color); padding: 2.5rem 0 3rem; max-width: 54ch; }
.nw-empty h2 { font-family: "Noto Sans Telugu", sans-serif; font-size: 1.5rem; font-weight: 600; }
.nw-empty p { margin: .7rem 0 1.2rem; color: var(--ink-soft); font-family: "Noto Sans Telugu", sans-serif; line-height: 1.7; }

.nw-foot-note {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem 2.5rem;
  border-top: 1px solid var(--glass-border); padding: 1.4rem 0 2.5rem;
}
.nw-foot-note p { margin: .45rem 0 0; color: var(--ink-soft); font-size: .88rem; line-height: 1.65; max-width: 62ch; }

/* ---------------- homepage strip ---------------- */
.nw-strip-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem 1.4rem; }
.nw-strip-card {
  display: flex; gap: .8rem; text-decoration: none; color: inherit;
  border-top: 1px solid var(--glass-border); padding-top: .7rem;
}
.nw-strip-art { position: relative; flex: 0 0 92px; height: 68px; overflow: hidden; border-radius: 3px; background: var(--glass-bg); }
.nw-strip-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nw-strip-art .nw-art { font-size: 1.05rem; }
.nw-strip-body { min-width: 0; display: flex; flex-direction: column; gap: .18rem; }
.nw-strip-src {
  font-family: "JetBrains Mono", monospace; font-size: .58rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--page-accent, var(--md-accent));
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nw-strip-title {
  font-family: "Noto Sans Telugu", "DM Sans", sans-serif; font-size: .9rem; line-height: 1.38;
  color: var(--bs-emphasis-color); font-weight: 500;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.nw-strip-card:hover .nw-strip-title { color: var(--page-accent, var(--md-accent)); }
.nw-strip-meta { font-size: .68rem; color: var(--ink-soft); font-family: "Noto Sans Telugu", sans-serif; }
.nw-strip-meta i { margin-right: .3rem; }

/* ---------------- responsive: fewer columns, same cell ---------------- */
@media (max-width: 1200px) {
  .nw-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .nw-cell:nth-child(-n+4) { border-top: 1px solid var(--glass-border); }
  .nw-cell:nth-child(-n+3) { border-top: 2px solid var(--bs-emphasis-color); }
}
@media (max-width: 860px) {
  .nw-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nw-cell:nth-child(-n+3) { border-top: 1px solid var(--glass-border); }
  .nw-cell:nth-child(-n+2) { border-top: 2px solid var(--bs-emphasis-color); }
  .nw-bar { align-items: flex-start; }
}
@media (max-width: 560px) {
  .nw-grid { grid-template-columns: minmax(0, 1fr); gap: 1.1rem; }
  .nw-cell:nth-child(-n+2) { border-top: 1px solid var(--glass-border); }
  .nw-cell:first-child { border-top: 2px solid var(--bs-emphasis-color); }
  /* Phones keep the desktop shape: artwork on top, headline under it, deck last.
     (It used to flip to a thumbnail-beside-text row, which cropped the photo.) */
  .nw-cell > a { flex-direction: column; gap: 0; }
  .nw-shot { flex: none; width: 100%; align-self: stretch; margin: 0 0 .7rem; aspect-ratio: 3 / 2; }
  .nw-slot { display: none; }
  .nw-deck { -webkit-line-clamp: 3; }
  .nw-title { font-size: 1.02rem; }
  .nw-title.te { font-size: 1rem; }
  .nw-wm { font-size: .6rem; }
  .nw-select { flex-basis: 100%; }
}

/* ---------------- admin screen bits ---------------- */
.nw-admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .8rem; }
.nw-admin-stat { padding: .85rem 1rem; border: 1px solid var(--glass-border); border-radius: 12px; background: var(--glass-bg); }
.nw-admin-stat b { display: block; font-family: "Bricolage Grotesque", sans-serif; font-size: 1.5rem; line-height: 1.05; color: var(--md-accent); }
.nw-admin-stat span { font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
.nw-dotstat { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: .4rem; background: var(--ink-soft); }
.nw-dotstat.ok { background: #38e1b0; }
.nw-dotstat.fail { background: #ff6b6b; }
.nw-src-feed { font-family: "JetBrains Mono", monospace; font-size: .7rem; color: var(--ink-soft); word-break: break-all; }
.nw-src-name { font-family: "Noto Sans Telugu", "DM Sans", sans-serif; font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  .nw-ticker-track, .nw-dot { animation: none !important; }
  .nw-shot img, .nw-title { transition: none !important; }
}
