/* Barueri em Tempo Real — design tokens & components */

:root {
  --bg: #0b0c0f;
  --bg-elev: #121418;
  --bg-soft: #181b20;
  --line: #23262d;
  --line-soft: #1a1d23;
  --fg: #f4f5f7;
  --fg-muted: #9aa0aa;
  --fg-dim: #6b7079;

  --brand: oklch(0.62 0.17 258);
  --brand-ink: oklch(0.72 0.15 258);
  --brand-soft: oklch(0.30 0.10 258 / 0.25);

  --live: #ff3b2f;
  --live-soft: rgba(255, 59, 47, 0.12);

  --cat-politica: oklch(0.70 0.14 30);
  --cat-esportes: oklch(0.72 0.15 150);
  --cat-cultura:  oklch(0.72 0.15 310);
  --cat-saude:    oklch(0.74 0.13 190);
  --cat-seguranca:oklch(0.72 0.14 60);
  --cat-cidade:   oklch(0.70 0.14 258);
  --cat-economia: oklch(0.70 0.14 90);
  --cat-default:  oklch(0.70 0.14 258);

  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --fs-xxs: 11px;
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-base: 15px;
  --fs-md: 17px;
  --fs-lg: 20px;
  --fs-xl: 24px;
  --fs-2xl: 32px;
  --fs-3xl: 44px;
  --fs-4xl: 56px;

  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 6px;

  --gap-1: 4px;
  --gap-2: 8px;
  --gap-3: 12px;
  --gap-4: 16px;
  --gap-5: 24px;
  --gap-6: 32px;
  --gap-7: 48px;
  --gap-8: 64px;

  --content-max: 1280px;
  --content-gutter: 32px;
}

html[data-theme="light"] {
  --bg: #f7f6f3;
  --bg-elev: #ffffff;
  --bg-soft: #efeee9;
  --line: #dcdad3;
  --line-soft: #e8e6e0;
  --fg: #0b0c0f;
  --fg-muted: #5b6169;
  --fg-dim: #8a8f97;
  --brand: oklch(0.48 0.17 258);
  --brand-ink: oklch(0.38 0.18 258);
  --brand-soft: oklch(0.48 0.17 258 / 0.12);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.5;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
hr { border: 0; }

.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--content-gutter);
}

.mono { font-family: var(--font-mono); }
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-xxs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.eyebrow--live { color: var(--live); }
.eyebrow--brand { color: var(--brand-ink); }

.rule { height: 1px; background: var(--line); margin: 0; }
.rule-strong { height: 2px; background: var(--fg); margin: 0; }

/* Skip link */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 9999;
  padding: 12px 18px; background: var(--fg); color: var(--bg);
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
}
.skip-link:focus { left: 0; }

/* ============ TOP BAR ============ */
.topbar {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  font-size: 12px;
  color: var(--fg-muted);
}
.topbar__inner {
  display: flex; justify-content: space-between; align-items: center; height: 36px;
}
.topbar__left, .topbar__right { display: flex; align-items: center; gap: 18px; }
.topbar__sep { color: var(--line); }
.topbar__date { letter-spacing: 0.04em; }
.topbar__link {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.12em; text-transform: uppercase;
}
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; color: var(--fg-muted);
}
.theme-toggle svg { width: 14px; height: 14px; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
html[data-theme="light"] .theme-toggle .icon-sun { display: none; }
html[data-theme="light"] .theme-toggle .icon-moon { display: block; }
.theme-toggle .theme-toggle__label-light,
.theme-toggle .theme-toggle__label-dark { display: none; }

/* Weather mini */
.weather-mini {
  display: inline-flex; align-items: center; gap: 8px; font-size: 12px;
}
.weather-mini__city { color: var(--fg); }
.weather-mini__temp { font-family: var(--font-mono); }
.weather-mini__cond { color: var(--fg-dim); }

/* Social icons */
.social-icons { display: flex; gap: 12px; color: var(--fg-muted); }
.social-icons a {
  width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 3px;
  border: 1px solid var(--line);
  transition: color .15s ease, border-color .15s ease;
}
.social-icons a svg { width: 100%; height: 100%; display: block; }
.social-icons a:hover { color: var(--fg); border-color: var(--fg); }

/* ============ MAIN NAV ============ */
.main-nav {
  background: var(--bg);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 40;
}
/* Keep ancestors out of any transform/filter context that would break sticky scope. */
html, body { transform: none; filter: none; }
.main-nav__inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 56px; gap: 24px;
}
.main-nav__menu {
  list-style: none; display: flex; gap: 22px; margin: 0; padding: 0;
  flex: 1; justify-content: center; flex-wrap: wrap;
}
.main-nav__menu a {
  font-size: 12px; font-weight: 600; letter-spacing: 0.08em;
  color: var(--fg-muted);
  border-bottom: 2px solid transparent;
  padding-bottom: 4px;
  display: inline-flex; align-items: center; gap: 6px;
  text-transform: uppercase;
}
.main-nav__menu .current-menu-item > a,
.main-nav__menu .current_page_item > a,
.main-nav__menu a:hover {
  color: var(--fg);
  border-bottom-color: var(--brand);
}
.main-nav__menu a[href*="ao-vivo"]::before,
.main-nav__menu .menu-ao-vivo > a::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 0 0 rgba(255, 59, 47, 0.6);
  animation: pulse 1.6s infinite;
  display: inline-block;
}
.main-nav__search {
  color: var(--fg-muted);
  display: inline-flex; align-items: center; justify-content: center;
}
.main-nav__drawer {
  display: contents; /* desktop: pass children straight through to flex parent */
}
.main-nav__drawer-extras { display: none; }
.menu-toggle__icon-close,
.menu-toggle__label { display: none; }
.main-nav.is-open .menu-toggle__icon-open  { display: none; }
.main-nav.is-open .menu-toggle__icon-close { display: block; }

