/**
 * Atlaseco - Main Stylesheet
 * High-performance Arabic RTL Digital Newspaper Design
 * Inspired by Al Eqtisadiah (aleqt.com)
 */

/* ==========================================================================
   1. CSS Reset & Box Sizing
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  font-size: 16px;
}

/* ==========================================================================
   2. Design Tokens (CSS Custom Properties) - Atlas Economiste Redesign
   ========================================================================== */
:root {
  /* Brand Editorial Colors - Atlas Economiste Crimson Palette */
  --primary: #b31d1d;          /* Deep Crimson Red sampled from Atlas Economiste */
  --primary-hover: #981919;    /* Darker Crimson for active/hover */
  --primary-dark: #7a1212;     /* Header border & dark accents */
  --primary-light: #fbebeb;
  --header-bg: #b31d1d;        /* Solid Crimson Red Header */
  --header-active: #981919;    /* Active menu button pill */
  --accent-red: #d21818;
  --accent-green: #0a8754;

  /* Button / Section Title Pill Tokens (Sampled from Reference Image) */
  --pill-bg: #f2f3f5;
  --pill-text: #141718;
  --pill-bar: #d21818;

  /* Light Theme (Default) */
  --bg-page: #f5f5f5;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #fbfbfb;
  --bg-subtle: #f0f2f3;
  --text-main: #141718;
  --text-secondary: #3c4246;
  --text-muted: #6b7278;
  --border-subtle: #e5e8ea;
  --border-strong: #c2c8cc;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.07);

  /* Typography */
  --font-arabic: 'Readex Pro', 'Cairo', 'IBM Plex Sans Arabic', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-editorial: 'Readex Pro', 'Cairo', sans-serif;
  --font-mono: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  /* Font Scale */
  --text-xs: 0.75rem;     /* 12px */
  --text-sm: 0.84375rem;  /* 13.5px */
  --text-base: 0.9375rem; /* 15px */
  --text-md: 1.0625rem;   /* 17px */
  --text-lg: 1.25rem;     /* 20px */
  --text-xl: 1.5rem;      /* 24px */
  --text-2xl: clamp(1.6rem, 2.5vw, 2.1rem);
  --text-3xl: clamp(2rem, 3.5vw, 2.75rem);
  --text-hero: clamp(2.2rem, 4.2vw, 3.25rem);

  /* Line Heights */
  --lh-tight: 1.25;
  --lh-heading: 1.35;
  --lh-body: 1.7;

  /* Layout Metrics */
  --container-max: 1312px;
  --container-padding: 1rem;
  --header-height: 70px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Theme Variables */
html[data-theme="dark"] {
  --header-bg: #801212;
  --header-active: #640c0c;
  --pill-bg: #232729;
  --pill-text: #f5f5f5;
  --pill-bar: #d21818;
  --bg-page: #0f1112;
  --bg-surface: #1a1d1e;
  --bg-surface-elevated: #232628;
  --bg-subtle: #272b2d;
  --text-main: #f5f5f5;
  --text-secondary: #d5dade;
  --text-muted: #9aa2a8;
  --border-subtle: #2d3235;
  --border-strong: #454c51;
  --primary-light: rgba(179, 29, 29, 0.18);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.45);
}

/* ==========================================================================
   3. Base & Typography
   ========================================================================== */
body {
  font-family: var(--font-arabic);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: var(--lh-body);
  text-align: start;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

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

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-editorial);
  line-height: var(--lh-heading);
  font-weight: 700;
  color: var(--text-main);
}

/* Containers */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-padding);
}

/* ==========================================================================
   4. Header & Navigation (Atlas Economiste Redesign)
   ========================================================================== */
.site-header {
  background-color: var(--header-bg);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  position: relative;
  z-index: 50;
  color: #ffffff;
}

/* Top Meta Bar - Seamless Crimson Red background matching reference */
.top-bar {
  background-color: transparent;
  border-bottom: none;
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.95);
  padding-block: 0.35rem 0.15rem;
}

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

