/* ============================================
   doyouknow.app — Complete Design System
   Mobile-first, RTL-ready, Dark Mode
   ============================================ */

/* Design Tokens */
:root {
  --color-primary-deep: #0F172A;
  --color-primary-accent: #B45309;
  --color-on-primary-accent: #FFFFFF;
  --color-secondary-accent: #10B981;
  --color-bg-light: #FAFAFA;
  --color-surface-light: #FFFFFF;
  --color-text-primary: #1E293B;
  --color-text-secondary: #64748B;
  /* Was #94A3B8 — 2.56:1 on white, failing AA for card dates and read time.
     No grey lighter than this clears 4.5:1 on white, so the muted tier now
     separates from secondary by size and weight rather than by colour. */
  --color-text-muted: #64748B;
  --color-border-light: #E2E8F0;
  --color-error: #EF4444;
  --color-info: #3B82F6;
  --color-warning: #B45309;
  --color-category-purple: #8B5CF6;
  --color-category-teal: #14B8A6;
  --color-category-rose: #F43F5E;
  --color-category-sky: #0EA5E9;
  --color-category-orange: #F97316;
  --color-category-olive: #65A30D;
  --color-category-indigo: #6366F1;
  --color-category-amber: #D97706;
  --color-accent-blue: #3B82F6;
  --color-accent-red: #EF4444;
  --color-accent-purple: #8B5CF6;
  --color-accent-teal: #14B8A6;
  --color-accent-orange: #F97316;
  --color-accent-rose: #F43F5E;
  
  /* Type scale — see design/design-system.md §Type Scale.
     Use these; do not add raw font-size values. */
  --t-display: clamp(28px, 4.2vw, 48px);
  --t-h1: clamp(24px, 3.4vw, 42px);
  --t-h2: clamp(20px, 2.6vw, 32px);
  --t-h3: clamp(18px, 1.9vw, 24px);
  --t-lead: clamp(18px, 1.4vw, 20px);
  --t-body: 16px;
  --t-small: 14px;
  --t-caption: 12px;
  --t-label: 11px;

  /* Reading measure. 800px at 1.05rem ran to ~95 characters per line. */
  --measure: 68ch;
  /* Minimum interactive target. */
  --tap: 44px;

  --font-en: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-ar: 'Cairo', 'Tajawal', 'Noto Sans Arabic', 'Segoe UI', Tahoma, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 48px;
  --space-9: 64px;
  --space-10: 96px;
  
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
  --shadow-xl: 0 20px 25px rgba(0,0,0,0.15);
  --shadow-glow: 0 0 20px rgba(245,158,11,0.3);
  --shadow-amber: 0 4px 12px rgba(245,158,11,0.2);
  
  --transition-fast: 0.15s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;
  --transition-bounce: 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  
  --max-content: 1200px;
  --max-article: 800px;
  --header-height: 64px;
  --header-height-mobile: 56px;
}

[data-theme="dark"] {
  --color-primary-accent: #F59E0B;
  --color-on-primary-accent: #0F172A;
  --color-bg-light: #0B1120;
  --color-surface-light: #1E293B;
  --color-surface-elevated: #334155;
  --color-text-primary: #E2E8F0;
  --color-text-secondary: #94A3B8;
  /* Was #64748B — 3.07:1 on the dark card surface, failing AA. */
  --color-text-muted: #94A3B8;
  --color-border-light: #334155;
  --color-border-hover: #475569;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.4);
  --shadow-xl: 0 20px 25px rgba(0,0,0,0.5);
}

/* Arabic overrides */
[lang="ar"] {
  --font-primary: var(--font-ar);
  direction: rtl;
  text-align: start;
  line-height: 1.75;
  word-spacing: 0.05em;
  letter-spacing: 0;
}

[lang="ar"] h1, [lang="ar"] h2, [lang="ar"] h3, [lang="ar"] h4 {
  font-family: var(--font-ar);
  line-height: 1.3;
}

[lang="ar"] body, [lang="ar"] p, [lang="ar"] li {
  font-family: var(--font-ar);
  line-height: 1.75;
}

[lang="ar"] .nav-links, [lang="ar"] .footer-links {
  direction: rtl;
}

[lang="ar"] .share-btn:first-child {
  order: 1;
}

[lang="ar"] .logo { margin-right: 0; margin-left: auto; }
[lang="ar"] .search-toggle { margin-left: 0; margin-right: auto; }


/* Keyframe Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

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

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-100%); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideOutRight {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(100%); }
}

@keyframes slideOutLeft {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(-100%); }
}

/* Scroll-reveal animation classes */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.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; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, var(--color-border-light) 25%, var(--color-surface-light) 50%, var(--color-border-light) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s linear infinite;
  border-radius: var(--radius-md);
}

[data-theme="dark"] .skeleton {
  background: linear-gradient(90deg, var(--color-border-light) 25%, var(--color-surface-elevated) 50%, var(--color-border-light) 75%);
  background-size: 200% 100%;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: var(--space-5);
  right: var(--space-5);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 320px;
  width: 100%;
  pointer-events: none;
}

[lang="ar"] .toast-container {
  right: auto;
  left: var(--space-5);
}

.toast {
  background: var(--color-surface-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-4) var(--space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text-primary);
  border-left: 4px solid var(--color-primary-accent);
  animation: slideInRight 0.3s ease forwards;
  pointer-events: auto;
  word-break: break-word;
}

[lang="ar"] .toast {
  border-left: none;
  border-right: 4px solid var(--color-primary-accent);
  animation: slideInLeft 0.3s ease forwards;
}

.toast.success { border-left-color: var(--color-secondary-accent); }
.toast.error { border-left-color: var(--color-error); }
.toast.info { border-left-color: var(--color-info); }
.toast.warning { border-left-color: var(--color-warning); }

[lang="ar"] .toast.success { border-right-color: var(--color-secondary-accent); }
[lang="ar"] .toast.error { border-right-color: var(--color-error); }
[lang="ar"] .toast.info { border-right-color: var(--color-info); }
[lang="ar"] .toast.warning { border-right-color: var(--color-warning); }

.toast-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--color-text-muted);
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
  transition: color var(--transition-fast);
}

.toast-close:hover { color: var(--color-text-primary); }

.toast.toast-exit {
  animation: slideOutRight 0.3s ease forwards;
}

[lang="ar"] .toast.toast-exit {
  animation: slideOutLeft 0.3s ease forwards;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-en);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text-primary);
  background: var(--color-bg-light);
  transition: background 0.3s ease, color 0.3s ease;
  min-height: 100vh;
}

body.no-scroll { overflow: hidden; }

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-en);
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-primary-deep);
  margin-bottom: var(--space-4);
}

[data-theme="dark"] h1, [data-theme="dark"] h2, [data-theme="dark"] h3, [data-theme="dark"] h4 {
  color: #F8FAFC;
}

h1 { font-size: var(--t-h1); font-weight: 700; line-height: 1.2; }
h2 { font-size: var(--t-h2); font-weight: 600; line-height: 1.25; }
h3 { font-size: var(--t-h3); font-weight: 600; line-height: 1.3; }
h4 { font-size: var(--t-lead); font-weight: 600; line-height: 1.35; }

p { margin-bottom: var(--space-4); font-size: 1.05rem; line-height: 1.65; }