/* Logo */
.brand { display: inline-flex; align-items: center; }
.brand__stack { display: flex; flex-direction: column; line-height: 1; }
.brand__word {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 22px;
  letter-spacing: -0.04em;
  color: var(--fg);
}
.brand__word .dot { color: var(--brand); }
.brand__sub {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-top: 3px;
}
.brand--sm .brand__word { font-size: 18px; }
.brand--sm .brand__sub { font-size: 8px; }
.brand--lg .brand__word { font-size: 30px; }
.brand--lg .brand__sub { font-size: 12px; }

/* Live pill */
.live-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px 3px 7px;
  border: 1px solid var(--live); color: var(--live);
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.18em; text-transform: uppercase;
  font-weight: 600;
}
.live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 0 0 rgba(255, 59, 47, 0.6);
  animation: pulse 1.6s infinite;
  display: inline-block;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255, 59, 47, 0.55); }
  70%  { box-shadow: 0 0 0 10px rgba(255, 59, 47, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 59, 47, 0); }
}

/* ============ BREAKING TICKER ============ */
.ticker {
  background: var(--live); color: #fff;
  overflow: hidden;
}
.ticker__inner {
  display: flex; align-items: stretch; height: 38px;
}
.ticker__label {
  display: flex; align-items: center; gap: 8px;
  padding: 0 16px 0 0;
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.18em; text-transform: uppercase; font-weight: 700;
  border-right: 1px solid rgba(255, 255, 255, 0.25);
  margin-right: 16px;
}
.ticker__label .live-dot { background: #fff; }
.ticker__track {
  flex: 1; overflow: hidden; position: relative;
  display: flex; align-items: center;
}
.ticker__strip {
  display: flex; gap: 40px;
  animation: marquee 50s linear infinite;
  white-space: nowrap;
}
.ticker__strip:hover { animation-play-state: paused; }
.ticker__item {
  font-size: 13px; font-weight: 500; color: #fff;
  display: inline-flex; align-items: baseline; gap: 10px;
}
.ticker__cat {
  opacity: 0.85; font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.18em; font-weight: 700;
  padding: 2px 6px; border: 1px solid rgba(255, 255, 255, 0.45);
}
@keyframes marquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ============ AD SLOTS ============ */
.ad {
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-soft);
  border: 1px dashed var(--line);
  color: var(--fg-dim);
  font-family: var(--font-mono); font-size: var(--fs-xs);
  text-transform: uppercase; letter-spacing: 0.12em;
  position: relative;
}
.ad::before {
  content: "Publicidade";
  position: absolute; top: 4px; left: 8px;
  font-size: 9px; letter-spacing: 0.18em;
  color: var(--fg-dim); opacity: 0.7;
}
.ad--leaderboard { height: 90px; }
.ad--billboard { height: 250px; }
.ad--rectangle { height: 250px; }
.ad--halfpage { height: 600px; }
.ad--infeed { min-height: 180px; }
.ad--mobile { height: 100px; }
.ad--sticky { height: 56px; }
.ad__label { font-size: 10px; letter-spacing: 0.2em; }
.ad-slot { padding: 16px 0; }
.ad-slot--sidebar { margin-bottom: 40px; }
.ad-slot--sidebar .eyebrow { margin-bottom: 8px; text-align: center; }
.ad-slot--infeed {
  padding: 24px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 16px 0;
}
.ad-slot--infeed .eyebrow { margin-bottom: 10px; }

