/* ============================================================
   AHLY07 Design System — Shared Tokens & Components
   RTL-first | Cairo (AR) + Inter (EN) | Al-Ahly Red
   ============================================================ */

/* ─── FONTS ──────────────────────────────────────────────────
   Self-hosted Cairo (WOFF2). Replaces an @import of Google Fonts, which was the
   worst available option for LCP: @import inside a stylesheet is render-blocking
   AND serialised — the browser had to fetch ahly07.css, parse it, discover the
   Google URL, fetch that CSS, and only then fetch the font files. Three
   sequential round trips to a third party before any text painted.

   The .woff2 files are generated from the .ttf already in wwwroot/fonts (which
   were previously dead weight — nothing referenced them). WOFF2 is ~63% smaller.

   font-display: swap paints immediately in the fallback and swaps when Cairo
   arrives, so text is never invisible.

   Arabic + Latin both come from Cairo; Inter is dropped rather than adding
   another network dependency for the small amount of Latin text on the site. */

@font-face {
  font-family: 'Cairo';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('../fonts/Cairo-Light.woff2') format('woff2');
}
@font-face {
  font-family: 'Cairo';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/Cairo-Regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Cairo';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/Cairo-Medium.woff2') format('woff2');
}
@font-face {
  font-family: 'Cairo';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/Cairo-SemiBold.woff2') format('woff2');
}
@font-face {
  font-family: 'Cairo';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/Cairo-Bold.woff2') format('woff2');
}
@font-face {
  font-family: 'Cairo';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../fonts/Cairo-ExtraBold.woff2') format('woff2');
}
@font-face {
  font-family: 'Cairo';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url('../fonts/Cairo-Black.woff2') format('woff2');
}

/* ─── TOKENS ─────────────────────────────────────────────── */
:root {
  /* Brand */
  --red-50:  #fff1f2;
  --red-100: #ffe1e4;
  --red-200: #ffc7cc;
  --red-300: #ff9da6;
  --red-400: #ff6475;
  --red-500: #f83b4f;
  --red-600: #e51a30;
  --red-700: #C8102E;   /* primary */
  --red-800: #a50e26;
  --red-900: #880d22;

  --gold:    #C9942A;
  --gold-lt: #F5E4B8;

  /* Neutrals */
  --ink:     #0E0E10;
  --ink-80:  #2a2a2d;
  --ink-60:  #46464b;
  --muted:   #6B7280;
  --border:  #E5E7EB;
  --surface: #F7F7F8;
  --white:   #FFFFFF;

  /* Semantic */
  --success: #16A34A;
  --warn:    #D97706;
  --danger:  #DC2626;
  --info:    #2563EB;

  /* Typography */
  --font-ar: 'Cairo', system-ui, sans-serif;
  /* Cairo covers Latin too. This token is currently unreferenced; it resolves to the
     system UI font rather than pulling Inter over the network for no measured benefit. */
  --font-en: system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* Type scale */
  --text-xs:   12px;
  --text-sm:   14px;
  --text-base: 16px;
  --text-md:   18px;
  --text-lg:   20px;
  --text-xl:   24px;
  --text-2xl:  30px;
  --text-3xl:  36px;
  --text-4xl:  48px;

  /* Radius */
  --r-sm:   6px;
  --r-md:  10px;
  --r-lg:  16px;
  --r-full: 9999px;

  /* Shadow */
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:  0 4px 12px rgba(0,0,0,.10), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg:  0 10px 30px rgba(0,0,0,.12), 0 4px 8px rgba(0,0,0,.06);

  /* Spacing (4pt grid) */
  --sp-1:  4px;   --sp-2:  8px;   --sp-3: 12px;
  --sp-4: 16px;   --sp-5: 20px;   --sp-6: 24px;
  --sp-8: 32px;   --sp-10:40px;   --sp-12:48px;
  --sp-16:64px;

  /* Layout */
  --nav-h:  64px;
  --max-w:  1280px;
  --col-main: 820px;
  --col-side: 300px;
}

/* Dark mode */
[data-theme="dark"] {
  --ink:     #F0F0F2;
  --ink-80:  #D1D1D6;
  --ink-60:  #A1A1AA;
  --muted:   #71717A;
  --border:  #27272A;
  --surface: #18181B;
  --white:   #09090B;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.3);
  --shadow-md:  0 4px 12px rgba(0,0,0,.4);
  --shadow-lg:  0 10px 30px rgba(0,0,0,.5);
}

