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

:root {
  --accent: #dc2626;
  --accent-hover: #b91c1c;
  --accent-light: #fef2f2;
  --text: #0f172a;
  --text-secondary: #64748b;
  --bg: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.08);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --max-width: 1400px;
  --header-height: 64px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

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

::selection {
  background: var(--accent);
  color: #fff;
}

/* ─── Topbar ─── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.logo-icon {
  flex-shrink: 0;
}

.logo-text {
  font-weight: 900;
  font-size: 20px;
  letter-spacing: 1px;
  white-space: nowrap;
}

.logo-text span {
  color: var(--accent);
  margin-left: 4px;
}

.main-nav {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  flex: 1;
  justify-content: center;
}

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

.main-nav a {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: all 0.2s;
}

.main-nav a:hover,
.main-nav a.active {
  background: var(--bg-tertiary);
  color: var(--text);
}

.main-nav a.active {
  color: var(--accent);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.search {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  width: 200px;
  outline: none;
  transition: border-color 0.2s, width 0.3s;
}

.search:focus {
  border-color: var(--accent);
  width: 260px;
}

.search-wrap {
  position: relative;
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 101;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-top: 6px;
  max-height: 360px;
  overflow-y: auto;
  display: none;
  box-shadow: var(--shadow-lg);
}

.search-results.open {
  display: block;
}

.theme-toggle,
.live-btn {
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 999px;
  cursor: pointer;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.theme-toggle {
  width: 36px;
  height: 36px;
}

.theme-toggle:hover {
  background: var(--bg-tertiary);
}

.live-btn {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  gap: 6px;
  letter-spacing: 0.5px;
}

.live-btn::before {
  content: "";
  width: 6px;
  height: 6px;
  background: #fff;
  border-radius: 50%;
  animation: pulse-dot 1.4s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.live-btn:hover {
  background: var(--accent-hover);
}

.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 32px;
  height: 32px;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s;
}

/* ─── Ticker ─── */
.ticker {
  background: #0f172a;
  border-top: 1px solid #1e293b;
  overflow: hidden;
  position: relative;
}

.ticker-track {
  display: flex;
  gap: 32px;
  padding: 8px 0;
  white-space: nowrap;
  animation: ticker-scroll 40s linear infinite;
  width: max-content;
}

.ticker-track:hover {
  animation-play-state: paused;
}

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

.ticker-item {
  font-size: 13px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ticker-dot {
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: 50%;
}

.ticker-item strong {
  color: #f1f5f9;
  margin-right: 2px;
}

.tag-live {
  color: #fbbf24;
  font-weight: 700;
  font-size: 11px;
}

.tag-new {
  color: #34d399;
  font-weight: 700;
  font-size: 11px;
}

.tag-upcoming {
  color: #60a5fa;
  font-weight: 700;
  font-size: 11px;
}

/* ─── Container ─── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 28px 24px;
}

/* ─── Hero ─── */
.hero {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 40px;
}

.hero-main {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 480px;
  background-size: cover;
  background-position: center;
  cursor: pointer;
  display: flex;
  align-items: flex-end;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.3) 50%, transparent 100%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  padding: 40px;
  z-index: 2;
  width: 100%;
}