/* Placeholder image (when no thumbnail) */
.ph {
  background-color: #1a1d23;
  background-image:
    repeating-linear-gradient(135deg,
      rgba(255, 255, 255, 0.035) 0 2px,
      transparent 2px 10px);
  position: relative;
  overflow: hidden;
}
html[data-theme="light"] .ph {
  background-color: #e5e2da;
  background-image:
    repeating-linear-gradient(135deg,
      rgba(0, 0, 0, 0.04) 0 2px,
      transparent 2px 10px);
}
.ph::after {
  content: attr(data-label);
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: var(--fs-xs);
  color: var(--fg-dim);
  letter-spacing: 0.14em; text-transform: uppercase;
  text-align: center; padding: 0 8px;
}
.ph--16x10 { aspect-ratio: 16 / 10; }
.ph--4x3 { aspect-ratio: 4 / 3; }
.ph--1x1 { aspect-ratio: 1 / 1; }

/* Article featured image wrapper */
.media {
  position: relative; overflow: hidden;
}
.media--16x10 { aspect-ratio: 16 / 10; }
.media--4x3 { aspect-ratio: 4 / 3; }
.media--1x1 { aspect-ratio: 1 / 1; }
.media img { width: 100%; height: 100%; object-fit: cover; }
.media__live {
  position: absolute; top: 16px; left: 16px;
}

/* ============ CATEGORY CHIPS ============ */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--fg);
  padding: 2px 0;
  position: relative;
}
.chip::before {
  content: "";
  width: 8px; height: 8px;
  background: var(--chip-c, var(--cat-default));
  border-radius: 2px;
}
.chip--politica   { --chip-c: var(--cat-politica); }
.chip--esportes   { --chip-c: var(--cat-esportes); }
.chip--cultura    { --chip-c: var(--cat-cultura); }
.chip--saude      { --chip-c: var(--cat-saude); }
.chip--seguranca  { --chip-c: var(--cat-seguranca); }
.chip--cidade     { --chip-c: var(--cat-cidade); }
.chip--economia   { --chip-c: var(--cat-economia); }
.chips { display: flex; gap: 10px; flex-wrap: wrap; }

/* ============ HEADLINES ============ */
.h-display {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.02;
  margin: 0;
}
.hover-headline { transition: color 120ms; }
.hover-headline:hover { color: var(--brand-ink); }
.meta {
  color: var(--fg-muted);
  font-size: var(--fs-xs);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

/* ============ BYLINE ============ */
.byline {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--fg-muted); letter-spacing: 0.04em; flex-wrap: wrap;
}
.byline__author { color: var(--fg); }
.byline__sep { color: var(--line); }

/* ============ CARDS ============ */
.card { display: flex; flex-direction: column; min-width: 0; }
.card__media-link { display: block; color: inherit; }
.card__media { display: block; }
.card__chips { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.card__title {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.15;
  margin: 10px 0 0;
}
.card__title a { color: inherit; display: inline; }
.card__dek {
  font-size: 14px; color: var(--fg-muted);
  margin: 8px 0 0; line-height: 1.45;
}
.card__meta { margin-top: 10px; }
.card--lg .card__title { font-size: 22px; }
.card--md .card__title { font-size: 18px; }
.card--sm .card__title { font-size: 15px; }
.card--sm .card__dek { display: none; }

/* Hero card */
.hero-card { display: flex; flex-direction: column; min-width: 0; }
.hero-card__media-link { display: block; color: inherit; }
.hero-card__media { aspect-ratio: 16 / 10; position: relative; }
.hero-card__chips { margin-top: 20px; display: flex; gap: 10px; flex-wrap: wrap; }
.hero-card__title {
  font-family: var(--font-display);
  font-size: clamp(32px, 3.6vw, 52px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.03;
  margin: 14px 0 0;
}
.hero-card__title a { color: inherit; }
.hero-card__dek {
  font-size: 18px; line-height: 1.5; color: var(--fg-muted);
  margin-top: 12px; max-width: 680px;
}
.hero-card__byline { margin-top: 14px; }

/* Story row (search results / list view) */
.story-row {
  display: grid;
  grid-template-columns: auto 1fr 120px;
  gap: 16px; align-items: start;
  padding: 18px 0;
  border-bottom: 1px solid var(--line-soft);
}
.story-row--no-image { grid-template-columns: auto 1fr; }
.story-row--no-number { grid-template-columns: 1fr 120px; }
.story-row--no-image.story-row--no-number { grid-template-columns: 1fr; }
.story-row__num {
  font-family: var(--font-mono);
  font-size: 28px; font-weight: 700; color: var(--fg-dim);
  line-height: 1; min-width: 32px;
}
.story-row__title {
  font-family: var(--font-display);
  font-size: 16px; font-weight: 600;
  line-height: 1.25; letter-spacing: -0.01em;
}
.story-row__title a { color: inherit; }
.story-row__media-link { display: block; color: inherit; }
.story-row__media { aspect-ratio: 4 / 3; }

/* ============ SECTION HEADER ============ */
.section-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  border-top: 2px solid var(--fg);
  padding-top: 16px;
  gap: 16px;
}
.section-header__title {
  font-family: var(--font-display);
  font-size: 28px; font-weight: 700;
  letter-spacing: -0.02em; line-height: 1;
  margin: 6px 0 0;
}
.section-header__action {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--fg-muted);
}