/* ─── BASE RESET ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { direction: rtl; scroll-behavior: smooth; }
body {
  font-family: var(--font-ar);
  font-size: var(--text-base);
  color: var(--ink);
  background: var(--surface);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; }

/* ─── LAYOUT ─────────────────────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--sp-6);
}
@media (max-width: 768px) { .container { padding: 0 var(--sp-4); } }

.page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--col-side);
  gap: var(--sp-8);
  align-items: start;
}
@media (max-width: 1100px) { .page-layout { grid-template-columns: 1fr; } }
.sidebar { display: flex; flex-direction: column; gap: var(--sp-6); }

/* ─── NAVBAR ─────────────────────────────────────────────── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  height: var(--nav-h);
}
.navbar-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: var(--sp-6);
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--sp-6);
}
.navbar-logo { display: flex; align-items: center; gap: var(--sp-2); flex-shrink: 0; }
.navbar-logo img { height: 56px; width: auto; transition: transform .15s; }
.navbar-logo:hover img { transform: scale(1.04); }
.navbar-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
}
.nav-link {
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-sm);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink-60);
  transition: color .15s, background .15s;
  white-space: nowrap;
}
.nav-link:hover { color: var(--red-700); background: var(--red-50); }
.nav-link.active { color: var(--red-700); background: var(--red-50); }
.navbar-actions { display: flex; align-items: center; gap: var(--sp-2); margin-inline-start: auto; }
.navbar-search-btn {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: transparent; cursor: pointer; color: var(--muted);
  transition: border-color .15s, color .15s;
}
.navbar-search-btn:hover { border-color: var(--red-700); color: var(--red-700); }
.hamburger {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: var(--sp-2);
}
.hamburger span { display: block; width: 22px; height: 2px; background: var(--ink); border-radius: 2px; }
@media (max-width: 960px) {
  .navbar-nav { display: none; }
  .hamburger { display: flex; }
}
@media (max-width: 600px) {
  .navbar { height: auto; min-height: var(--nav-h); }
  .navbar-inner { gap: var(--sp-3); padding: var(--sp-2) var(--sp-4); }
  .navbar-logo img { height: 46px; }
  /* Keep the action cluster from wrapping or overflowing on narrow phones */
  .navbar-actions { gap: 6px; }
  .navbar-actions .btn-sm { padding: var(--sp-1) var(--sp-2); }
}
@media (max-width: 380px) {
  .navbar-logo img { height: 40px; }
  /* Hide the standalone search icon — search is reachable from the drawer */
  .navbar-search-btn { display: none; }
}

/* ─── NAV DROPDOWN ───────────────────────────────────────── */
.nav-drop-wrap {
  position: relative;
}
.nav-link-has-drop {
  display: flex; align-items: center; gap: 4px;
}
.nav-caret {
  flex-shrink: 0;
  transition: transform .2s;
  opacity: .6;
}
.nav-drop-wrap:hover .nav-caret { transform: rotate(180deg); opacity: 1; }

.nav-drop {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 180px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-1);
  z-index: 200;
  /* hidden by default — shown on hover */
  opacity: 0; pointer-events: none;
  transform: translateY(-6px);
  transition: opacity .18s, transform .18s;
}
.nav-drop-wrap:hover .nav-drop,
.nav-drop-wrap:focus-within .nav-drop {
  opacity: 1; pointer-events: auto; transform: translateY(0);
}
.nav-drop-item {
  display: block;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-sm);
  font-size: var(--text-sm); font-weight: 600;
  color: var(--ink-60);
  transition: background .12s, color .12s;
  white-space: nowrap;
}
.nav-drop-item:hover { background: var(--red-50); color: var(--red-700); }
.nav-drop-all { color: var(--red-700); font-weight: 700; }
.nav-drop-all:hover { background: var(--red-50); }
.nav-drop-divider {
  height: 1px; background: var(--border);
  margin: var(--sp-1) var(--sp-2);
}

