/* ===== NFLSpice News — Main CSS ===== */
/* Design: Magazine Style — Dark Navy + Yellow */
/* Speed optimized — No external deps */

:root {
  --primary: #0f172a;      /* Dark Navy */
  --accent: #f59e0b;       /* Yellow/Amber */
  --accent-dark: #d97706;
  --red: #dc2626;
  --bg: #f8fafc;
  --bg2: #ffffff;
  --bg3: #f1f5f9;
  --text: #1e293b;
  --text2: #475569;
  --text3: #94a3b8;
  --border: #e2e8f0;
  --border2: #cbd5e1;
  --shadow: 0 1px 4px rgba(0,0,0,.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,.12);
  --radius: 6px;
  --radius-lg: 10px;
  --header-h: 112px;
  --font-body: 'Segoe UI', Arial, sans-serif;
  --font-head: 'Segoe UI', Georgia, serif;
  --transition: 0.2s ease;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; font-size: 14px; }
body { font-family: var(--font-body); background: var(--bg); color: var(--text); line-height: 1.6; width: 100%; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button { font-family: var(--font-body); cursor: pointer; }
ul, ol { list-style: none; }

/* ===== PAGE WRAP (CLS prevention) ===== */
#page-wrap { overflow-x: hidden; width: 100%; position: relative; }

/* ===== CONTAINER ===== */
.container { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.container-sm { max-width: 820px; margin: 0 auto; padding: 0 16px; }

/* ===== HEADER ===== */
#site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg2); width: 100%;
  -webkit-position: sticky;
  will-change: transform;
}
.header-topbar {
  background: var(--primary);
  padding: 5px 0;
  font-size: 11px;
  color: #64748b;
}
.header-topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.header-topbar-links { display: flex; gap: 14px; }
.header-topbar-links a { color: #64748b; transition: color var(--transition); }
.header-topbar-links a:hover { color: var(--accent); }

.header-main {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.header-main .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.site-logo { flex: 0 0 auto; }
.site-logo .logo-text {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -1px;
  line-height: 1;
  display: flex;
  align-items: baseline;
  gap: 2px;
}
.site-logo .logo-nfl { color: var(--primary); }
.site-logo .logo-spice { color: var(--accent); }
.site-logo .logo-tag { font-size: 9px; letter-spacing: 2px; color: var(--text3); text-transform: uppercase; margin-top: 2px; }

.header-search {
  flex: 1;
  max-width: 340px;
}
.header-search-input {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 8px 16px 8px 38px;
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition);
  position: relative;
}
.header-search-wrap {
  position: relative;
}
.header-search-wrap svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text3);
  pointer-events: none;
}
.header-search-input:focus { border-color: var(--accent); }

.header-actions { display: flex; align-items: center; gap: 8px; }
.btn-subscribe {
  background: var(--primary);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 4px;
  border: none;
  letter-spacing: .3px;
  transition: opacity var(--transition);
  white-space: nowrap;
}
.btn-subscribe:hover { opacity: .88; }
.btn-dark-toggle {
  width: 34px; height: 34px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}

/* ===== NAV ===== */
#main-nav {
  background: var(--primary);
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
#main-nav::-webkit-scrollbar { display: none; }
.nav-inner { display: flex; min-width: max-content; padding: 0 8px; position: relative; }
.nav-item {
  display: flex; align-items: center; gap: 4px;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,.75);
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
  position: relative;
}
.nav-item:hover, .nav-item.active { color: var(--accent); border-bottom-color: var(--accent); }
.nav-item .nav-arrow { font-size: 9px; opacity: .7; }

/* Dropdown */
.nav-item:hover .nav-dropdown { display: block; }
.nav-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  min-width: 180px;
  box-shadow: var(--shadow-md);
  z-index: 200;
  padding: 6px 0;
}
.nav-dropdown a {
  display: block;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  transition: background var(--transition), color var(--transition);
}
.nav-dropdown a:hover { background: var(--bg3); color: var(--primary); }

/* ===== MOBILE NAV ===== */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 4px;
}
.hamburger span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: all var(--transition); }
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

#mobile-nav {
  display: none;
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0; bottom: 0;
  background: var(--bg2);
  z-index: 99;
  overflow-y: auto;
  padding: 16px;
  flex-direction: column;
  gap: 4px;
}
#mobile-nav.open { display: flex; }
#mobile-nav a {
  padding: 11px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  border-radius: var(--radius);
  transition: background var(--transition);
}
#mobile-nav a:hover { background: var(--bg3); }
.mobile-nav-divider { height: 1px; background: var(--border); margin: 6px 0; }

