/* News page — extends the shared /styles.css (loaded first). News-only styles. */
:root { --news-radius: 0; }

.news-hero { padding: 32px 0 18px; }
/* Tighten the live dot so it sits right next to the NEWS DESK text (≤4px). */
.news-hero .eyebrow .eyebrow-dot { margin-right: 4px; }
.news-hero h1 { margin: 0 0 8px; font-size: clamp(30px, 3.4vw, 48px); line-height: 1.04; font-weight: 900; }
.news-sub { margin: 0 0 18px; color: var(--muted); font-size: 15px; max-width: 720px; }

.news-tabs { display: inline-flex; gap: 6px; border: 1px solid var(--line); padding: 4px; background: rgba(255, 255, 255, 0.025); }
.news-tab { border: 1px solid transparent; background: transparent; color: var(--muted); padding: 8px 14px; font-size: 12px; font-weight: 800; cursor: pointer; border-radius: 0; transition: color .15s ease, background .15s ease, border-color .15s ease; }
.news-tab:hover, .news-tab.active { color: var(--text); background: var(--green-soft, rgba(22,242,139,.1)); border-color: var(--line-green, rgba(22,242,139,.28)); }

.news-state { color: var(--muted); padding: 40px 0; text-align: center; }
.news-status { padding: 14px 0 0; font-size: 13px; }

.news-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin: 18px 0 48px; }

.news-card { display: flex; flex-direction: column; border: 1px solid var(--line); background: var(--panel, rgba(3,7,5,.96)); cursor: pointer; overflow: hidden; text-decoration: none; color: inherit; transition: border-color .18s ease, transform .18s ease; }
.news-card:hover { border-color: var(--line-green, rgba(22,242,139,.28)); transform: translateY(-2px); }

.news-card-img { position: relative; height: 140px; background: rgba(255, 255, 255, 0.04); overflow: hidden; display: grid; place-items: center; }
.news-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.news-card-img .news-img-fallback { color: var(--muted); font-size: 26px; }