/* ─── TOP BAR ────────────────────────────────────────────── */
.top-bar {
  background: var(--red-800);
  border-bottom: 2px solid var(--red-700);
  position: relative;
  z-index: 90;
}
.top-bar-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--sp-6);
  display: flex;
  align-items: center;
  height: 38px;
  gap: var(--sp-4);
}
.top-bar-label {
  display: flex; align-items: center; gap: var(--sp-1);
  font-size: var(--text-xs);
  font-weight: 800;
  color: rgba(255,255,255,.45);
  letter-spacing: .06em;
  text-transform: uppercase;
  flex-shrink: 0;
  padding-inline-end: var(--sp-3);
  border-inline-end: 1px solid rgba(255,255,255,.12);
}
.top-bar-items {
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
}
.top-bar-items::-webkit-scrollbar { display: none; }
.top-bar-item {
  display: inline-flex; align-items: center;
  padding: 4px var(--sp-3);
  border-radius: var(--r-sm);
  font-size: var(--text-xs); font-weight: 700;
  color: rgba(255,255,255,.7);
  white-space: nowrap;
  transition: background .12s, color .12s;
}
.top-bar-item:hover {
  background: rgba(255,255,255,.1);
  color: white;
}
.top-bar-item.active {
  background: var(--red-700);
  color: white;
}
@media (max-width: 600px) {
  .top-bar-label { display: none; }
  .top-bar-inner { padding: 0 var(--sp-4); }
}

/* ─── TRENDING / CATEGORY CHIPS ─────────────────────────── */
.trending-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--r-full);
  border: 1.5px solid var(--border);
  font-size: var(--text-sm); font-weight: 600;
  color: var(--ink-60);
  background: var(--white);
  transition: border-color .15s, color .15s, background .15s, transform .15s;
  white-space: nowrap;
}
.trending-chip:hover {
  border-color: var(--red-700);
  color: var(--red-700);
  background: var(--red-50);
  transform: translateY(-1px);
}
.trending-chip .count {
  font-size: 11px; font-weight: 700;
  color: var(--muted);
  background: var(--surface);
  padding: 1px 6px;
  border-radius: var(--r-full);
}
.trending-chip:hover .count { background: var(--red-100); color: var(--red-700); }

/* Breaking ticker */
.breaking-bar {
  background: var(--red-700);
  color: white;
  font-size: var(--text-sm);
  font-weight: 700;
  display: flex;
  align-items: center;
  overflow: hidden;
  height: 36px;
}
.breaking-label {
  flex-shrink: 0;
  padding: 0 var(--sp-4);
  background: var(--red-900);
  height: 100%;
  display: flex; align-items: center;
  font-size: var(--text-xs);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.breaking-ticker {
  overflow: hidden; flex: 1; white-space: nowrap;
  display: flex; align-items: center;
}
.ticker-inner {
  display: inline-block;
  animation: ticker 30s linear infinite;
  padding-inline-start: 100%;
}
@keyframes ticker { from { transform: translateX(100%); } to { transform: translateX(-100%); } }
[dir="rtl"] .ticker-inner { animation-name: ticker-rtl; }
@keyframes ticker-rtl { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ─── SECTION HEADER ─────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-4);
  padding-bottom: var(--sp-3);
  border-bottom: 2px solid var(--border);
  position: relative;
}
.section-header::before {
  content: '';
  position: absolute;
  bottom: -2px; right: 0;
  width: 60px; height: 2px;
  background: var(--red-700);
}
.section-title {
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--ink);
}
.section-title span { color: var(--red-700); }
.see-all {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--red-700);
  display: flex; align-items: center; gap: 4px;
}
.see-all:hover { text-decoration: underline; }

/* ─── CARDS ──────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

/* Hero card */
.card-hero {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  aspect-ratio: 16/9;
}
.card-hero img { width: 100%; height: 100%; object-fit: cover; }
.card-hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.85) 0%, rgba(0,0,0,.3) 50%, transparent 100%);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: var(--sp-6);
  color: white;
}
.card-hero-title {
  font-size: var(--text-2xl);
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: var(--sp-2);
  text-wrap: pretty;
}
@media (max-width: 768px) { .card-hero-title { font-size: var(--text-xl); } }