/* Sidebar section title */
.sidebar-section { margin-bottom: 40px; }
.sidebar-section__head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding-bottom: 10px; border-bottom: 2px solid var(--fg);
  margin-bottom: 14px;
}
.sidebar-section__title {
  font-family: var(--font-display);
  font-size: 18px; font-weight: 700; letter-spacing: -0.01em;
  margin: 0;
}

/* Vertical module (Opinião / Economia) */
.vmod__head {
  display: flex; align-items: center; gap: 10px;
  border-bottom: 2px solid var(--fg);
  padding-bottom: 10px; margin-bottom: 14px;
}
.vmod__swatch { width: 14px; height: 14px; display: inline-block; background: var(--cat-default); }
.vmod__title {
  font-family: var(--font-display);
  font-size: 18px; font-weight: 700; letter-spacing: -0.01em;
  margin: 0;
}
.vmod__item {
  display: block; padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}
.vmod__item:last-child { border-bottom: 0; }
.vmod__item-title {
  font-family: var(--font-display);
  font-size: 15px; font-weight: 600; line-height: 1.3; letter-spacing: -0.005em;
}

/* ============ MOST READ ============ */
.most-read__item {
  display: grid; grid-template-columns: auto 1fr; gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}
.most-read__item:last-child { border-bottom: 0; }
.most-read__num {
  font-family: var(--font-mono);
  font-size: 22px; font-weight: 800; color: var(--brand);
  line-height: 1; font-variant-numeric: tabular-nums;
}
.most-read__title {
  font-family: var(--font-display);
  font-size: 14px; font-weight: 600;
  line-height: 1.3; letter-spacing: -0.005em;
}
.most-read__meta { font-family: var(--font-mono); font-size: 10px; color: var(--fg-muted); margin-top: 4px; }

/* ============ WEATHER WIDGET ============ */
.weather-widget {
  background: var(--bg-soft); border: 1px solid var(--line);
  padding: 18px;
}
.weather-widget__top {
  display: flex; align-items: flex-start; gap: 14px;
}
.weather-widget__icon { color: var(--brand); }
.weather-widget__temp {
  font-family: var(--font-display);
  font-size: 36px; font-weight: 700; line-height: 1; letter-spacing: -0.03em;
  color: var(--fg);
}
.weather-widget__temp small {
  font-size: 16px; color: var(--fg-muted); font-weight: 500;
}
.weather-widget__cond { margin-top: 4px; }
.weather-widget__forecast {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px;
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line);
  text-align: center;
}
.weather-widget__day { font-family: var(--font-mono); font-size: 10px; color: var(--fg-muted); }
.weather-widget__icon-sm { font-size: 18px; margin: 4px 0; }
.weather-widget__temp-sm { font-family: var(--font-mono); font-size: 12px; }
.weather-widget__source {
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line);
  font-size: 10px; text-align: right;
}

/* ============ NEWSLETTER ============ */
.newsletter__title {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 700;
  letter-spacing: -0.01em;
  margin: 10px 0;
}
.newsletter__body {
  color: var(--fg-muted); font-size: 13px; line-height: 1.5; margin-bottom: 14px;
}
.newsletter__form {
  display: flex; border: 1px solid var(--line);
}
.newsletter__input {
  flex: 1; background: transparent; border: 0; outline: none;
  padding: 12px 14px; color: var(--fg);
  font-family: var(--font-sans); font-size: 13px;
}
.newsletter__btn {
  background: var(--fg); color: var(--bg); padding: 0 18px;
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.14em; text-transform: uppercase; font-weight: 600;
}

/* ============ FOOTER ============ */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-elev);
  margin-top: 64px;
  padding: 48px 0 32px;
}
.site-footer__cols {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--line);
}
.site-footer__col {
  flex: 1 1 180px;
  min-width: 0;
}
.site-footer__col:first-child { flex: 1.5 1 240px; }
.site-footer__col:last-child  { flex: 1.4 1 240px; }
.site-footer__col p {
  color: var(--fg-muted); font-size: 13px; line-height: 1.6; margin: 16px 0;
}
.site-footer__col h4 {
  margin: 0 0 14px;
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-muted);
  font-weight: 500;
}
.site-footer__col ul { list-style: none; padding: 0; margin: 0; }
.site-footer__col li { margin-bottom: 8px; }
.site-footer__col a { font-size: 13px; color: var(--fg-muted); }
.site-footer__col a:hover { color: var(--fg); }
.site-footer__bar {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 20px; font-size: 11px;
  font-family: var(--font-mono); letter-spacing: 0.08em; color: var(--fg-dim);
}

