/**
 * Al-Raya News Platform - Main Stylesheet
 * Modern, Ultra-responsive, Dark/Light Mode, RTL & LTR Support
 */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800;900&family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --font-arabic: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-latin: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Light Theme Colors */
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-elevated: #ffffff;
  --bg-subtle: #f1f5f9;
  --border-color: #e2e8f0;
  --border-subtle: #f1f5f9;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  --primary: #dc2626;
  /* Al-Raya Signature Crimson */
  --primary-hover: #b91c1c;
  --primary-soft: rgba(220, 38, 38, 0.1);
  --accent: #0284c7;
  --accent-gold: #d97706;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.08);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Theme Variables */
[data-theme="dark"] {
  --bg-body: #090d16;
  --bg-card: #111827;
  --bg-card-hover: #1f2937;
  --bg-elevated: #1a2234;
  --bg-subtle: #162032;
  --border-color: #1f293d;
  --border-subtle: #1a2234;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-light: #64748b;

  --primary: #ef4444;
  --primary-hover: #dc2626;
  --primary-soft: rgba(239, 68, 68, 0.18);

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.6);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.7);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-arabic);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body[dir="ltr"] {
  font-family: var(--font-latin);
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

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

button,
input,
select,
textarea {
  font-family: inherit;
  border: none;
  outline: none;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header & Top Bar */
.top-bar {
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  font-size: 0.85rem;
  padding: 0.45rem 0;
  color: var(--text-muted);
}

.top-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.top-meta {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.top-date,
.top-weather {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.social-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.social-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  color: #ffffff;
  font-size: 0.92rem;
  background-color: var(--primary);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.social-icon-btn:hover {
  transform: translateY(-2px) scale(1.1);
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.22);
  filter: brightness(1.12);
  color: #ffffff;
}

/* Individual Brand Colors */
.social-icon-btn.social-facebook,
.social-icon-btn:has(.fa-facebook-f),
.social-icon-btn[title*="Facebook"] {
  background-color: #1877f2;
}

.social-icon-btn.social-twitter,
.social-icon-btn:has(.fa-x-twitter),
.social-icon-btn[title*="Twitter"],
.social-icon-btn[title*="X"] {
  background-color: #0f1419;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.social-icon-btn.social-whatsapp,
.social-icon-btn:has(.fa-whatsapp),
.social-icon-btn[title*="WhatsApp"] {
  background-color: #25d366;
}

.social-icon-btn.social-telegram,
.social-icon-btn:has(.fa-telegram),
.social-icon-btn[title*="Telegram"] {
  background-color: #229ed9;
}

.social-icon-btn.social-instagram,
.social-icon-btn:has(.fa-instagram),
.social-icon-btn[title*="Instagram"] {
  background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285aeb 90%);
}

.social-icon-btn.social-youtube,
.social-icon-btn:has(.fa-youtube),
.social-icon-btn[title*="YouTube"] {
  background-color: #ff0000;
}

.social-icon-btn.social-linkedin,
.social-icon-btn:has(.fa-linkedin-in),
.social-icon-btn[title*="LinkedIn"] {
  background-color: #0a66c2;
}

/* Dark Mode Tweaks for Twitter */
[data-theme="dark"] .social-icon-btn.social-twitter,
[data-theme="dark"] .social-icon-btn:has(.fa-x-twitter),
[data-theme="dark"] .social-icon-btn[title*="Twitter"],
[data-theme="dark"] .social-icon-btn[title*="X"] {
  background-color: #1e293b;
  border-color: rgba(255, 255, 255, 0.35);
}

.theme-toggle-btn,
.lang-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-subtle);
  color: var(--text-main);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  transition: var(--transition);
}

.theme-toggle-btn:hover,
.lang-toggle-btn:hover {
  background-color: var(--border-color);
}

/* Distinct Theme Mode Switcher */
#themeToggleBtn {
  width: 35px;
  height: 35px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  cursor: pointer;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: #facc15;
  border: 1.5px solid rgba(250, 204, 21, 0.35);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.25);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  flex-shrink: 0;
}

#themeToggleBtn:hover {
  transform: translateY(-2px) rotate(15deg) scale(1.08);
  box-shadow: 0 4px 14px rgba(250, 204, 21, 0.45);
  background: linear-gradient(135deg, #0f172a 0%, #020617 100%);
  color: #fde047;
}