/* Article card (list) */
.article-card {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: var(--sp-3);
  padding: var(--sp-3);
  background: var(--white);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  transition: box-shadow .2s;
}
.article-card:hover { box-shadow: var(--shadow-md); }
.article-card-img {
  width: 120px; height: 80px;
  border-radius: var(--r-sm);
  overflow: hidden; flex-shrink: 0;
}
.article-card-img img { width: 100%; height: 100%; object-fit: cover; }
.article-card-body { display: flex; flex-direction: column; gap: var(--sp-1); }
.article-card-title {
  font-size: var(--text-sm);
  font-weight: 700;
  line-height: 1.4;
  color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.article-card-meta { font-size: var(--text-xs); color: var(--muted); display: flex; align-items: center; gap: var(--sp-2); }

/* Grid card */
.grid-card { display: flex; flex-direction: column; }
.grid-card-img { aspect-ratio: 16/9; overflow: hidden; }
.grid-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.grid-card:hover .grid-card-img img { transform: scale(1.04); }
.grid-card-body { padding: var(--sp-3) var(--sp-4) var(--sp-4); flex: 1; display: flex; flex-direction: column; gap: var(--sp-2); }
.grid-card-title { font-size: var(--text-base); font-weight: 700; line-height: 1.4; color: var(--ink); text-wrap: pretty; }

/* ─── BADGES & TAGS ──────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px var(--sp-2);
  border-radius: var(--r-full);
  font-size: var(--text-xs); font-weight: 700;
  line-height: 1.4;
}
.badge-red   { background: var(--red-700); color: white; }
.badge-red-lt { background: var(--red-50); color: var(--red-700); }
.badge-gold  { background: var(--gold); color: white; }
.badge-gray  { background: var(--border); color: var(--ink-60); }
.badge-green { background: var(--success); color: white; }

.tag-chip {
  display: inline-flex; align-items: center;
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  font-size: var(--text-xs); font-weight: 600; color: var(--ink-60);
  transition: border-color .15s, color .15s, background .15s;
  cursor: pointer;
}
.tag-chip:hover { border-color: var(--red-700); color: var(--red-700); background: var(--red-50); }

/* ─── BUTTONS ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-5);
  border-radius: var(--r-sm);
  font-family: var(--font-ar); font-size: var(--text-sm); font-weight: 700;
  border: 1.5px solid transparent;
  cursor: pointer; transition: all .15s;
  min-height: 44px;
  white-space: nowrap;
}
.btn-primary { background: var(--red-700); color: white; border-color: var(--red-700); }
.btn-primary:hover { background: var(--red-800); border-color: var(--red-800); }
.btn-ghost   { background: transparent; color: var(--red-700); border-color: var(--red-700); }
.btn-ghost:hover { background: var(--red-50); }
.btn-outline { background: transparent; color: var(--ink-60); border-color: var(--border); }
.btn-outline:hover { border-color: var(--ink); color: var(--ink); }
.btn-sm { min-height: 36px; padding: var(--sp-1) var(--sp-4); font-size: var(--text-xs); }
.btn-icon { width: 44px; height: 44px; padding: 0; }

/* ─── FORM ELEMENTS ──────────────────────────────────────── */
.input {
  width: 100%;
  height: 44px;
  padding: 0 var(--sp-4);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-family: var(--font-ar); font-size: var(--text-sm);
  background: var(--white); color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
.input:focus { border-color: var(--red-700); box-shadow: 0 0 0 3px rgba(200,16,46,.15); }
.input::placeholder { color: var(--muted); }

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 7L11 1' stroke='%236B7280' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 12px center;
}

/* ─── AD SLOTS ───────────────────────────────────────────── */
.ad-slot {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--r-sm);
  overflow: hidden;
}
.ad-slot::before {
  content: 'إعلان';
  position: absolute; top: 4px; right: 6px;
  font-size: 10px; color: var(--muted);
  background: var(--surface); padding: 1px 4px;
  border-radius: 3px; z-index: 1;
  border: 1px solid var(--border);
}
.ad-slot img { width: 100%; height: 100%; object-fit: cover; }
.ad-970x90 { width: 100%; height: 90px; max-width: 970px; }
.ad-728x90 { width: 100%; height: 90px; max-width: 728px; }
.ad-300x250 { width: 300px; height: 250px; }
.ad-300x600 { width: 300px; height: 600px; }
.ad-320x50  { width: 320px; height: 50px; display: none; }
@media (max-width: 768px) {
  .ad-320x50  { display: flex; }
  .ad-970x90  { display: none; }
  .ad-728x90  { display: none; }
}

/* ─── SKELETON ───────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, var(--surface) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--r-sm);
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ─── META INFO ──────────────────────────────────────────── */
.meta {
  display: flex; align-items: center; gap: var(--sp-3);
  flex-wrap: wrap; font-size: var(--text-xs); color: var(--muted);
}
.meta-item { display: flex; align-items: center; gap: 4px; }
.meta svg { width: 14px; height: 14px; }