/* ============ HOMEPAGE ============ */
.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 48px;
}
.home-grid__sec {
  display: grid; gap: 28px; align-content: start;
}
.home-grid__sec-pair {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
}
.section-rule { margin-top: 56px; }
.layout-with-sidebar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 48px;
  margin-top: 32px;
}
.cards-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.cards-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.cards-row-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
.cards-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 40px 40px; row-gap: 48px; }
.modules-row { margin-top: 56px; display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }

/* ============ CATEGORY ============ */
.cat-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  border-bottom: 2px solid var(--fg); padding-bottom: 20px;
  gap: 24px; flex-wrap: wrap;
}
.cat-header__title {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 800; letter-spacing: -0.035em; line-height: 0.95;
  margin: 0;
}
.cat-header__desc {
  color: var(--fg-muted); margin-top: 12px; max-width: 620px;
}
.cat-feature {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 40px; align-items: center; margin-bottom: 48px;
}
.cat-feature__media { display: block; }
.cat-feature__media .ph,
.cat-feature__media .media { aspect-ratio: 4 / 3; }
.cat-feature__title {
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 40px); font-weight: 700;
  letter-spacing: -0.025em; line-height: 1.05; margin: 12px 0 14px;
}
.cat-feature__dek {
  font-size: 17px; color: var(--fg-muted); margin: 14px 0 16px; line-height: 1.55;
}
.subnav { display: flex; gap: 4px; flex-wrap: wrap; }
.subnav a {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 8px 12px; color: var(--fg-muted); font-weight: 600;
  border: 1px solid transparent;
}
.subnav a.is-active {
  color: var(--bg); background: var(--fg);
}

/* Pagination */
.pagination {
  display: flex; justify-content: center; gap: 6px; margin-top: 40px; flex-wrap: wrap;
}
.pagination .page-numbers {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 12px;
  border: 1px solid var(--line); color: var(--fg);
}
.pagination .page-numbers.current {
  background: var(--fg); color: var(--bg); border-color: var(--fg);
}
.pagination .page-numbers.dots { border: 0; }

/* ============ ARTICLE ============ */
.breadcrumb {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--fg-muted); margin-bottom: 24px;
}
.breadcrumb a:hover { color: var(--fg); }
.breadcrumb__current { color: var(--fg); }

.article-container { padding-top: 32px; }
.article-header { max-width: 820px; margin-bottom: 32px; }
.article-header__chips { margin-bottom: 18px; display: flex; gap: 10px; flex-wrap: wrap; }
.article-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 4.2vw, 56px);
  font-weight: 700; letter-spacing: -0.03em; line-height: 1.02;
  margin: 0;
}
.article-dek {
  font-size: 22px; line-height: 1.45; color: var(--fg-muted);
  margin: 18px 0 0; letter-spacing: -0.005em;
}
.article-byline-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  margin-bottom: 32px; gap: 16px; flex-wrap: wrap;
}
.article-byline-bar__author { display: flex; align-items: center; gap: 14px; }
.article-byline-bar__avatar {
  width: 40px; height: 40px; border-radius: 50%; overflow: hidden;
  background: var(--bg-soft);
}
.article-byline-bar__avatar img { width: 100%; height: 100%; object-fit: cover; }
.article-byline-bar__name { font-size: 13px; font-weight: 600; }
.share { display: flex; gap: 8px; }
.share button, .share a {
  width: 32px; height: 32px;
  border: 1px solid var(--line);
  color: var(--fg-muted);
  background: transparent;
  padding: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: color .15s ease, border-color .15s ease;
}
.share a svg, .share button svg { width: 100%; height: 100%; display: block; }
.share a:hover, .share button:hover { color: var(--fg); border-color: var(--fg); }
.article-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 300px;
  gap: 64px;
}
.article-body { max-width: 700px; }
.article-body p, .article-body li {
  font-size: 18px; line-height: 1.7; color: var(--fg);
  margin: 0 0 20px; max-width: 66ch;
}
.article-body p strong { color: var(--fg); }
.article-body h2 {
  font-family: var(--font-display);
  font-size: 28px; font-weight: 700; letter-spacing: -0.02em;
  margin: 36px 0 14px; line-height: 1.15;
}
.article-body h3 {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 700; letter-spacing: -0.015em;
  margin: 28px 0 12px;
}
.article-body a { color: var(--brand-ink); text-decoration: underline; text-underline-offset: 3px; }
.article-body img { margin: 20px 0; }
.article-body blockquote {
  margin: 32px 0; padding: 20px 0 20px 24px;
  border-left: 3px solid var(--brand);
  font-family: var(--font-display);
  font-size: 26px; font-weight: 500; line-height: 1.3; letter-spacing: -0.015em;
  color: var(--fg);
}
.article-body blockquote cite, .article-body blockquote footer {
  display: block; margin-top: 12px;
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.04em; color: var(--fg-muted); font-weight: 500;
  font-style: normal;
}
.article-figure { margin: 0 0 12px; }
.article-figure figcaption {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.04em; color: var(--fg-muted);
  margin-top: 8px; margin-bottom: 32px;
}