[data-theme="dark"] #themeToggleBtn {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #d97706;
  border: 1.5px solid rgba(217, 119, 6, 0.4);
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.35);
}

[data-theme="dark"] #themeToggleBtn:hover {
  transform: translateY(-2px) rotate(20deg) scale(1.08);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.6);
  background: linear-gradient(135deg, #ffffff 0%, #fef08a 100%);
  color: #b45309;
}

#themeToggleBtn:active {
  transform: scale(0.92);
}

/* Main Header */
.main-header {
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 1.2rem 0;
  position: relative;
}

.main-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
}

.site-logo-img {
  height: 52px;
  width: auto;
  max-width: 170px;
  object-fit: contain;
  display: block;
  transition: transform 0.25s ease;
}

.brand-logo:hover .site-logo-img {
  transform: scale(1.03);
}

.site-logo-img.logo-dark {
  display: none !important;
}

.site-logo-img.logo-light {
  display: block !important;
}

[data-theme="dark"] .site-logo-img.logo-light {
  display: none !important;
}

[data-theme="dark"] .site-logo-img.logo-dark {
  display: block !important;
}

.brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.brand-name {
  font-size: 1.65rem;
  font-weight: 900;
  line-height: 1.15;
  color: #0f172a;
  letter-spacing: -0.5px;
  margin: 0;
}

[data-theme="dark"] .brand-name {
  color: #f8fafc;
}

.brand-name span {
  color: var(--primary);
}

.brand-tagline {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 3px;
  white-space: nowrap;
}

.header-search-bar {
  flex: 1;
  max-width: 460px;
  margin: 0 2rem 0 0;
  position: relative;
}

.header-search-form {
  display: flex;
  align-items: center;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 0.25rem 0.5rem 0.25rem 1rem;
  transition: var(--transition);
}

.header-search-form:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.header-search-input {
  width: 100%;
  background: transparent;
  padding: 0.4rem 0.5rem;
  font-size: 0.9rem;
  color: var(--text-main);
}

.header-search-btn {
  background: var(--primary);
  color: #ffffff;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.header-search-btn:hover {
  background: var(--primary-hover);
}

/* Navigation Bar */
.main-navbar {
  background-color: var(--bg-elevated);
  border-bottom: 2px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-links {
  display: flex;
  align-items: center;
  list-style: none;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

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

.nav-item a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.85rem 1.1rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  border-bottom: 3px solid transparent;
  position: relative;
}

.nav-item a:hover,
.nav-item.active a {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.nav-item-icon {
  font-size: 0.9rem;
  opacity: 0.8;
}

.mobile-menu-toggle {
  display: none;
  background: transparent;
  font-size: 1.4rem;
  color: var(--text-main);
  cursor: pointer;
  padding: 0.5rem;
}

/* Breaking News Ticker (شريط الأخبار العاجلة) */
.breaking-ticker-wrap {
  background: linear-gradient(90deg, #b91c1c, #dc2626);
  color: #ffffff;
  display: flex;
  align-items: center;
  overflow: hidden;
  box-shadow: inset 0 -1px 3px rgba(0, 0, 0, 0.15);
}

.breaking-badge {
  background-color: #991b1b;
  padding: 0.5rem 1.25rem;
  font-weight: 900;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  z-index: 2;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
}

.pulse-dot {
  width: 10px;
  height: 10px;
  background-color: #ffffff;
  border-radius: var(--radius-full);
  animation: pulse-ring 1.5s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

@keyframes pulse-ring {
  0% {
    transform: scale(0.9);
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
  }

  70% {
    transform: scale(1.1);
    box-shadow: 0 0 0 8px rgba(255, 255, 255, 0);
  }

  100% {
    transform: scale(0.9);
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  }
}

.ticker-marquee {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
  padding: 0.5rem 0;
}

.ticker-track {
  display: inline-block;
  white-space: nowrap;
  animation: ticker-slide 30s linear infinite;
}

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

@keyframes ticker-slide {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-50%);
  }
}

[dir="rtl"] .ticker-track {
  animation-name: ticker-slide-rtl;
}

@keyframes ticker-slide-rtl {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(50%);
  }
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #ffffff;
}

.ticker-item:hover {
  text-decoration: underline;
}

.ticker-bullet {
  opacity: 0.7;
}

/* Hero Section / Slider */
.hero-section {
  padding: 1.5rem 0 1rem;
}

.slider-container {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background-color: #0b0f19;
  /* Dark background to prevent any white gap */
  box-shadow: var(--shadow-lg);
  height: 500px;
  /* Fixed cinematic height */
}

.slider-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.6s ease;
  display: flex;
  align-items: flex-end;
  z-index: 1;
}

