/* USA MEDIA X — editorial design system */
:root {
  --paper: #ffffff;
  --surface: #f6f8fb;
  --surface-2: #eef2f8;
  --ink: #0d1b2a;
  --ink-soft: #334155;
  --muted: #66758c;
  --line: #e2e8f0;
  --navy: #0b1f3a;
  --blue: #1667ff;
  --blue-deep: #0b3edb;
  --cyan: #38d6ff;
  --red: #e3292e;
  --shadow: 0 8px 28px rgba(13, 27, 42, .07);
  --radius: 10px;
  --wrap: 1240px;
}

[data-theme="dark"] {
  --paper: #0b1424;
  --surface: #101d31;
  --surface-2: #17263d;
  --ink: #eef4fd;
  --ink-soft: #c4d2e6;
  --muted: #90a1ba;
  --line: #23344c;
  --navy: #070f1d;
  --blue: #6fa6ff;
  --blue-deep: #4c8dff;
  --red: #ff5d62;
  --shadow: 0 10px 34px rgba(0, 0, 0, .32);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background .25s ease, color .25s ease;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
.wrap { width: min(100% - 48px, var(--wrap)); margin-inline: auto; }

svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- utility ---------- */
.utility { background: var(--navy); color: #b9c8df; font-size: 11.5px; letter-spacing: .03em; }
.utility-inner { height: 34px; display: flex; align-items: center; justify-content: space-between; }
.utility-left, .utility-right { display: flex; align-items: center; gap: 14px; }
.pipe { width: 1px; height: 12px; background: #40526b; }
.utility-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: #cbd8ea; font-size: 11.5px; padding: 4px 2px; }
.utility-btn:hover { color: #fff; }
.utility-btn svg { width: 14px; height: 14px; }
.utility-btn.is-spinning svg { animation: spin .9s linear infinite; }
.icon-only { padding: 4px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- masthead ---------- */
.masthead { background: var(--paper); border-bottom: 1px solid var(--line); }
.masthead-inner { min-height: 86px; display: grid; grid-template-columns: 1fr minmax(280px, 440px) 1fr; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; width: fit-content; }
.brand-mark { width: 36px; height: 36px; }
.brand-text { font-weight: 800; font-size: 21px; letter-spacing: -.045em; white-space: nowrap; }
.brand-text b { color: var(--blue); font-weight: 900; margin-left: 2px; }
.search { position: relative; display: flex; align-items: center; gap: 9px; height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--muted); transition: border-color .2s, box-shadow .2s; }
.search:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(22,103,255,.12); }
.search svg { width: 16px; height: 16px; flex: none; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 13px; }
.search input::placeholder { color: var(--muted); }
.search-clear { border: 0; background: transparent; color: var(--muted); font-size: 20px; line-height: 1; padding: 0 2px; }
.masthead-cta { justify-self: end; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--blue); }
.masthead-cta span { display: inline-block; margin-left: 5px; transition: transform .2s; }
.masthead-cta:hover span { transform: translateX(4px); }

/* ---------- nav ---------- */
.nav { position: sticky; top: 0; z-index: 30; background: var(--paper); border-bottom: 1px solid var(--line); }
.nav-inner { display: flex; align-items: stretch; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.nav-inner::-webkit-scrollbar { display: none; }
.nav-item { position: relative; flex: none; border: 0; background: transparent; padding: 15px 14px; font-size: 11.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-soft); white-space: nowrap; }
.nav-item::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 0; height: 2px; background: transparent; }
.nav-item:hover { color: var(--blue); }
.nav-item.is-active { color: var(--blue); }
.nav-item.is-active::after { background: var(--blue); }
.nav-sources { margin-left: auto; color: var(--muted); }

/* ---------- breaking ---------- */
.breaking { background: var(--surface); border-bottom: 1px solid var(--line); }
.breaking-inner { height: 44px; display: flex; align-items: center; gap: 16px; }
.breaking-tag { flex: none; display: inline-flex; align-items: center; gap: 7px; color: var(--red); font-size: 11px; font-weight: 800; letter-spacing: .12em; }
.breaking-tag i { width: 7px; height: 7px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 3px rgba(227,41,46,.15); }
.breaking-track { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.breaking-track a:hover { color: var(--blue); text-decoration: underline; }
.breaking-label { flex: none; font-size: 10px; font-weight: 800; letter-spacing: .14em; color: var(--muted); }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; margin: 30px 0 40px; min-height: 380px; }
.hero-lead { display: block; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.hero-media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background-color: var(--blue-deep); background-image: radial-gradient(circle at 82% 18%, rgba(255,255,255,.22), transparent 46%), repeating-linear-gradient(135deg, rgba(255,255,255,.075) 0 1px, transparent 1px 16px), linear-gradient(135deg, var(--blue-deep), var(--cyan)); }
.hero-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.hero-lead:hover .hero-media img { transform: scale(1.035); }
.hero-media .fallback { position: absolute; inset: 0; display: grid; place-items: center; font-size: 68px; font-weight: 900; letter-spacing: -.08em; color: rgba(255,255,255,.22); text-shadow: 0 8px 40px rgba(0,0,0,.14); }
.hero-body { padding: 22px 24px 24px; }
.hero-kicker { font-size: 10.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--blue); }
.hero-body h1 { margin: 8px 0 10px; font-size: clamp(25px, 2.4vw, 36px); line-height: 1.14; letter-spacing: -.035em; font-weight: 800; }
.hero-body p { margin: 0 0 16px; color: var(--muted); font-size: 14px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); }
.meta .source { font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-soft); }
.hero-side { display: grid; grid-template-rows: 1fr 1fr; gap: 20px; }
.hero-mini { display: grid; grid-template-columns: 128px 1fr; gap: 16px; align-items: center; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); overflow: hidden; }
.hero-mini .mini-media { height: 100%; min-height: 118px; border-radius: 6px; overflow: hidden; background: linear-gradient(140deg, var(--blue-deep), var(--cyan)); display: grid; place-items: center; }
.hero-mini .mini-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-mini .mini-media span { color: rgba(255,255,255,.6); font-size: 34px; font-weight: 900; }
.hero-mini h3 { margin: 8px 0; font-size: 17px; line-height: 1.3; letter-spacing: -.02em; font-weight: 700; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hero-mini:hover h3 { color: var(--blue); }
.hero-skeleton { grid-column: 1 / -1; min-height: 380px; }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 38px; align-items: start; padding-bottom: 70px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding-bottom: 16px; border-bottom: 2px solid var(--ink); margin-bottom: 4px; }
.eyebrow { display: block; font-size: 10px; font-weight: 800; letter-spacing: .16em; color: var(--blue); }
.section-head h2 { margin: 3px 0 0; font-size: 24px; letter-spacing: -.035em; font-weight: 800; }
.filter-row { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.chip { border: 1px solid var(--line); background: var(--paper); color: var(--muted); border-radius: 100px; padding: 5px 12px; font-size: 11px; font-weight: 600; }
.chip:hover { border-color: var(--blue); color: var(--blue); }
.chip.is-active { background: var(--navy); border-color: var(--navy); color: #fff; }
[data-theme="dark"] .chip.is-active { background: var(--blue-deep); border-color: var(--blue-deep); }

/* ---------- cards ---------- */
.card { display: grid; grid-template-columns: 176px 1fr; gap: 20px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.card:hover h3 { color: var(--blue); }
.card-thumb { position: relative; aspect-ratio: 16 / 10; border-radius: 7px; overflow: hidden; background-color: var(--blue-deep); background-image: radial-gradient(circle at 80% 20%, rgba(255,255,255,.18), transparent 48%), repeating-linear-gradient(135deg, rgba(255,255,255,.06) 0 1px, transparent 1px 12px), linear-gradient(135deg, var(--blue-deep), var(--cyan)); }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-thumb .fallback { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255,255,255,.5); font-size: 26px; font-weight: 900; letter-spacing: -.06em; }
.card-meta { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); margin-bottom: 7px; }
.card-meta .source { font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-soft); }
.card-meta .cat { color: var(--blue); font-weight: 700; }
.card h3 { margin: 0 0 7px; font-size: 19px; line-height: 1.32; letter-spacing: -.025em; font-weight: 700; transition: color .18s; }
.card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.load-more { display: block; width: 100%; margin-top: 26px; padding: 13px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft); border-radius: 8px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.load-more:hover { border-color: var(--blue); color: var(--blue); }
.empty { padding: 50px 0; text-align: center; color: var(--muted); }

