/*
Theme Name: SoilTune News
Theme URI: https://soiltune.com/
Author: SoilTune
Description: Modern technology and AI news theme for soiltune.com. Framework-free, fast, dark-mode ready.
Version: 1.0.0
Requires at least: 6.4
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: soiltune
*/

/* ---------------------------------------------------------
   1. Design tokens
--------------------------------------------------------- */
:root {
  --bg: #ffffff;
  --bg-alt: #f4f6f8;
  --surface: #ffffff;
  --ink: #0b0f14;
  --ink-2: #2b3542;
  --muted: #627083;
  --line: #e4e8ee;
  --line-strong: #cdd5df;
  --brand: #e11d2e;
  --brand-dark: #b3121f;
  --brand-ink: #ffffff;
  --ok: #0f766e;

  --cat-ai: #6d28d9;
  --cat-gadgets: #0369a1;
  --cat-software: #0f766e;
  --cat-security: #b91c1c;
  --cat-startups: #c2410c;
  --cat-reviews: #4d7c0f;
  --cat-big-tech: #334155;
  --cat-science: #7c3aed;
  --cat-chips: #b45309;
  --cat-policy: #1d4ed8;
  --cat-default: #334155;

  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --display: "Inter Tight", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;

  --max: 1240px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(9, 16, 26, .05), 0 10px 30px rgba(9, 16, 26, .07);
  --shadow-sm: 0 1px 2px rgba(9, 16, 26, .06);
  --header-h: 66px;
}

[data-theme="dark"] {
  --bg: #0a0e13;
  --bg-alt: #111823;
  --surface: #121a24;
  --ink: #f1f5f9;
  --ink-2: #c7d2de;
  --muted: #90a0b3;
  --line: #223041;
  --line-strong: #33465c;
  --brand: #ff3b4a;
  --brand-dark: #ff5d6a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 32px rgba(0, 0, 0, .35);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
}

/* ---------------------------------------------------------
   2. Reset / base
--------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4, h5 { margin: 0; font-family: var(--display); letter-spacing: -.015em; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; }
figure { margin: 0; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--brand); color: #fff; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 6px;
  transition: top .15s ease;
}
.skip-link:focus { top: 12px; }

/* ---------------------------------------------------------
   3. Top bar
--------------------------------------------------------- */
.topbar {
  background: var(--ink);
  color: #e9eef4;
  font-size: 12px;
  letter-spacing: .01em;
}
.topbar-in {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; min-height: 36px;
}
.topbar-date { white-space: nowrap; opacity: .85; }
.topbar-tag {
  font-weight: 600; text-transform: uppercase; letter-spacing: .12em; font-size: 10.5px;
  color: #fff; opacity: .9;
}
.topbar-links { display: flex; gap: 18px; align-items: center; }
.topbar-links a { opacity: .82; }
.topbar-links a:hover { opacity: 1; color: #fff; }
.topbar-social { display: flex; gap: 12px; align-items: center; opacity: .85; }
.topbar-social a { display: inline-flex; }
.topbar-social svg { width: 15px; height: 15px; fill: currentColor; }

/* ---------------------------------------------------------
   4. Masthead / navigation
--------------------------------------------------------- */
.masthead {
  position: sticky; top: 0; z-index: 90;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.masthead.is-stuck { box-shadow: 0 6px 24px rgba(9, 16, 26, .08); }
.masthead-in {
  display: grid; grid-template-columns: auto 1fr auto;
  align-items: center; gap: 26px; min-height: var(--header-h);
}
.brand { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; background: var(--ink); color: var(--bg);
  display: grid; place-items: center; font-family: var(--display); font-weight: 900; font-size: 18px;
  letter-spacing: -.04em;
}
[data-theme="dark"] .brand-mark { background: var(--brand); color: #fff; }
.brand-word {
  font-family: var(--display); font-weight: 900; font-size: 24px;
  letter-spacing: -.045em; line-height: 1; text-transform: uppercase;
}
.brand-word span { color: var(--brand); }
.brand-tag {
  display: block; font-family: var(--sans); font-size: 9px; font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin-top: 3px;
}

.main-nav { justify-self: center; }
.main-nav ul { display: flex; align-items: center; gap: 2px; list-style: none; }
.main-nav li { position: relative; }
.main-nav a {
  display: block; padding: 10px 12px; border-radius: 6px;
  font-size: 12.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink-2); white-space: nowrap;
}
.main-nav a:hover, .main-nav .current-menu-item > a { color: var(--brand); background: var(--bg-alt); }
.main-nav .menu-item-has-children > a::after { content: "▾"; font-size: 9px; margin-left: 5px; opacity: .6; }
.main-nav .sub-menu {
  position: absolute; top: 100%; left: 0; min-width: 190px; padding: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow); display: none; flex-direction: column; gap: 2px; z-index: 20;
}
.main-nav li:hover .sub-menu, .main-nav li:focus-within .sub-menu { display: flex; }

.mast-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center;
  background: transparent; border: 1px solid var(--line); border-radius: 8px; cursor: pointer;
  color: var(--ink-2); transition: border-color .15s, color .15s, background .15s;
}
.icon-btn:hover { border-color: var(--line-strong); color: var(--ink); background: var(--bg-alt); }
.icon-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; }
.btn-sub {
  display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 16px;
  background: var(--brand); color: #fff; border-radius: 8px;
  font-size: 12.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  transition: background .15s;
}
.btn-sub:hover { background: var(--brand-dark); }
.nav-toggle { display: none; }