.slider-slide.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 2;
}

.slide-img-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.slide-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 6s ease;
}

.slider-slide.active .slide-img {
  transform: scale(1.04);
}

.slide-gradient {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.15) 0%, rgba(0, 0, 0, 0.5) 45%, rgba(0, 0, 0, 0.92) 100%);
  z-index: 2;
}

.slide-content {
  position: relative;
  z-index: 3;
  padding: 3rem 2.5rem 2.5rem;
  max-width: 850px;
  width: 100%;
  color: #ffffff;
}

.slide-category-badge {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  margin-bottom: 0.85rem;
  color: #ffffff;
}

.slide-title {
  font-size: 2.1rem;
  font-weight: 900;
  line-height: 1.25;
  margin-bottom: 0.85rem;
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

.slide-summary {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 1.2rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.slide-meta {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.85);
}

.slide-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.slider-controls {
  position: absolute;
  bottom: 2rem;
  inset-inline-end: 2.5rem;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.slider-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(10px);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  font-size: 1.05rem;
}

.slider-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  transform: scale(1.08);
}

.slider-dots {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-inline-end: 0.75rem;
}

.slider-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.45);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: var(--transition);
}

.slider-dot.active {
  width: 26px;
  background: var(--primary);
}

/* Layout Grids */
.main-content-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2rem;
  margin-bottom: 3rem;
}

/* Section Header */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  position: relative;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--border-color);
}

.section-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  position: relative;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -0.85rem;
  inset-inline-start: 0;
  width: 50px;
  height: 3px;
  background-color: var(--primary);
  border-radius: var(--radius-full);
}

.section-more-link {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.section-more-link:hover {
  text-decoration: underline;
}

/* News Cards Grid */
.news-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.news-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.news-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(220, 38, 38, 0.3);
}

.news-card-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background-color: var(--bg-subtle);
}

.news-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.news-card:hover .news-card-img {
  transform: scale(1.06);
}