.top-bar-dates {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  white-space: nowrap;
  font-size: 0.825rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.95);
}

.top-bar-dates svg {
  color: rgba(255, 255, 255, 0.95);
}

.top-bar-dates .sep {
  opacity: 0.4;
}

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

/* Theme Toggle Button */
.theme-toggle-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.88);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

.theme-toggle-btn:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.18);
}

.theme-toggle-btn svg {
  width: 17px;
  height: 17px;
}

/* Main Brand Header with Inline Navigation */
.main-header {
  padding-block: 0.5rem 0.75rem;
  background-color: var(--header-bg);
}

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

.site-branding {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.site-branding-link {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.site-logo-img {
  height: 48px;
  width: auto;
  display: block;
  object-fit: contain;
  transition: opacity var(--transition-fast);
}

.site-branding-link:hover .site-logo-img {
  opacity: 0.92;
}

.site-title {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  line-height: 1;
}

.site-title .brand-atlas {
  color: #ffffff;
}

.site-title .brand-eco {
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.9em;
  font-weight: 700;
}

/* Main Horizontal Inline Menu */
.main-nav-inline {
  display: flex;
  align-items: center;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
  margin-inline: 1rem;
}

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

.primary-menu {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  white-space: nowrap;
}

.primary-menu li a {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.95rem;
  font-size: var(--text-base);
  font-weight: 600;
  color: #ffffff;
  border-radius: 6px;
  transition: background-color var(--transition-fast), color var(--transition-fast);
  text-decoration: none;
}

.primary-menu li a:hover {
  background-color: rgba(0, 0, 0, 0.18);
  color: #ffffff;
}

/* Active Menu Item Pill Button Style (From Atlas Economiste reference) */
.primary-menu li.current-menu-item a {
  background-color: var(--header-active);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.primary-menu li a::after {
  display: none;
}

/* Header Actions & Search */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: relative;
  flex-shrink: 0;
}

.search-toggle-btn {
  background: rgba(0, 0, 0, 0.18);
  border: none;
  color: #ffffff;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.search-toggle-btn:hover {
  background: rgba(0, 0, 0, 0.32);
  transform: scale(1.05);
}

.header-search-dropdown {
  position: absolute;
  inset-inline-start: 0;
  top: calc(100% + 10px);
  width: 320px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  padding: 0.75rem;
  display: none;
  z-index: 60;
}

.header-search-dropdown.is-open {
  display: block;
  animation: dropdownFade 150ms ease-out;
}

@keyframes dropdownFade {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.search-form-header {
  display: flex;
  align-items: center;
  position: relative;
}

.search-form-header input {
  width: 100%;
  height: 38px;
  padding-inline-start: 1rem;
  padding-inline-end: 2.75rem;
  background-color: var(--bg-page);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: inherit;
  font-size: var(--text-sm);
}

.search-form-header button {
  position: absolute;
  inset-inline-end: 2px;
  top: 2px;
  bottom: 2px;
  width: 34px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Mobile Menu Toggle */
.mobile-nav-toggle {
  display: none;
  background: none;
  border: none;
  color: #ffffff;
  padding: 0.5rem;
  cursor: pointer;
}

/* Mobile Off-canvas Drawer */
.mobile-nav-drawer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background-color: rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.mobile-nav-drawer.is-active {
  opacity: 1;
  pointer-events: auto;
}

.mobile-nav-content {
  position: absolute;
  top: 0;
  bottom: 0;
  inset-inline-start: 0;
  width: 82%;
  max-width: 320px;
  height: 100%;
  background-color: var(--bg-surface);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform var(--transition-base);
  overflow-y: auto;
  box-shadow: var(--shadow-md);
}

[dir="rtl"] .mobile-nav-content {
  transform: translateX(100%);
}

.mobile-nav-drawer.is-active .mobile-nav-content,
[dir="rtl"] .mobile-nav-drawer.is-active .mobile-nav-content {
  transform: translateX(0);
}

.mobile-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 1rem;
}

.mobile-nav-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-main);
  cursor: pointer;
}

.mobile-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mobile-menu a {
  display: block;
  font-size: var(--text-md);
  font-weight: 600;
  padding-block: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

/* ==========================================================================
   5. Breaking News Ticker Module
   ========================================================================== */
.ticker-module {
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
  overflow: hidden;
  padding-block: 0.5rem;
}

.ticker-inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  height: 40px;
}

.ticker-badge {
  background-color: var(--primary);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 1.15rem;
  border-radius: 4px;
  font-weight: 700;
  font-size: var(--text-sm);
  white-space: nowrap;
  flex-shrink: 0;
  z-index: 2;
  border-top: none;
}

.ticker-track-wrapper {
  flex: 1;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  padding-inline: 1rem;
}

.ticker-items {
  display: flex;
  align-items: center;
  gap: 2rem;
  width: max-content;
  animation: ticker-slide-ltr 40s linear infinite;
}

[dir="rtl"] .ticker-items {
  animation: ticker-slide-rtl 40s linear infinite;
}

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

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

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

.ticker-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  white-space: nowrap;
  font-size: var(--text-sm);
  color: var(--text-main);
}