/* ===== BREAKING TICKER ===== */
.breaking-bar {
  background: #fffbeb;
  border-bottom: 1px solid #fde68a;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.breaking-label {
  background: var(--accent);
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
  padding: 8px 14px;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: .5px;
  text-transform: uppercase;
}
.breaking-text {
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  color: #92400e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== SECTION HEADING ===== */
.sec-head {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 20px 0 14px;
  border-bottom: 2px solid var(--primary);
  padding-bottom: 8px;
}
.sec-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--primary);
  padding-right: 14px;
  border-right: 3px solid var(--accent);
  margin-right: 14px;
  white-space: nowrap;
}
.sec-more {
  margin-left: auto;
  font-size: 11px;
  color: var(--text3);
  font-weight: 600;
  transition: color var(--transition);
}
.sec-more:hover { color: var(--primary); }

/* ===== CARDS ===== */
.card {
  background: var(--bg2);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

.card-img-wrap {
  overflow: hidden;
  background: var(--bg3);
}
.card-img {
  width: 100%; aspect-ratio: 16/9;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.card:hover .card-img { transform: scale(1.03); }

.card-body { padding: 12px; }
.card-category {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 5px;
}
.card-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
  color: var(--text);
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-title-sm { font-size: 12px; -webkit-line-clamp: 2; }
.card-meta { font-size: 11px; color: var(--text3); display: flex; gap: 8px; flex-wrap: wrap; }

/* ===== BADGE/TAG ===== */
.badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-live { background: var(--red); color: #fff; }

/* ===== HERO CARD ===== */
.hero-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.hero-card-img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}
.hero-card-overlay {
  position: relative;
}
.hero-card-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0,0,0,.8) 0%, rgba(0,0,0,.2) 60%, transparent 100%);
}
.hero-card-body {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 20px;
  z-index: 1;
}

/* ===== HORIZONTAL LIST CARD ===== */
.hcard {
  display: flex;
  gap: 0;
  background: var(--bg2);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: box-shadow var(--transition);
}
.hcard:hover { box-shadow: var(--shadow-md); }
.hcard-img {
  width: 100px;
  min-width: 100px;
  object-fit: cover;
  aspect-ratio: 1/1;
}
.hcard-img-placeholder {
  width: 100px;
  min-width: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #fff;
  font-weight: 700;
  text-align: center;
  padding: 6px;
}
.hcard-body { padding: 10px 12px; flex: 1; min-width: 0; }

/* ===== GRID LAYOUTS ===== */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; }
.grid-main-sidebar { display: grid; grid-template-columns: 1fr 300px; gap: 16px; }