a {
  color: var(--color-primary-accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover { color: #0F172A; text-decoration: underline; }
[data-theme="dark"] a:hover { color: #F8FAFC; }

img { max-width: 100%; height: auto; border-radius: var(--radius-lg); display: block; }

ul, ol { padding-left: var(--space-5); margin-bottom: var(--space-4); }
[lang="ar"] ul, [lang="ar"] ol { padding-left: 0; padding-right: var(--space-5); }

li { margin-bottom: var(--space-2); }

blockquote {
  border-left: 4px solid var(--color-primary-accent);
  padding: var(--space-4) var(--space-5);
  background: var(--color-surface-light);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: var(--space-5) 0;
  font-style: italic;
  color: var(--color-text-secondary);
}

[lang="ar"] blockquote {
  border-left: none;
  border-right: 4px solid var(--color-primary-accent);
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  font-style: normal;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  z-index: 10000;
  background: var(--color-primary-accent);
  color: var(--color-on-primary-accent);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-weight: 600;
  transition: top var(--transition-fast);
}

.skip-link:focus { top: var(--space-4); outline: 3px solid var(--color-primary-deep); outline-offset: 2px; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--color-surface-light);
  border-bottom: 1px solid var(--color-border-light);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  height: var(--header-height);
  transition: background 0.3s ease, border-color 0.3s ease;
}

[data-theme="dark"] .site-header {
  background: rgba(15, 23, 42, 0.85);
  border-color: var(--color-border-light);
}

.header-inner {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 0 var(--space-5);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-primary-deep);
  text-decoration: none;
  flex-shrink: 0;
}

.logo:hover { text-decoration: none; color: var(--color-primary-deep); }

[data-theme="dark"] .logo,
[data-theme="dark"] .logo:hover { color: var(--color-text-primary); }

.logo-icon {
  width: 32px;
  height: 32px;
  background: var(--color-primary-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}

.logo-icon::after {
  content: '';
  width: 10px;
  height: 10px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 0 8px 2px rgba(255,255,255,0.6);
}

.logo-text { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.01em; }
.logo-text .accent { color: var(--color-primary-accent); }

/* Navigation */
.main-nav {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  flex: 1;
  justify-content: center;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-links a {
  color: var(--color-text-primary);
  font-weight: 500;
  font-size: var(--t-small);
  padding: var(--space-2) 0;
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
  position: relative;
  transition: color var(--transition-fast);
}

.nav-links a:hover { color: var(--color-primary-accent); text-decoration: none; }

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-primary-accent);
  transform: scaleX(0);
  transition: transform var(--transition-fast);
  border-radius: 2px;
}

.nav-links a:hover::after { transform: scaleX(1); }

/* Countries / Categories dropdown nav */
.nav-item-countries, .nav-item-categories { position: relative; }
.nav-dropdown-toggle { background: none; border: none; font: inherit; color: inherit; font-weight: 500; cursor: pointer; padding: var(--space-2) 0; display: flex; align-items: center; gap: 6px; border-radius: var(--radius-sm); transition: color var(--transition-fast); }
/* chevron drawn from borders so it can rotate smoothly when the menu opens */
.nav-dropdown-toggle::after { content: ''; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform var(--transition-fast); }
.nav-dropdown-toggle:hover { color: var(--color-primary-accent); }
.nav-dropdown-toggle[aria-expanded="true"] { color: var(--color-primary-accent); }
.nav-dropdown-toggle[aria-expanded="true"]::after { transform: translateY(1px) rotate(-135deg); }
.nav-dropdown-toggle:focus-visible { outline: 2px solid var(--color-primary-accent); outline-offset: 3px; }
.nav-dropdown { display: none; position: absolute; top: calc(100% + 10px); left: 0; background: var(--color-surface-light); border: 1px solid var(--color-border-light); border-radius: var(--radius-xl); box-shadow: 0 12px 32px rgba(15, 23, 42, 0.13), 0 2px 8px rgba(15, 23, 42, 0.06); list-style: none; padding: var(--space-3); margin: 0; z-index: 1001; min-width: 190px; }
/* invisible bridge across the visual gap: keeps the pointer "inside" the menu on the way down */
.nav-dropdown::before { content: ''; position: absolute; left: 0; right: 0; top: -12px; height: 12px; }
.nav-dropdown.active { display: block; animation: navDropdownIn 0.16s ease-out; }
.nav-dropdown li a { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-3); white-space: nowrap; border-radius: var(--radius-md); color: var(--color-text-primary); font-size: 0.93rem; font-weight: 500; transition: background var(--transition-fast), color var(--transition-fast); }
.nav-dropdown li a:hover { background: var(--color-bg-light); color: var(--color-primary-accent); text-decoration: none; }
.nav-dropdown li a:focus-visible { outline: 2px solid var(--color-primary-accent); outline-offset: -2px; background: var(--color-bg-light); text-decoration: none; }
.nav-dropdown li a[aria-current="page"] { color: var(--color-primary-accent); background: var(--color-bg-light); }
.nav-dropdown .nav-flag { font-size: 1.05rem; line-height: 1; }
/* Categories mega menu: grouped into labelled sections, balanced across columns */
.nav-dropdown-mega { left: 50%; translate: -50% 0; width: max-content; max-width: min(660px, calc(100vw - 32px)); padding: var(--space-4) var(--space-5); columns: 3; column-gap: var(--space-6); }
.nav-dropdown-mega.active { display: block; }
.nav-dropdown-group { break-inside: avoid; margin-bottom: var(--space-4); }
.nav-dropdown-group:last-child { margin-bottom: 0; }
.nav-dropdown-group ul { list-style: none; padding: 0; margin: 0; }
.nav-dropdown-heading { display: block; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-text-muted); padding: 0 var(--space-3) var(--space-2); margin: 0; }
@keyframes navDropdownIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
[lang="ar"] .nav-dropdown { left: auto; right: 0; }
[lang="ar"] .nav-dropdown-mega { left: 50%; right: auto; }
.mobile-nav-heading { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-text-muted); padding: var(--space-4) 0 var(--space-1); border-bottom: none !important; }
.mobile-nav-subheading { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--color-primary-accent); padding: var(--space-3) 0 var(--space-1); border-bottom: none !important; opacity: 0.85; }
.mobile-nav-links .nav-flag { margin-inline-end: var(--space-2); }
.empty-category-state { max-width: var(--max-content); margin: 0 auto; padding: var(--space-7) var(--space-5); text-align: center; color: var(--color-text-secondary); }
@media (max-width: 1080px) { .nav-dropdown-mega { columns: 2; max-width: min(460px, calc(100vw - 32px)); } }
/* No-JS fallback: hover alone opens the menus (site.js adds .nav-js and takes over) */
@media (hover: hover) and (pointer: fine) {
  .main-nav:not(.nav-js) .nav-item-countries:hover .nav-dropdown { display: block; }
  .main-nav:not(.nav-js) .nav-item-categories:hover .nav-dropdown-mega { display: block; }
}
@media (prefers-reduced-motion: reduce) {
  .nav-dropdown.active { animation: none; }
}

/* Header controls */
.header-controls {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

.lang-switch, .theme-toggle, .search-toggle {
  background: none;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  /* These measured ~35px; 44px is the accessibility floor. */
  min-height: var(--tap);
  min-width: var(--tap);
  justify-content: center;
  cursor: pointer;
  font-size: var(--t-small);
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-en);
}

.lang-switch:hover, .theme-toggle:hover, .search-toggle:hover {
  border-color: var(--color-primary-accent);
  color: var(--color-primary-accent);
}

/* Mobile menu */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
  color: var(--color-text-primary);
}

.mobile-menu-btn svg { width: 24px; height: 24px; }

/* Mobile nav overlay */
.mobile-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 998;
}

.mobile-nav-overlay.active { display: block; }