/* ─── TABS ───────────────────────────────────────────────── */
.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--border); }
.tab-btn {
  padding: var(--sp-2) var(--sp-4);
  font-size: var(--text-sm); font-weight: 600; color: var(--muted);
  background: none; border: none; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: color .15s, border-color .15s;
}
.tab-btn:hover { color: var(--red-700); }
.tab-btn.active { color: var(--red-700); border-bottom-color: var(--red-700); }

/* ─── PAGINATION ─────────────────────────────────────────── */
.pagination {
  display: flex; align-items: center; gap: 6px;
  justify-content: center; flex-wrap: wrap;
  margin: var(--sp-8) 0 var(--sp-4);
}
.page-btn {
  min-width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--border); border-radius: var(--r-sm);
  font-size: var(--text-sm); font-weight: 600; color: var(--ink-60);
  background: var(--white); text-decoration: none;
  transition: border-color .15s, color .15s, background .15s;
  line-height: 1;
}
a.page-btn:hover          { border-color: var(--red-700); color: var(--red-700); }
.page-btn.active          { background: var(--red-700); border-color: var(--red-700); color: #fff; font-weight: 800; }
.page-ellipsis            { color: var(--muted); font-size: var(--text-sm); padding: 0 4px; line-height: 38px; }
.pagination-info          { text-align: center; font-size: var(--text-xs); color: var(--muted); margin: 0 0 var(--sp-6); }

/* ─── INFINITE SCROLL ────────────────────────────────────── */
/* Loading spinner */
@keyframes spin { to { transform: rotate(360deg); } }

.scroll-loader {
  display: flex; align-items: center; justify-content: center;
  gap: var(--sp-3); padding: var(--sp-8) var(--sp-4);
}
.scroll-spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--red-700);
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}
.scroll-loader-text { font-size: var(--text-sm); color: var(--muted); }

/* End-of-list marker */
.scroll-end {
  display: flex; align-items: center; justify-content: center;
  padding: var(--sp-8) var(--sp-4);
  font-size: var(--text-xs); color: var(--muted);
  letter-spacing: .06em;
}

/* Error state */
.scroll-error {
  text-align: center; padding: var(--sp-6) var(--sp-4);
  font-size: var(--text-sm); color: var(--danger);
}

/* ─── BREADCRUMB ─────────────────────────────────────────── */
.breadcrumb { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--text-sm); color: var(--muted); flex-wrap: wrap; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--red-700); }
.breadcrumb-sep { color: var(--border); }
.breadcrumb-current { color: var(--ink); font-weight: 600; }

/* ─── AVATAR ─────────────────────────────────────────────── */
.avatar {
  border-radius: 50%; overflow: hidden; flex-shrink: 0;
  background: var(--surface); border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: var(--red-700);
}
.avatar-sm { width: 32px; height: 32px; font-size: var(--text-xs); }
.avatar-md { width: 44px; height: 44px; font-size: var(--text-sm); }
.avatar-lg { width: 64px; height: 64px; font-size: var(--text-xl); }

/* ─── SHARE BAR ──────────────────────────────────────────── */
.share-bar { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.share-btn {
  display: flex; align-items: center; gap: var(--sp-1);
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--r-full);
  font-size: var(--text-xs); font-weight: 700;
  border: none; cursor: pointer; transition: opacity .15s;
  min-height: 36px;
}
.share-btn:hover { opacity: .85; }
.share-fb   { background: #1877F2; color: white; }
.share-tw   { background: #000000; color: white; }
.share-wa   { background: #25D366; color: white; }
.share-copy { background: var(--surface); color: var(--ink); border: 1px solid var(--border); }

/* ─── TOAST ──────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: var(--sp-6); left: 50%; transform: translateX(-50%);
  z-index: 9999; background: var(--ink); color: white;
  padding: var(--sp-3) var(--sp-5); border-radius: var(--r-md);
  font-size: var(--text-sm); font-weight: 600;
  box-shadow: var(--shadow-lg); animation: toast-in .3s ease;
  display: flex; align-items: center; gap: var(--sp-3);
  min-width: 240px; max-width: 400px;
}
@keyframes toast-in { from { transform: translateX(-50%) translateY(20px); opacity:0; } to { transform: translateX(-50%) translateY(0); opacity:1; } }

/* ─── FOOTER ─────────────────────────────────────────────── */
.footer {
  background: var(--ink);
  color: rgba(255,255,255,.7);
  padding: var(--sp-12) 0 var(--sp-6);
  margin-top: var(--sp-16);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--sp-8);
  margin-bottom: var(--sp-8);
}
@media (max-width: 768px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--sp-6); } }
.footer-heading { font-size: var(--text-sm); font-weight: 800; color: white; margin-bottom: var(--sp-4); text-transform: uppercase; letter-spacing: .05em; }
.footer-links { display: flex; flex-direction: column; gap: var(--sp-2); }
.footer-links a { font-size: var(--text-sm); color: rgba(255,255,255,.6); transition: color .15s; }
.footer-links a:hover { color: var(--red-400); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: var(--sp-6);
  display: flex; align-items: center; justify-content: space-between;
  font-size: var(--text-xs); flex-wrap: wrap; gap: var(--sp-4);
}