/* ---------- rail ---------- */
.rail { display: grid; gap: 22px; position: sticky; top: 74px; }
.rail-box { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); padding: 20px; box-shadow: var(--shadow); }
.rail-head { padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.rail-head h3 { margin: 3px 0 0; font-size: 17px; letter-spacing: -.02em; font-weight: 800; }
.trending { list-style: none; margin: 0; padding: 0; }
.trending li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.trending li:last-child { border-bottom: 0; padding-bottom: 0; }
.trending .rank { font-size: 22px; font-weight: 900; line-height: 1; letter-spacing: -.06em; color: var(--line); }
.trending li:hover .rank { color: var(--blue); }
.trending a { font-size: 13px; font-weight: 600; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.trending small { display: block; margin-top: 4px; color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; }
.source-list { display: grid; gap: 2px; }
.source-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 0; font-size: 12px; }
.source-item .name { display: flex; align-items: center; gap: 8px; color: var(--ink-soft); font-weight: 600; }
.source-item .dot { width: 7px; height: 7px; border-radius: 50%; background: #22b573; flex: none; }
.source-item .dot.off { background: #cbd5e1; }
.source-item .count { color: var(--muted); font-variant-numeric: tabular-nums; }
.source-note { margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10.5px; line-height: 1.55; }
.rail-cta { border-radius: var(--radius); background: linear-gradient(140deg, #0b3edb, #1667ff 55%, #38d6ff); color: #fff; padding: 24px; box-shadow: var(--shadow); }
.rail-cta-mark { display: inline-grid; place-items: center; width: 32px; height: 32px; border: 1.5px solid rgba(255,255,255,.6); border-radius: 8px; font-weight: 900; font-size: 17px; }
.rail-cta h3 { margin: 16px 0 6px; font-size: 19px; letter-spacing: -.03em; }
.rail-cta p { margin: 0; font-size: 12px; color: rgba(255,255,255,.82); }

/* ---------- footer ---------- */
.footer { background: var(--navy); color: #aebdd2; padding: 40px 0 28px; }
.footer-inner { display: grid; gap: 18px; }
.footer-brand { display: flex; align-items: center; gap: 11px; }
.footer-mark { width: 32px; height: 32px; }
.footer-brand strong { display: block; color: #fff; font-size: 15px; letter-spacing: -.02em; }
.footer-brand span { font-size: 11px; }
.footer-note { max-width: 760px; margin: 0; font-size: 11.5px; line-height: 1.7; }
.footer-meta { display: flex; justify-content: space-between; gap: 20px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.12); font-size: 10.5px; letter-spacing: .04em; }

/* ---------- states ---------- */
.skeleton { border-radius: 8px; background: linear-gradient(100deg, var(--surface) 20%, var(--surface-2) 40%, var(--surface) 60%); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; }
.card-skeleton { height: 130px; margin-bottom: 10px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 100; padding: 11px 16px; border-radius: 8px; background: var(--navy); color: #fff; font-size: 12px; box-shadow: 0 12px 30px rgba(0,0,0,.22); opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translateY(0); }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .layout { grid-template-columns: minmax(0, 1fr) 260px; gap: 26px; }
  .hero { grid-template-columns: 1.25fr 1fr; }
  .card { grid-template-columns: 144px 1fr; gap: 16px; }
}
@media (max-width: 860px) {
  .wrap { width: min(100% - 32px, var(--wrap)); }
  .masthead-inner { grid-template-columns: 1fr auto; min-height: 74px; }
  .search { grid-column: 1 / -1; grid-row: 2; margin-bottom: 14px; }
  .masthead-cta { display: none; }
  .hero { grid-template-columns: 1fr; margin: 22px 0 30px; }
  .hero-side { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
  .layout { grid-template-columns: 1fr; }
  .rail { position: static; grid-template-columns: 1fr 1fr; }
  .rail-cta { grid-column: 1 / -1; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .filter-row { justify-content: flex-start; }
}
@media (max-width: 600px) {
  .utility-left span:last-child, .breaking-label, #refreshLabel { display: none; }
  .hero-side { grid-template-columns: 1fr; }
  .hero-mini { grid-template-columns: 96px 1fr; }
  .card { grid-template-columns: 1fr; gap: 12px; }
  .card-thumb { aspect-ratio: 16 / 8; }
  .rail { grid-template-columns: 1fr; }
  .card h3 { font-size: 17px; }
  .brand-text { font-size: 19px; }
}