.ticker-item .ticker-date {
  color: var(--text-muted);
  font-size: var(--text-xs);
}

.ticker-item a:hover {
  color: var(--primary);
}

.ticker-item::after {
  content: "•";
  color: var(--border-strong);
  margin-inline-start: 1rem;
}

/* ==========================================================================
   6. Editorial News Cards
   ========================================================================== */
/* Lead Article Card */
.card-lead {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.card-lead:hover {
  box-shadow: var(--shadow-md);
}

.card-lead-media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background-color: var(--bg-subtle);
}

.card-lead-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-base);
}

.card-lead:hover .card-lead-media img {
  transform: scale(1.03);
}

.card-lead-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}

.card-lead-title {
  font-size: var(--text-2xl);
  font-weight: 800;
  line-height: 1.35;
}

.card-lead-excerpt {
  color: var(--text-secondary);
  font-size: var(--text-base);
  line-height: 1.6;
}

/* Lead Article Card (Hero Overlay Style - Matching Atlas Economiste Reference) */
.card-lead-hero-overlay {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background-color: #141718;
  border: 1px solid var(--border-subtle);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.card-lead-hero-overlay .card-lead-media {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 380px;
  aspect-ratio: auto;
  flex: 1;
  overflow: hidden;
}

.card-lead-hero-overlay .card-lead-link {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
  text-decoration: none;
}

.card-lead-hero-overlay .card-lead-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-base);
}

.card-lead-hero-overlay:hover .card-lead-media img {
  transform: scale(1.03);
}

.card-lead-hero-overlay .card-lead-overlay {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  padding: 3rem 1.75rem 1.25rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.5) 60%, transparent 100%);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  color: #ffffff;
  text-align: center;
}

.card-lead-hero-overlay .card-lead-title {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.45;
  color: #ffffff;
  margin: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-slider-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 0.25rem;
}

.hero-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.4);
  transition: all var(--transition-fast);
}

.hero-dot.is-active {
  width: 24px;
  height: 8px;
  border-radius: 4px;
  background-color: var(--pill-bar);
}

/* Standard Grid Card */
.card-grid {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--transition-fast);
}

.card-grid:hover {
  box-shadow: var(--shadow-sm);
}

.card-grid-media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background-color: var(--bg-subtle);
}

.card-grid-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-base);
}

.card-grid:hover .card-grid-media img {
  transform: scale(1.03);
}