.hero-badges {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.badge-live {
  background: var(--accent);
  color: #fff;
  animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.badge-sport {
  background: rgba(255,255,255,0.2);
  color: #fff;
  backdrop-filter: blur(4px);
}

.badge-sm {
  padding: 2px 8px;
  font-size: 10px;
}

.hero-title {
  font-size: 34px;
  font-weight: 900;
  line-height: 1.15;
  color: #fff;
  margin-bottom: 14px;
}

.hero-meta {
  color: rgba(255,255,255,0.7);
  font-size: 14px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.hero-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hero-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  gap: 14px;
  cursor: pointer;
  transition: all 0.25s;
  overflow: hidden;
}

.hero-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.hero-card-img {
  width: 120px;
  min-height: 90px;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
}

.hero-card-body {
  padding: 12px 14px 12px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

.hero-card-body h4 {
  font-size: 14px;
  line-height: 1.35;
  font-weight: 700;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-secondary);
}

/* ─── Section ─── */
.section {
  margin-bottom: 44px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--border);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.section-title small {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.sport-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #fff;
  flex-shrink: 0;
}

.see-all {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  transition: gap 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
}

.see-all:hover {
  gap: 8px;
}

/* ─── Card Grid ─── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

.card-img {
  height: 180px;
  background-size: cover;
  background-position: center;
  position: relative;
}

.card-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(0,0,0,0.85);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  backdrop-filter: blur(4px);
}

.card-body {
  padding: 18px;
}

.card-body h3 {
  font-size: 16px;
  line-height: 1.35;
  font-weight: 700;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-body p {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  color: var(--text-secondary);
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

/* ─── Layout Split ─── */
.split {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 32px;
  align-items: start;
}

/* ─── Sidebar ─── */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: calc(var(--header-height) + 20px);
}

.widget {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
}

.widget-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.widget-icon {
  font-size: 18px;
}

.widget-header h3 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 800;
}

/* Countdown */
.countdown {
  font-size: 28px;
  font-weight: 900;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  margin-bottom: 4px;
}

