/*
Theme Name: National Times
Theme URI: https://nationaltimes.news
Author: National Times
Author URI: https://nationaltimes.news
Description: Ultra-modern international viral news & trend analytics theme. Luxury dark-mode dashboard with light toggle, Radar Impulse logo, viral velocity badges, breaking ticker, Trend Radar sidebar, live reading counters, quick polls, reading progress, Trending Wave mobile bar and infinite scroll. Pairs with the National Times Newsroom plugin (virtual AI editorial staff).
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: nationaltimes
Tags: news, dark, one-column, three-columns, custom-logo, featured-images
*/

:root {
  --ink-950: #07090f;
  --ink-900: #0b0e17;
  --ink-850: #10141f;
  --ink-800: #151a28;
  --ink-700: #1e2436;
  --ink-600: #2a3147;
  --pulse-cyan: #22d3ee;
  --pulse-red: #fb3b4e;
  --pulse-amber: #fbbf24;
  --pulse-violet: #8b5cf6;
  --pulse-lime: #a3e635;
  --bg: var(--ink-950);
  --surface: var(--ink-850);
  --surface-soft: var(--ink-900);
  --border: var(--ink-700);
  --text: #e2e8f0;
  --text-strong: #ffffff;
  --text-soft: #94a3b8;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;
}
html.light {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-soft: #f1f5f9;
  --border: #e2e8f0;
  --text: #334155;
  --text-strong: #0f172a;
  --text-soft: #64748b;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
::selection { background: rgba(34, 211, 238, 0.35); }

.nt-container { max-width: 1600px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 1024px) { .nt-container { padding: 0 32px; } }

.surface { background: var(--surface); border: 1px solid var(--border); }
.text-strong { color: var(--text-strong); }
.text-soft { color: var(--text-soft); }

/* ── Navbar ─────────────────────────────────────────────── */
.nt-nav {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  border-bottom: 1px solid var(--border);
}
.nt-nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.nt-logo { display: flex; align-items: center; gap: 10px; }
.nt-logo-name { font-family: var(--font-display); font-weight: 700; font-size: 19px; color: var(--text-strong); line-height: 1; }
.nt-logo-name .grad {
  background: linear-gradient(90deg, var(--pulse-cyan), var(--pulse-violet), var(--pulse-red), var(--pulse-cyan));
  background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: nt-shimmer 4s linear infinite;
}
.nt-logo-tag { display: block; font-size: 8.5px; font-weight: 600; letter-spacing: 0.28em; text-transform: uppercase; color: var(--text-soft); margin-top: 3px; }
.nt-menu { display: none; gap: 4px; align-items: center; list-style: none; }
@media (min-width: 900px) { .nt-menu { display: flex; } }
.nt-menu a { font-size: 13px; font-weight: 600; color: var(--text-soft); padding: 6px 14px; border-radius: 999px; white-space: nowrap; transition: all .2s; }
.nt-menu a:hover { background: var(--ink-700); color: #fff; }
html.light .nt-menu a:hover { background: #e2e8f0; color: var(--text-strong); }
.nt-nav-right { display: flex; align-items: center; gap: 12px; }
.nt-live { display: none; align-items: center; gap: 8px; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; color: var(--pulse-lime); background: var(--surface-soft); border: 1px solid var(--border); padding: 6px 12px; border-radius: 999px; }
@media (min-width: 1024px) { .nt-live { display: flex; } }
.nt-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pulse-lime); animation: nt-blink 1.6s infinite; }
.nt-toggle { width: 54px; height: 30px; border-radius: 999px; background: var(--surface-soft); border: 1px solid var(--border); cursor: pointer; position: relative; }
.nt-toggle span { position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%; background: var(--ink-700); display: flex; align-items: center; justify-content: center; font-size: 12px; transition: transform .3s cubic-bezier(.4,0,.2,1); }
html.light .nt-toggle span { transform: translateX(24px); background: #fcd34d; }

/* ── Ticker ─────────────────────────────────────────────── */
.nt-ticker { overflow: hidden; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface-soft); padding: 8px 0; }
.nt-ticker-track { display: flex; gap: 40px; white-space: nowrap; width: max-content; animation: nt-scroll 45s linear infinite; }
.nt-ticker-item { font-size: 12px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.nt-ticker-item .tag { background: var(--pulse-red); color: #fff; font-size: 9px; font-weight: 900; text-transform: uppercase; padding: 2px 6px; border-radius: 4px; }
@media (min-width: 1024px) { .nt-ticker-mobile { display: none; } }
.nt-ticker-col { border-radius: 16px; padding: 16px; }
.nt-ticker-col h4 { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.15em; color: var(--pulse-red); display: flex; align-items: center; gap: 8px; }
.nt-ticker-col h4 .nt-dot { background: var(--pulse-red); }
.nt-ticker-col ul { list-style: none; margin-top: 16px; display: grid; gap: 14px; }
.nt-ticker-col li { border-left: 2px solid var(--ink-600); padding-left: 12px; font-size: 13px; line-height: 1.45; }
.nt-ticker-col li a:hover { color: var(--pulse-cyan); }
.nt-ticker-col .t { font-family: monospace; font-size: 10px; color: var(--pulse-cyan); margin-right: 6px; }

/* ── Dashboard layout ───────────────────────────────────── */
.nt-dash { display: grid; grid-template-columns: 1fr; gap: 24px; padding-top: 24px; }
@media (min-width: 1024px) { .nt-dash { grid-template-columns: 280px minmax(0, 1fr) 340px; } }
.nt-rail { display: none; }
@media (min-width: 1024px) { .nt-rail { display: block; } .nt-rail-sticky { position: sticky; top: 80px; display: grid; gap: 20px; } }
.nt-panels-tablet { display: none; }
@media (min-width: 700px) and (max-width: 1023px) { .nt-panels-tablet { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; } }
.nt-panels-mobile { display: grid; gap: 20px; margin-top: 24px; }
@media (min-width: 700px) { .nt-panels-mobile { display: none; } }

/* ── Hero ───────────────────────────────────────────────── */
.nt-hero { position: relative; display: block; border-radius: 24px; overflow: hidden; margin-bottom: 24px; min-height: 300px; box-shadow: 0 8px 32px -12px rgba(0,0,0,.5); }
.nt-hero img.bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .65; transition: transform .7s; }
.nt-hero:hover img.bg { transform: scale(1.05); }
.nt-hero .shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.75), rgba(0,0,0,.15) 60%, transparent); }
.nt-hero .inner { position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-height: 300px; padding: 24px; }
@media (min-width: 1024px) { .nt-hero .inner { min-height: 360px; padding: 36px; } }
.nt-hero h1 { font-family: var(--font-display); color: #fff; font-size: clamp(24px, 3.2vw, 40px); line-height: 1.15; margin-top: 12px; max-width: 680px; }
.nt-hero p { color: rgba(255,255,255,.85); font-size: 15px; margin-top: 12px; max-width: 560px; }
.nt-hero .cta { color: #fff; font-weight: 700; font-size: 14px; margin-top: 16px; }

/* ── Masonry cards ──────────────────────────────────────── */
.nt-grid { columns: 1; column-gap: 20px; }
@media (min-width: 640px) { .nt-grid { columns: 2; } }
@media (min-width: 1500px) { .nt-grid { columns: 2; } }
.nt-card { break-inside: avoid; margin-bottom: 20px; border-radius: 16px; overflow: hidden; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 8px 32px -12px rgba(0,0,0,.5); transition: transform .25s, box-shadow .25s; }
.nt-card:hover { transform: translateY(-4px); box-shadow: 0 0 24px -4px rgba(34,211,238,.45); }
.nt-card-media { position: relative; aspect-ratio: 16/9; overflow: hidden; }
.nt-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s; }
.nt-card:hover .nt-card-media img { transform: scale(1.05); }
.nt-card-media .cat { position: absolute; left: 12px; bottom: 12px; background: rgba(0,0,0,.45); color: #fff; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: 3px 8px; border-radius: 6px; backdrop-filter: blur(4px); }
.nt-card-media .badge-wrap { position: absolute; left: 12px; top: 12px; }
.nt-card-body { padding: 18px; }
.nt-card-body h3 { font-family: var(--font-display); color: var(--text-strong); font-size: 19px; line-height: 1.3; }
.nt-card:hover .nt-card-body h3 { color: var(--pulse-cyan); }
.nt-card-body p { color: var(--text-soft); font-size: 14px; margin-top: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nt-card-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; font-size: 11px; color: var(--text-soft); }
.nt-card-meta .stats { font-family: monospace; display: flex; gap: 12px; }

/* ── Viral badge ────────────────────────────────────────── */
.nt-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; padding: 4px 10px; border-radius: 999px; backdrop-filter: blur(6px); }
.nt-badge.exploding { color: var(--pulse-red); background: rgba(251,59,78,.14); border: 1px solid rgba(251,59,78,.4); }
.nt-badge.rising { color: var(--pulse-amber); background: rgba(251,191,36,.14); border: 1px solid rgba(251,191,36,.4); }
.nt-badge.steady { color: var(--pulse-cyan); background: rgba(34,211,238,.14); border: 1px solid rgba(34,211,238,.4); }
.nt-badge.cooling { color: var(--pulse-violet); background: rgba(139,92,246,.14); border: 1px solid rgba(139,92,246,.4); }

/* ── Sidebar panels ─────────────────────────────────────── */
.nt-panel { border-radius: 16px; padding: 18px; background: var(--surface); border: 1px solid var(--border); }
.nt-panel-title { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .18em; }
.nt-panel-title.cyan { color: var(--pulse-cyan); } .nt-panel-title.violet { color: var(--pulse-violet); }
.nt-radar-scope { display: block; margin: 16px auto; }
.nt-radar-rows { display: grid; gap: 10px; margin-top: 14px; }
.nt-radar-row { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.nt-radar-row .name { width: 118px; font-weight: 600; color: var(--text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nt-radar-row .bar { flex: 1; height: 6px; border-radius: 999px; background: var(--ink-700); overflow: hidden; }
html.light .nt-radar-row .bar { background: #e2e8f0; }
.nt-radar-row .bar i { display: block; height: 100%; border-radius: 999px; background: var(--pulse-cyan); transition: width 1s ease; }
.nt-radar-row .bar i.hot { background: var(--pulse-red); }
.nt-radar-row .delta { width: 56px; text-align: right; font-family: monospace; font-size: 10px; font-weight: 700; color: var(--pulse-lime); }
.nt-radar-row .delta.down { color: var(--pulse-violet); }
.nt-reading { list-style: none; margin-top: 12px; display: grid; gap: 4px; }
.nt-reading li a { display: flex; gap: 12px; padding: 8px; border-radius: 12px; transition: background .2s; }
.nt-reading li a:hover { background: rgba(42,49,71,.4); }
.nt-reading .rank { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--ink-600); min-width: 22px; }
.nt-reading li a:hover .rank { color: var(--pulse-cyan); }
.nt-reading .t { font-size: 13px; font-weight: 600; color: var(--text-strong); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nt-reading .live { display: flex; align-items: center; gap: 6px; font-family: monospace; font-size: 10px; color: var(--pulse-lime); margin-top: 4px; }
.nt-reading .live .nt-dot { width: 6px; height: 6px; }

/* ── Single article ─────────────────────────────────────── */
.nt-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60; background: linear-gradient(90deg, var(--pulse-cyan), var(--pulse-violet), var(--pulse-red)); transform-origin: left; transform: scaleX(0); }
.nt-article { max-width: 760px; margin: 0 auto; padding: 40px 16px 60px; }
.nt-article-head .meta-line { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--text-soft); display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.nt-article h1 { font-family: var(--font-display); color: var(--text-strong); font-size: clamp(28px, 4.5vw, 46px); line-height: 1.15; margin-top: 14px; }
.nt-article .dek { font-size: 18px; color: var(--text-soft); margin-top: 14px; line-height: 1.6; }
.nt-byline { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 12px 0; margin-top: 20px; font-size: 14px; }
.nt-byline .live-count { font-family: monospace; font-size: 12px; color: var(--pulse-lime); }
.nt-article figure { margin: 24px 0; }
.nt-article figure img { border-radius: 16px; width: 100%; max-height: 520px; object-fit: cover; }
.nt-article figcaption { font-size: 11px; color: var(--text-soft); margin-top: 8px; }
.nt-article figcaption a { text-decoration: underline; }
.nt-content { margin-top: 28px; font-size: 17px; line-height: 1.85; display: grid; gap: 22px; }
.nt-content p { color: var(--text); }
.nt-pull { border-left: 4px solid var(--pulse-cyan); padding: 4px 0 4px 20px; margin: 8px 0; }
.nt-pull p { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--text-strong); line-height: 1.4; }
.nt-analysis { border-radius: 16px; border: 1px solid var(--border); border-left: 4px solid var(--pulse-violet); background: var(--surface); padding: 20px; }
.nt-analysis .label { font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .2em; color: var(--pulse-violet); }
.nt-analysis p { font-size: 15px; margin-top: 12px; }
.nt-analysis .read { color: var(--text-strong); font-weight: 600; }
.nt-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.nt-chip { background: var(--surface-soft); border: 1px solid var(--border); color: var(--pulse-cyan); font-size: 11px; font-weight: 600; padding: 4px 12px; border-radius: 999px; }
.nt-sources { font-size: 12px; color: var(--text-soft); }
.nt-sources a { text-decoration: underline; }
.nt-staffbox { border-radius: 12px; background: var(--surface-soft); border: 1px solid var(--border); padding: 14px 16px; font-size: 11px; line-height: 1.7; color: var(--text-soft); }
.nt-staffbox b { color: var(--text-strong); }

/* ── Poll ───────────────────────────────────────────────── */
.nt-poll { border-radius: 16px; border: 1px solid var(--border); border-left: 4px solid var(--pulse-cyan); background: var(--surface); padding: 20px; }
.nt-poll .label { font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .2em; color: var(--pulse-cyan); }
.nt-poll h4 { font-family: var(--font-display); color: var(--text-strong); font-size: 18px; margin-top: 8px; }
.nt-poll-opts { display: grid; gap: 10px; margin-top: 14px; }
.nt-poll-opt { position: relative; overflow: hidden; text-align: left; width: 100%; border: 1px solid var(--ink-600); background: transparent; color: var(--text-soft); font: inherit; font-size: 14px; font-weight: 600; padding: 10px 16px; border-radius: 12px; cursor: pointer; transition: all .2s; }
html.light .nt-poll-opt { border-color: #cbd5e1; }
.nt-poll-opt:hover { border-color: var(--pulse-cyan); color: var(--text-strong); }
.nt-poll-opt .fill { position: absolute; inset: 0 auto 0 0; width: 0; background: rgba(34,211,238,.18); transition: width .7s ease; }
.nt-poll-opt .row { position: relative; display: flex; justify-content: space-between; }
.nt-poll-opt.picked { border-color: var(--pulse-cyan); color: var(--text-strong); }
.nt-poll-note { font-size: 11px; color: var(--text-soft); margin-top: 10px; }

/* ── Share ──────────────────────────────────────────────── */
.nt-share { display: flex; flex-wrap: wrap; gap: 10px; margin: 28px 0; }
.nt-share a, .nt-share button { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 12px; font-weight: 700; padding: 8px 16px; border-radius: 999px; cursor: pointer; border: none; transition: transform .15s; }
.nt-share a:hover, .nt-share button:hover { transform: scale(1.05); }
.nt-share .x { background: #000; color: #fff; border: 1px solid rgba(255,255,255,.25); }
.nt-share .wa { background: #25d366; color: #04210f; }
.nt-share .cp { background: var(--surface-soft); color: var(--text-strong); border: 1px solid var(--border); }

/* ── Up next ────────────────────────────────────────────── */
.nt-next { display: block; border-radius: 16px; overflow: hidden; background: var(--surface); border: 1px solid var(--border); margin: 24px 0 40px; transition: box-shadow .25s; }
.nt-next:hover { box-shadow: 0 0 24px -4px rgba(34,211,238,.45); }
.nt-next .bar { height: 6px; background: linear-gradient(90deg, var(--pulse-cyan), var(--pulse-violet)); }
.nt-next .inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px; }
.nt-next .label { font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .2em; color: var(--pulse-red); }
.nt-next h4 { font-family: var(--font-display); color: var(--text-strong); font-size: 18px; line-height: 1.35; margin-top: 6px; }
.nt-next:hover h4 { color: var(--pulse-cyan); }
.nt-next .arrow { font-size: 22px; color: var(--pulse-cyan); }

/* ── Trending wave bar (mobile) ─────────────────────────── */
.nt-wave { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: color-mix(in srgb, var(--ink-900) 92%, transparent); backdrop-filter: blur(16px); border-top: 1px solid var(--border); }
html.light .nt-wave { background: rgba(255,255,255,.92); }
@media (min-width: 1024px) { .nt-wave { display: none; } }
.nt-wave a { display: flex; align-items: center; gap: 12px; height: 62px; padding: 0 16px; }
.nt-eq { display: flex; align-items: flex-end; gap: 3px; height: 26px; }
.nt-eq i { width: 3px; border-radius: 999px; background: var(--pulse-cyan); animation: nt-wavebar 1.4s ease-in-out infinite; transform-origin: bottom; }
.nt-wave .lbl { font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .2em; color: var(--pulse-red); }
.nt-wave .ttl { font-size: 13px; font-weight: 600; color: var(--text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nt-wave .go { color: var(--pulse-cyan); font-size: 18px; }
body.single .nt-wave, body.home .nt-wave { padding-bottom: env(safe-area-inset-bottom); }
body { padding-bottom: 70px; }
@media (min-width: 1024px) { body { padding-bottom: 0; } }

/* ── Load more / footer ─────────────────────────────────── */
.nt-loadmore { display: flex; justify-content: center; padding: 24px 0 40px; }
.nt-loadmore button { font: inherit; font-size: 13px; font-weight: 700; color: #04121a; background: var(--pulse-cyan); border: none; border-radius: 999px; padding: 10px 28px; cursor: pointer; box-shadow: 0 0 24px -4px rgba(34,211,238,.45); }
.nt-loadmore button[disabled] { opacity: .5; cursor: default; }
.nt-footer { border-top: 1px solid var(--border); background: var(--surface-soft); margin-top: 40px; }
.nt-footer-grid { display: grid; gap: 32px; padding: 44px 0; grid-template-columns: 1fr; }
@media (min-width: 700px) { .nt-footer-grid { grid-template-columns: repeat(3, 1fr); } }
.nt-footer h5 { font-family: var(--font-display); font-size: 20px; color: var(--text-strong); }
.nt-footer h6 { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; color: var(--text-strong); margin-bottom: 12px; }
.nt-footer p, .nt-footer li { font-size: 13px; color: var(--text-soft); }
.nt-footer ul { list-style: none; display: grid; gap: 8px; }
.nt-footer ul a:hover { color: var(--pulse-cyan); }
.nt-copy { border-top: 1px solid var(--border); text-align: center; font-size: 11px; color: var(--text-soft); padding: 18px 0; }

/* ── WP defaults ────────────────────────────────────────── */
.alignwide, .alignfull { width: 100%; }
.wp-caption { max-width: 100%; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.nt-content ul, .nt-content ol { padding-left: 24px; }
.nt-content blockquote { border-left: 4px solid var(--pulse-cyan); padding-left: 20px; font-style: italic; }
.nt-content h2, .nt-content h3 { font-family: var(--font-display); color: var(--text-strong); line-height: 1.3; }

/* ── Animations ─────────────────────────────────────────── */
@keyframes nt-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes nt-shimmer { from { background-position: 0% center; } to { background-position: 200% center; } }
@keyframes nt-blink { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes nt-wavebar { 0%,100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }
@keyframes nt-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