.article-tags {
  margin-top: 40px; padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex; gap: 8px; flex-wrap: wrap;
}
.article-tags a {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em;
  padding: 6px 10px; border: 1px solid var(--line); color: var(--fg-muted);
}
.article-tags a:hover { color: var(--fg); border-color: var(--fg); }

/* Comments */
.comments { margin-top: 56px; }
.comments__list {
  margin-top: 24px; display: grid; gap: 20px;
  list-style: none; padding: 0;
}
.comments__item {
  padding: 18px; background: var(--bg-soft); border: 1px solid var(--line);
}
.comments__head {
  display: flex; justify-content: space-between; margin-bottom: 8px; gap: 10px;
}
.comments__author { font-size: 13px; font-weight: 700; }
.comments__body p { margin: 0; font-size: 14px; line-height: 1.5; }
.comment-form {
  margin-top: 24px; display: grid; gap: 12px;
}
.comment-form input, .comment-form textarea {
  width: 100%; background: var(--bg-elev); border: 1px solid var(--line);
  color: var(--fg); padding: 10px 12px; font-family: var(--font-sans); font-size: 14px;
}
.comment-form .submit, .comment-form button[type="submit"] {
  background: var(--fg); color: var(--bg); padding: 10px 18px;
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.14em; text-transform: uppercase; font-weight: 600;
  justify-self: start;
}

/* Related */
.related { margin-top: 80px; }

/* ============ SEARCH ============ */
.search-hero { padding-top: 40px; }
.search-form-big {
  display: flex; align-items: center; gap: 12px;
  border-bottom: 2px solid var(--fg); padding-bottom: 14px;
}
.search-form-big input {
  flex: 1; background: transparent; border: 0; outline: none;
  font-family: var(--font-display);
  font-size: clamp(22px, 3vw, 36px); font-weight: 600;
  letter-spacing: -0.02em; color: var(--fg);
}
.search-filters {
  display: flex; gap: 24px; padding: 18px 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 32px; align-items: center; flex-wrap: wrap;
}
.search-filters__list { display: flex; gap: 6px; flex: 1; flex-wrap: wrap; }
.search-filters__list a, .search-filters__list .active {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 8px 12px; font-weight: 600;
  color: var(--fg-muted); border: 1px solid var(--line);
}
.search-filters__list .active {
  background: var(--fg); color: var(--bg); border-color: var(--fg);
}
.search-filters__sort {
  display: flex; gap: 14px; align-items: center;
}
.search-filters__sort select {
  border: 1px solid var(--line); background: var(--bg);
  padding: 8px 10px; color: var(--fg); font-size: 12px;
  font-family: var(--font-mono); letter-spacing: 0.08em;
}
.search-result {
  display: grid; grid-template-columns: 1fr 180px; gap: 24px;
  padding: 22px 0; border-bottom: 1px solid var(--line-soft);
}
.search-result__meta { margin-bottom: 6px; }
.search-result__title {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.2;
}
.search-result__title a { color: inherit; }
.search-result__dek {
  color: var(--fg-muted); margin: 8px 0 0; font-size: 14px; line-height: 1.5;
}
.search-result__media-link { display: block; color: inherit; }
.search-result__media { aspect-ratio: 4 / 3; }
mark {
  background: var(--brand-soft); color: var(--fg); padding: 0 4px;
}

/* Faceted refinement */
.facets__group { margin-bottom: 24px; }
.facets__group .eyebrow { margin-bottom: 10px; }
.facets__item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 0; font-size: 13px; cursor: pointer;
}
.facets__item input { accent-color: var(--brand); }

/* ============ 404 ============ */
.error-404 {
  padding: 96px 0; text-align: center;
}
.error-404__code {
  font-family: var(--font-mono); font-size: 96px; font-weight: 800;
  color: var(--brand); letter-spacing: -0.04em; line-height: 1;
}
.error-404__title {
  font-family: var(--font-display); font-size: 32px; font-weight: 700;
  margin: 16px 0 8px; letter-spacing: -0.02em;
}
.error-404__body { color: var(--fg-muted); max-width: 420px; margin: 0 auto 24px; }