/* ─── UTILITY ────────────────────────────────────────────── */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }
.gap-6 { gap: var(--sp-6); }
.w-full { width: 100%; }
.text-red { color: var(--red-700); }
.text-muted { color: var(--muted); }
.text-sm { font-size: var(--text-sm); }
.text-xs { font-size: var(--text-xs); }
.font-bold { font-weight: 700; }
.font-black { font-weight: 900; }
.truncate-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mt-4 { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); }
.mt-8 { margin-top: var(--sp-8); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-6 { margin-bottom: var(--sp-6); }
.p-4 { padding: var(--sp-4); }
.p-6 { padding: var(--sp-6); }
.rounded { border-radius: var(--r-md); }
.bg-white { background: var(--white); }
.border { border: 1px solid var(--border); }

/* grid helpers */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-4); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-4); }
@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 769px) and (max-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

/* sticky sidebar widget */
.sticky-sidebar { position: sticky; top: calc(var(--nav-h) + var(--sp-4)); }

/* ─── VIDEO EMBED ─────────────────────────────────────────── */
.video-embed {
  position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;
  border-radius: var(--r-md); background: var(--ink);
}
.video-embed iframe { position: absolute; top:0; left:0; width:100%; height:100%; border:0; }

/* ─── ARTICLE BODY ───────────────────────────────────────── */
.article-body {
  font-size: var(--text-md);
  line-height: 1.9;
  color: var(--ink-80);
}
.article-body p { margin-bottom: var(--sp-4); }
.article-body strong { font-weight: 700; color: var(--ink); }
.article-body img { border-radius: var(--r-md); margin: var(--sp-4) 0; max-width: 100%; }
.article-body h2 { font-size: var(--text-xl); font-weight: 800; margin: var(--sp-6) 0 var(--sp-3); }
.article-body a { color: var(--red-700); text-decoration: underline; }

/* ─── LIGHTBOX ───────────────────────────────────────────── */
.lightbox-overlay {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,0,0,.92);
  display: flex; align-items: center; justify-content: center;
  animation: fade-in .2s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.lightbox-img { max-width: 90vw; max-height: 85vh; border-radius: var(--r-sm); object-fit: contain; }
.lightbox-close {
  position: absolute; top: var(--sp-4); left: var(--sp-4);
  width: 44px; height: 44px;
  background: rgba(255,255,255,.15); border: none; border-radius: 50%;
  color: white; font-size: 20px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

/* ─── MOBILE DRAWER ──────────────────────────────────────── */
.mobile-drawer {
  position: fixed; inset: 0; z-index: 200;
  display: flex;
  pointer-events: none;
}
.mobile-drawer.open { pointer-events: all; }
.drawer-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.5);
  opacity: 0; transition: opacity .3s;
}
.mobile-drawer.open .drawer-backdrop { opacity: 1; }
.drawer-panel {
  position: absolute; top: 0; right: -100%;
  width: min(320px, 90vw); height: 100%;
  background: var(--white); box-shadow: var(--shadow-lg);
  transition: right .3s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column;
  overflow-y: auto;
}
.mobile-drawer.open .drawer-panel { right: 0; }
.drawer-header {
  padding: var(--sp-4) var(--sp-4);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.drawer-nav { display: flex; flex-direction: column; padding: var(--sp-4); gap: var(--sp-1); }
.drawer-link {
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-sm);
  font-size: var(--text-base); font-weight: 600; color: var(--ink-60);
  display: flex; align-items: center; gap: var(--sp-3);
  transition: color .15s, background .15s;
}
.drawer-link:hover { color: var(--red-700); background: var(--red-50); }
