/* ============================================================
   NEXUS NEWS — Redesigned Premium Style
   Inspired by NYT / BBC / Reuters
   ============================================================ */

/* ── RESET & ROOT ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --red:      #c9192b;
  --red-dark: #a01020;
  --black:    #111111;
  --ink:      #1a1a1a;
  --ink-2:    #333333;
  --ink-3:    #555555;
  --ink-4:    #888888;
  --border:   #e0e0e0;
  --bg:       #ffffff;
  --bg-2:     #f7f7f5;
  --bg-3:     #eeeeea;

  /* Typography */
  --serif:    'Playfair Display', 'Georgia', serif;
  --body:     'Source Serif 4', 'Georgia', serif;
  --sans:     'DM Sans', 'Helvetica Neue', sans-serif;

  /* Spacing */
  --max-w:    1280px;
  --col-gap:  24px;
}

[data-theme="dark"] {
  --black:    #ffffff;
  --ink:      #f0f0f0;
  --ink-2:    #cccccc;
  --ink-3:    #999999;
  --ink-4:    #666666;
  --border:   #333333;
  --bg:       #0f0f0f;
  --bg-2:     #181818;
  --bg-3:     #222222;
  --red:      #e03040;
}

html { scroll-behavior: smooth; }

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

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; font: inherit; }

/* ── BREAKING TICKER ─────────────────────────────────────── */
.breaking-ticker {
  background: var(--red);
  color: #fff;
  display: flex;
  align-items: center;
  height: 36px;
  overflow: hidden;
  position: relative;
  z-index: 1000;
}

.ticker-label {
  background: #000;
  color: #fff;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 0 16px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.ticker-label i { font-size: 8px; animation: pulse 1.5s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }

.ticker-track {
  overflow: hidden;
  flex: 1;
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}

.ticker-inner {
  display: inline-flex;
  animation: ticker-scroll 40s linear infinite;
  white-space: nowrap;
}

.ticker-item {
  font-family: var(--sans);
  font-size: 13px;
  padding: 0 32px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.ticker-item::before { content: '●'; font-size: 6px; color: rgba(255,255,255,.6); }
.ticker-item a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

@keyframes ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ── MASTHEAD ─────────────────────────────────────────────── */
.masthead {
  border-bottom: 3px solid var(--black);
  position: relative;
}

.masthead-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px 12px;
  max-width: var(--max-w);
  margin: 0 auto;
}

.masthead-date {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-3);
  min-width: 160px;
}

.masthead-logo {
  text-align: center;
  flex: 1;
}

.logo-wordmark {
  font-family: var(--serif);
  font-size: clamp(28px, 5vw, 52px);
  font-weight: 800;
  color: var(--black);
  letter-spacing: -0.02em;
  line-height: 1;
}

.logo-tagline {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--ink-4);
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-top: 3px;
}

.masthead-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 160px;
  justify-content: flex-end;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-2);
  font-size: 16px;
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--bg-3); color: var(--black); }

/* ── NAVBAR ───────────────────────────────────────────────── */
.navbar {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 900;
  transition: transform .3s ease, box-shadow .2s;
}
.navbar.hide { transform: translateY(-100%); }
.navbar.scrolled { box-shadow: 0 2px 12px rgba(0,0,0,.08); }

.categories-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.categories-scroll::-webkit-scrollbar { display: none; }

.categories-inner {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 16px;
  max-width: var(--max-w);
  margin: 0 auto;
}

.cat-pill {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-3);
  padding: 10px 14px;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: color .15s, border-color .15s;
  display: block;
  line-height: 1;
}
.cat-pill:hover { color: var(--black); }
.cat-pill.active {
  color: var(--red);
  border-bottom-color: var(--red);
  font-weight: 700;
}

/* ── SEARCH BAR ───────────────────────────────────────────── */
.search-bar {
  display: none;
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 12px 24px;
}
.search-bar.open { display: block; }

.search-form {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 600px;
  margin: 0 auto;
  border: 2px solid var(--black);
  border-radius: 2px;
  padding: 0 12px;
  background: var(--bg);
}
.search-icon { color: var(--ink-4); font-size: 14px; }
.search-form input {
  flex: 1;
  border: none;
  outline: none;
  background: none;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  padding: 10px 0;
}
.search-close { color: var(--ink-4); font-size: 16px; padding: 4px; }

.search-suggestions {
  max-width: 600px;
  margin: 8px auto 0;
  background: var(--bg);
  border: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(0,0,0,.12);
}