.mobile-nav {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 280px;
  max-width: 85vw;
  background: var(--color-surface-light);
  z-index: 999;
  padding: var(--space-6) var(--space-5);
  transform: translateX(100%);
  transition: transform var(--transition-base);
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

[lang="ar"] .mobile-nav { right: auto; left: 0; transform: translateX(-100%); }

.mobile-nav.active { transform: translateX(0); }

.mobile-nav-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-primary);
  padding: var(--space-2);
}

[lang="ar"] .mobile-nav-close { right: auto; left: var(--space-4); }

.mobile-nav-links {
  list-style: none;
  padding: 0;
  margin: var(--space-7) 0 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.mobile-nav-links a {
  color: var(--color-text-primary);
  font-weight: 600;
  font-size: 1.1rem;
  display: block;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-border-light);
}

/* Hero section */
.hero-section {
  background: var(--color-surface-light);
  border-bottom: 1px solid var(--color-border-light);
  padding: var(--space-9) var(--space-5) var(--space-7);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(245,158,11,0.1) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero-section::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(59,130,246,0.06) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero-inner {
  max-width: var(--max-content);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero-title {
  font-size: clamp(32px, 6vw, 56px);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: var(--space-4);
  color: var(--color-primary-deep);
}

[data-theme="dark"] .hero-title { color: #F8FAFC; }

.hero-subtitle {
  font-size: clamp(16px, 2.5vw, 20px);
  color: var(--color-text-secondary);
  max-width: 600px;
  margin: 0 auto var(--space-6);
  line-height: 1.6;
}

.hero-trending {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.trending-pill {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: var(--space-2) var(--space-4);
  background: var(--color-bg-light);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: all var(--transition-fast);
  cursor: pointer;
  text-decoration: none;
}

/* These render as non-interactive <span>s. Until they become real links in the
   Explore rail, they must not advertise interactivity they do not have. */
.trending-pill { cursor: default; }
.trending-pill:hover {
  border-color: var(--color-border-light);
  color: var(--color-text-secondary);
  text-decoration: none;
}

/* Newsletter signup */
.newsletter-signup {
  display: flex;
  gap: var(--space-3);
  max-width: 480px;
  margin: 0 auto;
  flex-wrap: wrap;
  justify-content: center;
}

.newsletter-signup input {
  flex: 1;
  min-width: 200px;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-full);
  font-size: 1rem;
  font-family: var(--font-en);
  background: var(--color-surface-light);
  color: var(--color-text-primary);
  transition: border-color var(--transition-fast);
}

.newsletter-signup input:focus {
  outline: none;
  border-color: var(--color-primary-accent);
  box-shadow: 0 0 0 3px rgba(245,158,11,0.15);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  font-family: var(--font-en);
  text-decoration: none;
}

.btn:hover { text-decoration: none; transform: translateY(-1px); }

.btn-primary {
  background: var(--color-primary-accent);
  color: var(--color-on-primary-accent);
  box-shadow: 0 2px 8px rgba(180,83,9,0.26);
}

.btn-primary:hover {
  background: #92400E;
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(180,83,9,0.34);
}

.btn-secondary {
  background: transparent;
  color: var(--color-primary-accent);
  border: 2px solid var(--color-primary-accent);
}

.btn-secondary:hover { background: var(--color-primary-accent); color: var(--color-on-primary-accent); }

.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border-light);
}

.btn-ghost:hover { background: var(--color-bg-light); color: var(--color-text-primary); }

.btn-whatsapp {
  background: #25D366;
  color: white;
  box-shadow: 0 2px 8px rgba(37,211,102,0.3);
}

.btn-whatsapp:hover { background: #1DA851; box-shadow: 0 4px 12px rgba(37,211,102,0.4); }

/* Category badge */
.category-badge {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-uae { background: #E0F2FE; color: #0EA5E9; }
.badge-ksa { background: #DCFCE7; color: #16A34A; }
.badge-travel { background: #CCFBF1; color: #0D9488; }
.badge-tech { background: #DBEAFE; color: #2563EB; }
.badge-science { background: #EDE9FE; color: #7C3AED; }
.badge-history { background: #FEF3C7; color: #D97706; }
.badge-food { background: #FFE4E6; color: #E11D48; }
.badge-sports { background: #FFEDD5; color: #EA580C; }
.badge-culture { background: #E8E8E8; color: #525252; }
.badge-business { background: #E0E7FF; color: #4338CA; }
.badge-health { background: #D1FAE5; color: #059669; }
.badge-entertainment { background: #FCE7F3; color: #BE185D; }
.badge-islamic { background: #F0FDF4; color: #15803D; }

/* Article cards */
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-5);
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 0 var(--space-5);
}

@media (max-width: 640px) {
  .article-grid { grid-template-columns: 1fr; padding: 0 var(--space-4); gap: var(--space-4); }
}

.article-card {
  background: var(--color-surface-light);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border-light);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.article-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
  border-color: var(--color-primary-accent);
}

.article-card .card-image {
  width: 100%;
  aspect-ratio: 16/9;
  height: auto;
  object-fit: cover;
  background: linear-gradient(135deg, var(--color-border-light), var(--color-bg-light));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease;
}

.article-card:hover .card-image {
  transform: scale(1.03);
}

.article-card .card-content {
  padding: var(--space-5);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.article-card .card-title {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: var(--space-3);
  color: var(--color-text-primary);
}

.article-card .card-excerpt {
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  line-height: 1.55;
  margin-bottom: var(--space-4);
  flex: 1;
}

.article-card .card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 0.8rem;
  color: var(--color-text-muted);
  flex-wrap: wrap;
}

.article-card .card-meta .read-time::before {
  content: '•';
  margin: 0 var(--space-2);
}

/* Section headers */
.section-header {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: var(--space-7) var(--space-5) var(--space-5);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.section-header h2 {
  font-size: clamp(22px, 3.5vw, 30px);
  margin: 0;
}

.section-header .view-all {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-primary-accent);
}

/* Content section */
.content-section {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: var(--space-7) var(--space-5);
}

/* Article page */
.article-page {
  /* Character-based, not pixel-based: keeps the measure comfortable in both
     Inter and Cairo instead of only in Latin. */
  max-width: var(--measure);
  margin: 0 auto;
  padding: var(--space-6) var(--space-5);
}

.article-header {
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--color-border-light);
}

.article-header .category-badge {
  margin-bottom: var(--space-3);
}

.article-header h1 {
  margin-bottom: var(--space-4);
  font-size: clamp(26px, 4.5vw, 42px);
}

.article-meta {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  font-size: 0.9rem;
  color: var(--color-text-muted);
  flex-wrap: wrap;
}

.article-meta .author {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.article-meta .author-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary-accent), #D97706);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.85rem;
}

.article-meta .updated {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* Featured image */
.featured-image {
  width: 100%;
  aspect-ratio: 16/9;
  max-height: 480px;
  object-fit: cover;
  border-radius: var(--radius-xl);
  margin-bottom: var(--space-6);
  background: linear-gradient(135deg, #E2E8F0, #F1F5F9);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  transition: box-shadow 0.3s ease;
}

.article-page:hover .featured-image {
  box-shadow: var(--shadow-md);
}

/* Article body */
.article-body {
  font-size: 1.05rem;
  line-height: 1.75;
}

.article-body h2 {
  font-size: clamp(22px, 3vw, 28px);
  margin-top: var(--space-7);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border-light);
  transition: border-color 0.3s ease;
}

.article-body h3 {
  font-size: clamp(18px, 2.5vw, 24px);
  margin-top: var(--space-6);
  margin-bottom: var(--space-3);
  color: var(--color-primary-deep);
  transition: color 0.3s ease;
}

[data-theme="dark"] .article-body h3 {
  color: #F8FAFC;
}

/* World Cup 2026 live center */
.wc-live-shell {
  margin-top: var(--space-7);
}

.wc-live-status {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-4);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-xl);
  background: var(--color-bg-card);
  box-shadow: var(--shadow-sm);
}

.wc-live-status > span {
  color: #DC2626;
  font-size: 1.15rem;
}

.wc-live-status.ok > span {
  color: #16A34A;
}

.wc-live-status small {
  display: block;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.wc-feed-note,
.wc-empty,
.wc-venue {
  color: var(--color-text-muted);
}

.wc-live-section {
  margin-top: var(--space-7);
}

.wc-match-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-4);
}

.wc-match-card,
.wc-table-wrap {
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-xl);
  padding: var(--space-4);
  background: var(--color-bg-card);
  box-shadow: var(--shadow-sm);
}

.wc-match-card.is-live {
  border-color: #DC2626;
}

.wc-match-meta,
.wc-scoreline,
.wc-team {
  display: flex;
  align-items: center;
}

.wc-match-meta {
  justify-content: space-between;
  gap: var(--space-3);
  color: var(--color-text-muted);
  font-size: 0.85rem;
  margin-bottom: var(--space-3);
}

.wc-scoreline {
  justify-content: space-between;
  gap: var(--space-3);
}

.wc-scoreline strong {
  font-size: 1.35rem;
  white-space: nowrap;
}

.wc-team {
  gap: var(--space-2);
  min-width: 0;
  flex: 1;
}

.wc-team:last-child {
  justify-content: flex-end;
  text-align: end;
}

.wc-team img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex: 0 0 auto;
}

.wc-flag {
  font-size: 1.3rem;
  line-height: 1;
  flex: 0 0 auto;
}

.wc-team span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.wc-standings {
  display: grid;
  gap: var(--space-5);
}

.wc-table {
  width: 100%;
  border-collapse: collapse;
}

.wc-table th,
.wc-table td {
  padding: var(--space-2);
  border-bottom: 1px solid var(--color-border-light);
  text-align: start;
}

.wc-table th {
  color: var(--color-text-muted);
  font-weight: 600;
}

.wc-mini-widget {
  margin: var(--space-6) 0;
  padding: var(--space-5);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.04), rgba(37, 99, 235, 0.06));
  box-shadow: var(--shadow-sm);
}

.wc-mini-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.wc-mini-head h2 {
  margin: var(--space-2) 0 0;
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
}

.wc-mini-head a {
  white-space: nowrap;
  font-weight: 700;
}

.wc-mini-list {
  display: grid;
  gap: var(--space-3);
}

.wc-mini-match {
  padding: var(--space-3);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  background: var(--color-bg-card);
}

.wc-mini-match.is-live {
  border-color: #DC2626;
}

.wc-mini-line,
.wc-mini-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.wc-mini-line strong {
  white-space: nowrap;
}

.wc-mini-meta {
  margin-top: var(--space-2);
  color: var(--color-text-muted);
  font-size: 0.82rem;
}

.wc-mini-recent {
  margin-top: var(--space-4);
}

.wc-mini-recent summary {
  cursor: pointer;
  color: var(--color-text-muted);
  font-weight: 700;
  margin-bottom: var(--space-3);
}

/* Google-inspired World Cup board */
.wc-google-board {
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 28px;
  background: #202124;
  color: #E8EAED;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
}

.wc-google-board h1,
.wc-google-board h2,
.wc-google-board h3,
.wc-google-board strong {
  color: #F8F1F2;
}

.wc-google-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  padding: clamp(22px, 4vw, 36px);
  border-bottom: 1px solid rgba(232, 234, 237, 0.14);
  background:
    radial-gradient(circle at top right, rgba(126, 69, 74, 0.28), transparent 34%),
    #202124;
}

.wc-google-hero p {
  margin: 0 0 var(--space-2);
  color: #BDC1C6;
}

.wc-google-hero h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 3.75rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.wc-google-hero span {
  flex: 0 0 auto;
  border: 1px solid rgba(216, 181, 186, 0.56);
  border-radius: 999px;
  padding: 8px 15px;
  color: #EAD7D9;
  font-weight: 800;
}

.wc-google-hero span.ok {
  border-color: rgba(74, 222, 128, 0.5);
  color: #BBF7D0;
}

.wc-google-tabs,
.wc-google-subtabs {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 18px 24px 12px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.wc-google-tabs::-webkit-scrollbar,
.wc-google-subtabs::-webkit-scrollbar,
.wc-mini-list::-webkit-scrollbar {
  display: none;
}

.wc-google-tabs a,
.wc-google-subtabs span {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #3B272A;
  color: #F4E7E8;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.wc-google-tabs a {
  padding: 11px 19px;
}

.wc-google-tabs a.active {
  outline: 2px solid #E8D6D8;
  background: #725358;
}

.wc-google-subtabs {
  padding: 0 0 var(--space-3);
  border-bottom: 1px solid rgba(232, 234, 237, 0.16);
}

.wc-google-subtabs span {
  background: transparent;
  color: #BDC1C6;
  padding: 10px 22px;
}

.wc-google-subtabs span.active {
  color: #AECBFA;
  box-shadow: inset 0 -3px 0 #AECBFA;
  border-radius: 0;
}

.wc-google-updated {
  display: block;
  padding: 0 24px 14px;
  color: #9AA0A6;
}

.wc-google-section {
  padding: 24px;
  border-top: 1px solid rgba(232, 234, 237, 0.14);
}

.wc-google-section h2 {
  margin: 0 0 var(--space-4);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  letter-spacing: -0.03em;
}

.wc-google-match-list {
  display: grid;
  gap: 16px;
}

.wc-google-match {
  border: 1px solid rgba(154, 160, 166, 0.24);
  border-radius: 22px;
  background: #2B2C33;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.wc-google-match.is-live {
  border-color: rgba(239, 68, 68, 0.68);
}

.wc-google-round {
  padding: 15px 18px 0;
  color: #9AA0A6;
  font-weight: 700;
}

.wc-google-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1px minmax(110px, 0.34fr);
  gap: 18px;
  align-items: center;
  padding: 10px 18px 18px;
}

.wc-google-teams {
  min-width: 0;
}

.wc-google-teams div {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  margin: 11px 0;
  color: #E8EAED;
  font-size: clamp(1.08rem, 2.6vw, 1.8rem);
  font-weight: 700;
}

.wc-google-teams div span:first-child {
  flex: 0 0 auto;
  font-size: 1.35em;
}

.wc-google-teams div span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wc-google-divider {
  width: 1px;
  min-height: 92px;
  background: rgba(154, 160, 166, 0.46);
}

.wc-google-time {
  text-align: center;
  color: #E8EAED;
  font-weight: 800;
  line-height: 1.35;
}

.wc-google-time span {
  display: block;
  color: #BDC1C6;
  font-size: 0.92rem;
}

.wc-google-table-scroll {
  overflow-x: auto;
  margin: 0 -24px;
  padding: 0 24px;
  -webkit-overflow-scrolling: touch;
}

.wc-google-group {
  margin-top: var(--space-5);
}

.wc-google-group h3 {
  margin: 0 0 var(--space-2);
  font-size: 1.35rem;
}

.wc-google-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  color: #E8EAED;
}

.wc-google-table th,
.wc-google-table td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(154, 160, 166, 0.28);
  text-align: center;
}

.wc-google-table th:first-child,
.wc-google-table td:first-child,
.wc-google-table th:nth-child(2),
.wc-google-table td:nth-child(2) {
  text-align: start;
}

.wc-google-table th {
  color: #9AA0A6;
  font-weight: 700;
}

.wc-google-table td:first-child {
  color: #F1F3F4;
  font-weight: 700;
}

.wc-google-table td:nth-child(2) {
  font-size: 1.05rem;
  font-weight: 700;
}

.wc-google-table td:nth-child(6),
.wc-google-table th:nth-child(6) {
  color: #F1F3F4;
  font-weight: 900;
}

.wc-google-table .wc-team {
  display: inline-flex;
  justify-content: flex-start;
  gap: 10px;
  text-align: start;
}

.wc-google-more {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: var(--space-4);
  border: 0;
  border-radius: 999px;
  padding: 13px 18px;
  background: #3B272A;
  color: #F4E7E8;
  font: inherit;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.wc-google-note {
  margin: var(--space-3) 0 0;
  color: #BDC1C6;
}

.wc-group-results {
  display: grid;
  gap: var(--space-5);
}

.wc-group-result {
  display: grid;
  gap: var(--space-3);
}

.wc-group-result h3 {
  margin: 0;
  color: #BDC1C6;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}

.wc-mini-widget {
  overflow: hidden;
  padding: var(--space-4) 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.wc-mini-head {
  padding: 0 2px;
}

.wc-mini-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
  gap: 12px;
  overflow-x: visible;
  padding: 4px 2px 12px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.wc-mini-match {
  display: grid;
  grid-template-rows: auto 1fr auto;
  flex: 0 0 198px;
  width: 100%;
  min-height: 116px;
  padding: 14px 16px;
  border: 1px solid rgba(154, 160, 166, 0.34);
  border-radius: 22px;
  background: #25272F;
  color: #F1F3F4;
  scroll-snap-align: start;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.16);
}

.wc-mini-match.is-live {
  border-color: rgba(239, 68, 68, 0.72);
}

.wc-mini-code {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.wc-mini-code span {
  color: #BDC1C6;
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: lowercase;
}

.wc-mini-time {
  align-self: center;
  justify-self: center;
  color: #BDC1C6;
  font-weight: 800;
  text-align: center;
}

.wc-mini-flags {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1.55rem;
  line-height: 1;
}

.wc-mini-recent {
  padding: 0 2px;
}

.wc-mini-zone {
  margin: 0;
  padding: 0 2px;
  color: #9AA0A6;
  font-size: 0.9rem;
}

html[dir="rtl"] .wc-google-tabs,
html[dir="rtl"] .wc-google-subtabs,
html[dir="rtl"] .wc-mini-list {
  direction: rtl;
}

@media (max-width: 640px) {
  .wc-live-shell {
    margin-top: var(--space-5);
  }

  .wc-google-board {
    margin-inline: calc(-1 * var(--space-4));
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .wc-google-hero {
    padding: 24px var(--space-4);
  }

  .wc-google-hero span {
    display: none;
  }

  .wc-google-tabs {
    padding-inline: var(--space-4);
  }

  .wc-google-section {
    padding: 22px var(--space-4);
  }

  .wc-google-main {
    grid-template-columns: minmax(0, 1fr) 1px 92px;
    gap: 13px;
    padding-inline: 14px;
  }

  .wc-google-round {
    padding-inline: 14px;
  }

  .wc-google-time {
    font-size: 0.94rem;
  }

  .wc-google-time span {
    font-size: 0.8rem;
  }

  .wc-mini-match {
    flex: 0 0 min(82vw, 360px);
  }

  .wc-mini-list {
    display: flex;
    overflow-x: auto;
  }
}

.article-body h3 {
  font-size: clamp(18px, 2.5vw, 22px);
  margin-top: var(--space-6);
  margin-bottom: var(--space-3);
}

.article-body h4 {
  font-size: 1.1rem;
  margin-top: var(--space-5);
  margin-bottom: var(--space-3);
}

.article-body p { margin-bottom: var(--space-4); }

.article-body ul, .article-body ol { margin-bottom: var(--space-4); padding-left: var(--space-5); }
[lang="ar"] .article-body ul, [lang="ar"] .article-body ol { padding-left: 0; padding-right: var(--space-5); }

.article-body li { margin-bottom: var(--space-2); }

.article-body strong { color: var(--color-primary-deep); font-weight: 600; }
[data-theme="dark"] .article-body strong { color: #F8FAFC; }

.article-body a { color: var(--color-primary-accent); font-weight: 500; }

.article-body a:hover { color: #D97706; }

.article-body img {
  border-radius: var(--radius-lg);
  margin: var(--space-5) 0;
  box-shadow: var(--shadow-sm);
  max-width: 100%;
}

.article-body .image-caption {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  text-align: center;
  margin-top: calc(-1 * var(--space-3));
  margin-bottom: var(--space-5);
}

/* Share bar */
.share-bar {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin: var(--space-6) 0;
  padding: var(--space-5) 0;
  border-top: 1px solid var(--color-border-light);
  border-bottom: 1px solid var(--color-border-light);
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid var(--color-border-light);
  background: var(--color-surface-light);
  color: var(--color-text-secondary);
  font-family: var(--font-en);
  text-decoration: none;
}

.share-btn:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-sm); }

.share-btn svg { width: 18px; height: 18px; }

.share-btn.whatsapp { background: #25D366; color: white; border-color: #25D366; }
.share-btn.whatsapp:hover { background: #1DA851; }

.share-btn.twitter { background: #000; color: white; border-color: #000; }
.share-btn.twitter:hover { background: #333; }

.share-btn.facebook { background: #1877F2; color: white; border-color: #1877F2; }
.share-btn.facebook:hover { background: #166fe5; }

.share-btn.copy {
  background: var(--color-surface-light);
  border: 1px solid var(--color-border-light);
  color: var(--color-text-secondary);
}

.share-btn.copy:hover { background: var(--color-bg-light); color: var(--color-text-primary); }

.share-btn.copy.copied { background: var(--color-secondary-accent); color: white; border-color: var(--color-secondary-accent); }

/* Author bio box */
.author-bio {
  display: flex;
  gap: var(--space-5);
  padding: var(--space-6);
  background: var(--color-surface-light);
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border-light);
  margin: var(--space-7) 0;
}

.author-bio .avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary-accent), #D97706);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.author-bio .bio-content h4 {
  font-size: 1.1rem;
  margin-bottom: var(--space-2);
}

.author-bio .bio-content p {
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-3);
}

.author-bio .bio-content .more-articles {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-primary-accent);
}

/* FAQ section */
.faq-section {
  margin: var(--space-7) 0;
  padding: var(--space-6);
  background: var(--color-surface-light);
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border-light);
}

.faq-section h2 {
  margin-bottom: var(--space-5);
  font-size: 1.5rem;
}

.faq-item {
  border-bottom: 1px solid var(--color-border-light);
  padding: var(--space-4) 0;
}

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

.faq-item h3 {
  font-size: 1.05rem;
  margin-bottom: var(--space-3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.faq-item h3 .toggle-icon {
  transition: transform var(--transition-fast);
  flex-shrink: 0;
}

.faq-item h3:hover { color: var(--color-primary-accent); }

.faq-item .faq-answer {
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  line-height: 1.65;
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-slow), padding var(--transition-slow);
  padding: 0;
}

.faq-item.open .faq-answer {
  max-height: 500px;
  padding-top: var(--space-3);
}

.faq-item.open .toggle-icon { transform: rotate(180deg); }

/* Sources section */
.sources-section {
  margin: var(--space-7) 0;
  padding: var(--space-5);
  background: var(--color-bg-light);
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border-light);
}

.sources-section h2 { font-size: 1.3rem; margin-bottom: var(--space-4); }

.sources-section ol { padding-left: var(--space-5); }
[lang="ar"] .sources-section ol { padding-left: 0; padding-right: var(--space-5); }

.sources-section li {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-3);
  line-height: 1.5;
}

.sources-section li a { color: var(--color-primary-accent); font-weight: 500; word-break: break-all; }

/* Related articles */
.related-articles {
  margin: var(--space-7) 0;
  padding: var(--space-6) 0;
  border-top: 1px solid var(--color-border-light);
}

.related-articles h2 { font-size: 1.5rem; margin-bottom: var(--space-5); }

.related-articles .related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--space-4);
}

@media (max-width: 480px) {
  .related-articles .related-grid { grid-template-columns: 1fr; }
}

.related-articles .related-card {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--color-surface-light);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-light);
  transition: all var(--transition-fast);
  text-decoration: none;
}

.related-articles .related-card:hover {
  border-color: var(--color-primary-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

.related-articles .related-card .thumb {
  width: 80px;
  height: 60px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--color-border-light), var(--color-bg-light));
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: var(--color-text-muted);
}

.related-articles .related-card .info h4 {
  font-size: 0.95rem;
  margin-bottom: var(--space-1);
  color: var(--color-text-primary);
  line-height: 1.3;
}

.related-articles .related-card .info .meta {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

/* Newsletter CTA */
.newsletter-cta {
  background: var(--color-primary-deep);
  color: white;
  padding: var(--space-8) var(--space-5);
  text-align: center;
  margin: var(--space-7) 0;
  border-radius: var(--radius-xl);
  position: relative;
  overflow: hidden;
}

.newsletter-cta::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -20%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(245,158,11,0.15) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.newsletter-cta h2 {
  font-size: clamp(20px, 3.5vw, 28px);
  margin-bottom: var(--space-3);
  color: white;
  position: relative;
  z-index: 1;
}

.newsletter-cta p {
  font-size: 1rem;
  opacity: 0.85;
  max-width: 500px;
  margin: 0 auto var(--space-5);
  position: relative;
  z-index: 1;
}

.newsletter-cta .signup-form {
  display: flex;
  gap: var(--space-3);
  max-width: 480px;
  margin: 0 auto;
  flex-wrap: wrap;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.newsletter-cta input {
  flex: 1;
  min-width: 220px;
  padding: var(--space-3) var(--space-4);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-full);
  font-size: 1rem;
  font-family: var(--font-en);
  background: rgba(255,255,255,0.1);
  color: white;
  transition: border-color var(--transition-fast);
}

.newsletter-cta input::placeholder { color: rgba(255,255,255,0.5); }

.newsletter-cta input:focus {
  outline: none;
  border-color: var(--color-primary-accent);
  background: rgba(255,255,255,0.15);
}

.newsletter-cta .btn-primary {
  background: var(--color-primary-accent);
  color: var(--color-on-primary-accent);
  border: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Breadcrumb */
.breadcrumb {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: var(--space-4) var(--space-5) 0;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.breadcrumb a { color: var(--color-text-secondary); font-weight: 500; }
.breadcrumb a:hover { color: var(--color-primary-accent); }
.breadcrumb .current { color: var(--color-text-muted); font-weight: 400; }

.breadcrumb ol {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

.breadcrumb li { margin: 0; }

.breadcrumb li:not(:last-child)::after {
  content: '>';
  margin-left: var(--space-2);
  color: var(--color-text-muted);
  font-size: 0.75rem;
}

[lang="ar"] .breadcrumb li:not(:last-child)::after {
  content: '<';
  margin-left: 0;
  margin-right: var(--space-2);
}

/* Table of contents */
.toc {
  background: var(--color-surface-light);
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border-light);
  padding: var(--space-5);
  margin-bottom: var(--space-6);
}

.toc h3 {
  font-size: 1.1rem;
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc li { margin-bottom: var(--space-2); }

.toc a {
  color: var(--color-text-secondary);
  font-size: 0.95rem;
  display: block;
  padding: var(--space-2) 0;
  transition: color var(--transition-fast), padding-left var(--transition-fast);
  border-left: 2px solid transparent;
  padding-left: var(--space-3);
}

[lang="ar"] .toc a {
  border-left: none;
  border-right: 2px solid transparent;
  padding-left: 0;
  padding-right: var(--space-3);
}

.toc a:hover {
  color: var(--color-primary-accent);
  border-left-color: var(--color-primary-accent);
  padding-left: var(--space-4);
  text-decoration: none;
}

[lang="ar"] .toc a:hover {
  border-left-color: transparent;
  border-right-color: var(--color-primary-accent);
  padding-left: 0;
  padding-right: var(--space-4);
}

.toc a.sub-item { padding-left: var(--space-6); font-size: 0.9rem; }
[lang="ar"] .toc a.sub-item { padding-left: 0; padding-right: var(--space-6); }

/* Back to top button */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-primary-deep);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  border: none;
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
  pointer-events: none;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

[lang="ar"] .back-to-top {
  right: auto;
  left: 24px;
}

.back-to-top:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

.back-to-top svg {
  width: 24px;
  height: 24px;
}

@media (prefers-reduced-motion: reduce) {
  .back-to-top {
    transition: none;
  }
}

/* Footer */
.site-footer {
  background: var(--color-primary-deep);
  color: #94A3B8;
  padding: var(--space-9) var(--space-5) var(--space-6);
  margin-top: var(--space-8);
}

.footer-inner {
  max-width: var(--max-content);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-7);
}

@media (max-width: 768px) {
  .footer-inner { grid-template-columns: 1fr 1fr; gap: var(--space-6); }
}

@media (max-width: 480px) {
  .footer-inner { grid-template-columns: 1fr; gap: var(--space-5); }
}

.footer-brand .logo-text {
  color: white;
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: var(--space-3);
  display: block;
}

.footer-brand .tagline {
  font-size: 0.9rem;
  opacity: 0.7;
  margin-bottom: var(--space-4);
}

.footer-brand .footer-newsletter {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-4);
  flex-wrap: wrap;
}

.footer-brand .footer-newsletter input {
  flex: 1;
  min-width: 160px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.05);
  color: white;
  font-size: 0.9rem;
}

.footer-brand .footer-newsletter input::placeholder { color: rgba(255,255,255,0.4); }

.footer-brand .footer-newsletter .btn {
  padding: var(--space-2) var(--space-4);
  font-size: 0.85rem;
}

.footer-column .footer-heading {
  color: white;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: var(--space-4);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer-links a {
  color: #94A3B8;
  font-size: 0.9rem;
  transition: color var(--transition-fast);
  text-decoration: none;
}

.footer-links a:hover { color: white; text-decoration: none; }

.footer-bottom {
  max-width: var(--max-content);
  margin: var(--space-7) auto 0;
  padding-top: var(--space-5);
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  font-size: 0.85rem;
}

.footer-bottom .copyright { opacity: 0.6; }

.footer-bottom .social-links {
  display: flex;
  gap: var(--space-3);
}

.footer-bottom .social-links a {
  color: #94A3B8;
  min-width: 32px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  transition: color var(--transition-fast);
  text-decoration: none;
}

.footer-bottom .social-links a:hover { color: white; }

/* Category page */
.category-header {
  background: var(--color-surface-light);
  border-bottom: 1px solid var(--color-border-light);
  padding: var(--space-7) var(--space-5) var(--space-5);
  text-align: center;
}

.category-header h1 {
  font-size: clamp(28px, 5vw, 42px);
  margin-bottom: var(--space-3);
}

.category-header .category-description {
  max-width: 640px;
  margin: 0 auto;
  color: var(--color-text-secondary);
  font-size: 1.05rem;
}

.category-header .article-count {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: var(--space-3);
}

/* Category pills on homepage */
.category-explorer {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 0 var(--space-5) var(--space-5);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: center;
}

.category-tile {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface-light);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: all var(--transition-fast);
  min-width: 140px;
}

.category-tile:hover {
  border-color: var(--color-primary-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  background: var(--color-bg-light);
}

.category-tile .tile-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.category-tile .tile-info .tile-title {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0;
  color: var(--color-text-primary);
}

.category-tile .tile-info span {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
}

/* About page */
.about-page {
  max-width: 800px;
  margin: 0 auto;
  padding: var(--space-6) var(--space-5);
}

.about-page .about-hero {
  text-align: center;
  padding: var(--space-7) 0;
  border-bottom: 1px solid var(--color-border-light);
  margin-bottom: var(--space-6);
}

.about-page .about-hero h1 {
  font-size: clamp(28px, 5vw, 42px);
  margin-bottom: var(--space-4);
}

.about-page .about-hero p {
  font-size: 1.1rem;
  color: var(--color-text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-5);
  margin-top: var(--space-6);
}

.team-card {
  text-align: center;
  padding: var(--space-5);
  background: var(--color-surface-light);
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border-light);
}

.team-card .avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary-accent), #D97706);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 2rem;
  margin: 0 auto var(--space-4);
}