.countdown-label {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Standings */
.standings {
  display: flex;
  flex-direction: column;
}

.standing-row {
  display: grid;
  grid-template-columns: 28px 1fr 50px 50px;
  gap: 10px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 13px;
}

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

.standing-row .pos {
  font-weight: 800;
  color: var(--accent);
}

.standing-row .team {
  font-weight: 600;
}

.standing-row .num {
  text-align: right;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

/* Trending */
.trending-list {
  display: flex;
  flex-direction: column;
}

.trending-item {
  display: flex;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px dashed var(--border);
  align-items: flex-start;
}

.trending-item:last-child {
  border-bottom: none;
}

.trending-num {
  width: 26px;
  height: 26px;
  background: var(--bg-tertiary);
  color: var(--accent);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 13px;
  flex-shrink: 0;
  margin-top: 1px;
}

.trending-item h5 {
  font-size: 13px;
  line-height: 1.35;
  font-weight: 600;
  margin-bottom: 3px;
}

.trending-meta {
  color: var(--text-secondary);
  font-size: 11px;
}

/* Newsletter widget */
.widget-newsletter p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.5;
}

.newsletter-form {
  display: flex;
  gap: 8px;
}

.newsletter-form input {
  flex: 1;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

.newsletter-form input:focus {
  border-color: var(--accent);
}

.newsletter-form button {
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.newsletter-form button:hover {
  background: var(--accent-hover);
}

/* ─── Footer ─── */
footer {
  background: #0f172a;
  margin-top: 60px;
  padding: 48px 24px 0;
  color: #94a3b8;
}

.footer-content {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 40px;
}

.footer-content .logo {
  font-weight: 900;
  font-size: 18px;
  color: #f1f5f9;
}

.footer-content .logo span {
  color: var(--accent);
}

.footer-brand p {
  font-size: 13px;
  line-height: 1.7;
  color: #64748b;
}

.footer-links h4 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
  color: #f1f5f9;
  font-weight: 700;
}

.footer-links a {
  display: block;
  color: #64748b;
  font-size: 13px;
  padding: 4px 0;
  transition: color 0.2s;
}

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

.footer-bottom {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px 0;
  border-top: 1px solid #1e293b;
  font-size: 12px;
  text-align: center;
  color: #475569;
}

/* ─── Modal ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 200;
  display: none;
  align-items: stretch;
  justify-content: stretch;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: var(--bg);
  width: 100vw;
  height: 100vh;
  overflow-y: auto;
  position: relative;
  animation: modalIn 0.2s ease-out;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.modal-close {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 210;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,0.4);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  backdrop-filter: blur(4px);
}

.modal-close:hover {
  background: rgba(0,0,0,0.7);
}

.modal-img {
  width: 100%;
  height: 50vh;
  min-height: 300px;
  background-size: cover;
  background-position: center;
}

.modal-body {
  padding: 36px 48px;
  max-width: 800px;
  margin: 0 auto;
}

.modal-tag {
  display: inline-block;
  padding: 4px 12px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  border-radius: 4px;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.modal-title {
  font-size: 32px;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 14px;
}

.modal-meta {
  color: var(--text-secondary);
  font-size: 14px;
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.modal-text {
  font-size: 17px;
  line-height: 1.8;
  color: #334155;
}

.modal-text p {
  margin-bottom: 16px;
}

.modal-progress {
  position: sticky;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--accent);
  z-index: 215;
  transition: width 0.1s linear;
}

.modal-share {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.share-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg);
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  color: var(--text);
}

.share-btn:hover {
  background: var(--bg-tertiary);
  transform: scale(1.1);
}

.modal-readtime {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.modal-related {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.modal-related h3 {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 14px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.modal-loading {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px;
  color: var(--text-secondary);
  gap: 16px;
}

.modal-loading.active {
  display: flex;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ─── Toast ─── */
.toast-container {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.toast {
  background: #0f172a;
  color: #f1f5f9;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  pointer-events: auto;
  animation: toastIn 0.3s ease-out;
}

.toast.success {
  background: #059669;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Back to Top ─── */
.back-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 99;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(220,38,38,0.3);
  transition: all 0.3s;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}

.back-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-top:hover {
  background: var(--accent-hover);
  transform: translateY(-3px);
}

/* ─── Scroll Reveal ─── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* ─── Skeleton Loaders ─── */
.skeleton {
  background: linear-gradient(90deg, var(--border-light) 25%, var(--bg-tertiary) 50%, var(--border-light) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-card {
  height: 180px;
  margin-bottom: 16px;
}

.skeleton-line {
  height: 14px;
  margin-bottom: 10px;
  width: 100%;
}

.skeleton-line:nth-child(2) { width: 75%; }
.skeleton-line:nth-child(3) { width: 60%; }

.skeleton-body {
  padding: 18px;
}

/* ─── Filter Pills ─── */
.filter-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 0 16px;
  scrollbar-width: none;
}

.filter-bar::-webkit-scrollbar { display: none; }

.filter-pill {
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.filter-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-pill.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.filter-pill[data-count]::after {
  content: attr(data-count);
  display: inline-block;
  margin-left: 6px;
  font-size: 10px;
  opacity: 0.7;
}

.card-grid.filter-hidden {
  display: none;
}

/* ─── Lazy image loading ─── */
.card-img.lazy-bg {
  background-image: none !important;
}

.card-img.lazy-bg.loaded {
  background-image: var(--bg-url) !important;
}

/* ─── Custom Scrollbar ─── */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* ─── Dark Mode ─── */
:root.dark {
  --bg: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --text: #f1f5f9;
  --text-secondary: #94a3b8;
  --border: #334155;
  --border-light: #1e293b;
  --accent-light: #450a0a;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.4);
}

:root.dark .topbar {
  background: rgba(15,23,42,0.97);
  border-color: #1e293b;
}

:root.dark .topbar-inner {
  border-color: #1e293b;
}

:root.dark .ticker {
  background: #020617;
  border-color: #1e293b;
}

:root.dark .search {
  background: var(--bg-secondary);
  border-color: var(--border);
  color: var(--text);
}

:root.dark .modal {
  background: var(--bg);
}

:root.dark .modal-text {
  color: #94a3b8;
}

:root.dark .card:hover {
  box-shadow: 0 12px 28px rgba(0,0,0,0.4);
}

:root.dark footer {
  background: #020617;
}

:root.dark .standing-row,
:root.dark .trending-item {
  border-color: var(--border);
}

:root.dark .main-nav a:hover {
  background: var(--bg-tertiary);
}

:root.dark .widget {
  background: var(--bg-secondary);
}

:root.dark .hero-card {
  background: var(--bg-secondary);
}

:root.dark .card {
  background: var(--bg-secondary);
}

:root.dark .live-btn {
  background: var(--accent);
  border-color: var(--accent);
}

:root.dark .modal-share .share-btn {
  background: var(--bg-secondary);
  border-color: var(--border);
}

/* ─── Saved / History sidebar widgets ─── */
.saved-list, .history-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.history-item {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  transition: all 0.2s;
}
.history-item:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent);
}
.history-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.history-meta {
  font-size: 11px;
  color: var(--text-secondary);
}

/* ─── Search Highlight ─── */
.search-hl {
  background: #fde68a;
  color: #1e293b;
  border-radius: 2px;
  padding: 0 2px;
}
:root.dark .search-hl {
  background: #92400e;
  color: #fef3c7;
}

/* ─── Reading Mode ─── */
.reading-mode .modal-img {
  height: 120px;
  min-height: 120px;
}
.reading-mode .modal-share,
.reading-mode .modal-related,
.reading-mode .modal-tag,
.reading-mode .modal-readtime,
.reading-mode .reading-mode-btn {
  display: none;
}
.reading-mode .modal-body {
  max-width: 700px;
}
.reading-mode .modal-title {
  font-size: 26px;
}
.reading-mode .modal-text {
  font-size: 18px;
  line-height: 2;
  color: var(--text);
}
.reading-mode .modal-close {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 210;
}
.reading-mode .modal-meta {
  border-bottom: none;
  margin-bottom: 8px;
}

.reading-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 12px;
}
.reading-mode-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ─── Push Notification Button ─── */
.push-btn {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.push-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.push-btn:disabled {
  opacity: 0.6;
  cursor: default;
  border-color: var(--border);
  color: var(--text-secondary);
}

:root.dark .newsletter-form input {
  background: var(--bg-secondary);
  border-color: var(--border);
  color: var(--text);
}

:root.dark .trending-num {
  background: var(--bg-tertiary);
}

/* ─── Responsive ─── */
@media (max-width: 1100px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-main {
    min-height: 360px;
  }

  .hero-title {
    font-size: 28px;
  }

  .hero-side {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .hero-card {
    flex-direction: column;
  }

  .hero-card-img {
    width: 100%;
    height: 100px;
  }

  .hero-card-body {
    padding: 10px 12px;
  }

  .hero-card-body h4 {
    -webkit-line-clamp: 2;
  }

  .split {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .main-nav {
    display: none;
  }

  .main-nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 12px 24px;
    box-shadow: var(--shadow-lg);
    z-index: 99;
  }

  .hamburger {
    display: flex;
  }

  .search {
    width: 140px;
  }

  .search:focus {
    width: 180px;
  }

  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-content {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }

  .sidebar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .topbar-inner {
    padding: 0 16px;
    gap: 8px;
  }

  .logo-text {
    font-size: 16px;
  }

  .search {
    width: 100px;
  }

  .search:focus {
    width: 140px;
  }

  .container {
    padding: 16px;
  }

  .hero-main {
    min-height: 280px;
    border-radius: var(--radius-md);
  }

  .hero-content {
    padding: 24px;
  }

  .hero-title {
    font-size: 22px;
  }

  .hero-meta {
    font-size: 12px;
    flex-wrap: wrap;
  }

  .hero-side {
    grid-template-columns: 1fr;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .card-img {
    height: 200px;
  }

  .section-title {
    font-size: 16px;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .footer-links h4 {
    margin-bottom: 10px;
  }

  .modal-img {
    height: 35vh;
    min-height: 200px;
  }

  .modal-body {
    padding: 20px 24px;
  }

  .modal-title {
    font-size: 22px;
  }

  .back-top {
    bottom: 20px;
    right: 20px;
    width: 38px;
    height: 38px;
    font-size: 17px;
  }

  .newsletter-form {
    flex-direction: column;
  }

  .top-actions {
    gap: 4px;
  }

  .trabajo-btn {
    display: none !important;
  }
}

.trabajo-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--accent);
  color: #fff !important;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background .2s;
}
.trabajo-btn:hover {
  background: var(--accent-hover);
}
