:root {
  --bg: #F6F6F2;
  --surface: #FFFFFF;
  --ink: #14171A;
  --ink-70: rgba(20, 23, 26, 0.7);
  --ink-60: rgba(20, 23, 26, 0.6);
  --ink-45: rgba(20, 23, 26, 0.45);
  --divider: #E4E3DC;
  --accent: #1E6FEB;
  --accent-ink: #FFFFFF;
  --support: #E8A33D;
  --flag-green: #007A4D;
  --flag-gold: #FFB612;
  --flag-red: #E03C31;

  --font-heading: 'Space Grotesk', sans-serif;
  --font-body: 'Work Sans', sans-serif;

  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 32px;
  --space-xl: 56px;

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

  --container-width: 1200px;
}

:where(*, *::before, *::after) {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:where(html) {
  -webkit-text-size-adjust: 100%;
}

:where(body) {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

:where(img) {
  max-width: 100%;
  display: block;
}

:where(a) {
  color: inherit;
  text-decoration: none;
}

:where(ul, ol) {
  list-style: none;
}

:where(h1, h2, h3, h4) {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

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

/* ---------- Masthead ---------- */

.masthead {
  border-bottom: 1px solid var(--divider);
  background: var(--bg);
}

.masthead__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) 0;
  gap: var(--space-md);
}

.masthead__logo {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.masthead__logo span {
  color: var(--accent);
}

.masthead__meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-size: 13px;
  color: var(--ink-60);
}

.masthead__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--divider);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
}

.masthead__toggle svg {
  width: 18px;
  height: 18px;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  border-top: 1px solid var(--divider);
  border-bottom: 1px solid var(--divider);
  overflow-x: auto;
  scrollbar-width: none;
}

/*
  A rare, deliberate signature -- not a general accent. Exactly two on the
  site: here, and on .site-footer. Never add a third or use it decoratively
  elsewhere (see the active design's Do's/Don'ts).
*/
.flag-tick {
  position: absolute;
  top: -1px;
  right: var(--space-md);
  width: 32px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(
    90deg,
    var(--flag-green) 0% 33%,
    var(--flag-gold) 33% 66%,
    var(--flag-red) 66% 100%
  );
}

.nav::-webkit-scrollbar {
  display: none;
}

.nav__list {
  display: flex;
  gap: var(--space-lg);
  padding: var(--space-sm) 0;
  white-space: nowrap;
}

.nav__link {
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-70);
}

.nav__link:hover,
.nav__link.is-active {
  color: var(--accent);
}

/* ---------- Breaking strip ---------- */

.breaking-strip {
  background: var(--ink);
  color: var(--bg);
  font-size: 13px;
  padding: var(--space-sm) 0;
}

.breaking-strip .container {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.live-badge {
  display: inline-flex;
  align-items: center;
  background: var(--support);
  color: var(--ink);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

/* ---------- Lead story ---------- */

.lead {
  padding: var(--space-lg) 0;
}

.lead__card {
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr;
}

.lead__media {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #DCE6F7 0%, #EDEEE7 100%);
  overflow: hidden;
}

.lead__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lead__body {
  padding: var(--space-lg) var(--space-md);
}

.lead__category {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-70);
  margin-bottom: var(--space-sm);
  display: block;
}

.lead__headline {
  font-size: 28px;
  margin-bottom: var(--space-sm);
}

.lead__headline a:hover {
  color: var(--accent);
}

.lead__dek {
  color: var(--ink-70);
  font-size: 16px;
  line-height: 1.5;
  margin-bottom: var(--space-sm);
}

.lead__meta {
  font-size: 13px;
  color: var(--ink-45);
}

@media (min-width: 768px) {
  .lead__card {
    grid-template-columns: 1.2fr 1fr;
  }

  .lead__headline {
    font-size: 36px;
  }
}

/* Full-bleed lead image on mobile only, per the active design's variance rule. */
@media (max-width: 767px) {
  .lead {
    padding-top: 0;
  }

  .lead__card {
    border-left: none;
    border-right: none;
    border-radius: 0;
    margin: 0 calc(var(--space-md) * -1);
  }

  .lead__media {
    aspect-ratio: 4 / 3;
  }
}

/* ---------- Section rails ---------- */

.rail {
  padding: var(--space-lg) 0;
  border-top: 1px solid var(--divider);
}

.rail__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.rail__title {
  font-size: 20px;
}

.rail__more {
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
}

.headline-list {
  display: flex;
  flex-direction: column;
}

.headline-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--divider);
}