.team-card h4 { font-size: 1.1rem; margin-bottom: var(--space-1); }
.team-card .role { font-size: 0.85rem; color: var(--color-primary-accent); font-weight: 600; margin-bottom: var(--space-2); }
.team-card .bio { font-size: 0.9rem; color: var(--color-text-secondary); line-height: 1.5; }

/* Contact page */
.contact-page {
  max-width: 600px;
  margin: 0 auto;
  padding: var(--space-6) var(--space-5);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-top: var(--space-5);
}

.contact-form label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-primary);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.contact-form input,
.contact-form textarea {
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-family: var(--font-en);
  background: var(--color-surface-light);
  color: var(--color-text-primary);
  transition: border-color var(--transition-fast);
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--color-primary-accent);
  box-shadow: 0 0 0 3px rgba(245,158,11,0.15);
}

.contact-form textarea { min-height: 150px; resize: vertical; }

/* Keyboard Shortcuts Help Modal */
.keyboard-help {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  padding: var(--space-4);
}
.keyboard-help.active { display: flex; }
.keyboard-help-inner {
  background: var(--color-surface-light);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  max-width: 400px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  position: relative;
}
.keyboard-help-inner h3 {
  margin: 0 0 var(--space-4);
  font-size: 1.25rem;
  color: var(--color-text-primary);
}
.keyboard-help-inner ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.keyboard-help-inner li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.95rem;
  color: var(--color-text-secondary);
}
.keyboard-help-inner kbd {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  background: var(--color-bg-light);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--color-text-primary);
  min-width: 32px;
  text-align: center;
}
.keyboard-help-hint {
  margin: var(--space-4) 0 0;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  text-align: center;
}