.news-card-body { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px 14px; flex: 1; }
.news-meta { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; }
.news-meta .news-dot { opacity: .6; }
.news-headline { margin: 0; font-size: 14px; font-weight: 500; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.news-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: auto; }
.news-tag { font-size: 9px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; padding: 2px 6px; border: 1px solid var(--line); color: var(--muted); border-radius: 999px; }
.news-tag.is-sol { color: var(--mint, #16f28b); border-color: var(--line-green, rgba(22,242,139,.4)); background: var(--green-soft, rgba(22,242,139,.1)); }

/* Skeleton loading */
.news-card.skeleton { cursor: default; }
.news-card.skeleton .news-card-img, .news-card.skeleton .sk-line { background: linear-gradient(90deg, rgba(255,255,255,.05), rgba(255,255,255,.1), rgba(255,255,255,.05)); background-size: 200% 100%; animation: news-shimmer 1.2s infinite; }
.news-card.skeleton .sk-line { height: 12px; border-radius: 3px; }
.news-card.skeleton .sk-line.short { width: 50%; }
@media (prefers-reduced-motion: reduce) { .news-card.skeleton .news-card-img, .news-card.skeleton .sk-line { animation: none; } }
@keyframes news-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Pagination */
.news-count { color: var(--muted); font-size: 12px; text-align: center; margin: 4px 0 12px; }
.news-pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin: 0 0 48px; }
.pg-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.025); color: var(--text); font: inherit; font-size: 13px; font-weight: 800; cursor: pointer; border-radius: 0; transition: color .15s ease, background .15s ease, border-color .15s ease; }
.pg-btn:hover:not(:disabled):not(.active) { background: var(--green-soft, rgba(22,242,139,.1)); border-color: var(--line-green, rgba(22,242,139,.28)); }
.pg-btn.active { background: var(--mint, #16f28b); border-color: var(--mint, #16f28b); color: #04130c; cursor: default; }
.pg-btn:disabled { opacity: .4; cursor: not-allowed; }
.pg-ellipsis { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 32px; color: var(--muted); }

@media (max-width: 900px) { .news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .news-grid { grid-template-columns: 1fr; } }

/* ── Missing/broken image placeholder (clean, no broken-image icon) ── */
.news-card-img--ph { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: #1a1a2e; color: var(--muted, #8a93a6); text-align: center; padding: 12px; }
.news-card-img--ph .news-ph-source { font-size: 15px; font-weight: 800; letter-spacing: .02em; color: rgba(255,255,255,.55); text-transform: uppercase; }
.news-card-img--ph .news-ph-icon { color: rgba(255,255,255,.35); display: inline-flex; }
html.light-theme .news-card-img--ph { background: #e8eaf0; }
html.light-theme .news-card-img--ph .news-ph-source { color: rgba(20,22,30,.5); }
html.light-theme .news-card-img--ph .news-ph-icon { color: rgba(20,22,30,.4); }

/* ── In-page article modal (auto-adapts to theme via CSS variables) ── */
.news-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 24px; opacity: 0; transition: opacity .2s ease; }
.news-modal.is-open { opacity: 1; }
.news-modal[hidden] { display: none; }
.news-modal-overlay { position: absolute; inset: 0; background: rgba(0, 0, 0, .75); }
.news-modal-card { position: relative; z-index: 1; width: 100%; max-width: 720px; max-height: 85vh; overflow-y: auto; background: var(--panel, #0a0f0c); color: var(--text, #e8fff2); border: 1px solid var(--line); border-radius: 14px; padding: 2rem; box-shadow: 0 24px 80px rgba(0, 0, 0, .5); }
.news-modal-close { position: absolute; top: 12px; right: 12px; z-index: 2; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 8px; background: var(--panel, rgba(0, 0, 0, .4)); color: var(--text); font-size: 22px; line-height: 1; cursor: pointer; transition: background .15s ease, border-color .15s ease; }
.news-modal-close:hover { background: var(--green-soft, rgba(22, 242, 139, .12)); border-color: var(--mint); }
.news-modal-img { margin: -.5rem 0 1rem; border-radius: 10px; overflow: hidden; }
.news-modal-img img { display: block; width: 100%; max-height: 280px; object-fit: cover; }
.news-modal-meta { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; }
.news-modal-meta .news-dot { opacity: .6; }
.news-modal-headline { margin: .5rem 0 0; font-size: 22px; font-weight: 500; line-height: 1.3; color: var(--text); }
.news-modal-divider { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }
.news-modal-text { font-size: 15px; line-height: 1.7; color: var(--text); }
.news-modal-text p { margin: 0 0 1rem; }
.news-modal-text p:last-child { margin-bottom: 0; }
.news-modal-empty { font-size: 15px; line-height: 1.7; color: var(--muted); }
.news-modal-tags { margin-top: 1.25rem; }
.news-modal-source-link { display: inline-block; margin-top: 1.5rem; color: var(--muted); font-size: 13px; text-decoration: none; }
.news-modal-source-link:hover { color: var(--mint, #16f28b); }
body.news-modal-open { overflow: hidden; }

/* Light theme: white modal surface */
html.light-theme .news-modal-card { background: #ffffff; color: #111111; border-color: #e0e0e0; }
html.light-theme .news-modal-close { background: #ffffff; color: #111111; border-color: #e0e0e0; }
html.light-theme .news-modal-headline, html.light-theme .news-modal-text { color: #111111; }
html.light-theme .news-modal-divider { border-top-color: #e0e0e0; }

/* Mobile: full-screen modal */
@media (max-width: 620px) {
  .news-modal { padding: 0; }
  .news-modal-card { max-width: 100vw; width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; border: 0; padding: 1.25rem; }
  .news-modal-img { margin-top: .25rem; }
}
@media (prefers-reduced-motion: reduce) { .news-modal { transition: none; } }

/* ── Breaking badge, source-count indicator, card badges row ── */
.news-breaking-badge { position: absolute; top: 8px; left: 8px; z-index: 2; background: #e3342f; color: #fff; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 3px 7px; border-radius: 4px; box-shadow: 0 2px 8px rgba(227, 52, 47, .45); }
.news-breaking-badge.in-modal { position: static; display: inline-block; }
.news-badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.news-srccount { font-size: 10px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; padding: 2px 7px; border: 1px solid var(--line); color: var(--muted); border-radius: 999px; }
.news-modal-meta .news-srccount { text-transform: uppercase; }

/* ── Full article content rendered from feed ── */
.news-modal-text img { max-width: 100%; height: auto; border-radius: 8px; margin: 1rem 0; display: block; }
.news-modal-text figure { margin: 1rem 0; }
.news-modal-text figure img { margin: 0; }
.news-modal-text figcaption { font-size: 12px; color: var(--muted); margin-top: .4rem; text-align: center; }
.news-modal-text h2 { font-size: 19px; }
.news-modal-text h3 { font-size: 17px; }
.news-modal-text h4 { font-size: 15px; }
.news-modal-text h2, .news-modal-text h3, .news-modal-text h4 { font-weight: 700; line-height: 1.3; margin: 1.5rem 0 .6rem; color: var(--text); }
.news-modal-text ul, .news-modal-text ol { margin: 0 0 1rem; padding-left: 1.4rem; }
.news-modal-text li { margin: 0 0 .4rem; }
.news-modal-text a { color: var(--text); text-decoration: none; cursor: pointer; word-break: break-word; }
.news-modal-text, .news-modal-text p, .news-modal-text li, .news-modal-text strong, .news-modal-text b, .news-modal-text em, .news-modal-text i, .news-modal-text span, .news-modal-text a { color: var(--text); }
.news-modal-text blockquote { margin: 1rem 0; padding: .6rem 1rem; border-left: 3px solid var(--mint, #16f28b); background: var(--green-soft, rgba(22, 242, 139, .08)); color: var(--text); border-radius: 0 6px 6px 0; }
.news-modal-text blockquote p:last-child { margin-bottom: 0; }
.news-modal-text strong, .news-modal-text b { font-weight: 700; }
.news-modal-text em, .news-modal-text i { font-style: italic; }
.news-modal-text table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 14px; display: block; overflow-x: auto; }
.news-modal-text th, .news-modal-text td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; }
.news-modal-text hr { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }
html.light-theme .news-modal-text h2, html.light-theme .news-modal-text h3, html.light-theme .news-modal-text h4 { color: #111111; }
html.light-theme .news-modal-text blockquote { color: #111111; }
html.light-theme .news-srccount { border-color: #e0e0e0; }