.suggestion-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}
.suggestion-item:hover { background: var(--bg-2); }
.suggestion-item:last-child { border-bottom: none; }
.sugg-thumb {
  width: 52px;
  height: 36px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-3);
}
.sugg-thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-4);
}
.sugg-info { flex: 1; min-width: 0; }
.sugg-title { font-family: var(--sans); font-size: 13px; font-weight: 600; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sugg-source { font-family: var(--sans); font-size: 11px; color: var(--red); font-weight: 700; text-transform: uppercase; display: block; margin-top: 2px; }
.sugg-arrow { color: var(--ink-4); font-size: 12px; }

/* ── MAIN LAYOUT ──────────────────────────────────────────── */
.main-content {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 16px;
}

/* ── LIVE SECTION ─────────────────────────────────────────── */
.live-section {
  padding: 16px 0 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.live-badge {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--red);
  display: flex;
  align-items: center;
  gap: 6px;
}
.live-badge i { animation: pulse 1.5s infinite; }

.live-time {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-4);
}

.live-feed {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.live-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .1s;
  text-decoration: none;
  color: inherit;
}
.live-item:last-child { border-bottom: none; }
.live-item:hover .live-headline { color: var(--red); }

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink-3);
  flex-shrink: 0;
  margin-top: 6px;
}
.live-dot.breaking {
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(201,25,43,.2);
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
  0%,100%{box-shadow:0 0 0 3px rgba(201,25,43,.2)}
  50%{box-shadow:0 0 0 6px rgba(201,25,43,.05)}
}

.live-text { flex: 1; min-width: 0; }
.live-headline {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.4;
  transition: color .15s;
}
.live-meta {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--ink-4);
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.breaking-label {
  background: var(--red);
  color: #fff;
  padding: 1px 5px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  border-radius: 2px;
}

/* ── HERO SECTION ─────────────────────────────────────────── */
.hero-section { margin-bottom: 32px; }

.hero-card {
  position: relative;
  cursor: pointer;
  overflow: hidden;
  background: var(--bg-3);
}

.hero-img-wrap {
  width: 100%;
  aspect-ratio: 16 / 7;
  overflow: hidden;
  background: var(--bg-3);
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
  display: block;
}
.hero-card:hover .hero-img { transform: scale(1.02); }

.hero-no-img {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: var(--ink-4);
  background: var(--bg-3);
}

.hero-overlay {
  padding: 20px 0 0;
}

.hero-cat {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.hero-title {
  font-family: var(--serif);
  font-size: clamp(22px, 4vw, 42px);
  font-weight: 800;
  line-height: 1.1;
  color: var(--ink);
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}
.hero-card:hover .hero-title { text-decoration: underline; text-decoration-thickness: 2px; }

.hero-desc {
  font-family: var(--body);
  font-size: clamp(14px, 1.6vw, 17px);
  color: var(--ink-3);
  line-height: 1.6;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-4);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.hero-source {
  font-weight: 700;
  color: var(--ink-3);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: .06em;
}

/* ── FEED HEADER ──────────────────────────────────────────── */
.feed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 12px;
  border-bottom: 3px solid var(--black);
  margin-bottom: 20px;
}

.feed-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.refresh-btn {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 2px;
  transition: all .15s;
}
.refresh-btn:hover { border-color: var(--black); color: var(--black); }
.refresh-btn i { transition: transform .4s; }
.refresh-btn.spinning i { animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── NEWS GRID ────────────────────────────────────────────── */
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}

/* Every card shares a bottom border */
.news-card {
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  position: relative;
}

/* Right border on cols 1 and 2 */
.news-card:nth-child(3n+1),
.news-card:nth-child(3n+2) {
  border-right: 1px solid var(--border);
}

.news-card:hover .card-title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }

/* Vertical card (tall) — takes full row */
.news-card.vertical {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-right: none;
}
.news-card.vertical .card-layout { display: contents; }
.news-card.vertical .card-img-wrap {
  aspect-ratio: 4/3;
  border-right: 1px solid var(--border);
}
.news-card.vertical .card-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.news-card.vertical .card-title {
  font-size: 22px;
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.25;
  -webkit-line-clamp: 4;
}
.news-card.vertical .card-desc {
  font-size: 14px;
  color: var(--ink-3);
  font-family: var(--body);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 8px 0;
  line-height: 1.5;
}

/* Horizontal card (small) */
.news-card.horizontal .card-layout {
  display: flex;
  flex-direction: column;
}
.news-card.horizontal .card-img-wrap { aspect-ratio: 16/9; }
.news-card.horizontal .card-body { padding: 12px 16px 16px; }
.news-card.horizontal .card-title {
  font-size: 15px;
  font-family: var(--sans);
  font-weight: 600;
  line-height: 1.4;
  -webkit-line-clamp: 3;
}

/* Shared card parts */
.card-layout { height: 100%; }

.card-img-wrap {
  overflow: hidden;
  background: var(--bg-3);
  position: relative;
  flex-shrink: 0;
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .35s ease;
}
.news-card:hover .card-img { transform: scale(1.04); }

.card-no-img {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: var(--ink-4);
  background: var(--bg-3);
}