/* Search Overlay */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}
.search-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
}
.search-container {
  position: relative;
  width: 100%;
  max-width: 600px;
  margin: 0 var(--space-4);
  background: var(--color-surface-light);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}
.search-input {
  width: 100%;
  height: 48px;
  padding: 0 var(--space-4);
  border: none;
  border-bottom: 1px solid var(--color-border-light);
  font-size: 1rem;
  font-family: inherit;
  color: var(--color-text-primary);
  background: transparent;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.search-input:focus-visible {
  border-bottom-color: var(--color-primary-accent);
  box-shadow: inset 0 0 0 3px rgba(245,158,11,0.15);
}
.search-input::placeholder {
  color: var(--color-text-muted);
}
.search-results {
  max-height: 50vh;
  overflow-y: auto;
}
.search-result-item {
  display: block;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border-light);
  text-decoration: none;
  color: var(--color-text-primary);
  transition: background var(--transition-fast);
}
.search-result-item:hover,
.search-result-item:focus {
  background: var(--color-bg-light);
}
.search-result-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 2px;
}
.search-result-meta {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.search-empty-state {
  padding: var(--space-6) var(--space-4);
  text-align: center;
  color: var(--color-text-secondary);
  font-size: 0.95rem;
}

/* Search Enhancements */
.search-input-wrapper {
  position: relative;
}
.search-clear-btn {
  position: absolute;
  right: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.25rem;
  color: var(--color-text-muted);
  padding: 0;
  line-height: 1;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast);
}
.search-clear-btn:hover { color: var(--color-text-primary); }
[lang="ar"] .search-clear-btn { right: auto; left: var(--space-4); }