/* ---------------------------------------------------------
   5. Latest ticker
--------------------------------------------------------- */
.ticker { background: var(--surface); border-bottom: 1px solid var(--line); }
.ticker-in { display: flex; align-items: stretch; max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.ticker-label {
  display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0;
  background: var(--brand); color: #fff; font-size: 10.5px; font-weight: 800;
  letter-spacing: .14em; text-transform: uppercase; padding: 0 13px; margin: 8px 0;
  border-radius: 4px;
}
.ticker-label i { width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: pulse 1.6s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.ticker-track { position: relative; overflow: hidden; flex: 1; padding-left: 18px; }
.ticker-move { display: flex; align-items: center; gap: 46px; white-space: nowrap; animation: ticker 55s linear infinite; width: max-content; }
.ticker-track:hover .ticker-move { animation-play-state: paused; }
.ticker-item { display: inline-flex; align-items: center; gap: 9px; padding: 11px 0; font-size: 12.5px; color: var(--ink-2); }
.ticker-item:hover { color: var(--brand); }
.ticker-item b { color: var(--brand); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; }
.ticker-item span.dot { width: 3px; height: 3px; border-radius: 50%; background: var(--line-strong); }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------------------------------------------------------
   6. Search overlay
--------------------------------------------------------- */
.search-overlay {
  position: fixed; inset: 0; z-index: 120; background: rgba(6, 10, 15, .72);
  backdrop-filter: blur(6px); display: none; padding: 12vh 20px 0;
}
.search-overlay.open { display: block; }
.search-box {
  max-width: 680px; margin: 0 auto; background: var(--surface);
  border-radius: 14px; padding: 22px; box-shadow: var(--shadow);
}
.search-box label { display: block; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.search-row { display: flex; gap: 8px; }
.search-row input[type="search"] {
  flex: 1; height: 50px; padding: 0 16px; font-size: 17px;
  border: 1px solid var(--line-strong); border-radius: 8px; background: var(--bg); color: var(--ink);
}
.search-row button {
  height: 50px; padding: 0 22px; border: 0; border-radius: 8px;
  background: var(--brand); color: #fff; font-weight: 700; cursor: pointer;
}
.search-hint { margin-top: 12px; font-size: 12px; color: var(--muted); }
.search-close { position: absolute; top: 22px; right: 24px; background: none; border: 0; color: #fff; font-size: 26px; cursor: pointer; }

/* ---------------------------------------------------------
   7. Categories / chips
--------------------------------------------------------- */
.cat-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  color: var(--cat, var(--brand)); white-space: nowrap;
}
.cat-chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.cat-chip.on-dark { color: #fff; }

/* ---------------------------------------------------------
   8. Lead section
--------------------------------------------------------- */
.lead { display: grid; grid-template-columns: minmax(0, 2.05fr) minmax(0, 1fr); gap: 30px; padding: 26px 0 8px; }
.lead-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.lead-main .thumb { aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: var(--bg-alt); position: relative; }
.lead-main .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.lead-main:hover .thumb img { transform: scale(1.025); }
.lead-main h2 {
  font-size: clamp(28px, 3.5vw, 44px); line-height: 1.06; font-weight: 800; letter-spacing: -.03em;
}
.lead-main h2 a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.lead-main .dek { font-size: 16.5px; color: var(--muted); line-height: 1.55; max-width: 60ch; }

.lead-side { display: flex; flex-direction: column; gap: 18px; min-width: 0; border-left: 1px solid var(--line); padding-left: 26px; }
.story-sm { display: grid; grid-template-columns: 1fr 104px; gap: 14px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.story-sm:last-of-type { border-bottom: 0; padding-bottom: 0; }
.story-sm h3 { font-size: 16.5px; line-height: 1.25; font-weight: 700; margin-top: 6px; }
.story-sm h3 a:hover { color: var(--brand); }
.story-sm .thumb { aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--bg-alt); }
.story-sm .thumb img { width: 100%; height: 100%; object-fit: cover; }
.story-sm .meta { margin-top: 6px; }

.trending { margin-top: 4px; }
.trending-head {
  display: flex; align-items: center; gap: 8px; padding-bottom: 8px;
  border-bottom: 2px solid var(--ink); margin-bottom: 4px;
  font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
}
.trending-head svg { width: 13px; height: 13px; fill: var(--brand); }
.trending ol { list-style: none; counter-reset: tr; }
.trending li { counter-increment: tr; display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.trending li:last-child { border-bottom: 0; }
.trending li::before {
  content: counter(tr); font-family: var(--display); font-size: 17px; font-weight: 800;
  color: var(--line-strong); line-height: 1.2; min-width: 20px;
}
.trending a { font-size: 13.5px; font-weight: 600; line-height: 1.4; }
.trending a:hover { color: var(--brand); }

/* ---------------------------------------------------------
   9. Cards / grids
--------------------------------------------------------- */
.meta { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; font-size: 11.5px; color: var(--muted); }
.meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--line-strong); }
.meta .author { color: var(--ink-2); font-weight: 600; }

.section { padding: 34px 0 10px; }
.sec-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  padding-bottom: 12px; margin-bottom: 22px; border-bottom: 2px solid var(--ink);
}
.sec-head h2 { font-size: 21px; font-weight: 800; letter-spacing: -.02em; text-transform: uppercase; display: flex; align-items: center; gap: 10px; }
.sec-head h2::before { content: ""; width: 9px; height: 9px; background: var(--brand); display: inline-block; }
.sec-head .sub { font-size: 12.5px; color: var(--muted); margin: 3px 0 0; }
.sec-head .all { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--brand); white-space: nowrap; }
.sec-head .all:hover { text-decoration: underline; }

.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 26px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px; }