.card-grid-content {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.card-grid-title {
  font-size: var(--text-md);
  font-weight: 700;
  line-height: 1.4;
}

/* Compact Horizontal Card (List item with thumbnail) */
.card-compact {
  display: flex;
  gap: 1rem;
  padding-block: 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
  align-items: flex-start;
}

.card-compact:last-child {
  border-bottom: none;
}

.card-compact-media {
  width: 100px;
  height: 68px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background-color: var(--bg-subtle);
}

.card-compact-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-compact-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.card-compact-title {
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.45;
}

/* Global Thumbnail Placeholder */
.thumbnail-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-subtle) 0%, var(--border-subtle) 100%);
}

.thumbnail-placeholder .placeholder-icon {
  opacity: 0.35;
  color: var(--text-muted);
}

/* Photo Story Card ("صورة وقصة") */
.photo-story-card {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background-color: #000;
}

.photo-story-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
  transition: transform var(--transition-base), opacity var(--transition-base);
}

.photo-story-card:hover img {
  transform: scale(1.03);
  opacity: 0.75;
}

.photo-story-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.9) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.75rem;
  color: #ffffff;
}

.photo-story-title {
  font-size: var(--text-xl);
  font-weight: 800;
  color: #ffffff;
}

/* Badges & Meta */
.category-badge {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* ==========================================================================
   7. Homepage Layout Grids
   ========================================================================== */
.main-content-layout {
  padding-block: 1.75rem;
}

.editorial-layout-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.75rem;
}