/* ============ HAMBURGER (mobile menu) ============ */
.menu-toggle {
  display: none;
  width: 44px; height: 44px;
  align-items: center; justify-content: center;
  color: var(--fg);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
  .home-grid { grid-template-columns: 1fr; gap: 32px; }
  .layout-with-sidebar { grid-template-columns: 1fr; gap: 48px; }
  .article-layout { grid-template-columns: 1fr; gap: 40px; }
  .cards-row-3 { grid-template-columns: repeat(2, 1fr); gap: 24px; }
  .cards-row-4 { grid-template-columns: repeat(2, 1fr); gap: 24px; }
  .site-footer__cols { gap: 32px; }
  .cat-feature { grid-template-columns: 1fr; gap: 20px; }
  .modules-row { grid-template-columns: 1fr; gap: 32px; }
  .search-result { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  :root { --content-gutter: 18px; }
  .site-topbar { display: none; }
  .topbar { display: none; }

  /* Closed: hamburger left, brand right next to it, search hidden. */
  .main-nav__inner {
    height: 56px;
    gap: 12px;
    padding: 0;
    justify-content: flex-start;
  }
  .main-nav__search { display: none; }
  .brand__word { font-size: 16px; letter-spacing: -0.03em; }
  .brand__sub  { font-size: 7px;  letter-spacing: 0.22em; }

  .menu-toggle { display: inline-flex; }

  /* Drawer hidden by default. */
  .main-nav__drawer { display: none; }

  /* Open: turn the WHOLE main-nav into a full-screen overlay so the drawer is unambiguous. */
  .main-nav.is-open {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: var(--bg);
    overflow-y: auto;
    border: 0;
  }
  .main-nav.is-open .main-nav__inner {
    flex-direction: column;
    align-items: stretch;
    height: auto;
    min-height: 100%;
    gap: 0;
    padding: 0 18px 32px;
  }
  /* Header row inside the open overlay: close button on left, brand centered, no search. */
  .main-nav.is-open .menu-toggle {
    align-self: flex-start;
    margin: 12px 0 8px;
    width: auto; height: auto;
    padding: 10px 14px 10px 0;
    gap: 10px;
    color: var(--fg);
  }
  .main-nav.is-open .menu-toggle .menu-toggle__icon-close { display: inline-block; }
  .main-nav.is-open .menu-toggle .menu-toggle__label-close {
    display: inline;
    font-family: var(--font-mono);
    font-size: 12px; font-weight: 700;
    letter-spacing: 0.16em; text-transform: uppercase;
    color: var(--fg);
  }
  .main-nav.is-open .brand {
    align-self: flex-start;
    margin: 0 0 16px;
  }

  .main-nav.is-open .main-nav__drawer {
    display: block;
    flex: 1;
  }

  /* Vertical stack of menu items inside the drawer. */
  .main-nav.is-open .main-nav__menu {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    gap: 0;
    flex: none;
    justify-content: flex-start;
    flex-wrap: nowrap;
  }
  .main-nav.is-open .main-nav__menu li {
    border-bottom: 1px solid var(--line-soft);
    list-style: none;
  }
  .main-nav.is-open .main-nav__menu a {
    display: block;
    padding: 16px 0;
    font-size: 15px;
    border-bottom: 0;
    color: var(--fg);
  }
  .main-nav.is-open .main-nav__menu .current-menu-item > a,
  .main-nav.is-open .main-nav__menu .current_page_item > a { color: var(--brand-ink); }

  /* Theme toggle / extras block. */
  .main-nav.is-open .main-nav__drawer-extras {
    display: block;
    padding-top: 24px;
    margin-top: 16px;
    border-top: 1px solid var(--line);
  }
  .theme-toggle--drawer {
    width: 100%; height: auto;
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    color: var(--fg);
    font-family: var(--font-mono);
    font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
  }
  .theme-toggle--drawer svg { width: 18px; height: 18px; flex-shrink: 0; }
  html[data-theme="dark"]  .theme-toggle--drawer .theme-toggle__label-light { display: inline; }
  html[data-theme="light"] .theme-toggle--drawer .theme-toggle__label-dark  { display: inline; }

  /* Lock the page behind the drawer; hide the rest of the header chrome. */
  body.menu-open { overflow: hidden; }
  body.menu-open .ticker,
  body.menu-open .sub-nav,
  body.menu-open .ad-slot,
  body.menu-open #site-main,
  body.menu-open .site-footer,
  body.menu-open .sticky-mobile-ad { display: none; }

  .ticker__inner { padding: 0 18px; }

  .cards-row-3 { grid-template-columns: 1fr; }
  .cards-row-2, .cards-row-4 { grid-template-columns: 1fr; }
  .cards-grid-2 { grid-template-columns: 1fr; }
  .home-grid__sec-pair { grid-template-columns: 1fr; }
  .site-footer__col, .site-footer__col:first-child, .site-footer__col:last-child { flex: 1 1 100%; }
  .site-footer__bar { flex-direction: column; gap: 6px; text-align: center; }

  .hero-card__title { font-size: clamp(26px, 7vw, 36px); }
  .article-title { font-size: clamp(28px, 7vw, 40px); }
  .article-dek { font-size: 17px; }
  .article-body p, .article-body li { font-size: 17px; }
  .article-body blockquote { font-size: 20px; }
  .article-body h2 { font-size: 22px; }

  .story-row { grid-template-columns: 1fr 90px; }
  .story-row__num { display: none; }

  .ad--leaderboard { height: 100px; }
  .ad--halfpage { height: 250px; }

  .section-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .section-header__action { align-self: flex-end; }

  .article-byline-bar { flex-direction: column; align-items: flex-start; }
  .search-filters__sort { width: 100%; justify-content: space-between; }

  /* Tighter homepage hero spacing on mobile */
  .hero-card__chips  { margin-top: 12px; }
  .hero-card__title  { margin-top: 6px; line-height: 1.1; }
  .hero-card__dek    { margin-top: 8px; }
  .hero-card__byline { margin-top: 8px; }
  .home-grid         { gap: 24px; }

  /* Tighter single-post header on mobile so article body lands above the fold */
  .article-container        { padding-top: 12px; }
  .breadcrumb               { margin-bottom: 10px; font-size: 12px; }
  .article-header           { margin-bottom: 16px; }
  .article-header__chips    { margin-bottom: 10px; }
  .article-title            { line-height: 1.1; }
  .article-byline-bar       { padding: 12px 0; margin-bottom: 16px; gap: 10px; }
  .article-byline-bar__avatar { width: 32px; height: 32px; }
  .article-byline-bar__author { gap: 10px; }
}

/* Mobile sticky bottom ad slot */
.sticky-mobile-ad {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
  background: var(--bg-elev);
  border-top: 1px solid var(--line);
  padding: 10px;
}
.sticky-mobile-ad .eyebrow { font-size: 9px; text-align: center; margin-bottom: 4px; }
@media (max-width: 720px) {
  .sticky-mobile-ad { display: block; }
  body { padding-bottom: 90px; }
}

/* ============ SECONDARY NAV ============ */
.sub-nav {
  background: var(--bg-elev);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
}
.sub-nav .sub-nav__menu {
  list-style: none; margin: 0; padding: 8px 0;
  display: flex; gap: 18px; flex-wrap: wrap;
  justify-content: center;
}
.sub-nav__menu a {
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--fg-muted); padding: 4px 0; font-weight: 500;
}
.sub-nav__menu a:hover { color: var(--fg); }