.search-highlight {
  background: rgba(245,158,11,0.3);
  color: inherit;
  font-weight: 600;
  padding: 0 2px;
  border-radius: 2px;
}

.search-result-item.selected {
  border-left: 3px solid var(--color-primary-accent);
  background: var(--color-surface-light);
}
[lang="ar"] .search-result-item.selected {
  border-left: none;
  border-right: 3px solid var(--color-primary-accent);
}

.search-result-title-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: 2px;
}
.search-result-title {
  font-weight: 600;
  font-size: 0.95rem;
  flex: 1;
}
.search-result-meta-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-1);
}
.search-result-excerpt {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  line-height: 1.45;
}

.search-lang-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--color-bg-light);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border-light);
  flex-shrink: 0;
}

.search-count {
  padding: var(--space-2) var(--space-4);
  font-size: 0.8rem;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border-light);
}

.search-loading {
  padding: var(--space-6) var(--space-4);
  text-align: center;
  color: var(--color-text-secondary);
  font-size: 0.95rem;
}
.search-loading-dots::after {
  content: '...';
  animation: searchDots 1.5s steps(4, end) infinite;
}
@keyframes searchDots {
  0% { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75% { content: '...'; }
  100% { content: ''; }
}

.search-recent-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  font-size: 0.8rem;
  color: var(--color-text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.search-clear-recent {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.75rem;
  color: var(--color-primary-accent);
  font-weight: 600;
  padding: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.search-clear-recent:hover { text-decoration: underline; }

.search-recent-chip,
.search-suggestion {
  display: inline-block;
  padding: var(--space-2) var(--space-3);
  background: var(--color-bg-light);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  margin: 2px;
  font-family: inherit;
}
.search-recent-chip:hover,
.search-suggestion:hover {
  border-color: var(--color-primary-accent);
  color: var(--color-primary-accent);
  transform: translateY(-1px);
}

.search-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: center;
  margin-top: var(--space-3);
}

/* Responsive */
@media (max-width: 900px) {
  .main-nav { display: none; }
  .mobile-menu-btn { display: block; }
  .header-inner { padding: 0 var(--space-4); }
  .article-page { padding: var(--space-5) var(--space-4); }
  .content-section { padding: var(--space-5) var(--space-4); }
  .hero-section { padding: var(--space-7) var(--space-4) var(--space-5); }
  .section-header { padding: var(--space-6) var(--space-4) var(--space-4); }
  .site-footer { padding: var(--space-7) var(--space-4) var(--space-5); }
  .breadcrumb { padding: var(--space-3) var(--space-4) 0; }
  .category-header { padding: var(--space-6) var(--space-4) var(--space-4); }
  .author-bio { flex-direction: column; text-align: center; }
  .author-bio .avatar { margin: 0 auto; }
  .share-bar { justify-content: center; }
  .related-articles .related-grid { grid-template-columns: 1fr; }
  .newsletter-signup { flex-direction: column; align-items: stretch; }
  .newsletter-signup input { width: 100%; }
  .newsletter-cta .signup-form { flex-direction: column; align-items: stretch; }
  .newsletter-cta .signup-form input { width: 100%; }
  .footer-brand .footer-newsletter { flex-direction: column; }
  .toc { margin: 0 calc(-1 * var(--space-4)) var(--space-5); border-radius: 0; border-left: none; border-right: none; }
  .header-controls .search-toggle { display: none; }
  .lang-switch { padding: var(--space-2); font-size: 0.75rem; }
}

@media (max-width: 480px) {
  .article-grid { grid-template-columns: 1fr; }
  .hero-title { font-size: 28px; }
  .hero-subtitle { font-size: 15px; }
  .article-header h1 { font-size: 24px; }
  .footer-inner { grid-template-columns: 1fr; }
  .team-grid { grid-template-columns: 1fr; }
  .category-explorer { flex-direction: column; align-items: stretch; }
  .category-tile { width: 100%; }
  .footer-bottom { flex-direction: column; text-align: center; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* Focus styles */
:focus-visible {
  outline: 2px solid var(--color-primary-accent);
  outline-offset: 2px;
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--color-bg-light); }
::-webkit-scrollbar-thumb { background: var(--color-border-light); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-text-muted); }

/* Selection */
::selection { background: rgba(245,158,11,0.2); color: var(--color-text-primary); }
/* Newsletter capture is intentionally hidden until a consent-aware provider is connected. */


/* ============================================
   Print Styles — Professional Print Experience
   ============================================ */

@media print {
  /* (1) Hide non-essential elements */
  .site-header,
  .site-footer,
  .share-bar,
  .newsletter-cta,
  .related-articles,
  .language-switcher,
  .dark-mode-toggle,
  .back-to-top,
  .scroll-progress,
  .toc-sidebar,
  .mobile-menu-btn,
  .theme-toggle,
  .lang-switch,
  .toast-container,
  .mobile-nav-overlay,
  .mobile-nav,
  .skip-link,
  .hero-section::before,
  .hero-section::after {
    display: none !important;
  }

  /* (2) Expand FAQ accordions */
  .faq-answer {
    display: block !important;
  }
  .faq-toggle,
  .faq-toggle svg,
  .faq-toggle .icon,
  .faq-toggle .chevron,
  .faq-toggle .arrow {
    display: none !important;
  }

  /* (3) Show URLs after links (except internal anchors) */
  a[href]::after {
    content: ' (' attr(href) ')';
    font-size: 10px;
    color: #666;
  }
  a[href^='#']::after,
  a[href^='javascript']::after {
    content: none !important;
  }

  /* (4) Optimize typography for print */
  body {
    font-size: 12pt;
    line-height: 1.5;
    color: #000;
    background: #fff;
  }

  h1 {
    font-size: 18pt;
    page-break-after: avoid;
  }

  h2 {
    font-size: 14pt;
    page-break-after: avoid;
  }

  h3 {
    font-size: 12pt;
    page-break-after: avoid;
  }

  p {
    orphans: 3;
    widows: 3;
  }

  img {
    max-width: 100%;
    page-break-inside: avoid;
  }

  table {
    page-break-inside: avoid;
  }

  pre,
  blockquote {
    page-break-inside: avoid;
    border-left: 2px solid #ccc;
    padding-left: 10px;
  }

  /* (5) Page breaks */
  .article-body h2 {
    page-break-before: auto;
  }

  .article-body p,
  .article-body ul,
  .article-body ol,
  .article-body li {
    page-break-inside: avoid;
  }

  /* (6) Header/footer — print header with article title and URL */
  @page {
    margin: 1cm 1.5cm;
  }

  @page {
    @top-center {
      content: string(doctitle);
      font-size: 9pt;
      color: #666;
    }
  }

  /* Fallback/simple print header for browsers without @page support */
  .article-header::before {
    content: attr(data-title) ' — ' attr(data-url);
    display: block;
    font-size: 9pt;
    color: #666;
    border-bottom: 1px solid #ccc;
    padding-bottom: 8px;
    margin-bottom: 12px;
    page-break-after: avoid;
  }

  /* (7) Featured image: constrain for print layout */
  .featured-image {
    max-width: 400px;
    float: right;
    margin-left: 20px;
    margin-bottom: 12px;
  }

  /* (8) Author bio: show at bottom with border-top */
  .author-bio,
  .article-meta .author,
  .author-info {
    display: block !important;
    border-top: 1px solid #ccc;
    padding-top: 12px;
    margin-top: 24px;
    page-break-inside: avoid;
  }

  /* Reset backgrounds and shadows for print */
  *,
  *::before,
  *::after {
    background: transparent !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  /* Ensure article page uses full width */
  .article-page {
    max-width: 100%;
    padding: 0;
    margin: 0;
  }

  /* Ensure links are visible in print */
  a {
    color: #000;
    text-decoration: underline;
  }

  /* Hide skeleton and animation-related elements */
  .skeleton,
  .reveal,
  .reveal-delay-1,
  .reveal-delay-2,
  .reveal-delay-3,
  .reveal-delay-4,
  .reveal-delay-5 {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
  }
}

/* ============================================
   Explore index — homepage listing (Direction B)
   Rows, not tiles: the headline does the work and the thumbnail is an aid.
   Written with logical properties, so RTL needs no mirrored overrides.
   ============================================ */
.index-list {
  max-width: var(--max-content);
  margin-inline: auto;
  padding-inline: var(--space-5);
}

.index-row {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  gap: var(--space-5);
  align-items: start;
  padding-block: var(--space-5);
  border-block-start: 1px solid var(--color-border-light);
  color: inherit;
  text-decoration: none;
  transition: background var(--transition-fast);
}

.index-row:hover {
  background: var(--color-surface-light);
  text-decoration: none;
}

.index-thumb {
  inline-size: 96px;
  block-size: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-light);
}

.index-main {
  display: grid;
  gap: var(--space-2);
  min-inline-size: 0;
}

.index-eyebrow {
  font-size: var(--t-label);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cat, var(--color-primary-accent));
}

/* Arabic takes no tracking and does not uppercase. */
[lang="ar"] .index-eyebrow {
  letter-spacing: 0;
  text-transform: none;
}

.index-title {
  font-family: var(--font-en);
  font-size: var(--t-h3);
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-text-primary);
}

[lang="ar"] .index-title { font-family: var(--font-ar); line-height: 1.45; }

[data-theme="dark"] .index-title { color: #F8FAFC; }

.index-excerpt {
  font-size: var(--t-small);
  color: var(--color-text-secondary);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.index-meta {
  display: grid;
  gap: var(--space-1);
  justify-items: end;
  font-size: var(--t-caption);
  color: var(--color-text-muted);
  white-space: nowrap;
}

.index-count {
  font-size: var(--t-caption);
  color: var(--color-text-muted);
  font-weight: 500;
}

@media (max-width: 640px) {
  .index-list { padding-inline: var(--space-4); }
  .index-row {
    grid-template-columns: 72px 1fr;
    gap: var(--space-4);
    padding-block: var(--space-4);
  }
  .index-thumb { inline-size: 72px; }
  .index-meta {
    grid-column: 2;
    grid-auto-flow: column;
    justify-content: start;
    justify-items: start;
    gap: var(--space-3);
  }
}