.card { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.card .thumb { aspect-ratio: 3 / 2; border-radius: var(--radius-sm); overflow: hidden; background: var(--bg-alt); }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card:hover .thumb img { transform: scale(1.03); }
.card h3 { font-size: 18px; line-height: 1.28; font-weight: 700; }
.card h3 a:hover { color: var(--brand); }
.card .dek { font-size: 13.5px; color: var(--muted); line-height: 1.5; margin: 0; }
.card .meta { margin-top: auto; }

.card-wide { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 20px; align-items: center; }
.card-wide h3 { font-size: 22px; }
.card-wide .thumb { aspect-ratio: 16 / 10; border-radius: var(--radius-sm); overflow: hidden; background: var(--bg-alt); }

.thumb-fallback {
  width: 100%; height: 100%; display: grid; place-items: center; overflow: hidden;
  background:
    radial-gradient(120% 120% at 15% 10%, color-mix(in srgb, var(--cat, #334155) 30%, transparent), transparent 60%),
    linear-gradient(135deg, color-mix(in srgb, var(--cat, #334155) 88%, #000), color-mix(in srgb, var(--cat, #334155) 40%, #000));
  color: rgba(255, 255, 255, .82);
  font-family: var(--display); font-weight: 800; font-size: clamp(8px, 9cqi, 15px);
  line-height: 1.2; letter-spacing: .12em; text-transform: uppercase; text-align: center; padding: 8px;
}

/* Let the fallback label scale with its thumbnail instead of clipping. */
.lead-main .thumb, .story-sm .thumb, .card .thumb, .card-wide .thumb, .band-list .thumb { container-type: inline-size; }

/* ---------------------------------------------------------
   10. Category band
--------------------------------------------------------- */
.band { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 28px; }
.band-list { display: flex; flex-direction: column; }
.band-list article { display: grid; grid-template-columns: 92px 1fr; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.band-list article:first-child { padding-top: 0; }
.band-list article:last-child { border-bottom: 0; }
.band-list h3 { font-size: 15.5px; line-height: 1.3; font-weight: 700; margin-top: 4px; }
.band-list h3 a:hover { color: var(--brand); }
.band-list .thumb { aspect-ratio: 1; border-radius: 6px; overflow: hidden; background: var(--bg-alt); }
.band-list .thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ---------------------------------------------------------
   11. Newsletter
--------------------------------------------------------- */
.newsletter {
  margin: 38px 0; border-radius: 14px; overflow: hidden;
  background:
    radial-gradient(900px 300px at 90% -20%, rgba(225, 29, 46, .35), transparent 60%),
    linear-gradient(120deg, #0b0f14, #1b2634);
  color: #fff; padding: 34px 36px;
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; align-items: center;
}
.newsletter h2 { font-size: clamp(22px, 2.6vw, 30px); line-height: 1.15; font-weight: 800; letter-spacing: -.02em; }
.newsletter p { color: #c3cfdc; font-size: 14px; margin: 8px 0 0; max-width: 46ch; }
.newsletter-form { display: flex; gap: 8px; }
.newsletter-form input {
  flex: 1; min-width: 0; height: 48px; padding: 0 16px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .2);
  background: rgba(255, 255, 255, .08); color: #fff; font-size: 14px;
}
.newsletter-form input::placeholder { color: #93a4b8; }
.newsletter-form button {
  height: 48px; padding: 0 20px; border: 0; border-radius: 8px; background: var(--brand);
  color: #fff; font-weight: 700; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.newsletter-form button:hover { background: var(--brand-dark); }
.newsletter small { display: block; margin-top: 9px; font-size: 11px; color: #8fa1b5; }
.inline-newsletter { grid-template-columns: 1fr; gap: 16px; padding: 26px 28px; margin: 34px 0; }
.inline-newsletter h2 { font-size: clamp(20px, 2.4vw, 26px); }
.inline-newsletter .newsletter-form { max-width: 520px; }
@media (max-width: 520px) {
  .inline-newsletter .newsletter-form { flex-direction: column; }
}

/* ---------------------------------------------------------
   12. Sidebar
--------------------------------------------------------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 46px; align-items: start; }
.sidebar { position: sticky; top: calc(var(--header-h) + 18px); display: flex; flex-direction: column; gap: 26px; }
.widget { border-top: 2px solid var(--ink); padding-top: 12px; }
.widget-title {
  font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
}
.widget-title::before { content: ""; width: 7px; height: 7px; background: var(--brand); }
.widget ul { list-style: none; }
.widget li { border-bottom: 1px solid var(--line); padding: 9px 0; font-size: 13.5px; }
.widget li:last-child { border-bottom: 0; }
.widget li a:hover { color: var(--brand); }
.widget .count { color: var(--muted); font-size: 11px; margin-left: 4px; }
.widget-ad { min-height: 250px; border: 1px dashed var(--line-strong); border-radius: 10px; display: grid; place-items: center; color: var(--muted); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }

/* Ad slots render only when an AdSense client ID is configured. */
.ad-slot { margin: 26px 0; }
.ad-slot-leaderboard { min-height: 90px; }
.ad-slot ins { display: block; }

/* ---------------------------------------------------------
   13. Article
--------------------------------------------------------- */
.article-wrap { padding: 26px 0 40px; }
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; font-size: 11.5px; color: var(--muted); margin-bottom: 18px; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--brand); }
.breadcrumbs .sep { opacity: .5; }
.article-head { max-width: 820px; }
.article-cat { margin-bottom: 12px; }
.article-title {
  font-size: clamp(30px, 4.4vw, 50px); line-height: 1.05; font-weight: 800;
  letter-spacing: -.03em; margin-bottom: 16px;
}
.article-dek { font-size: 18px; line-height: 1.55; color: var(--muted); margin-bottom: 22px; max-width: 72ch; }
.article-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
  padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  font-size: 12.5px; color: var(--muted);
}
.byline { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; background: var(--ink); color: var(--bg);
  display: grid; place-items: center; font-weight: 800; font-size: 13px; flex-shrink: 0;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.byline b { display: block; color: var(--ink); font-size: 13px; }
.byline span { font-size: 11.5px; }
.share { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.share a, .share button {
  width: 32px; height: 32px; border-radius: 6px; border: 1px solid var(--line);
  display: grid; place-items: center; background: transparent; cursor: pointer; color: var(--ink-2);
}
.share a:hover, .share button:hover { border-color: var(--brand); color: var(--brand); }
.share svg { width: 14px; height: 14px; fill: currentColor; }

.article-hero { margin: 26px 0 0; border-radius: var(--radius); overflow: hidden; background: var(--bg-alt); }
.article-hero img { width: 100%; max-height: 560px; object-fit: cover; }
.article-hero figcaption { font-size: 11.5px; color: var(--muted); padding: 9px 2px 0; }

.article-body {
  max-width: 760px; font-family: var(--serif); font-size: 19px; line-height: 1.72; color: var(--ink-2);
}
.article-body p { margin: 0 0 1.25em; }
.article-body > p:first-of-type::first-letter {
  float: left; font-family: var(--display); font-size: 64px; line-height: .82;
  font-weight: 800; padding: 6px 10px 0 0; color: var(--ink);
}
.article-body h2 { font-family: var(--display); font-size: 27px; line-height: 1.2; font-weight: 800; color: var(--ink); margin: 1.7em 0 .6em; letter-spacing: -.02em; }
.article-body h3 { font-family: var(--display); font-size: 21px; font-weight: 700; color: var(--ink); margin: 1.5em 0 .5em; }
.article-body a { color: var(--brand); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.article-body ul, .article-body ol { margin: 0 0 1.3em; padding-left: 1.3em; }
.article-body li { margin-bottom: .5em; }
.article-body blockquote {
  margin: 1.6em 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--brand);
  font-size: 21px; line-height: 1.5; color: var(--ink);
}
.article-body blockquote p:last-child { margin-bottom: 0; }
.article-body figure { margin: 1.6em 0; }
.article-body figure img { border-radius: 8px; width: 100%; }
.article-body figcaption { font-family: var(--sans); font-size: 12px; color: var(--muted); margin-top: 8px; }
.article-body table { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: 14px; margin: 1.5em 0; }
.article-body th, .article-body td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.article-body th { background: var(--bg-alt); font-weight: 700; color: var(--ink); }
.article-body code { background: var(--bg-alt); padding: 2px 6px; border-radius: 4px; font-size: .86em; }
.article-body pre { background: #0b0f14; color: #e6edf3; padding: 18px; border-radius: 8px; overflow: auto; font-size: 14px; line-height: 1.5; }
.article-body pre code { background: none; padding: 0; color: inherit; }
.article-body hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 32px 0 0; }
.tags a {
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 6px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted);
}
.tags a:hover { border-color: var(--brand); color: var(--brand); }

.author-box {
  display: grid; grid-template-columns: 56px 1fr; gap: 16px; align-items: start;
  margin: 36px 0 0; padding: 22px; background: var(--bg-alt); border-radius: 12px;
}
.author-box .avatar { width: 56px; height: 56px; font-size: 18px; }
.author-box h4 { font-family: var(--display); font-size: 16px; font-weight: 800; margin-bottom: 4px; }
.author-box p { font-size: 13.5px; color: var(--muted); margin: 0; }

.progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--brand); z-index: 200; transition: width .1s linear; }

/* ---------------------------------------------------------
   14. Category header / pagination
--------------------------------------------------------- */
.cat-head { padding: 34px 0 22px; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.cat-head .kicker { font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--brand); }
.cat-head h1 { font-size: clamp(30px, 4vw, 44px); font-weight: 800; letter-spacing: -.03em; margin: 8px 0 8px; }
.cat-head p { max-width: 70ch; color: var(--muted); font-size: 15px; margin: 0; }
.cat-head .count { font-size: 12px; color: var(--muted); margin-top: 10px; }

.pagination { display: flex; justify-content: center; gap: 6px; margin: 40px 0 10px; }
.pagination .page-numbers {
  min-width: 38px; height: 38px; display: grid; place-items: center; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--ink-2);
}
.pagination .page-numbers:hover { border-color: var(--ink); }
.pagination .current { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pagination .dots { border: 0; }

/* ---------------------------------------------------------
   15. Pages / legal
--------------------------------------------------------- */
.page-head { padding: 36px 0 20px; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.page-head h1 { font-size: clamp(30px, 4vw, 46px); font-weight: 800; letter-spacing: -.03em; }
.page-head p { color: var(--muted); margin: 10px 0 0; max-width: 65ch; }
.page-body { max-width: 760px; font-size: 17px; line-height: 1.7; color: var(--ink-2); }
.page-body h2 { font-family: var(--display); font-size: 26px; font-weight: 800; color: var(--ink); margin: 1.6em 0 .5em; }
.page-body h3 { font-family: var(--display); font-size: 20px; font-weight: 700; color: var(--ink); margin: 1.4em 0 .4em; }
.page-body a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.page-body ul, .page-body ol { padding-left: 1.3em; margin-bottom: 1.2em; }
.page-body li { margin-bottom: .45em; }
.page-body table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 1.4em 0; }
.page-body th, .page-body td { border-bottom: 1px solid var(--line); padding: 10px; text-align: left; }
.page-body .updated { font-size: 12px; color: var(--muted); margin-bottom: 24px; }

/* ---------------------------------------------------------
   16. Footer
--------------------------------------------------------- */
.footer { margin-top: 56px; background: #070b10; color: #9fb0c3; border-top: 1px solid #1b2634; }
.footer-top { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 36px; padding: 48px 0 36px; }
.footer .brand-word { color: #fff; }
.footer p { font-size: 13px; line-height: 1.65; color: #8fa1b5; max-width: 34ch; }
.footer h3 { font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #fff; margin-bottom: 14px; }
.footer ul { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.footer li a { font-size: 13px; color: #9fb0c3; }
.footer li a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid #1b2634; padding: 18px 0; display: flex; flex-wrap: wrap;
  justify-content: space-between; gap: 12px; font-size: 11.5px; color: #74879c;
}
.footer-bottom a:hover { color: #fff; }
.footer-social { display: flex; gap: 10px; }
.footer-social a { width: 30px; height: 30px; border: 1px solid #253244; border-radius: 6px; display: grid; place-items: center; }
.footer-social svg { width: 13px; height: 13px; fill: currentColor; }

/* ---------------------------------------------------------
   17. Search / 404
--------------------------------------------------------- */
.search-head { padding: 36px 0 18px; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.search-head h1 { font-size: clamp(26px, 3.4vw, 38px); font-weight: 800; }
.search-head p { color: var(--muted); margin: 8px 0 0; }
.search-form-inline { display: flex; gap: 8px; max-width: 520px; margin-top: 18px; }
.search-form-inline input { flex: 1; height: 46px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--bg); color: var(--ink); font-size: 15px; }
.search-form-inline button { height: 46px; padding: 0 20px; border: 0; border-radius: 8px; background: var(--ink); color: var(--bg); font-weight: 700; cursor: pointer; }
.empty { padding: 30px 0 50px; color: var(--muted); }
.empty h2 { color: var(--ink); font-size: 26px; margin-bottom: 8px; }

.hero-404 { text-align: center; padding: 80px 20px 60px; }
.hero-404 .code { font-family: var(--display); font-size: clamp(80px, 16vw, 150px); font-weight: 900; line-height: 1; letter-spacing: -.05em; color: var(--line-strong); }
.hero-404 h1 { font-size: clamp(24px, 3vw, 34px); margin: 6px 0 10px; }
.hero-404 p { color: var(--muted); max-width: 52ch; margin: 0 auto 22px; }
.hero-404 .btn { display: inline-flex; height: 44px; align-items: center; padding: 0 18px; background: var(--brand); color: #fff; border-radius: 8px; font-weight: 700; font-size: 13px; }

/* ---------------------------------------------------------
   18. Utilities / responsive
--------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 8px; border: 0;
  background: var(--ink); color: var(--bg); font-size: 13px; font-weight: 700; cursor: pointer;
}
.btn.brand { background: var(--brand); color: #fff; }
.btn.ghost { background: transparent; border: 1px solid var(--line-strong); color: var(--ink); }

@media (max-width: 1100px) {
  .main-nav a { padding: 10px 8px; font-size: 11.5px; }
  .layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; }
  .lead { gap: 22px; }
  .lead-side { padding-left: 20px; }
}

@media (max-width: 960px) {
  .topbar-tag { display: none; }
  .main-nav {
    position: fixed; inset: var(--header-h) 0 auto 0; z-index: 80;
    background: var(--surface); border-bottom: 1px solid var(--line);
    padding: 12px 20px 20px; display: none;
    max-height: calc(100vh - var(--header-h)); overflow-y: auto;
    box-shadow: 0 18px 30px rgba(9, 16, 26, .12);
  }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; align-items: stretch; gap: 2px; }
  .main-nav a { padding: 12px 10px; font-size: 13px; border-radius: 8px; }
  .main-nav .sub-menu { position: static; display: flex; border: 0; box-shadow: none; padding: 0 0 0 14px; background: transparent; }
  .nav-toggle { display: grid; }
  .masthead-in { grid-template-columns: auto 1fr auto; gap: 12px; }
  .brand { justify-self: center; }
  .btn-sub { display: none; }
  .lead { grid-template-columns: 1fr; }
  .lead-side { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
  .lead-side .trending { grid-column: 1 / -1; }
  .story-sm { grid-template-columns: 1fr 90px; border-bottom: 0; padding-bottom: 0; }
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
  .band { grid-template-columns: 1fr; }
  .newsletter { grid-template-columns: 1fr; padding: 28px; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .article-body { font-size: 18px; }
}

@media (max-width: 720px) {
  .topbar { display: none; }
  :root { --header-h: 60px; }
  .wrap { padding: 0 16px; }
  .grid-3 { grid-template-columns: 1fr 1fr; gap: 24px 18px; }
  .card h3 { font-size: 16px; }
  .card .dek { display: none; }
  .ticker-in { padding: 0 16px; }
  .ticker-label { font-size: 9px; padding: 0 9px; }
  .ticker-item { font-size: 11.5px; }
  .section { padding: 28px 0 6px; }
  .sec-head h2 { font-size: 18px; }
  .sec-head .sub { display: none; }
  .lead { padding-top: 20px; }
  .lead-side { grid-template-columns: 1fr; }
  .card-wide { grid-template-columns: 1fr; }
  .article-meta { gap: 10px; }
  .share { margin-left: 0; width: 100%; }
  .article-hero { margin-top: 20px; }
  .author-box { grid-template-columns: 44px 1fr; }
  .footer-top { grid-template-columns: 1fr 1fr; gap: 28px; padding: 36px 0 28px; }
  .newsletter-form { flex-direction: column; }
}

@media (max-width: 520px) {
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .sidebar { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr; }
  .brand-word { font-size: 21px; }
  .brand-tag { display: none; }
  .article-body { font-size: 17.5px; }
  .article-body > p:first-of-type::first-letter { font-size: 52px; }
  .pagination .page-numbers { min-width: 34px; height: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .ticker-move { animation: none; overflow-x: auto; }
}

@media print {
  .topbar, .masthead, .ticker, .sidebar, .footer, .newsletter, .share, .progress, .search-overlay { display: none !important; }
  body { background: #fff; color: #000; }
  .article-body { max-width: 100%; font-size: 12pt; }
  .article-title { font-size: 26pt; }
  a { text-decoration: none; color: #000; }
}

/* ---------------------------------------------------------
   Wire — live aggregated desk
--------------------------------------------------------- */
.wire-page { padding-bottom: 64px; }

.wire-head { padding: 38px 0 26px; }
.wire-head-top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 10px;
}
.wire-head .kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 800; letter-spacing: .16em;
  text-transform: uppercase; color: var(--brand);
}
.live-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--brand);
  box-shadow: 0 0 0 0 rgba(225, 29, 46, .5); animation: livepulse 2s infinite;
}
@keyframes livepulse {
  0% { box-shadow: 0 0 0 0 rgba(225, 29, 46, .45); }
  70% { box-shadow: 0 0 0 8px rgba(225, 29, 46, 0); }
  100% { box-shadow: 0 0 0 0 rgba(225, 29, 46, 0); }
}
.wire-stamp { font-size: 12px; color: var(--muted); }
.wire-stamp b { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.wire-head h1 {
  font-family: var(--display);
  font-size: clamp(38px, 6vw, 62px); font-weight: 900; letter-spacing: -.045em;
  line-height: .98; margin: 4px 0 14px;
}
.wire-head p { max-width: 74ch; margin: 0; color: var(--muted); font-size: 15.5px; line-height: 1.65; }
.wire-head p a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
.wire-head p a:hover { color: var(--brand); }

.wire-filters {
  position: sticky; top: var(--header-h); z-index: 30;
  display: flex; align-items: center; gap: 8px;
  padding: 14px 0; margin-bottom: 28px;
  background: var(--bg); border-bottom: 1px solid var(--line);
  overflow-x: auto; scrollbar-width: none;
}
.wire-filters::-webkit-scrollbar { display: none; }
.wire-filters a {
  flex-shrink: 0; padding: 8px 14px; border: 1px solid var(--line-strong);
  border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--ink-2);
  white-space: nowrap; transition: background .15s, color .15s, border-color .15s;
}
.wire-filters a:hover { border-color: var(--ink); color: var(--ink); }
.wire-filters a.is-active { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.wire-refresh {
  flex-shrink: 0; margin-left: auto; display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 13px; border: 1px solid var(--line-strong); border-radius: 999px;
  background: transparent; color: var(--muted); font: 600 12.5px/1 var(--sans); cursor: pointer;
  transition: color .15s, border-color .15s;
}
.wire-refresh:hover { color: var(--ink); border-color: var(--ink); }
.wire-refresh svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.wire-feed.is-loading .wire-refresh svg { animation: wirespin .8s linear infinite; }
@keyframes wirespin { to { transform: rotate(360deg); } }

.wire-feed { transition: opacity .2s; }
.wire-feed.is-loading { opacity: .55; }

.wire-lead {
  position: relative; padding: 34px 36px 30px; margin-bottom: 10px;
  background: linear-gradient(135deg, var(--bg-alt), var(--surface) 65%);
  border: 1px solid var(--line); border-top: 4px solid var(--cat, var(--brand));
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.wire-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  color: var(--muted); font-size: 11.5px; font-weight: 500;
}
.wire-cat {
  color: var(--cat, var(--brand)); font-size: 10px; font-weight: 800;
  letter-spacing: .14em; text-transform: uppercase;
}
.wire-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--line-strong); }
.wire-lead h2 {
  font-family: var(--display);
  font-size: clamp(25px, 3.4vw, 38px); font-weight: 800; letter-spacing: -.03em;
  line-height: 1.12; margin: 12px 0 12px;
}
.wire-lead h2 a, .wire-item h3 a { color: inherit; }
.wire-lead h2 a:hover, .wire-item h3 a:hover { color: var(--brand); }
.wire-lead p {
  max-width: 80ch; margin: 0 0 16px; color: var(--ink-2);
  font-family: var(--serif); font-size: 17px; line-height: 1.6;
}
.wire-sources { font-size: 11.5px; color: var(--muted); line-height: 1.6; }
.wire-sources a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--line-strong); }
.wire-sources a:hover { color: var(--brand); text-decoration-color: currentColor; }

.wire-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0 40px; }
.wire-item { padding: 22px 0 24px; border-top: 1px solid var(--line); }
.wire-item h3 {
  font-family: var(--display);
  font-size: 19px; font-weight: 700; letter-spacing: -.015em; line-height: 1.3;
  margin: 8px 0 8px;
}
.wire-item p {
  margin: 0 0 10px; color: var(--muted); font-size: 13.5px; line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.wire-note, .wire-empty {
  padding: 48px 28px; border: 1px dashed var(--line-strong); border-radius: var(--radius);
  text-align: center; color: var(--muted);
}
.wire-note p, .wire-empty p { margin: 0; font-size: 14.5px; }

.wire-foot {
  margin: 36px 0 0; padding-top: 18px; border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--muted);
}
.wire-foot a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
.wire-foot a:hover { color: var(--brand); }

@media (max-width: 900px) {
  .wire-list { grid-template-columns: 1fr; }
  .wire-lead { padding: 26px 24px 24px; }
}

@media (max-width: 720px) {
  .wire-head { padding: 26px 0 18px; }
  .wire-head-top { align-items: flex-start; }
  .wire-stamp { text-align: right; }
  .wire-filters { top: var(--header-h); padding: 11px 0; margin-bottom: 20px; }
  .wire-refresh span { display: none; }
  .wire-refresh { padding: 8px 10px; }
  .wire-lead p { font-size: 16px; }
  .wire-item h3 { font-size: 18px; }
}

@media (max-width: 520px) {
  .wire-head-top { flex-direction: column; gap: 6px; }
  .wire-stamp { text-align: left; }
  .wire-lead h2 { font-size: 24px; }
  .wire-sources { font-size: 11px; }
}

/* Phase 4 QA fixes (22 November 2026): stop horizontal overflow on small screens */
@media (max-width: 760px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .article-body table,
  .page-body table {
    display: block; width: 100%; overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .sec-head { flex-wrap: wrap; align-items: center; row-gap: 2px; }
  .sec-head > div { min-width: 0; }
  .sec-head .all { white-space: normal; }
}