.card-breaking {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--red);
  color: #fff;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  padding: 3px 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-cat {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 5px;
}

.card-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--ink);
  line-height: 1.35;
  margin-bottom: 8px;
  transition: color .15s;
}

.card-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 8px;
}

.card-source {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: .05em;
  flex: 1;
}
.card-time {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--ink-4);
}

.card-save {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-4);
  font-size: 13px;
  border-radius: 2px;
  transition: color .15s, background .15s;
}
.card-save:hover { color: var(--black); background: var(--bg-3); }
.card-save.saved { color: var(--red); }

/* ── AI BADGE ─────────────────────────────────────────────── */
.ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #6366f1;
  border: 1px solid #6366f1;
  padding: 2px 7px;
  border-radius: 2px;
  background: rgba(99,102,241,.08);
  cursor: pointer;
}
.ai-badge:hover { background: rgba(99,102,241,.16); }

/* ── SKELETON ─────────────────────────────────────────────── */
.skeleton-card { pointer-events: none; }
.skeleton-img, .skeleton-hero-img {
  background: linear-gradient(90deg, var(--bg-3) 25%, var(--border) 50%, var(--bg-3) 75%);
  background-size: 200%;
  animation: shimmer 1.4s infinite;
}
.skeleton-img { aspect-ratio: 16/9; }
.skeleton-hero-img { aspect-ratio: 16/7; }
.skeleton-line {
  height: 14px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--bg-3) 25%, var(--border) 50%, var(--bg-3) 75%);
  background-size: 200%;
  animation: shimmer 1.4s infinite;
  margin: 8px 0;
}
.skeleton-line.short { width: 40%; }
.skeleton-line.medium { width: 65%; }
.skeleton-body { padding: 12px 16px; }
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

.skeleton-live-item { display: flex; gap: 10px; padding: 8px 0; }
.skeleton-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bg-3); flex-shrink: 0; margin-top: 4px; }

/* ── LOAD MORE ────────────────────────────────────────────── */
.load-more-wrap {
  display: flex;
  justify-content: center;
  padding: 32px 0 48px;
}

.load-more-btn {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 700;
  color: var(--bg);
  background: var(--black);
  padding: 14px 32px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background .15s, transform .1s;
  letter-spacing: .03em;
}
.load-more-btn:hover { background: var(--ink-2); }
.load-more-btn:active { transform: scale(.98); }
.load-more-btn.loading { opacity: .6; pointer-events: none; }

/* ── NO RESULTS ───────────────────────────────────────────── */
.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-4);
}
.no-results i { font-size: 40px; margin-bottom: 16px; }
.no-results h3 { font-family: var(--serif); font-size: 22px; color: var(--ink-2); margin-bottom: 8px; }
.no-results p { font-family: var(--sans); font-size: 14px; }

/* ── ARTICLE OVERLAY ─────────────────────────────────────── */
.article-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  pointer-events: none;
  display: flex;
  align-items: flex-end;
}
.article-overlay.open { pointer-events: all; }

.article-sheet {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  max-height: 92vh;
  background: var(--bg);
  border-top: 3px solid var(--black);
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform .35s cubic-bezier(.32,.72,0,1);
  position: relative;
}
.article-overlay.open .article-sheet {
  transform: translateY(0);
}

.sheet-handle {
  width: 36px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 10px auto 0;
  flex-shrink: 0;
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sheet-back, .sheet-action {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-3);
  font-size: 16px;
  border-radius: 2px;
  transition: background .15s, color .15s;
}
.sheet-back:hover, .sheet-action:hover { background: var(--bg-3); color: var(--black); }
.sheet-action.active { color: var(--red); }
.sheet-actions { display: flex; gap: 4px; }

.sheet-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px 48px;
  -webkit-overflow-scrolling: touch;
}

/* Article reader styles */
.sa-cat {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 10px;
}

.sa-title {
  font-family: var(--serif);
  font-size: clamp(22px, 4vw, 34px);
  font-weight: 800;
  line-height: 1.15;
  color: var(--ink);
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.sa-byline {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.sa-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-4);
  font-size: 14px;
  flex-shrink: 0;
}

.sa-author {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.sa-meta {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--ink-4);
  margin-top: 1px;
}

.sa-hero {
  width: 100%;
  margin-bottom: 20px;
}
.sa-hero img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  display: block;
}

/* AI Enhanced indicator */
.sa-ai-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(99,102,241,.07);
  border-left: 3px solid #6366f1;
  margin-bottom: 20px;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-3);
}
.sa-ai-notice i { color: #6366f1; }
.sa-ai-notice .sa-ai-toggle {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  color: #6366f1;
  text-decoration: underline;
  cursor: pointer;
}

.sa-body {
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink-2);
}
.sa-body p { margin-bottom: 16px; }
.sa-body p:last-child { margin-bottom: 0; }

