:root {
  --blue: #1E3A8A;
  --blue-700: #1b357c;
  --sky: #3B82F6;
  --red: #DC2626;
  --green: #10B981;
  --bg: #F3F4F6;
  --paper: #ffffff;
  --ink: #111827;
  --muted: #6b7280;
  --faint: #9ca3af;
  --line: #e5e7eb;
  --serif: Georgia, "Times New Roman", Cambria, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
/* Sticky footer: body is a full-height column, main grows to fill. */
html, body { height: 100%; }
body { font-family: var(--sans); background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; }
main.container { flex: 1 0 auto; width: 100%; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { max-width: 1360px; margin: 0 auto; padding: 0 32px; }

/* ---- Sticky top stack (marquee + header stay pinned on every page) ---- */
.topbar { position: sticky; top: 0; z-index: 60; }

/* ---- Header ---- */
.site-header { background: var(--paper); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; gap: 26px; height: 68px; }
.logo { font-family: var(--serif); font-weight: 700; font-size: 26px; letter-spacing: 2px; color: var(--ink); }
.main-nav { display: flex; gap: 22px; }
.main-nav a { font-weight: 600; font-size: 15px; color: #374151; padding: 4px 0; border-bottom: 2px solid transparent; }
.main-nav a:hover, .main-nav a.active { color: var(--blue); border-bottom-color: var(--blue); }
.header-tools { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.country-select { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; background: #fff; }
.country-select select { border: none; font: inherit; font-weight: 600; color: var(--ink); background: none; cursor: pointer; outline: none; }
.search-box { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px; background: #fff; }
.search-box input { border: none; outline: none; font: inherit; width: 150px; }
.search-box::before { content: "⌕"; color: var(--faint); font-size: 18px; }

/* ---- Lead / hero ---- */
.hero { display: grid; grid-template-columns: 1.35fr 1fr; gap: 34px; padding: 34px 0; border-bottom: 1px solid var(--line); align-items: center; }
.hero-media { aspect-ratio: 16 / 10; border-radius: 12px; overflow: hidden; background: #dbeafe; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
.eyebrow { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.tag { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 4px 9px; border-radius: 6px; }
.tag-lead { background: #eff6ff; color: var(--blue); border: 1px solid #bfdbfe; }
.tag-cat { background: #e0e7ff; color: var(--blue); }
.time { color: var(--muted); font-size: 13.5px; }
.hero h1 { font-family: var(--serif); font-size: 40px; line-height: 1.12; letter-spacing: -.5px; margin-bottom: 16px; }
.hero .dek { font-size: 18px; color: #374151; margin-bottom: 18px; }
.byline { color: var(--muted); font-size: 14px; }
.byline strong { color: #374151; font-weight: 600; }

/* ---- Main grid ---- */
.layout { display: grid; grid-template-columns: 1fr 320px; gap: 40px; padding: 30px 0 60px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; border-bottom: 2px solid var(--ink); padding-bottom: 10px; margin-bottom: 22px; }
.section-head h2 { font-family: var(--serif); font-size: 15px; text-transform: uppercase; letter-spacing: .12em; }
.section-head .note { font-size: 13px; color: var(--muted); }

.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.story { display: flex; flex-direction: column; }
.story-media { aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden; background: #dbeafe; margin-bottom: 12px; }
.story-media img { width: 100%; height: 100%; object-fit: cover; }
.story .eyebrow { margin-bottom: 8px; }
.story h3 { font-family: var(--serif); font-size: 20px; line-height: 1.2; margin-bottom: 8px; }
.story:hover h3 { color: var(--blue); }
.story .dek { font-size: 14.5px; color: #4b5563; margin-bottom: 10px; }
.story .byline { font-size: 13px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }

.load-more { text-align: center; margin-top: 34px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 22px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font: inherit; font-weight: 600; cursor: pointer; color: var(--ink); }
.btn:hover { background: #f9fafb; }
.btn-primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.btn-primary:hover { background: var(--blue-700); }

/* ---- Sidebar ---- */
.sidebar > section { margin-bottom: 34px; }
.trending-list { list-style: none; }
.trending-item { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.trending-item:last-child { border-bottom: none; }
.rank { font-family: var(--serif); font-size: 26px; font-weight: 700; color: var(--sky); line-height: 1; width: 26px; }
.trending-item h4 { font-size: 15px; line-height: 1.25; margin-bottom: 4px; }
.trending-item:hover h4 { color: var(--blue); }
.trending-item .meta { font-size: 12.5px; color: var(--muted); }

.filter-card { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.filter-card .field { margin-bottom: 14px; }
.filter-card label { display: block; font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 6px; }
.filter-card select, .filter-card input { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: #fff; }

/* ---- Article page ---- */
.breadcrumb { font-size: 13px; color: var(--muted); padding: 22px 0 8px; }
.breadcrumb a:hover { color: var(--blue); text-decoration: underline; }
.article { max-width: 760px; margin: 0 auto; padding-bottom: 50px; }
.article h1 { font-family: var(--serif); font-size: 40px; line-height: 1.14; letter-spacing: -.5px; margin: 12px 0 16px; }
.article .dek { font-size: 20px; color: #374151; margin-bottom: 22px; }
.article-meta { display: flex; align-items: center; gap: 14px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--blue); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.article-meta .who { font-size: 14px; }
.article-meta .who strong { display: block; }
.share { margin-left: auto; display: flex; gap: 8px; }
.share a { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-weight: 700; }
.share a:hover { border-color: var(--blue); color: var(--blue); }
.article-hero { border-radius: 12px; overflow: hidden; margin-bottom: 8px; background: #dbeafe; aspect-ratio: 16/9; }
.caption { font-size: 12.5px; color: var(--faint); margin-bottom: 26px; }
.article-body p { font-size: 18px; line-height: 1.75; margin-bottom: 20px; }
.read-source { display: inline-flex; margin: 8px 0 26px; }
.related { border-top: 2px solid var(--ink); padding-top: 20px; }
.related h2 { font-family: var(--serif); font-size: 15px; text-transform: uppercase; letter-spacing: .12em; margin-bottom: 18px; }

/* ---- Search ---- */
.results-head { padding: 26px 0 18px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.results-head h1 { font-family: var(--serif); font-size: 30px; margin-bottom: 6px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.chip { font-size: 12.5px; background: #eef2ff; color: var(--blue); padding: 5px 10px; border-radius: 999px; font-weight: 600; }
.search-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 26px; }
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 40px; }
.pager a, .pager span { padding: 8px 13px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 14px; font-weight: 600; }
.pager .cur { background: var(--blue); color: #fff; border-color: var(--blue); }

/* ---- Placeholder image (branded, presentable) ---- */
.ph {
  width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background:
    radial-gradient(120% 120% at 15% 10%, rgba(59,130,246,.18), transparent 55%),
    radial-gradient(120% 120% at 85% 90%, rgba(30,58,138,.20), transparent 55%),
    linear-gradient(135deg, #1E3A8A 0%, #3B82F6 100%);
  color: #fff; font-family: var(--serif); font-size: 15px; font-weight: 700; letter-spacing: .5px;
  text-align: center; padding: 12px;
}
.ph::before {
  content: "";
  width: 34px; height: 34px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 5h13a2 2 0 0 1 2 2v10a2 2 0 0 0 2 2H6a2 2 0 0 1-2-2V5zm2 3h6v5H6V8zm8 0h3v2h-3V8zm0 3h3v2h-3v-2zM6 15h11v2H6v-2z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 5h13a2 2 0 0 1 2 2v10a2 2 0 0 0 2 2H6a2 2 0 0 1-2-2V5zm2 3h6v5H6V8zm8 0h3v2h-3V8zm0 3h3v2h-3v-2zM6 15h11v2H6v-2z'/%3E%3C/svg%3E") center/contain no-repeat;
  opacity: .95;
}

/* ---- Footer ---- */
.site-footer { background: var(--paper); border-top: 1px solid var(--line); padding: 30px 0; color: var(--muted); font-size: 13.5px; }
.site-footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.site-footer a:hover { color: var(--blue); }

.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty h3 { font-family: var(--serif); font-size: 22px; color: var(--ink); margin-bottom: 8px; }

/* ---- Breaking-news marquee ---- */
.marquee { background: var(--blue); color: #fff; overflow: hidden; }
.marquee-inner { display: flex; align-items: stretch; max-width: 1360px; margin: 0 auto; }
.marquee-badge { background: var(--red); color: #fff; font-weight: 800; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; padding: 9px 16px; display: flex; align-items: center; white-space: nowrap; flex-shrink: 0; }
.marquee-track-wrap { overflow: hidden; flex: 1; position: relative; }
.marquee-track { display: inline-flex; gap: 40px; white-space: nowrap; padding: 9px 20px; will-change: transform; animation: marquee 60s linear infinite; }
.marquee-track:hover { animation-play-state: paused; }
.marquee-track a { color: #dbe4ff; font-size: 13.5px; font-weight: 500; }
.marquee-track a:hover { color: #fff; text-decoration: none; }
.marquee-track a::before { content: "•"; margin-right: 40px; color: #7c9cf0; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---- Search autocomplete ---- */
.search-box { position: relative; }
.ac-list { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(17,24,39,.12); overflow: hidden; z-index: 100; display: none; }
.ac-list.open { display: block; }
.ac-item { display: block; padding: 10px 14px; font-size: 14px; border-bottom: 1px solid var(--line); color: var(--ink); }
.ac-item:last-child { border-bottom: none; }
.ac-item:hover, .ac-item.active { background: #eff6ff; text-decoration: none; }
.ac-item .ac-cat { font-size: 11px; color: var(--blue); text-transform: uppercase; font-weight: 700; letter-spacing: .04em; }

/* ---- Ad slots ---- */
.ad-slot { background: #fff; border: 1px dashed var(--line); border-radius: 12px; display: flex; align-items: center; justify-content: center; color: var(--faint); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; min-height: 90px; margin: 8px 0 26px; overflow: hidden; }
.ad-slot.ad-leaderboard { min-height: 100px; }
.ad-slot.ad-infeed { min-height: 120px; grid-column: 1 / -1; }
.ad-slot.ad-rail { min-height: 260px; }

@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; }
  .layout { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .search-list { grid-template-columns: 1fr; }
  .hero h1, .article h1 { font-size: 30px; }
}
@media (max-width: 640px) {
  .main-nav, .search-box { display: none; }
  .card-grid { grid-template-columns: 1fr; }
  .header-inner { gap: 14px; }
}