/* ============ MAIN NAV — long-list resilience ============ */
/* Let the menu wrap to multiple lines without crushing the bar. */
.main-nav__menu { align-items: center; row-gap: 6px; }
.main-nav__inner { min-height: 56px; height: auto; padding: 8px 0; }

/* ============ DEFENSIVE: neutralize WPBakery / Visual Composer wrappers ============
   These plugins inject .vc_row / .vc_column / .wpb_wrapper around content with
   their own widths and paddings. When they appear inside our containers, reset them
   so the editorial layout isn't squeezed into a 1170px nested column.
*/
.container .vc_row,
.container .wpb_row,
.container .vc_row-fluid {
  margin-left: 0 !important;
  margin-right: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
}
.container .vc_column_container,
.container .vc_column-inner,
.container .wpb_column,
.container .wpb_wrapper {
  padding: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  flex: 1 1 100% !important;
}
.article-body .vc_row,
.article-body .wpb_row,
.article-body .vc_column_container,
.article-body .vc_column-inner,
.article-body .wpb_column,
.article-body .wpb_wrapper {
  padding: 0 !important;
  margin: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
}
/* WPBakery often forces .wpb_text_column with a 100% width inner wrapper that
   collapses our typographic max-width on long-form. Let the article-body cap it. */
.article-body .wpb_text_column { margin-bottom: 0 !important; }

/* WordPress core block / alignment compatibility */
.alignleft { float: left; margin: 0 24px 16px 0; }
.alignright { float: right; margin: 0 0 16px 24px; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.alignwide { max-width: calc(var(--content-max) - 80px); margin-left: auto; margin-right: auto; }
.alignfull { max-width: 100vw; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); }
.wp-caption-text, .gallery-caption {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--fg-muted); letter-spacing: 0.04em; margin-top: 8px;
}
.sticky { position: relative; }
.bypostauthor { }
.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;
}

/* Utility */
.stack-1 > * + * { margin-top: 4px; }
.stack-2 > * + * { margin-top: 8px; }
.stack-3 > * + * { margin-top: 12px; }
.stack-4 > * + * { margin-top: 16px; }
.stack-5 > * + * { margin-top: 24px; }
.screen-pad { padding-bottom: var(--gap-8); }