/* Original content (shown when toggle clicked) */
.sa-original {
  display: none;
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-3);
  padding: 16px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  margin-bottom: 16px;
}
.sa-original.visible { display: block; }

.sa-source-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 20px 0;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-3);
}
.sa-source-box i { color: var(--ink-4); }
.sa-source-link {
  margin-left: auto;
  color: var(--red);
  font-weight: 700;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.sa-source-link:hover { text-decoration: underline; }

.sa-share-row {
  display: flex;
  gap: 8px;
  margin: 16px 0;
}
.sa-share-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--ink-3);
  transition: all .15s;
}
.sa-share-btn:hover { border-color: var(--black); color: var(--black); background: var(--bg-2); }
.sa-share-btn.twitter:hover { color: #000; }
.sa-share-btn.facebook:hover { color: #1877f2; }
.sa-share-btn.whatsapp:hover { color: #25d366; }

.sa-related { margin-top: 28px; border-top: 3px solid var(--black); padding-top: 16px; }
.sa-related-title {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 16px;
}
.sa-related-grid { display: flex; flex-direction: column; gap: 0; }
.sa-related-card {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.sa-related-card:last-child { border-bottom: none; }
.sa-related-card:hover .sa-related-title-t { text-decoration: underline; }
.sa-related-img {
  width: 80px;
  height: 60px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-3);
}
.sa-related-no-img {
  width: 80px;
  height: 60px;
  background: var(--bg-3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-4);
  font-size: 20px;
  flex-shrink: 0;
}
.sa-related-t { flex: 1; }
.sa-related-src {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--red);
  margin-bottom: 4px;
}
.sa-related-title-t {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sa-related-time { font-family: var(--sans); font-size: 11px; color: var(--ink-4); margin-top: 4px; }

.article-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 200px;
  color: var(--ink-4);
  font-family: var(--sans);
  font-size: 13px;
}
.spinner {
  width: 28px;
  height: 28px;
  border: 2px solid var(--border);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

/* ── OVERLAY DIM ──────────────────────────────────────────── */
.overlay-dim {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1050;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}
.overlay-dim.show { opacity: 1; pointer-events: all; }

/* ── BOOKMARKS PANEL ─────────────────────────────────────── */
.bookmarks-panel {
  position: fixed;
  top: 0;
  right: -360px;
  width: 360px;
  height: 100%;
  background: var(--bg);
  z-index: 1200;
  display: flex;
  flex-direction: column;
  transition: right .3s ease;
  border-left: 1px solid var(--border);
}
.bookmarks-panel.open { right: 0; }

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 3px solid var(--black);
}
.panel-header h3 {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-3);
  font-size: 18px;
  border-radius: 2px;
  transition: background .15s;
}
.panel-close:hover { background: var(--bg-3); }

.bookmarks-list { flex: 1; overflow-y: auto; padding: 12px; }
.bm-card {
  display: flex;
  gap: 10px;
  padding: 10px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}
.bm-card:hover { background: var(--bg-2); }
.bm-img {
  width: 64px;
  height: 48px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-3);
}
.bm-title {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}
.bm-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--ink-4);
  font-family: var(--sans);
}
.bm-empty i { font-size: 32px; margin-bottom: 12px; display: block; }

/* ── TOAST ────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--black);
  color: var(--bg);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 20px;
  z-index: 2000;
  opacity: 0;
  transition: transform .25s ease, opacity .25s ease;
  border-radius: 2px;
  white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ── FOOTER ───────────────────────────────────────────────── */
.site-footer {
  border-top: 3px solid var(--black);
  padding: 32px 24px;
  text-align: center;
  background: var(--bg-2);
}
.footer-logo {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 8px;
}
.footer-copy {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-4);
}

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .news-grid { grid-template-columns: repeat(2, 1fr); }
  .news-card:nth-child(3n+1),
  .news-card:nth-child(3n+2) { border-right: none; }
  .news-card:nth-child(2n+1) { border-right: 1px solid var(--border); }
  .news-card.vertical { grid-template-columns: 1fr; }
  .news-card.vertical .card-img-wrap { border-right: none; aspect-ratio: 16/9; border-bottom: 1px solid var(--border); }
  .news-card.vertical { grid-column: 1 / -1; }
}

@media (max-width: 600px) {
  .masthead-date { display: none; }
  .news-grid { grid-template-columns: 1fr; }
  .news-card:nth-child(2n+1) { border-right: none; }
  .news-card.vertical { grid-template-columns: 1fr; }
  .news-card.vertical .card-body { padding: 14px 16px; }
  .news-card.vertical .card-title { font-size: 18px; }
  .masthead-logo { text-align: left; }
  .masthead-top { padding: 12px 16px; }
  .bookmarks-panel { width: 100%; right: -100%; }
}