/* ===== WEB STORIES ===== */
.stories-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; -ms-overflow-style: none; scrollbar-width: none; }
.stories-row::-webkit-scrollbar { display: none; }
.story-pill {
  flex-shrink: 0;
  width: 90px;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  border: 2.5px solid var(--accent);
  transition: transform var(--transition);
}
.story-pill:hover { transform: scale(1.03); }
.story-img {
  height: 145px;
  display: flex;
  align-items: flex-end;
  padding: 8px;
}
.story-title { color: #fff; font-size: 10px; font-weight: 700; line-height: 1.3; text-shadow: 0 1px 4px rgba(0,0,0,.5); }

/* ===== SIDEBAR ===== */
.sidebar-widget {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.sidebar-widget-head {
  background: var(--primary);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sidebar-widget-title { color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; }
.sidebar-widget-more { color: #64748b; font-size: 10px; cursor: pointer; }
.sidebar-widget-more:hover { color: var(--accent); }
.sidebar-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  transition: background var(--transition);
}
.sidebar-item:last-child { border-bottom: none; }
.sidebar-item:hover { background: var(--bg3); }
.sidebar-num { font-size: 18px; font-weight: 800; color: var(--border2); min-width: 18px; line-height: 1; flex-shrink: 0; }
.sidebar-title { font-size: 12px; font-weight: 700; color: var(--text); line-height: 1.45; margin-bottom: 2px; }
.sidebar-meta { font-size: 10px; color: var(--text3); }

/* ===== POST CONTENT ===== */
.post-content { font-size: 15px; line-height: 1.85; color: var(--text); }
.post-content h2 { font-size: 20px; font-weight: 700; margin: 24px 0 12px; }
.post-content h3 { font-size: 17px; font-weight: 700; margin: 20px 0 10px; }
.post-content p  { margin-bottom: 16px; }
.post-content ul, .post-content ol { margin: 0 0 16px 20px; }
.post-content li { margin-bottom: 6px; line-height: 1.7; }
.post-content img { border-radius: var(--radius); margin: 16px auto; }
.post-content blockquote {
  border-left: 4px solid var(--accent);
  padding: 12px 18px;
  background: var(--bg3);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 16px 0;
  font-style: italic;
  color: var(--text2);
}
.post-content a { color: var(--primary); text-decoration: underline; }
/* ===== RESPONSIVE TABLES IN POST CONTENT ===== */
.post-content table { display: none; } /* hidden by default, shown via wrapper */

/* Wrap every table in a scroll div */
.post-content .table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 20px 0;
  border-radius: var(--radius);
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.post-content .table-wrap table {
  display: table;
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 480px; /* force scroll on small screens */
}

/* Default table — .post-table */
.post-content .post-table th,
.post-content table th {
  background: var(--primary);
  color: #fff;
  padding: 11px 16px;
  text-align: left;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.post-content .post-table td,
.post-content table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  vertical-align: top;
  line-height: 1.6;
}
.post-content .post-table tr:last-child td,
.post-content table tr:last-child td { border-bottom: none; }

/* Striped */
.post-content .post-table-striped tr:nth-child(even) td,
.post-content table tr:nth-child(even) td {
  background: var(--bg3);
}

/* Bordered */
.post-content .post-table-bordered td,
.post-content .post-table-bordered th {
  border: 1px solid var(--border);
}

/* Highlight cell */
.post-content .table-highlight {
  background: #fef3c7 !important;
  font-weight: 700;
  color: #92400e;
}

/* Dark mode tables */
body.dark-mode .post-content .post-table th,
body.dark-mode .post-content table th { background: #1e293b; }
body.dark-mode .post-content .post-table td,
body.dark-mode .post-content table td { border-color: rgba(255,255,255,.08); }

/* Mobile scroll hint */
@media (max-width: 640px) {
  .post-content .table-wrap {
    position: relative;
  }
  .post-content .table-wrap::after {
    content: '← Scroll →';
    display: block;
    text-align: center;
    font-size: 11px;
    color: var(--text3);
    padding: 4px 0;
  }
}

/* ===== BREADCRUMB ===== */
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text3); margin: 12px 0; flex-wrap: wrap; }
.breadcrumb a { color: var(--text3); } .breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { color: var(--text); font-weight: 600; }

/* ===== PAGINATION ===== */
.pagination { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin: 24px 0; }
.pag-btn {
  padding: 8px 13px; border: 1.5px solid var(--border); border-radius: 4px;
  font-size: 13px; font-weight: 600; color: var(--text2); background: var(--bg2);
  transition: all var(--transition); cursor: pointer;
}
.pag-btn:hover { border-color: var(--primary); color: var(--primary); }
.pag-btn.active { background: var(--primary); color: var(--accent); border-color: var(--primary); }
.pag-dots { padding: 8px 4px; font-size: 14px; color: var(--text3); }

/* ===== SEARCH ===== */
#search-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(15,23,42,.75); z-index: 200;
  align-items: flex-start; justify-content: center;
  padding: 80px 16px 0;
}
#search-overlay.open { display: flex; }
.search-box {
  background: var(--bg2);
  border-radius: var(--radius-lg);
  padding: 16px;
  width: 100%; max-width: 600px;
  display: flex; gap: 10px; align-items: center;
  box-shadow: var(--shadow-md);
}
.search-box input {
  flex: 1; border: none; outline: none;
  font-size: 16px; color: var(--text);
  background: transparent;
}
.search-box button {
  background: var(--primary); color: var(--accent);
  border: none; border-radius: 4px;
  padding: 8px 16px; font-size: 13px; font-weight: 700;
}

/* ===== FOOTER ===== */
#site-footer {
  background: var(--primary);
  color: #fff;
  padding: 32px 0 0;
  margin-top: 32px;
}
.footer-top { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 24px; margin-bottom: 24px; }
.footer-logo { font-size: 22px; font-weight: 900; letter-spacing: -1px; margin-bottom: 8px; }
.footer-logo .f-nfl { color: #fff; }
.footer-logo .f-spice { color: var(--accent); }
.footer-desc { font-size: 12px; color: #64748b; line-height: 1.8; }
.footer-col h4 { font-size: 11px; font-weight: 700; color: #94a3b8; letter-spacing: .4px; text-transform: uppercase; margin-bottom: 12px; }
.footer-col a { display: block; font-size: 12px; color: #64748b; line-height: 2.2; transition: color var(--transition); }
.footer-col a:hover { color: var(--accent); }
.footer-social { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.footer-social a {
  background: rgba(255,255,255,.08); color: #94a3b8;
  font-size: 11px; padding: 5px 12px; border-radius: 4px;
  transition: all var(--transition);
}
.footer-social a:hover { background: var(--accent); color: var(--primary); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 14px 0;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 8px;
}
.footer-bottom span { font-size: 11px; color: #475569; }

/* ===== BACK TO TOP ===== */
#back-top {
  position: fixed; bottom: 20px; right: 16px;
  width: 38px; height: 38px;
  background: var(--primary); color: var(--accent);
  border: none; border-radius: 4px;
  font-size: 16px; display: none;
  align-items: center; justify-content: center;
  cursor: pointer; box-shadow: var(--shadow-md);
  z-index: 50; transition: all var(--transition);
}
#back-top.show { display: flex; }
#back-top:hover { background: var(--accent); color: var(--primary); }

/* ===== DARK MODE ===== */
body.dark-mode {
  --bg: #0a0f1e;
  --bg2: #111827;
  --bg3: #1f2937;
  --text: #f1f5f9;
  --text2: #94a3b8;
  --text3: #64748b;
  --border: rgba(255,255,255,.08);
  --border2: rgba(255,255,255,.15);
  --shadow: 0 2px 12px rgba(0,0,0,.4);
}
body.dark-mode #site-header { background: #111827; }
body.dark-mode .breaking-bar { background: #1f1500; border-color: #78350f; }
body.dark-mode .header-search-input { background: var(--bg3); }

/* ===== RESPONSIVE ===== */
@media(max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2,1fr); }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .grid-main-sidebar { grid-template-columns: 1fr; }
  .grid-2-1 { grid-template-columns: 1fr; }
}
@media(max-width: 640px) {
  .grid-4, .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .header-search { display: none; }
  .hamburger { display: flex; }
  #main-nav { display: none; }
  .footer-top { grid-template-columns: 1fr; }
  .btn-subscribe span { display: none; }
}
@media(max-width: 400px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

/* ===== AD ZONES ===== */
.ad-zone {
  background: var(--bg3);
  border: 1px dashed var(--border2);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: var(--text3); font-size: 11px;
  text-align: center; padding: 8px;
}

/* ===== UTILS ===== */
.text-primary { color: var(--primary); }
.text-accent { color: var(--accent); }
.text-red { color: var(--red); }
.fw-bold { font-weight: 700; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; }
.d-flex { display: flex; } .align-center { align-items: center; }
.gap-1 { gap: 6px; } .gap-2 { gap: 12px; }
.hide-mobile { display: block; }
@media(max-width:640px) { .hide-mobile { display: none; } }

/* ===== READING PROGRESS BAR ===== */
#reading-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  background: var(--accent);
  width: 0%;
  z-index: 200;
  transition: width 0.1s linear;
}

/* ===== STORY CARD (grid view) ===== */
.story-grid-card {
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 9/16;
  display: flex;
  align-items: flex-end;
  padding: 10px;
  position: relative;
  cursor: pointer;
  text-decoration: none;
  background: var(--primary);
}
.story-grid-card img {
  position: absolute;
  inset: 0; width: 100%; height: 100%;
  object-fit: cover;
}
.story-grid-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0,0,0,.65) 0%, transparent 60%);
}
.story-grid-card-title {
  position: relative;
  z-index: 1;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  text-shadow: 0 1px 4px rgba(0,0,0,.5);
}

/* ===== POST SUBTITLE ===== */
.post-subtitle {
  font-size: 18px;
  color: var(--text2);
  font-weight: 400;
  line-height: 1.5;
  margin-bottom: 12px;
  padding-left: 12px;
  border-left: 3px solid var(--accent);
}