/* Hero Section */
.hero-news-section {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.hero-supporting-list {
  display: flex;
  flex-direction: column;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
}

/* Category Sections */
.category-section {
  margin-bottom: 2.25rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 1.25rem;
}

.section-title,
.widget-title {
  display: inline-flex;
  align-items: center;
  background-color: var(--pill-bg);
  color: var(--pill-text);
  font-family: var(--font-arabic);
  font-size: 1.15rem;
  font-weight: 800;
  padding-block: 0.45rem;
  padding-inline: 1.25rem 1.45rem;
  border-radius: 7px;
  position: relative;
  overflow: hidden;
  border-inline-start: 7px solid var(--pill-bar);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  line-height: 1.35;
  width: fit-content;
  align-self: flex-start;
  border-bottom: none;
  margin-bottom: 0;
}

.widget-title {
  margin-bottom: 1rem;
}

.section-title::before,
.widget-title::before {
  display: none;
}

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

.category-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

.category-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

/* ==========================================================================
   8. Sidebar & Widgets
   ========================================================================== */
.sidebar-area {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.widget-block {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

/* Newsletter Widget */
.newsletter-card {
  background: linear-gradient(135deg, var(--bg-surface-elevated) 0%, var(--bg-surface) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
}

.newsletter-card h3 {
  font-size: var(--text-lg);
  margin-bottom: 0.5rem;
}

.newsletter-card p {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.newsletter-form input[type="email"] {
  width: 100%;
  height: 40px;
  padding-inline: 0.75rem;
  background-color: var(--bg-page);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: var(--text-sm);
  margin-bottom: 0.5rem;
}

.newsletter-form button {
  width: 100%;
  height: 40px;
  background-color: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 700;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

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

/* Advertisement Units */
.ad-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-block: 1.5rem;
  background-color: var(--bg-surface-elevated);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  text-align: center;
}

.ad-slot-label {
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.ad-slot-leaderboard {
  min-height: 90px;
  width: 100%;
}

.ad-slot-rectangle {
  min-height: 250px;
  width: 100%;
}

/* ==========================================================================
   9. Article Detail Page (single.php)
   ========================================================================== */
.article-header {
  margin-bottom: 1.5rem;
}

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

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

.article-title {
  font-size: var(--text-3xl);
  font-weight: 800;
  line-height: 1.35;
  margin-block: 0.5rem 1rem;
}

.article-excerpt {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.article-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-block: 1px solid var(--border-subtle);
  padding-block: 0.75rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.author-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.author-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  background-color: var(--bg-subtle);
}

.author-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.author-name {
  font-weight: 700;
  font-size: var(--text-sm);
}

.article-share-buttons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.share-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.share-btn:hover {
  background-color: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* Featured Media */
.article-featured-media {
  margin-bottom: 2rem;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.article-featured-media img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.media-caption {
  font-size: var(--text-xs);
  color: var(--text-muted);
  padding: 0.5rem 0.25rem;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
}

/* Article Body Typography */
.article-content {
  font-size: var(--text-md);
  line-height: 1.85;
  color: var(--text-main);
  max-width: 820px;
}

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

.article-content h2 {
  font-size: var(--text-2xl);
  margin-block: 2rem 1rem;
}

.article-content h3 {
  font-size: var(--text-xl);
  margin-block: 1.5rem 0.75rem;
}

.article-content blockquote {
  border-inline-start: 4px solid var(--primary);
  padding-inline-start: 1.25rem;
  margin-block: 1.5rem;
  font-size: var(--text-lg);
  font-style: italic;
  color: var(--text-secondary);
  background-color: var(--bg-surface-elevated);
  padding-block: 0.75rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.article-content ul, 
.article-content ol {
  padding-inline-start: 1.5rem;
  margin-bottom: 1.5rem;
}

.article-content li {
  margin-bottom: 0.5rem;
}

/* Related Stories */
.related-posts-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 2px solid var(--border-subtle);
}

/* ==========================================================================
   Comments Section Styling (RTL)
   ========================================================================== */
#comments {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 2px solid var(--border-subtle);
}

.comments-title {
  font-size: var(--text-xl);
  font-weight: 800;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.comments-title::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 20px;
  background-color: var(--primary);
  border-radius: 2px;
}

.comment-list {
  list-style: none;
  padding: 0;
  margin-bottom: 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.comment-list .comment {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
}

.comment-list .children {
  list-style: none;
  padding-inline-start: 2rem;
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.comment-author {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.comment-author .avatar {
  border-radius: 50%;
}

.comment-author .fn {
  font-weight: 700;
  font-size: var(--text-sm);
}

.comment-metadata {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.comment-content {
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--text-main);
}

.comment-reply-link {
  display: inline-flex;
  align-items: center;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--primary);
  margin-top: 0.75rem;
}

/* Respond Box (Leave a Reply Form) */
#respond.comment-respond {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 2rem;
  margin-top: 3rem;
}

.comment-reply-title {
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.comment-reply-title small a {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--accent-red);
}

.comment-notes,
.logged-in-as {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.comment-form p {
  margin: 0;
}

.comment-form label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text-main);
}

.comment-form .required {
  color: var(--accent-red);
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"] {
  width: 100%;
  height: 44px;
  padding-inline: 1rem;
  background-color: var(--bg-page);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: inherit;
  font-size: var(--text-sm);
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.comment-form input[type="text"]:focus,
.comment-form input[type="email"]:focus,
.comment-form input[type="url"]:focus,
.comment-form textarea:focus {
  outline: none;
  border-color: var(--primary);
  background-color: var(--bg-surface);
}

.comment-form textarea {
  width: 100%;
  min-height: 130px;
  padding: 1rem;
  background-color: var(--bg-page);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: inherit;
  font-size: var(--text-sm);
  line-height: 1.6;
  resize: vertical;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.comment-form-cookies-consent {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-block: 0.5rem;
}

.comment-form-cookies-consent input[type="checkbox"] {
  margin-top: 0.2rem;
  accent-color: var(--primary);
  cursor: pointer;
}

.comment-form-cookies-consent label {
  font-weight: 400;
  font-size: var(--text-xs);
  color: var(--text-muted);
  cursor: pointer;
  margin: 0;
}

.form-submit input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.75rem 2.25rem;
  font-size: var(--text-base);
  font-weight: 700;
  cursor: pointer;
  transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.form-submit input[type="submit"]:hover {
  background-color: var(--primary-hover);
}

/* WordPress Default Block Widgets in Sidebars */
.widget-block .wp-block-group,
.sidebar-area .wp-block-group {
  margin-bottom: 1.5rem;
}

.sidebar-area h2.wp-block-heading,
.widget-block h2.wp-block-heading {
  font-size: var(--text-md);
  font-weight: 700;
  border-bottom: 2px solid var(--border-subtle);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sidebar-area h2.wp-block-heading::before,
.widget-block h2.wp-block-heading::before {
  content: "";
  width: 3px;
  height: 16px;
  background-color: var(--primary);
}

.sidebar-area ul.wp-block-archives,
.sidebar-area ul.wp-block-categories,
.sidebar-area ul.wp-block-latest-posts {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}

.sidebar-area ul.wp-block-archives li,
.sidebar-area ul.wp-block-categories li,
.sidebar-area ul.wp-block-latest-posts li {
  padding-block: 0.6rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-sm);
}

.sidebar-area ul.wp-block-archives li:last-child,
.sidebar-area ul.wp-block-categories li:last-child,
.sidebar-area ul.wp-block-latest-posts li:last-child {
  border-bottom: none;
}

.sidebar-area ul.wp-block-archives a,
.sidebar-area ul.wp-block-categories a,
.sidebar-area ul.wp-block-latest-posts a {
  color: var(--text-secondary);
  font-weight: 600;
}

.sidebar-area ul.wp-block-archives a:hover,
.sidebar-area ul.wp-block-categories a:hover,
.sidebar-area ul.wp-block-latest-posts a:hover {
  color: var(--primary);
}

/* ==========================================================================
   10. Footer Component
   ========================================================================== */
.site-footer {
  background-color: #0b0d0e;
  color: #f5f5f5;
  margin-top: auto;
  border-top: 4px solid var(--primary);
}

.footer-top {
  padding-block: 3rem;
}

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

.footer-col h4 {
  color: #ffffff;
  font-size: var(--text-md);
  margin-bottom: 1.25rem;
  border-inline-start: 3px solid var(--primary);
  padding-inline-start: 0.5rem;
}

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

.footer-col ul a {
  color: #a4abb0;
  font-size: var(--text-sm);
}

.footer-col ul a:hover {
  color: var(--primary);
}

.footer-social-links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.footer-social-links a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: #1a1e20;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  transition: background-color var(--transition-fast);
}

.footer-social-links a:hover {
  background-color: var(--primary);
}

.footer-bottom {
  background-color: #050607;
  padding-block: 1.25rem;
  font-size: var(--text-xs);
  color: #727a80;
  border-top: 1px solid #1a1d1e;
}

.footer-bottom-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ==========================================================================
   11. Pagination & Utility Pages
   ========================================================================== */
.posts-pagination {
  margin-block: 2.5rem;
  display: flex;
  justify-content: center;
}

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

.pagination .page-numbers {
  min-width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-surface);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: var(--text-sm);
}

.pagination .page-numbers.current,
.pagination .page-numbers:hover {
  background-color: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* 404 & Empty States */
.error-404-container {
  text-align: center;
  padding-block: 4rem;
}

.error-404-title {
  font-size: clamp(3rem, 8vw, 6rem);
  color: var(--primary);
  font-weight: 900;
  line-height: 1;
  margin-bottom: 1rem;
}

.error-404-text {
  font-size: var(--text-lg);
  color: var(--text-muted);
  margin-bottom: 2rem;
}

/* ==========================================================================
   12. Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1024px) {
  .editorial-layout-grid {
    grid-template-columns: 1fr;
  }

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

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

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

@media (max-width: 768px) {
  :root {
    --container-padding: 0.75rem;
  }

  .top-bar-dates {
    display: none;
  }

  .header-search {
    display: none;
  }

  .primary-menu {
    display: none;
  }

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

  .category-grid-4,
  .category-grid-3 {
    grid-template-columns: 1fr;
  }

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

  .card-lead-title {
    font-size: var(--text-xl);
  }

  .article-title {
    font-size: var(--text-2xl);
  }
}