.headline-row:last-child {
  border-bottom: none;
}

.headline-row__category {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-45);
}

.headline-row__title {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 17px;
  line-height: 1.25;
}

.headline-row__title a:hover {
  color: var(--accent);
}

.headline-row__meta {
  font-size: 12px;
  color: var(--ink-45);
}

@media (min-width: 768px) {
  .rail__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    column-gap: var(--space-lg);
  }
}

/* ---------- Article page ---------- */

.article {
  padding: var(--space-lg) 0 var(--space-xl);
  max-width: 760px;
  margin: 0 auto;
}

.article__category {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: var(--space-sm);
  display: inline-block;
}

.article__headline {
  font-size: 32px;
  margin-bottom: var(--space-sm);
}

.article__dek {
  font-size: 18px;
  color: var(--ink-70);
  margin-bottom: var(--space-md);
}

.article__byline {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 13px;
  color: var(--ink-60);
  padding-bottom: var(--space-md);
  margin-bottom: var(--space-md);
  border-bottom: 1px solid var(--divider);
}

.article__media {
  margin-bottom: var(--space-md);
}

.article__media img {
  width: 100%;
  border-radius: var(--radius-md);
}

.article__media figcaption {
  font-size: 12px;
  color: var(--ink-45);
  margin-top: var(--space-xs);
}

.key-points {
  border: 1px solid var(--divider);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-lg);
}

.key-points__title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-70);
  margin-bottom: var(--space-sm);
}

.key-points ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.key-points li {
  padding-left: var(--space-md);
  position: relative;
  font-size: 15px;
  line-height: 1.5;
}

.key-points li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.article__body {
  font-size: 18px;
  line-height: 1.65;
  max-width: 65ch;
}

.article__body p {
  margin-bottom: var(--space-md);
}

.article__body a {
  color: var(--accent);
  text-decoration: underline;
}

.sources {
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--divider);
}

.sources__title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-70);
  margin-bottom: var(--space-sm);
}

.sources__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.sources__item a {
  font-size: 14px;
  color: var(--accent);
  text-decoration: underline;
}

.sources__outlet {
  color: var(--ink-45);
  font-size: 13px;
}

.ai-disclosure {
  margin-top: var(--space-md);
  font-size: 13px;
  color: var(--ink-60);
}

.ai-disclosure a {
  color: var(--accent);
  text-decoration: underline;
}

/* ---------- Footer ---------- */

.site-footer {
  position: relative;
  border-top: 1px solid var(--divider);
  padding: var(--space-lg) 0 var(--space-xl);
  margin-top: var(--space-xl);
}

.site-footer .flag-tick {
  top: -1px;
}

.site-footer__grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-lg);
  justify-content: space-between;
}

.site-footer__brand {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 18px;
  margin-bottom: var(--space-sm);
}

.site-footer__tagline {
  font-size: 13px;
  color: var(--ink-60);
  max-width: 32ch;
}

.site-footer__links {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  font-size: 13px;
}

.site-footer__links a:hover {
  color: var(--accent);
}

.site-footer__legal {
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--divider);
  font-size: 12px;
  color: var(--ink-45);
}

/* ---------- Motion (near-static, degrades to visible) ---------- */

.reveal {
  opacity: 1;
}

html.js .reveal {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

html.js .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html.js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