.card-category-badge {
  position: absolute;
  top: 0.75rem;
  inset-inline-start: 0.75rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.card-breaking-tag {
  position: absolute;
  top: 0.75rem;
  inset-inline-end: 0.75rem;
  background-color: #dc2626;
  color: #ffffff;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 800;
}

.news-card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.card-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.news-card-title {
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.4;
  margin-bottom: 0.6rem;
  color: var(--text-main);
  transition: var(--transition);
}

.news-card:hover .news-card-title {
  color: var(--primary);
}

.news-card-summary {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.news-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.82rem;
}

.card-read-more {
  color: var(--primary);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.card-read-more:hover {
  text-decoration: underline;
}

/* Sidebar Widgets */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.sidebar-widget {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.widget-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 1.25rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--border-color);
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.widget-title::after {
  content: '';
  position: absolute;
  bottom: -2px;
  inset-inline-start: 0;
  width: 40px;
  height: 2px;
  background-color: var(--primary);
}

/* Trending / Most Read List */
.trending-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.trending-item {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

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

.trending-rank {
  font-size: 1.5rem;
  font-weight: 900;
  line-height: 1;
  color: var(--primary);
  opacity: 0.85;
  min-width: 32px;
}

.trending-content {
  flex: 1;
}

.trending-title {
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 0.35rem;
  color: var(--text-main);
  transition: var(--transition);
}

.trending-item:hover .trending-title {
  color: var(--primary);
}

.trending-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Category Badges Cloud */
.category-badges-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cat-badge-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  transition: var(--transition);
}

.cat-badge-item:hover {
  background-color: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* Article Details Page (صفحة قراءة الخبر) */
.article-page-wrap {
  padding: 2rem 0;
}

.article-header {
  margin-bottom: 1.75rem;
}

.article-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.article-breadcrumbs a:hover {
  color: var(--primary);
}

.article-main-title {
  font-size: 2.25rem;
  font-weight: 900;
  line-height: 1.3;
  margin-bottom: 1.25rem;
  color: var(--text-main);
}

.article-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.article-author-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.author-avatar-img {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background-color: var(--primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.article-utility-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.font-size-controls {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background-color: var(--bg-subtle);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
}

.font-btn {
  background: transparent;
  color: var(--text-main);
  padding: 0.2rem 0.45rem;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.font-btn:hover {
  background-color: var(--border-color);
  color: var(--primary);
}

.tts-speech-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-subtle);
  color: var(--text-main);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.tts-speech-btn:hover,
.tts-speech-btn.playing {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.article-hero-image-wrap {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-md);
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
}

.article-hero-image {
  width: 100%;
  height: auto;
  max-height: 600px;
  object-fit: contain;
  display: block;
}

.article-body-content {
  font-size: 1.15rem;
  line-height: 1.85;
  color: var(--text-main);
  margin-bottom: 2.5rem;
}

.article-body-content p {
  margin-bottom: 1.5rem;
}

.article-body-content h2,
.article-body-content h3 {
  margin: 2rem 0 1rem;
  font-weight: 800;
}

/* Social Share Bar */
.share-section-wrap {
  margin: 2rem 0;
  padding: 1.25rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.share-label {
  font-weight: 800;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-main);
}

.share-buttons {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 700;
  transition: var(--transition);
  cursor: pointer;
}

.share-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.share-facebook {
  background-color: #1877f2;
}

.share-twitter {
  background-color: #000000;
}

.share-whatsapp {
  background-color: #25d366;
}

.share-telegram {
  background-color: #0088cc;
}

.share-linkedin {
  background-color: #0a66c2;
}

.share-copy {
  background-color: #475569;
}

/* Toast Notification */
.toast-notice {
  position: fixed;
  bottom: 2rem;
  inset-inline-end: 2rem;
  background-color: #0f172a;
  color: #ffffff;
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 1000;
  transform: translateY(100px);
  opacity: 0;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toast-notice.show {
  transform: translateY(0);
  opacity: 1;
}

/* Footer */
.main-footer {
  background-color: #090d16;
  color: #cbd5e1;
  border-top: 4px solid var(--primary);
  margin-top: auto;
  padding-top: 3.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 2.5rem;
  padding-bottom: 2.5rem;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-logo-img {
  height: 52px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
  display: block;
  transition: transform 0.25s ease;
}

.footer-logo-img:hover {
  transform: scale(1.03);
}

/* Default on black/dark background: show white logo */
.footer-logo-dark {
  display: block !important;
}

.footer-logo-light {
  display: none !important;
}

/* When footer has white/light background: show dark logo */
.main-footer.footer-light .footer-logo-dark,
[data-footer-theme="light"] .footer-logo-dark,
.footer-light-bg .footer-logo-dark {
  display: none !important;
}

.main-footer.footer-light .footer-logo-light,
[data-footer-theme="light"] .footer-logo-light,
.footer-light-bg .footer-logo-light {
  display: block !important;
}

.footer-desc {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #94a3b8;
}

.footer-heading {
  font-size: 1.1rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 1.2rem;
  position: relative;
  padding-bottom: 0.5rem;
}

.footer-heading::after {
  content: '';
  position: absolute;
  bottom: 0;
  inset-inline-start: 0;
  width: 32px;
  height: 2px;
  background-color: var(--primary);
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-links a {
  font-size: 0.9rem;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.footer-links a:hover {
  color: #ffffff;
  transform: translateX(-4px);
}

[dir="ltr"] .footer-links a:hover {
  transform: translateX(4px);
}

.footer-bottom {
  background-color: #04070e;
  border-top: 1px solid #1a2234;
  padding: 1.25rem 0;
  font-size: 0.85rem;
  color: #64748b;
  text-align: center;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 2.5rem 0;
  max-width: 100%;
}

.page-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 0.75rem;
  border-radius: var(--radius-sm);
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-weight: 700;
  font-size: 0.9rem;
  transition: var(--transition);
}

.page-item:hover:not(.disabled):not(.ellipsis),
.page-item.active {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.page-item.ellipsis {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: default;
}

.page-item.disabled {
  opacity: 0.45;
  pointer-events: none;
  cursor: not-allowed;
}

/* Responsive Media Queries */
@media (max-width: 1024px) {
  .main-content-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 768px) {
  .top-bar-inner {
    justify-content: center;
  }

  .main-header-inner {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .site-logo-img {
    height: 38px;
    max-width: 130px;
  }

  .brand-name {
    font-size: 1.35rem;
  }

  .brand-tagline {
    font-size: 0.68rem;
  }

  .header-search-bar {
    order: 3;
    max-width: 100%;
    margin: 0;
    width: 100%;
  }

  .mobile-menu-toggle {
    display: block;
  }

  .nav-links {
    display: none;
  }

  .nav-links.mobile-open {
    display: flex;
    flex-direction: column;
    width: 100%;
    background-color: var(--bg-card);
    padding: 1rem 0;
  }

  .slider-container {
    height: 420px;
  }

  .slide-content {
    padding: 1.5rem;
    padding-bottom: 4.5rem;
  }

  .slider-controls {
    bottom: 1.25rem;
    inset-inline-end: 1.25rem;
  }

  .slide-title {
    font-size: 1.4rem;
  }

  .article-main-title {
    font-size: 1.6rem;
  }

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

/* ==========================================================================
   Media Team Component (الكوادر الإعلامية)
   ========================================================================== */
.team-hero-section {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.04) 0%, rgba(38, 30, 98, 0.06) 100%);
  border-bottom: 1px solid var(--border-color);
  padding: 3rem 0 2.5rem;
  margin-bottom: 2.5rem;
  position: relative;
  overflow: hidden;
}

[data-theme="dark"] .team-hero-section {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.08) 0%, rgba(15, 23, 42, 0.6) 100%);
}

.team-hero-header {
  text-align: center;
  max-width: 760px;
  margin: 0 auto;
}

.team-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(220, 38, 38, 0.1);
  color: var(--primary);
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 1rem;
  border: 1px solid rgba(220, 38, 38, 0.2);
}

.team-hero-title {
  font-size: 2.25rem;
  font-weight: 900;
  color: var(--text-main);
  margin-bottom: 0.75rem;
  line-height: 1.25;
}

.team-hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  margin-bottom: 3.5rem;
}

.team-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  text-align: center;
  position: relative;
}

.team-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.1);
  border-color: rgba(220, 38, 38, 0.35);
}

[data-theme="dark"] .team-card:hover {
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.4);
}

.team-card-header-bar {
  height: 95px;
  background: linear-gradient(135deg, var(--primary) 0%, #1e1b4b 100%);
  position: relative;
}

.team-card-avatar-wrap {
  position: relative;
  margin-top: -70px;
  margin-bottom: 1.25rem;
  display: inline-block;
}

.team-card-avatar {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  border: 5px solid var(--bg-card);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
  background-color: var(--bg-card);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.35s ease;
  display: inline-block;
}

.team-card:hover .team-card-avatar {
  transform: scale(1.06);
  box-shadow: 0 14px 30px rgba(220, 38, 38, 0.25);
}

.team-card-body {
  padding: 0 1.5rem 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.team-card-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.team-card-role {
  display: inline-block;
  background: rgba(220, 38, 38, 0.08);
  color: var(--primary);
  padding: 0.3rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.85rem;
  border: 1px solid rgba(220, 38, 38, 0.15);
}

.team-card-bio {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.team-card-socials {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

.team-social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #ffffff !important;
  font-size: 1.05rem;
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.team-social-btn.facebook {
  background-color: #1877f2;
}

.team-social-btn.instagram {
  background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285aeb 90%);
}

.team-social-btn.twitter {
  background-color: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.team-social-btn:hover {
  transform: translateY(-3px) scale(1.12);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
  filter: brightness(1.12);
}

/* =============================================================
   Animated Logo Loading Frame (Preloader)
   ============================================================= */
.site-preloader {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, #ffffff 0%, #f8fafc 55%, #e2e8f0 100%);
  opacity: 1;
  visibility: visible;
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.5s ease;
  overflow: hidden;
  user-select: none;
}

[data-theme="dark"] .site-preloader {
  background: radial-gradient(circle at center, #111827 0%, #090d16 65%, #030712 100%);
}

.site-preloader.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1.35rem;
  animation: preloader-fade-in 0.45s ease-out;
}

.preloader-frame-wrapper {
  position: relative;
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Outer Orbiting Glow Ring */
.preloader-orbit-ring {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2.5px solid transparent;
  border-top-color: #dc2626;
  border-right-color: #f59e0b;
  border-bottom-color: rgba(220, 38, 38, 0.2);
  animation: preloader-spin 1.8s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
  box-shadow: 0 0 25px rgba(220, 38, 38, 0.28);
}

/* Pulse Halo Effect */
.preloader-pulse-glow {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(220, 38, 38, 0.35) 0%, rgba(220, 38, 38, 0) 70%);
  animation: preloader-pulse 2s ease-in-out infinite;
}

/* Center Logo Badge Frame */
.preloader-logo-frame {
  width: 110px;
  height: 110px;
  border-radius: 26px;
  background: #ffffff;
  border: 1.5px solid rgba(220, 38, 38, 0.18);
  box-shadow: 0 12px 30px -5px rgba(220, 38, 38, 0.22), 0 4px 12px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  position: relative;
  z-index: 2;
  animation: preloader-float 2.4s ease-in-out infinite;
}

[data-theme="dark"] .preloader-logo-frame {
  background: #1e293b;
  border-color: rgba(220, 38, 38, 0.35);
  box-shadow: 0 12px 35px -5px rgba(220, 38, 38, 0.35), 0 0 25px rgba(0, 0, 0, 0.5);
}

.preloader-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(220, 38, 38, 0.25));
  transition: transform 0.2s ease;
}

.site-preloader .logo-dark {
  display: none;
}
.site-preloader .logo-light {
  display: block;
}
[data-theme="dark"] .site-preloader .logo-dark {
  display: block;
}
[data-theme="dark"] .site-preloader .logo-light {
  display: none;
}

/* Brand Typography */
.preloader-brand {
  margin-top: 0.25rem;
}

.preloader-title {
  font-family: var(--font-arabic);
  font-size: 1.55rem;
  font-weight: 900;
  color: #0f172a;
  margin: 0;
  letter-spacing: -0.5px;
}

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

.preloader-tagline {
  font-family: var(--font-arabic);
  font-size: 0.85rem;
  color: #64748b;
  font-weight: 600;
  display: block;
  margin-top: 0.25rem;
  letter-spacing: 0.2px;
}

[data-theme="dark"] .preloader-tagline {
  color: #94a3b8;
}

/* Animated Progress Track */
.preloader-progress-track {
  width: 170px;
  height: 4px;
  background: rgba(226, 232, 240, 0.9);
  border-radius: 99px;
  overflow: hidden;
  position: relative;
  margin-top: 0.35rem;
}

[data-theme="dark"] .preloader-progress-track {
  background: rgba(30, 41, 59, 0.9);
}

.preloader-progress-bar {
  position: absolute;
  height: 100%;
  width: 45%;
  border-radius: 99px;
  background: linear-gradient(90deg, #dc2626, #ef4444, #f59e0b);
  box-shadow: 0 0 10px rgba(220, 38, 38, 0.6);
  animation: preloader-progress-anim 1.5s ease-in-out infinite;
}

/* Preloader Keyframe Animations */
@keyframes preloader-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes preloader-pulse {
  0%, 100% {
    transform: scale(0.92);
    opacity: 0.35;
  }
  50% {
    transform: scale(1.18);
    opacity: 0.9;
  }
}

@keyframes preloader-float {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-5px) scale(1.03);
  }
}

@keyframes preloader-progress-anim {
  0% {
    left: -45%;
    width: 40%;
  }
  50% {
    width: 65%;
  }
  100% {
    left: 105%;
    width: 40%;
  }
}

@keyframes preloader-fade-in {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .preloader-orbit-ring,
  .preloader-pulse-glow,
  .preloader-logo-frame,
  .preloader-progress-bar {
    animation: none !important;
  }
}