/* ============================================================
   NAWAFITH — نوافذ | Syria News Intelligence Platform
   Production Stylesheet — Single-page layout with sidebar map
   ============================================================ */

/* === RESET & BASE === */

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

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--text-link);
  text-decoration: none;
  transition: color 0.15s ease;
}

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  font-size: inherit;
}

select {
  font-family: inherit;
}

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

ul, ol {
  list-style: none;
}

/* === CSS CUSTOM PROPERTIES === */

:root {
  /* Base — deep navy/slate, NOT pure black */
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --bg-hover: #253349;
  --border: #475569;
  --border-subtle: #334155;

  /* Text */
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-link: #60a5fa;

  /* Faction colors */
  --faction-regime: #E53E3E;
  --faction-opposition: #3182CE;
  --faction-kurdish: #d4a853;
  --faction-international: #8b9caa;
  --faction-regional: #c2a67d;
  --faction-ngo: #7c9a92;
  --faction-social: #A78BFA;

  /* Typography */
  --font-ar-headline: 'Lalezar', cursive;
  --font-ar-body: 'Amiri', serif;
  --font-en-headline: 'Space Grotesk', sans-serif;
  --font-en-body: 'Source Serif 4', serif;

  /* Accents */
  --accent: #60a5fa;
  --verified: #34d399;
  --developing: #fbbf24;
  --crisis: #f87171;
  --positive: #34d399;
  --negative: #f87171;

  /* Layout */
  --header-height: 68px;
  --sidebar-left-width: 220px;
  --sidebar-right-width: 280px;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-pill: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.35s ease;
}


/* === SCROLLBARS === */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--bg-tertiary) transparent;
}


/* === FOCUS & ACCESSIBILITY === */

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


/* === TYPOGRAPHY === */

.font-mono {
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
}

.font-arabic {
  font-family: 'Noto Naskh Arabic', 'Amiri', serif;
}


/* ============================================================
   HEADER
   ============================================================ */

#header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* --- Header: Damascus Clock (Left) --- */

.header-clock {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 200px;
}

.clock-label {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.clock-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 22px;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: 0.02em;
  min-width: 58px;
}

.clock-tz {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* --- Header: Logo (Center) --- */

.header-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  line-height: 1;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

/* ── Faction Windows (نوافذ) ── */
.faction-windows {
  display: flex;
  gap: 4px;
  margin-top: 2px;
}

.faction-window {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  border-radius: 3px;
  color: var(--fw-color, #888);
  opacity: 0.5;
  transition: all 0.2s ease;
  line-height: 0;
}

.faction-window:hover {
  opacity: 0.85;
  transform: scale(1.15);
}

.faction-window.active {
  opacity: 1;
  background: color-mix(in srgb, var(--fw-color) 15%, transparent);
  box-shadow: 0 0 6px color-mix(in srgb, var(--fw-color) 30%, transparent);
}

.faction-window.active svg rect {
  fill: color-mix(in srgb, var(--fw-color) 20%, transparent);
}

.logo-ar {
  font-family: var(--font-ar-headline);
  font-size: 26px;
  font-weight: 700;
  color: var(--syrian-gold, #d4a853);
  line-height: 1.1;
}

.logo-en {
  font-family: var(--font-en-headline);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--syrian-sand, #c2a67d);
  font-variant: small-caps;
  margin-top: 1px;
}

/* --- Header: Controls (Right) --- */

.header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 200px;
  justify-content: flex-end;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  background: var(--bg-primary);
  font-size: 13px;
  font-weight: 600;
  transition: border-color var(--transition-fast);
}

.lang-btn:hover {
  border-color: var(--border);
}

.lang-option {
  color: var(--text-muted);
  transition: color var(--transition-fast);
  cursor: pointer;
}

.lang-option.active {
  color: var(--text-primary);
}

.lang-divider {
  color: var(--border);
  font-size: 12px;
}

.hamburger-btn {
  display: none;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  transition: background var(--transition-fast), color var(--transition-fast);
}

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


/* ============================================================
   BANNER SLOT (reserved for future ads / announcements)
   ============================================================ */

.banner-slot {
  margin-top: var(--header-height);
  /* Empty by default — no height until content is placed */
}
.banner-slot:empty {
  margin-bottom: 0;
  padding: 0;
  height: 0;
  line-height: 0;
  font-size: 0;
}


/* ============================================================
   GOV INDICATOR (overlaid on sidebar map)
   ============================================================ */

.gov-indicator {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--accent);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-md);
  animation: slideUp 0.2s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateX(-50%) translateY(6px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

#gov-indicator-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}

.gov-indicator-clear {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 3px 8px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  background: var(--bg-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.gov-indicator-clear:hover {
  color: var(--text-primary);
  border-color: var(--border);
  background: var(--bg-tertiary);
}


/* ============================================================
   FEED — THREE-COLUMN LAYOUT
   ============================================================ */

.feed-layout {
  display: flex;
  min-height: calc(100vh - var(--header-height));
}

/* --- Left Sidebar --- */

.sidebar-left {
  width: var(--sidebar-left-width);
  min-width: var(--sidebar-left-width);
  height: calc(100vh - var(--header-height));
  position: sticky;
  top: var(--header-height);
  overflow-y: auto;
  border-right: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* --- Right Sidebar --- */

.sidebar-right {
  width: var(--sidebar-right-width);
  min-width: var(--sidebar-right-width);
  height: calc(100vh - var(--header-height));
  position: sticky;
  top: var(--header-height);
  overflow-y: auto;
  border-left: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* --- Main Feed Column --- */

.feed-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}


/* ============================================================
   SIDEBAR — NAVIGATION
   ============================================================ */

.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 0 8px;
  margin-bottom: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}


/* ============================================================
   SIDEBAR — SECTIONS
   ============================================================ */

.sidebar-section {
  padding: 12px 16px;
  border-top: 1px solid var(--border-subtle);
}

.sidebar-heading {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}


/* ============================================================
   TICKER WIDGET
   ============================================================ */

.ticker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  gap: 8px;
}

.ticker-pair {
  color: var(--text-secondary);
  font-size: 11px;
  min-width: 60px;
}

.ticker-rate {
  color: var(--text-primary);
  font-weight: 500;
  flex: 1;
  text-align: right;
}

.ticker-change {
  font-size: 11px;
  min-width: 50px;
  text-align: right;
  font-weight: 500;
}

.ticker-change.positive {
  color: var(--positive);
}

.ticker-change.negative {
  color: var(--negative);
}


/* ============================================================
   FILTER PILLS (Faction / Topic)
   ============================================================ */

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  background: transparent;
  transition: all var(--transition-fast);
  cursor: pointer;
  white-space: nowrap;
}

.filter-pill:hover {
  border-color: var(--border);
  color: var(--text-primary);
  background: var(--bg-hover);
}

/* Active faction pills inherit per-faction color */
.filter-pill.active {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.filter-pill.active[data-faction="regime"] {
  border-color: var(--faction-regime);
  color: var(--faction-regime);
}

.filter-pill.active[data-faction="opposition"] {
  border-color: var(--faction-opposition);
  color: var(--faction-opposition);
}

.filter-pill.active[data-faction="kurdish"] {
  border-color: var(--faction-kurdish);
  color: var(--faction-kurdish);
}

.filter-pill.active[data-faction="international"] {
  border-color: var(--faction-international);
  color: var(--faction-international);
}

.filter-pill.active[data-faction="regional"] {
  border-color: var(--faction-regional);
  color: var(--faction-regional);
}

.filter-pill.active[data-faction="ngo"] {
  border-color: var(--faction-ngo);
  color: var(--faction-ngo);
}

.filter-pill.active[data-faction="social"] {
  border-color: var(--faction-social);
  color: var(--faction-social);
}

/* Topic pills active state */
.filter-pill.active[data-topic] {
  border-color: var(--accent);
  color: var(--accent);
}


/* ============================================================
   GOVERNORATE DROPDOWN
   ============================================================ */

.gov-select {
  width: 100%;
  padding: 8px 12px;
  font-size: 13px;
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

.gov-select:hover {
  border-color: var(--border);
}

.gov-select:focus {
  border-color: var(--accent);
}

.gov-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}


/* ============================================================
   FEED FILTER BAR (Sticky)
   ============================================================ */

.feed-filter-bar {
  position: sticky;
  top: var(--header-height);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: rgba(30, 41, 59, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  gap: 12px;
}

.preset-pills,
.window-pills {
  display: flex;
  gap: 4px;
}

.preset-pill,
.window-pill {
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-pill);
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.preset-pill:hover,
.window-pill:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.preset-pill.active {
  color: #0f172a;
  background: var(--accent);
  font-weight: 600;
}

.window-pill.active {
  color: var(--text-primary);
  background: var(--bg-tertiary);
  border-color: var(--border);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: var(--accent);
  color: #0f172a;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-lg);
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.btn-primary:hover {
  background: #93bbfc;
  transform: translateY(-1px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: background var(--transition-fast), color var(--transition-fast),
    border-color var(--transition-fast);
}

.btn-secondary:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--text-muted);
}


/* ============================================================
   ARTICLE LIST
   ============================================================ */

#article-list {
  flex: 1;
}

/* --- Article Card --- */

.article-card {
  display: flex;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition-fast);
  cursor: pointer;
}

.article-card:hover {
  background: var(--bg-hover);
}

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

/* Timestamp column */
.article-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-muted);
  min-width: 42px;
  flex-shrink: 0;
  padding-top: 2px;
  text-align: right;
}

/* Article body */
.article-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Source meta line */
.article-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.article-source {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-secondary);
}

.source-faction-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.source-flag {
  font-size: 14px;
  line-height: 1;
}

.source-flag-img {
  vertical-align: middle;
  margin-right: 4px;
  border-radius: 1px;
}

.source-name {
  font-weight: 500;
}

/* Headlines — dual-script */
.article-title-primary {
  font-family: var(--font-en-headline);
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Arabic primary headline */
.article-title-primary:not(.article-title-en) {
  font-family: var(--font-ar-body);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.8;
  direction: rtl;
  text-align: right;
}

/* English primary headline */
.article-title-en {
  direction: ltr;
  text-align: left;
}

.article-title-secondary {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Tag pills */
.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 2px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 500;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.tag-gov {
  background: rgba(96, 165, 250, 0.12);
  color: #93bbfc;
  border: 1px solid rgba(96, 165, 250, 0.2);
}

.tag-topic {
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-muted);
  border: 1px solid rgba(148, 163, 184, 0.15);
}

/* Faction verification strip */
.faction-strip {
  display: flex;
  width: 120px;
  height: 3px;
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}

.faction-segment {
  min-width: 0;
}

/* Perspectives label */
.perspectives-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.02em;
  margin-top: 2px;
}


/* ============================================================
   LOADING & EMPTY STATES
   ============================================================ */

.loading-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 32px 20px;
  color: var(--text-muted);
  font-size: 13px;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-subtle);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}


/* ============================================================
   RIGHT SIDEBAR — TRENDING
   ============================================================ */

.sidebar-right .sidebar-heading {
  font-size: 10px;
  margin-bottom: 12px;
}

#trending-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.trending-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.trending-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 20px;
  flex-shrink: 0;
  line-height: 1.4;
}

.trending-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.trending-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color var(--transition-fast);
}

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

.trending-source {
  font-size: 11px;
  color: var(--text-muted);
}

/* Faction bar in trending items */
.trending-faction-bar {
  display: flex;
  width: 100%;
  height: 3px;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 4px;
}

.trending-faction-seg {
  min-width: 0;
  height: 100%;
}

/* ============================================================
   MODALS (About + Sources)
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.hidden {
  display: none;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  max-width: 480px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 28px;
  position: relative;
}

.modal-content-wide {
  max-width: 640px;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.modal-close:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.modal-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'Noto Naskh Arabic', serif;
}

.modal-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
  margin-bottom: 16px;
}

.modal-body {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* Source list in modal */
.source-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.source-row:last-child {
  border-bottom: none;
}

.source-row-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.source-row-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  flex: 1;
}

.source-row-faction {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: capitalize;
}

.source-row-type {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  background: var(--bg-tertiary);
  color: var(--text-muted);
}


/* ============================================================
   RIGHT SIDEBAR — SYRIA MAP WIDGET
   ============================================================ */

.sidebar-map-section {
  padding: 12px 0 8px 0 !important;
}

.sidebar-map-section .sidebar-heading {
  padding: 0 16px;
}

#sidebar-map-wrap {
  position: relative;
  width: 100%;
  height: 260px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

#sidebar-map {
  width: 100%;
  height: 100%;
  background: #0a0a12;
}

.sidebar-map-hint {
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 6px;
  letter-spacing: 0.02em;
}

/* Smaller gov indicator when inside sidebar */
.sidebar-map-section .gov-indicator {
  bottom: 6px;
  padding: 4px 10px;
  gap: 6px;
}


/* ============================================================
   RIGHT SIDEBAR — STATS BAR
   ============================================================ */

.stats-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.stat-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat-live {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--positive);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-inline-start: auto;
}

.live-dot {
  width: 8px;
  height: 8px;
  background: var(--positive);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5);
  }
  50% {
    opacity: 0.7;
    box-shadow: 0 0 0 6px rgba(52, 211, 153, 0);
  }
}


/* ============================================================
   LEAFLET OVERRIDES — DARK THEME
   ============================================================ */

.leaflet-container {
  background: var(--bg-primary);
  font-family: 'Inter', sans-serif;
}

.leaflet-tile-pane {
  filter: brightness(0.6) invert(1) contrast(3) hue-rotate(200deg) saturate(0.3) brightness(0.7);
}

.leaflet-control-zoom {
  border: 1px solid var(--border-subtle) !important;
  border-radius: var(--radius-md) !important;
  overflow: hidden;
}

.leaflet-control-zoom a {
  background: var(--bg-secondary) !important;
  color: var(--text-secondary) !important;
  border-color: var(--border-subtle) !important;
  width: 28px !important;
  height: 28px !important;
  line-height: 28px !important;
  font-size: 14px !important;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.leaflet-control-zoom a:hover {
  background: var(--bg-tertiary) !important;
  color: var(--text-primary) !important;
}

/* Governorate tooltip */
.gov-tooltip {
  background: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-md) !important;
  padding: 6px 10px !important;
  font-size: 12px !important;
  line-height: 1.4 !important;
}

.gov-tooltip::before {
  border-top-color: var(--bg-secondary) !important;
}

.leaflet-interactive:hover {
  fill-opacity: 0.5 !important;
}

/* Attribution */
.leaflet-control-attribution {
  background: rgba(15, 23, 42, 0.8) !important;
  color: var(--text-muted) !important;
  font-size: 9px !important;
}

.leaflet-control-attribution a {
  color: var(--text-muted) !important;
}


/* ============================================================
   MOBILE DRAWER
   ============================================================ */

.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.drawer-overlay.open {
  opacity: 1;
  visibility: visible;
}

.sidebar-left.drawer-open {
  position: fixed;
  top: var(--header-height);
  left: 0;
  bottom: 0;
  z-index: 90;
  transform: translateX(0) !important;
  box-shadow: var(--shadow-lg);
}


/* ============================================================
   RTL SUPPORT
   ============================================================ */

[dir="rtl"] body {
  font-family: 'Noto Naskh Arabic', 'Inter', sans-serif;
}

[dir="rtl"] .header-clock {
  flex-direction: row-reverse;
}

/* header-controls stays LTR — handled by top-header direction:ltr */

[dir="rtl"] .sidebar-left {
  border-right: none;
  border-left: 1px solid var(--border-subtle);
}

[dir="rtl"] .sidebar-right {
  border-left: none;
  border-right: 1px solid var(--border-subtle);
}

[dir="rtl"] .feed-layout {
  flex-direction: row-reverse;
}

[dir="rtl"] .article-card {
  flex-direction: row-reverse;
}

[dir="rtl"] .article-time {
  text-align: left;
}

[dir="rtl"] .article-body {
  align-items: flex-end;
}

[dir="rtl"] .article-source {
  flex-direction: row-reverse;
}

[dir="rtl"] .article-tags {
  justify-content: flex-end;
}

[dir="rtl"] .nav-item {
  flex-direction: row-reverse;
  text-align: right;
}

[dir="rtl"] .sidebar-heading {
  text-align: right;
}

[dir="rtl"] .trending-item {
  flex-direction: row-reverse;
  text-align: right;
}

[dir="rtl"] .ticker-row {
  flex-direction: row-reverse;
}

[dir="rtl"] .gov-select {
  background-position: left 10px center;
  padding-left: 30px;
  padding-right: 12px;
  text-align: right;
}

[dir="rtl"] .sidebar-left.drawer-open {
  left: auto;
  right: 0;
}

[dir="rtl"] .stats-bar {
  flex-direction: row-reverse;
}

[dir="rtl"] .stat {
  align-items: flex-end;
}

[dir="rtl"] .preset-pills,
[dir="rtl"] .window-pills {
  flex-direction: row-reverse;
}


/* ============================================================
   RESPONSIVE — TABLET & MOBILE
   ============================================================ */

@media (max-width: 1200px) {
  .sidebar-right {
    width: 240px;
    min-width: 240px;
  }
}

@media (max-width: 1024px) {
  /* Show hamburger */
  .hamburger-btn {
    display: flex;
  }

  /* Hide header clock on smaller screens */
  .header-clock {
    display: none;
  }

  .header-logo {
    position: static;
    transform: none;
  }

  /* Left sidebar → off-canvas drawer */
  .sidebar-left {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    z-index: 90;
    transform: translateX(-100%);
    transition: transform var(--transition-normal);
    box-shadow: none;
    height: calc(100vh - var(--header-height));
  }

  .sidebar-left.drawer-open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  [dir="rtl"] .sidebar-left {
    left: auto;
    right: 0;
    transform: translateX(100%);
  }

  [dir="rtl"] .sidebar-left.drawer-open {
    transform: translateX(0);
  }

  /* Hide right sidebar */
  .sidebar-right {
    display: none;
  }

  /* Feed takes full width */
  .feed-main {
    width: 100%;
  }

  .feed-filter-bar {
    top: var(--header-height);
  }
}

@media (max-width: 640px) {
  #header {
    padding: 0 12px;
  }

  .logo-ar {
    font-size: 20px;
  }

  .logo-en {
    font-size: 9px;
    letter-spacing: 0.2em;
  }

  .feed-filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 8px 12px;
  }

  .preset-pills,
  .window-pills {
    justify-content: center;
  }

  .article-card {
    padding: 12px;
    gap: 10px;
  }

  .article-time {
    min-width: 36px;
    font-size: 11px;
  }

  .article-title-primary {
    font-size: 14px;
  }

  .article-title-primary:not(.article-title-en) {
    font-size: 15px;
  }

  .gov-indicator {
    font-size: 11px;
    padding: 4px 10px;
    gap: 6px;
  }

  #gov-indicator-name {
    font-size: 11px;
  }
}


/* ============================================================
   UTILITY CLASSES
   ============================================================ */

.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.text-muted {
  color: var(--text-muted);
}


/* ============================================================
   PRINT STYLES
   ============================================================ */

/* ============================================================
   NAWAFITH WINDOWS NAV (نوافذ — lens switcher)
   ============================================================ */

.windows-nav {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  z-index: 90;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

.windows-nav-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 6px 20px;
}

.windows-brand {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px 0 4px;
  border-right: 1px solid var(--border-subtle);
  height: 32px;
  flex-shrink: 0;
}

.windows-icon {
  font-size: 15px;
}

.windows-label-ar {
  font-family: 'Noto Naskh Arabic', serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: -0.2px;
}

.windows-tabs {
  display: flex;
  gap: 4px;
}

.window-tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.window-tab:hover:not(.active) {
  background: var(--bg-hover);
}

.window-tab.active {
  background: rgba(96, 165, 250, 0.1);
  border-color: rgba(96, 165, 250, 0.25);
}

.window-tab.active[data-window-view="jobs"] {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.25);
}

.window-tab-icon {
  font-size: 14px;
}

.window-tab-label {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: -0.1px;
}

.window-tab.active .window-tab-label {
  font-weight: 600;
  color: var(--accent);
}

.window-tab.active[data-window-view="jobs"] .window-tab-label {
  color: #f59e0b;
}

.window-tab-label-ar {
  font-family: 'Noto Naskh Arabic', serif;
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.6;
}

.window-tab.active .window-tab-label-ar {
  opacity: 0.8;
}

.windows-coming {
  margin-left: auto;
  font-size: 10px;
  color: var(--text-muted);
  opacity: 0.5;
  padding: 4px 10px;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  letter-spacing: 0.3px;
}

/* Push content below windows nav */
.feed-layout {
  margin-top: calc(var(--header-height) + 44px) !important;
}


/* ============================================================
   JOBS VIEW
   ============================================================ */

.jobs-view {
  margin-top: calc(var(--header-height) + 44px);
  padding: 24px 32px 48px;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  min-height: calc(100vh - var(--header-height) - 44px);
}

.jobs-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Header */
.jobs-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.jobs-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.jobs-icon {
  font-size: 22px;
}

.jobs-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.jobs-title-ar {
  font-family: 'Noto Naskh Arabic', serif;
  font-size: 16px;
  color: var(--text-muted);
  direction: rtl;
}

.jobs-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

/* Sector sub-windows */
.jobs-sectors {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.sector-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.sector-pill:hover:not(.active) {
  background: var(--bg-hover);
}

.sector-pill.active {
  border-color: var(--sector-color, var(--accent));
  background: color-mix(in srgb, var(--sector-color, var(--accent)) 12%, transparent);
}

.sector-pill-icon {
  font-size: 13px;
}

.sector-pill-label {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-secondary);
  letter-spacing: -0.1px;
}

.sector-pill.active .sector-pill-label {
  font-weight: 600;
  color: var(--sector-color, var(--accent));
}

.sector-pill-label-ar {
  font-family: 'Noto Naskh Arabic', serif;
  font-size: 10px;
  color: var(--text-muted);
}

.sector-pill.active .sector-pill-label-ar {
  color: var(--sector-color, var(--accent));
  opacity: 0.8;
}

.sector-pill-count {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  color: var(--text-muted);
}

.sector-pill.active .sector-pill-count {
  background: color-mix(in srgb, var(--sector-color, var(--accent)) 18%, transparent);
  color: var(--sector-color, var(--accent));
}

/* Governorate filter */
.jobs-gov-filter {
  position: relative;
}

.jobs-gov-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.jobs-gov-toggle:hover {
  background: var(--bg-hover);
}

.jobs-gov-icon {
  font-size: 13px;
}

.jobs-gov-chevron {
  font-size: 10px;
  transition: transform var(--transition-fast);
}

.jobs-gov-toggle.open .jobs-gov-chevron {
  transform: rotate(180deg);
}

.jobs-gov-dropdown {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 14px 16px;
  margin-top: 8px;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  animation: fadeSlideIn 0.2s ease;
}

.jobs-gov-dropdown.hidden {
  display: none;
}

.jobs-gov-pill {
  padding: 5px 12px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.jobs-gov-pill:hover {
  background: var(--bg-hover);
}

.jobs-gov-pill.active {
  border-color: var(--accent);
  background: rgba(96, 165, 250, 0.12);
  color: var(--accent);
  font-weight: 600;
}

/* Search */
.jobs-search-wrap {
  position: relative;
}

.jobs-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  pointer-events: none;
}

.jobs-search {
  width: 100%;
  padding: 11px 14px 11px 38px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition-fast);
}

.jobs-search:focus {
  border-color: var(--accent);
}

/* Source cards grid */
.jobs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.job-source-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 18px;
  border-radius: var(--radius-xl);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  text-decoration: none;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.job-source-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--card-color, var(--accent)) 60%, transparent);
  opacity: 0.6;
}

.job-source-card:hover {
  border-color: var(--card-color, var(--accent));
  transform: translateY(-2px);
  background: var(--bg-hover);
  box-shadow: var(--shadow-md);
}

.job-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.job-card-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.job-card-icon {
  font-size: 20px;
}

.job-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.job-card-name-ar {
  font-family: 'Noto Naskh Arabic', serif;
  font-size: 12px;
  color: var(--text-muted);
  direction: rtl;
}

.job-card-arrow {
  color: var(--text-muted);
  font-size: 14px;
  opacity: 0.5;
  transition: opacity var(--transition-fast);
}

.job-source-card:hover .job-card-arrow {
  opacity: 1;
}

.job-card-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
}

.job-card-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-md);
  letter-spacing: 0.3px;
}

/* Footer */
.jobs-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  font-size: 12px;
  color: var(--text-muted);
}

.jobs-footer-ar {
  font-family: 'Noto Naskh Arabic', serif;
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.6;
}

/* Loading state */
.jobs-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 48px;
  color: var(--text-muted);
  font-size: 13px;
  grid-column: 1 / -1;
}

/* ── Job Listing Cards (real scraped jobs) ── */

.job-listing-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius-xl);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  text-decoration: none;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  grid-column: 1 / -1;
}

.job-listing-card:hover {
  border-color: var(--card-color, var(--accent));
  transform: translateY(-1px);
  background: var(--bg-hover);
  box-shadow: var(--shadow-sm);
}

.job-listing-strip {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: var(--radius-xl) 0 0 var(--radius-xl);
}

.job-listing-content {
  flex: 1;
  min-width: 0;
  padding-left: 4px;
}

.job-listing-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.2px;
  line-height: 1.4;
  margin-bottom: 2px;
}

.job-listing-title-ar {
  font-family: 'Noto Naskh Arabic', serif;
  font-size: 13px;
  color: var(--text-secondary);
  direction: rtl;
  text-align: right;
  margin-bottom: 6px;
  line-height: 1.5;
}

.job-listing-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.job-listing-org {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.job-listing-loc,
.job-listing-gov,
.job-listing-time {
  font-size: 11px;
  color: var(--text-muted);
}

.job-listing-tags {
  display: flex;
  align-items: center;
  gap: 6px;
}

.job-listing-arrow {
  color: var(--text-muted);
  font-size: 14px;
  opacity: 0.4;
  flex-shrink: 0;
  margin-top: 2px;
  transition: opacity var(--transition-fast);
}

.job-listing-card:hover .job-listing-arrow {
  opacity: 1;
}

/* Grid: listing cards use flex (full width), source cards use grid */
.jobs-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.jobs-grid--sources {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

/* ── Source directory section ── */
.jobs-sources-section {
  margin-top: 8px;
}

.jobs-sources-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.jobs-sources-toggle:hover {
  background: var(--bg-hover);
}

.jobs-sources-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
}

.jobs-sources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  margin-top: 12px;
  animation: fadeSlideIn 0.2s ease;
}

.jobs-sources-grid.hidden {
  display: none;
}

/* Empty state */
.jobs-empty {
  text-align: center;
  padding: 48px;
  color: var(--text-muted);
  font-size: 14px;
}

.jobs-empty-ar {
  font-family: 'Noto Naskh Arabic', serif;
  display: block;
  margin-top: 4px;
}

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

/* Mobile adjustments */
@media (max-width: 768px) {
  .windows-nav-inner {
    padding: 6px 12px;
  }

  .windows-brand {
    display: none;
  }

  .windows-coming {
    display: none;
  }

  .jobs-view {
    padding: 16px 12px 32px;
  }

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

  .jobs-header {
    flex-direction: column;
  }

  .jobs-sectors {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }

  .sector-pill {
    flex-shrink: 0;
  }
}


@media print {
  #header,
  .sidebar-left,
  .sidebar-right,
  .feed-filter-bar,
  .drawer-overlay {
    display: none !important;
  }

  .feed-layout {
    display: block;
  }

  .feed-main {
    margin: 0;
  }

  .article-card {
    border-bottom: 1px solid #ddd;
    break-inside: avoid;
  }

  body {
    background: white;
    color: black;
  }
}

/* ── Breaking News Banner ──────────────────────────────── */
.breaking-banner {
  background: linear-gradient(90deg, #1a0000 0%, #2d0a0a 50%, #1a0000 100%);
  border-bottom: 2px solid #E53E3E;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #FEB2B2;
  overflow: hidden;
  white-space: nowrap;
}
.breaking-pulse {
  animation: pulse-dot 1.5s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
.breaking-label {
  font-weight: 800;
  color: #E53E3E;
  letter-spacing: 2px;
  font-size: 12px;
  text-transform: uppercase;
  flex-shrink: 0;
}
.breaking-text {
  overflow: hidden;
  text-overflow: ellipsis;
  color: #FED7D7;
}
/* Breaking article card highlight */
.article-card.is-breaking {
  border-left: 3px solid #E53E3E;
  background: rgba(229, 62, 62, 0.05);
}
.breaking-badge {
  background: #E53E3E;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-left: 6px;
}

/* ── Faction Label ──────────────────────────────────────── */
.source-faction-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.8;
  margin-right: 4px;
}

/* ── Daily Briefing Card ───────────────────────────────── */
.briefing-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 12px;
  font-size: 13px;
  line-height: 1.5;
}
.briefing-content {
  color: #CBD5E0;
  max-height: 200px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.briefing-content::-webkit-scrollbar {
  width: 4px;
}
.briefing-content::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
}
.briefing-meta {
  margin-top: 8px;
  font-size: 11px;
  color: #718096;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.briefing-meta .hotspot-tag {
  background: rgba(229, 62, 62, 0.15);
  color: #FC8181;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 10px;
}
.briefing-placeholder {
  color: #4A5568;
  font-style: italic;
}

/* ── RTL Mode Fixes ────────────────────────────────────── */
[dir="rtl"] .article-card {
  direction: rtl;
  text-align: right;
}
[dir="rtl"] .article-meta {
  direction: rtl;
}
[dir="rtl"] .article-source {
  direction: rtl;
}
[dir="rtl"] .source-faction-label {
  margin-right: 0;
  margin-left: 4px;
}
[dir="rtl"] .article-title-primary {
  direction: rtl;
  text-align: right;
}
[dir="rtl"] .article-title-secondary {
  direction: ltr;
  text-align: left;
}
[dir="rtl"] .article-title-en {
  direction: ltr;
  text-align: left;
}
[dir="rtl"] .article-tags {
  direction: rtl;
  justify-content: flex-start;
}
[dir="rtl"] .article-time {
  text-align: right;
}
[dir="rtl"] .sidebar-heading {
  text-align: right;
}
[dir="rtl"] .filter-pills {
  direction: rtl;
}
[dir="rtl"] .briefing-content {
  direction: rtl;
  text-align: right;
  font-family: 'Noto Naskh Arabic', serif;
}
[dir="rtl"] .briefing-meta {
  direction: rtl;
}
[dir="rtl"] .trending-item {
  direction: rtl;
  text-align: right;
}
[dir="rtl"] .trending-title {
  text-align: right;
}
[dir="rtl"] .trending-source {
  text-align: right;
}
[dir="rtl"] .preset-pills,
[dir="rtl"] .window-pills {
  direction: rtl;
}
[dir="rtl"] .feed-filter-bar {
  direction: rtl;
}
[dir="rtl"] .gov-select {
  direction: rtl;
  text-align: right;
}
/* Map click label */
[dir="rtl"] .map-click-hint {
  direction: rtl;
  text-align: right;
}
/* Jobs cards RTL */
[dir="rtl"] .job-card {
  direction: rtl;
  text-align: right;
}
[dir="rtl"] .job-title {
  text-align: right;
}

/* ── RTL: keep lang toggle in same position ───────────── */
[dir="rtl"] .top-header {
  direction: ltr; /* Keep header layout stable — clock left, logo center, controls right */
}
[dir="rtl"] .header-controls {
  direction: ltr;
}
[dir="rtl"] .lang-btn {
  direction: ltr;
}

/* ── RTL: nav alignment ──────────────────────────────── */
[dir="rtl"] .nav-about,
[dir="rtl"] .nav-sources {
  text-align: right;
}
[dir="rtl"] .sidebar-nav {
  text-align: right;
  direction: rtl;
}
[dir="rtl"] .sidebar-nav a {
  text-align: right;
}

/* ── RTL: header stays LTR layout, only brand text is RTL ─ */
[dir="rtl"] .header-brand {
  direction: rtl;
}

/* ── RTL: article cards fully right-aligned ───────────── */
[dir="rtl"] .article-body {
  text-align: right;
  direction: rtl;
}
[dir="rtl"] .article-body h3,
[dir="rtl"] .article-body p {
  text-align: right;
  direction: rtl;
}
[dir="rtl"] .article-title-secondary {
  direction: ltr !important;
  text-align: left !important;
}
[dir="rtl"] .article-meta {
  flex-direction: row-reverse;
}

/* ── RTL: trending section ────────────────────────────── */
[dir="rtl"] .trending-section {
  direction: rtl;
  text-align: right;
}
[dir="rtl"] .trending-section h3 {
  text-align: right;
}

/* ── RTL: feed filter bar ─────────────────────────────── */
[dir="rtl"] .feed-header {
  direction: rtl;
}
[dir="rtl"] .window-nav {
  direction: rtl;
}

/* ── Briefing scroll hint ──────────────────────────────── */
.briefing-scroll-hint {
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-tertiary, #718096);
  letter-spacing: 0.05em;
  padding: 4px 0 2px;
  opacity: 0.7;
  animation: pulse-hint 2s ease-in-out infinite;
}
@keyframes pulse-hint {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}
.briefing-content:hover + .briefing-scroll-hint,
.briefing-content.scrolled-bottom + .briefing-scroll-hint {
  display: none;
}
.briefing-date {
  display: block;
  font-size: 0.7rem;
  color: var(--text-tertiary, #718096);
  margin-top: 6px;
}
/* ═══════════════════════════════════════════════════════════════════════════
   RTL FIX — Append to end of styles.css
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── 1. Lock entire header layout to LTR ──────────────────────────────────
   The header uses absolute-center logo + space-between for clock/controls.
   When the page flips to RTL, the flex layout reverses and .header-controls
   gets pushed off-screen. Locking the header to LTR keeps it stable.
   ─────────────────────────────────────────────────────────────────────── */
[dir="rtl"] #header {
  direction: ltr;
}

/* ── 2. Fix clock reversal ───────────────────────────────────────────────
   Block A sets row-reverse which puts the timezone before the time.
   Override back to normal row order.
   ─────────────────────────────────────────────────────────────────────── */
[dir="rtl"] .header-clock {
  flex-direction: row;
}

/* ── 3. Prevent lang button collapse ─────────────────────────────────────
   The ع character is very narrow → button shrinks to near-zero width.
   Force a minimum width and center the content.
   ─────────────────────────────────────────────────────────────────────── */
.lang-btn {
  min-width: 68px;
  justify-content: center;
}

.lang-option {
  display: inline-block;
  min-width: 20px;
  text-align: center;
}

/* ── 4. Resolve Block A vs Block B conflicts ─────────────────────────────
   These declarations use the correct RTL values.
   They override both Block A and Block B by cascade order.
   ─────────────────────────────────────────────────────────────────────── */

/* article-time: in RTL should be right-aligned (Block B was correct) */
[dir="rtl"] .article-time {
  text-align: right;
}

/* article-tags: in RTL should flow from the right (flex-start in RTL context) */
[dir="rtl"] .article-tags {
  direction: rtl;
  justify-content: flex-start;
}

/* preset-pills and window-pills: let direction handle it, don't reverse */
[dir="rtl"] .preset-pills,
[dir="rtl"] .window-pills {
  direction: rtl;
  flex-direction: row; /* remove row-reverse — direction:rtl handles it */
}

/* ── 5. Keep header controls and lang button always LTR ────────────────── */
[dir="rtl"] .header-controls {
  direction: ltr;
}

[dir="rtl"] .lang-btn {
  direction: ltr;
}

/* ── 6. Header brand text should be RTL (Arabic site name) ─────────────── */
[dir="rtl"] .header-brand {
  direction: rtl;
}

/* ── 7. Feed layout — let direction handle reversal ────────────────────── */
[dir="rtl"] .feed-layout {
  direction: rtl;
}

/* ── 8. Sidebar drawer RTL positioning ─────────────────────────────────── */
[dir="rtl"] .sidebar-left {
  border-right: none;
  border-left: 1px solid var(--border-subtle);
}

[dir="rtl"] .sidebar-right {
  border-left: none;
  border-right: 1px solid var(--border-subtle);
}

/* ── 9. Article card RTL — proper text alignment ───────────────────────── */
[dir="rtl"] .article-card {
  direction: rtl;
  text-align: right;
}

[dir="rtl"] .article-body {
  text-align: right;
  direction: rtl;
}

[dir="rtl"] .article-body h3,
[dir="rtl"] .article-body p {
  text-align: right;
}

/* English title stays LTR even in Arabic mode */
[dir="rtl"] .article-title-secondary,
[dir="rtl"] .article-title-en {
  direction: ltr !important;
  text-align: left !important;
}

/* Arabic primary title */
[dir="rtl"] .article-title-primary {
  direction: rtl;
  text-align: right;
}

/* Source and meta row — reverse layout */
[dir="rtl"] .article-meta {
  direction: rtl;
  flex-direction: row-reverse;
}

[dir="rtl"] .article-source {
  direction: rtl;
}

[dir="rtl"] .source-faction-label {
  margin-right: 0;
  margin-left: 4px;
}

/* ── 10. Sidebar headings and trending ─────────────────────────────────── */
[dir="rtl"] .sidebar-heading {
  text-align: right;
}

[dir="rtl"] .trending-item {
  direction: rtl;
  text-align: right;
}

[dir="rtl"] .trending-title,
[dir="rtl"] .trending-source {
  text-align: right;
}

[dir="rtl"] .trending-section {
  direction: rtl;
  text-align: right;
}

/* ── 11. Filter bar and nav ────────────────────────────────────────────── */
[dir="rtl"] .filter-pills,
[dir="rtl"] .feed-filter-bar,
[dir="rtl"] .feed-header,
[dir="rtl"] .window-nav {
  direction: rtl;
}

[dir="rtl"] .gov-select {
  direction: rtl;
  text-align: right;
  background-position: left 10px center;
  padding-left: 30px;
  padding-right: 12px;
}

/* ── 12. Sidebar nav alignment ─────────────────────────────────────────── */
[dir="rtl"] .sidebar-nav,
[dir="rtl"] .sidebar-nav a,
[dir="rtl"] .nav-about,
[dir="rtl"] .nav-sources,
[dir="rtl"] .nav-item {
  text-align: right;
  direction: rtl;
}

/* ── 13. Briefing content ──────────────────────────────────────────────── */
[dir="rtl"] .briefing-content {
  direction: rtl;
  text-align: right;
  font-family: 'Noto Naskh Arabic', serif;
}

[dir="rtl"] .briefing-meta {
  direction: rtl;
}

/* ── 14. Jobs cards ────────────────────────────────────────────────────── */
[dir="rtl"] .job-card {
  direction: rtl;
  text-align: right;
}

[dir="rtl"] .job-title {
  text-align: right;
}

/* ── 15. Map hint ──────────────────────────────────────────────────────── */
[dir="rtl"] .map-click-hint {
  direction: rtl;
  text-align: right;
}

/* ── 16. Stats bar ─────────────────────────────────────────────────────── */
[dir="rtl"] .stats-bar {
  direction: rtl;
}

[dir="rtl"] .stat {
  align-items: flex-end;
}

/* ── 17. Mobile RTL drawer ─────────────────────────────────────────────── */
@media (max-width: 1024px) {
  [dir="rtl"] .sidebar-left {
    left: auto;
    right: 0;
    transform: translateX(100%);
  }
  [dir="rtl"] .sidebar-left.drawer-open {
    transform: translateX(0);
  }
}

/* ── 18. Title language classes (replaces inline JS styles) ────────────── */
/* These classes are used by renderArticle() instead of inline style assignments.
   See rtl-fix.patch.js CHANGE 2 for the JS side. */
.article-title-ar {
  direction: rtl;
  text-align: right;
  font-family: 'Noto Naskh Arabic', serif;
}

.article-title-en {
  direction: ltr;
  text-align: left;
}


/* ═══════════════════════════════════════════════════════════════════
   BREAKING NEWS TICKER
   ═══════════════════════════════════════════════════════════════════ */

.breaking-ticker {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 99;
  font-family: 'Inter', sans-serif;
}

.breaking-ticker-bar {
  display: flex;
  align-items: center;
  height: 36px;
  background: linear-gradient(90deg, #1a0505 0%, #2d0a0a 50%, #1a0505 100%);
  border-bottom: 2px solid #E53E3E;
  padding: 0 12px;
  gap: 10px;
  overflow: hidden;
}

.breaking-ticker-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #E53E3E;
  text-transform: uppercase;
  padding-right: 12px;
  border-right: 1px solid rgba(229, 62, 62, 0.3);
}

.breaking-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #E53E3E;
  animation: breakingPulse 1.5s ease-in-out infinite;
}

@keyframes breakingPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(229, 62, 62, 0.6); }
  50% { opacity: 0.6; box-shadow: 0 0 0 4px rgba(229, 62, 62, 0); }
}

.breaking-ticker-track {
  flex: 1;
  overflow: hidden;
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  mask-image: linear-gradient(90deg, transparent 0%, black 3%, black 97%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, black 3%, black 97%, transparent 100%);
}

.breaking-ticker-scroll {
  display: flex;
  align-items: center;
  gap: 0;
  white-space: nowrap;
  animation: tickerScroll var(--ticker-duration, 30s) linear infinite;
}

.breaking-ticker-bar:hover .breaking-ticker-scroll {
  animation-play-state: paused;
}

@keyframes tickerScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.breaking-ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 20px;
  color: #FED7D7;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s;
  text-decoration: none;
}

.breaking-ticker-item:hover { color: #fff; }

.breaking-ticker-sep {
  color: rgba(229, 62, 62, 0.5);
  font-size: 10px;
  padding: 0 4px;
}

.breaking-ticker-age {
  font-size: 10px;
  color: rgba(254, 215, 215, 0.5);
  font-family: 'JetBrains Mono', monospace;
}

.breaking-expand-btn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(229, 62, 62, 0.3);
  border-radius: 4px;
  background: rgba(229, 62, 62, 0.1);
  color: #FEB2B2;
  font-size: 10px;
  cursor: pointer;
  transition: all 0.15s;
}

.breaking-expand-btn:hover { background: rgba(229, 62, 62, 0.2); color: #fff; }
.breaking-expand-btn.expanded { transform: rotate(180deg); }

.breaking-panel {
  display: none;
  background: rgba(26, 5, 5, 0.98);
  border-bottom: 1px solid rgba(229, 62, 62, 0.2);
  max-height: 320px;
  overflow-y: auto;
  backdrop-filter: blur(12px);
}

.breaking-panel.visible { display: block; }

.breaking-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #FEB2B2;
  border-bottom: 1px solid rgba(229, 62, 62, 0.15);
}

.breaking-panel-close {
  border: none;
  background: none;
  color: #FEB2B2;
  font-size: 14px;
  cursor: pointer;
}

.breaking-panel-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
  color: inherit;
}

.breaking-panel-item:hover { background: rgba(229, 62, 62, 0.08); }

.breaking-panel-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #E53E3E;
  flex-shrink: 0;
  margin-top: 6px;
}

.breaking-panel-content { flex: 1; min-width: 0; }

.breaking-panel-title {
  font-size: 13px;
  font-weight: 600;
  color: #FED7D7;
  line-height: 1.4;
}

.breaking-panel-meta {
  font-size: 11px;
  color: rgba(254, 215, 215, 0.5);
}

.breaking-panel-age {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: rgba(254, 215, 215, 0.4);
  flex-shrink: 0;
}

.article-card.is-breaking {
  border-left: 3px solid #E53E3E;
  background: linear-gradient(90deg, rgba(229, 62, 62, 0.08), rgba(229, 62, 62, 0.02));
}

/* ═══════════════════════════════════════════════════════════════════
   SEARCH
   ═══════════════════════════════════════════════════════════════════ */

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

.search-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle, rgba(255,255,255,0.08));
  background: var(--bg-primary, #0f172a);
  color: var(--text-secondary, #94a3b8);
  cursor: pointer;
  transition: all 0.15s;
}

.search-toggle:hover {
  border-color: var(--border, #334155);
  color: var(--text-primary, #f1f5f9);
}

.search-input {
  position: absolute;
  right: 40px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  opacity: 0;
  padding: 6px 12px;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  background: var(--bg-primary, #0f172a);
  color: var(--text-primary, #f1f5f9);
  border: 1px solid var(--border-subtle, rgba(255,255,255,0.08));
  border-radius: 20px;
  outline: none;
  transition: width 0.3s ease, opacity 0.3s ease;
}

.search-wrap.active .search-input {
  width: 240px;
  opacity: 1;
}

.search-input:focus {
  border-color: var(--accent, #60a5fa);
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.15);
}

.search-input::placeholder { color: var(--text-muted, #475569); }

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 420px;
  max-height: 480px;
  overflow-y: auto;
  background: var(--bg-secondary, #1e293b);
  border: 1px solid var(--border-subtle, rgba(255,255,255,0.08));
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  z-index: 200;
  display: none;
}

.search-results.visible { display: block; }

.search-result-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
  cursor: pointer;
  transition: background 0.15s;
}

.search-result-item:hover { background: var(--bg-tertiary, #334155); }
.search-result-item:last-child { border-bottom: none; }

.search-result-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary, #f1f5f9);
  line-height: 1.4;
}

.search-result-snippet {
  font-size: 12px;
  color: var(--text-secondary, #94a3b8);
  line-height: 1.5;
}

.search-result-snippet mark {
  background: rgba(96, 165, 250, 0.25);
  color: var(--accent, #60a5fa);
  padding: 0 2px;
  border-radius: 2px;
}

.search-result-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted, #475569);
}

.search-result-faction {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.search-no-results, .search-loading {
  padding: 24px 16px;
  text-align: center;
  color: var(--text-muted, #475569);
  font-size: 13px;
}

@media (max-width: 640px) {
  .search-wrap.active .search-input { width: 160px; }
  .search-results { width: calc(100vw - 24px); right: -12px; }
}

/* ═══════════════════════════════════════════════════════════════════
   MAP ENHANCEMENTS
   ═══════════════════════════════════════════════════════════════════ */

@keyframes mapPulseRing {
  0% { r: 0.15; opacity: 0.6; stroke-width: 0.03; }
  100% { r: 0.45; opacity: 0; stroke-width: 0.005; }
}

@keyframes mapGovGlow {
  0%, 100% { filter: drop-shadow(0 0 2px rgba(96, 165, 250, 0.6)); }
  50% { filter: drop-shadow(0 0 6px rgba(96, 165, 250, 0.9)); }
}

.map-tooltip {
  position: absolute;
  z-index: 60;
  pointer-events: none;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-subtle, rgba(255,255,255,0.08));
  border-radius: 8px;
  padding: 8px 12px;
  min-width: 160px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.15s;
}

.map-tooltip.visible { opacity: 1; }

.map-tooltip-name {
  font-weight: 700;
  color: var(--text-primary, #f1f5f9);
  margin-bottom: 6px;
  font-size: 13px;
}

.map-tooltip-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
  color: var(--text-secondary, #94a3b8);
}

.map-tooltip-bar {
  height: 4px;
  border-radius: 2px;
  background: var(--bg-tertiary, #334155);
  flex: 1;
  overflow: hidden;
}

.map-tooltip-fill {
  height: 100%;
  border-radius: 2px;
}

.map-view-toggle {
  display: flex;
  gap: 4px;
  padding: 6px 16px 2px;
}

.map-view-btn {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 20px;
  border: 1px solid var(--border-subtle, rgba(255,255,255,0.08));
  background: transparent;
  color: var(--text-muted, #475569);
  cursor: pointer;
  transition: all 0.15s;
}

.map-view-btn.active {
  background: var(--accent, #60a5fa);
  color: #fff;
  border-color: var(--accent, #60a5fa);
}

.map-view-btn:hover:not(.active) {
  border-color: var(--border, #334155);
  color: var(--text-secondary, #94a3b8);
}


/* ═══════════════════════════════════════════════════════════════════
   NEWS TICKER (always visible)
   ═══════════════════════════════════════════════════════════════════ */

.news-ticker {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 98;
  display: flex;
  align-items: center;
  height: 32px;
  margin-top: var(--header-height);
  background: var(--bg-secondary, #1e293b);
  border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
  overflow: hidden;
}

.news-ticker-label {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 0 14px;
  height: 100%;
  background: linear-gradient(90deg, rgba(96,165,250,0.12), transparent);
  border-right: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--accent, #60a5fa);
  text-transform: uppercase;
  white-space: nowrap;
}

.ticker-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent, #60a5fa);
  animation: tickerDotPulse 2s ease-in-out infinite;
}

@keyframes tickerDotPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.news-ticker-track {
  flex: 1;
  overflow: hidden;
  height: 100%;
  display: flex;
  align-items: center;
  mask-image: linear-gradient(90deg, transparent 0%, black 2%, black 98%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, black 2%, black 98%, transparent 100%);
}

.news-ticker-scroll {
  display: flex;
  align-items: center;
  white-space: nowrap;
  animation: tickerScrollLTR var(--ticker-speed, 40s) linear infinite;
}

@keyframes tickerScrollLTR {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@keyframes tickerScrollRTL {
  0% { transform: translateX(-50%); }
  100% { transform: translateX(0); }
}

[dir="rtl"] .news-ticker-scroll { animation-name: tickerScrollRTL; }
[dir="rtl"] .news-ticker-label { background: linear-gradient(270deg, rgba(96,165,250,0.12), transparent); border-right: none; border-left: 1px solid var(--border-subtle); }

.news-ticker:hover .news-ticker-scroll { animation-play-state: paused; }

.news-ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 24px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary, #94a3b8);
  cursor: pointer;
  transition: color 0.15s;
  text-decoration: none;
}

.news-ticker-item:hover { color: var(--text-primary, #f1f5f9); }

.news-ticker-item-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.news-ticker-sep {
  color: var(--border, #334155);
  font-size: 8px;
  padding: 0 2px;
}

.news-ticker-time {
  font-size: 10px;
  color: var(--text-muted, #475569);
  font-family: 'JetBrains Mono', monospace;
  margin-left: 6px;
}

[dir="rtl"] .news-ticker-time { margin-left: 0; margin-right: 6px; }
[dir="rtl"] .news-ticker-item { direction: rtl; }

@media (max-width: 640px) {
  .news-ticker-label { padding: 0 8px; font-size: 9px; }
  .news-ticker-item { font-size: 11px; padding: 0 16px; }
}

/* ═══════════════════════════════════════════════════════════════════
   MAP LEGEND
   ═══════════════════════════════════════════════════════════════════ */

.map-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  font-size: 9px;
  color: var(--text-muted, #475569);
}

.map-legend-bar {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, #1e293b 0%, #1e3a5f 25%, #2563eb 50%, #f59e0b 75%, #ef4444 100%);
}

.map-faction-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 16px 6px;
  font-size: 9px;
}

.map-faction-dot {
  display: flex;
  align-items: center;
  gap: 3px;
  color: var(--text-muted, #475569);
}

.map-faction-dot-circle {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

#sidebar-map { background: #080810 !important; }
/**
 * PATCH: Syrian Design System — Cultural Elements for Nawafith
 *
 * Authentic Syrian architectural & artistic motifs translated into CSS/SVG:
 *   1. Rub el Hizb Star (logo, favicon, spinner, bullets)
 *   2. Mashrabiya Lattice (page background texture)
 *   3. Pointed Arch Card Headers (nawfitha window frames)
 *   4. Ablaq Banding (row striping, dividers)
 *   5. Ajami Panel Borders (featured/spotlight cards)
 *   6. Jasmine Vine Scroll (section dividers)
 *   7. Syrian Color Palette (Umayyad Gold, Damascene Rose, etc.)
 *   8. Octagonal Filter Chips (geometric clip-path)
 *   9. Window-Opening Transition (page navigation)
 *  10. 8-Pointed Star Loading Spinner
 *
 * HOW TO APPLY: Append to styles.css
 */


/* ═══════════════════════════════════════════════════════════════════════
   SYRIAN COLOR VARIABLES — Add to :root
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  /* Syrian accent palette */
  --syrian-gold: #d4a853;        /* Umayyad Mosque mosaics, Ajami gold leaf */
  --syrian-rose: #c4566a;        /* Damascene Rose (ward al-jouri) */
  --syrian-olive: #6b7c5e;       /* Syrian olive groves, Ghouta */
  --syrian-sand: #c2a67d;        /* Desert sand, Palmyra limestone */
  --syrian-aleppo: #8b9caa;      /* Aleppo citadel grey limestone */
  --syrian-jasmine: #e8e4dc;     /* Jasmine blossoms, limestone white */
}


/* ═══════════════════════════════════════════════════════════════════════
   1. RUB EL HIZB STAR — Logo / Favicon / Spinner / Bullets
   ═══════════════════════════════════════════════════════════════════════ */

/* Base star container */
.hizb-star {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hizb-star .sq {
  position: absolute;
  border: 2px solid var(--accent);
  border-radius: 2px;
}

.hizb-star .sq:nth-child(2) {
  transform: rotate(45deg);
}

/* Size variants */
.hizb-star--logo {
  width: 80px;
  height: 80px;
}
.hizb-star--logo .sq {
  inset: 12px;
  border-width: 2.5px;
  border-radius: 3px;
}

.hizb-star--favicon {
  width: 32px;
  height: 32px;
}
.hizb-star--favicon .sq {
  inset: 5px;
  border-width: 1.5px;
  border-radius: 1px;
}

.hizb-star--header {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}
.hizb-star--header .sq {
  inset: 3px;
  border-width: 1.5px;
  border-radius: 1px;
}

/* Spinner: one square rotates */
.hizb-star--spinner {
  width: 48px;
  height: 48px;
}
.hizb-star--spinner .sq {
  inset: 8px;
}
.hizb-star--spinner .sq:nth-child(1) {
  animation: hizbSpin 3s linear infinite;
}
.hizb-star--spinner .sq:nth-child(2) {
  transform: rotate(45deg);
  opacity: 0.4;
}

@keyframes hizbSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Assembling spinner */
.hizb-star--assembling {
  width: 48px;
  height: 48px;
}
.hizb-star--assembling .sq {
  inset: 8px;
}
.hizb-star--assembling .sq:nth-child(1) {
  animation: hizbAssemble1 2s ease-in-out infinite;
}
.hizb-star--assembling .sq:nth-child(2) {
  animation: hizbAssemble2 2s ease-in-out infinite;
}

@keyframes hizbAssemble1 {
  0%   { transform: rotate(0deg) scale(0.5); opacity: 0; }
  30%  { transform: rotate(0deg) scale(1);   opacity: 1; }
  70%  { transform: rotate(0deg) scale(1);   opacity: 1; }
  100% { transform: rotate(0deg) scale(0.5); opacity: 0; }
}

@keyframes hizbAssemble2 {
  0%   { transform: rotate(0deg) scale(0.5); opacity: 0; }
  15%  { transform: rotate(0deg) scale(0.5); opacity: 0; }
  45%  { transform: rotate(45deg) scale(1);  opacity: 1; }
  70%  { transform: rotate(45deg) scale(1);  opacity: 1; }
  100% { transform: rotate(90deg) scale(0.5); opacity: 0; }
}

/* Pulsing star (gold variant) */
.hizb-star--pulse .sq {
  border-color: var(--syrian-gold);
}
.hizb-star--pulse .sq:nth-child(1) {
  animation: hizbPulse 1.5s ease-in-out infinite;
}
.hizb-star--pulse .sq:nth-child(2) {
  transform: rotate(45deg);
  animation: hizbPulse45 1.5s ease-in-out infinite 0.2s;
}

@keyframes hizbPulse {
  0%, 100% { opacity: 0.3; transform: scale(0.9); }
  50%      { opacity: 1;   transform: scale(1.05); }
}
@keyframes hizbPulse45 {
  0%, 100% { opacity: 0.3; transform: rotate(45deg) scale(0.9); }
  50%      { opacity: 1;   transform: rotate(45deg) scale(1.05); }
}

/* Star bullet points */
.hizb-bullet {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.hizb-bullet-icon {
  position: relative;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.hizb-bullet-icon .sq {
  position: absolute;
  inset: 1px;
  border: 1px solid var(--syrian-gold);
}

.hizb-bullet-icon .sq:nth-child(2) {
  transform: rotate(45deg);
}


/* ═══════════════════════════════════════════════════════════════════════
   2. MASHRABIYA LATTICE — Page Background Texture
   ═══════════════════════════════════════════════════════════════════════ */

.mashrabiya-bg {
  position: relative;
}

.mashrabiya-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48'%3E%3Crect x='12' y='12' width='24' height='24' fill='none' stroke='%2360a5fa' stroke-width='0.8'/%3E%3Crect x='12' y='12' width='24' height='24' fill='none' stroke='%2360a5fa' stroke-width='0.8' transform='rotate(45 24 24)'/%3E%3Ccircle cx='24' cy='24' r='2' fill='%2360a5fa' opacity='0.5'/%3E%3Ccircle cx='0' cy='0' r='2' fill='%2360a5fa' opacity='0.3'/%3E%3Ccircle cx='48' cy='0' r='2' fill='%2360a5fa' opacity='0.3'/%3E%3Ccircle cx='0' cy='48' r='2' fill='%2360a5fa' opacity='0.3'/%3E%3Ccircle cx='48' cy='48' r='2' fill='%2360a5fa' opacity='0.3'/%3E%3C/svg%3E");
  background-size: 48px 48px;
  z-index: 0;
}

.mashrabiya-bg > * {
  position: relative;
  z-index: 1;
}


/* ═══════════════════════════════════════════════════════════════════════
   3. POINTED ARCH CARD HEADERS — Nawfitha Window Frames
   ═══════════════════════════════════════════════════════════════════════ */

.arch-card {
  border-radius: 0 0 12px 12px;
  overflow: hidden;
  background: var(--bg-secondary, #1e293b);
  border: 1px solid var(--border, #334155);
}

.arch-card-header {
  position: relative;
  height: 44px;
  background: rgba(96, 165, 250, 0.05);
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 8px;
  overflow: hidden;
}

/* Arch SVG curve — inject via JS or inline SVG */
.arch-card-header .arch-svg {
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.arch-card-header .arch-label {
  position: relative;
  z-index: 1;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--accent);
  text-transform: uppercase;
}

.arch-card-body {
  padding: 16px;
}


/* ═══════════════════════════════════════════════════════════════════════
   4. ABLAQ BANDING — Row Striping & Dividers
   ═══════════════════════════════════════════════════════════════════════ */

/* Alternating row colors (apply to table or list) */
.ablaq-rows tr:nth-child(odd) td,
.ablaq-rows li:nth-child(odd) {
  background: #0f172a;
}

.ablaq-rows tr:nth-child(even) td,
.ablaq-rows li:nth-child(even) {
  background: #131b2e;
}

.ablaq-rows tr:hover td,
.ablaq-rows li:hover {
  background: rgba(96, 165, 250, 0.05);
}

/* Thin ablaq divider (2-tone) */
.ablaq-divider {
  height: 3px;
  border: none;
  background: repeating-linear-gradient(
    90deg,
    #334155 0px, #334155 12px,
    #1e293b 12px, #1e293b 24px
  );
  opacity: 0.6;
  border-radius: 2px;
}

/* Thick ablaq divider (3-tone, Mamluk-era) */
.ablaq-divider--thick {
  height: 6px;
  border: none;
  background: repeating-linear-gradient(
    90deg,
    #334155 0px, #334155 16px,
    #1a2332 16px, #1a2332 32px,
    #1e293b 32px, #1e293b 48px
  );
  opacity: 0.5;
  border-radius: 3px;
}


/* ═══════════════════════════════════════════════════════════════════════
   5. AJAMI PANEL BORDERS — Featured / Spotlight Cards
   ═══════════════════════════════════════════════════════════════════════ */

.ajami-panel {
  position: relative;
  padding: 24px;
  border: 1px solid rgba(96, 165, 250, 0.15);
  outline: 1px solid rgba(96, 165, 250, 0.08);
  outline-offset: 5px;
  background: var(--bg-primary, #0f172a);
}

/* Top corner diamonds (::before and ::after) */
.ajami-panel::before,
.ajami-panel::after {
  content: '';
  position: absolute;
  width: 9px;
  height: 9px;
  border: 1px solid rgba(96, 165, 250, 0.25);
  transform: rotate(45deg);
  background: var(--bg-deep, #080810);
}
.ajami-panel::before { top: -5px; left: -5px; }
.ajami-panel::after  { top: -5px; right: -5px; }

/* Bottom corners — use child elements */
.ajami-panel-corner-bl,
.ajami-panel-corner-br {
  position: absolute;
  width: 9px;
  height: 9px;
  border: 1px solid rgba(96, 165, 250, 0.25);
  transform: rotate(45deg);
  background: var(--bg-deep, #080810);
}
.ajami-panel-corner-bl { bottom: -5px; left: -5px; }
.ajami-panel-corner-br { bottom: -5px; right: -5px; }

.ajami-panel-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--syrian-gold);
  text-transform: uppercase;
  margin-bottom: 10px;
}

/* Gold variant for breaking news */
.ajami-panel--gold {
  border-color: rgba(212, 168, 83, 0.2);
  outline-color: rgba(212, 168, 83, 0.1);
}
.ajami-panel--gold::before,
.ajami-panel--gold::after,
.ajami-panel--gold .ajami-panel-corner-bl,
.ajami-panel--gold .ajami-panel-corner-br {
  border-color: rgba(212, 168, 83, 0.3);
}


/* ═══════════════════════════════════════════════════════════════════════
   6. JASMINE VINE SCROLL — Section Dividers
   ═══════════════════════════════════════════════════════════════════════

   Usage: <svg class="vine-divider"> with the SVG path inline.
   See syrian-elements.patch.js for the buildVineDivider() helper.
   ═══════════════════════════════════════════════════════════════════════ */

.vine-divider {
  width: 100%;
  height: 24px;
  display: block;
  margin: 8px 0;
}


/* ═══════════════════════════════════════════════════════════════════════
   8. OCTAGONAL FILTER CHIPS — Geometric Clip-Path
   ═══════════════════════════════════════════════════════════════════════ */

.oct-chip {
  clip-path: polygon(
    15% 0%, 85% 0%, 100% 15%, 100% 85%,
    85% 100%, 15% 100%, 0% 85%, 0% 15%
  );
  background: rgba(96, 165, 250, 0.12);
  padding: 7px 18px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary, #94a3b8);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: none;
}

.oct-chip:hover {
  background: rgba(96, 165, 250, 0.22);
  color: var(--text-primary, #f1f5f9);
}

.oct-chip.active,
.oct-chip[aria-selected="true"] {
  background: rgba(96, 165, 250, 0.3);
  color: #fff;
}


/* ═══════════════════════════════════════════════════════════════════════
   9. WINDOW-OPENING TRANSITION — Page Navigation
   ═══════════════════════════════════════════════════════════════════════ */

.window-transition {
  perspective: 800px;
  position: relative;
  overflow: hidden;
}

.window-panel-left,
.window-panel-right {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  background: var(--bg-secondary, #1e293b);
  border: 1px solid var(--border, #334155);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10;
}

.window-panel-left {
  left: 0;
  transform-origin: left center;
}

.window-panel-right {
  right: 0;
  transform-origin: right center;
}

.window-transition.open .window-panel-left {
  transform: rotateY(-75deg);
}

.window-transition.open .window-panel-right {
  transform: rotateY(75deg);
}


/* ═══════════════════════════════════════════════════════════════════════
   UTILITY: Syrian accent color classes
   ═══════════════════════════════════════════════════════════════════════ */

.text-gold     { color: var(--syrian-gold); }
.text-rose     { color: var(--syrian-rose); }
.text-olive    { color: var(--syrian-olive); }
.text-sand     { color: var(--syrian-sand); }
.text-aleppo   { color: var(--syrian-aleppo); }

.bg-gold       { background-color: var(--syrian-gold); }
.bg-rose       { background-color: var(--syrian-rose); }
.bg-olive      { background-color: var(--syrian-olive); }
.bg-sand       { background-color: var(--syrian-sand); }
.bg-aleppo     { background-color: var(--syrian-aleppo); }

/* Badge variants using Syrian colors */
.badge-breaking {
  background: rgba(212, 168, 83, 0.15);
  color: var(--syrian-gold);
  border: 1px solid rgba(212, 168, 83, 0.25);
}

.badge-alert {
  background: rgba(196, 86, 106, 0.15);
  color: var(--syrian-rose);
  border: 1px solid rgba(196, 86, 106, 0.25);
}

.badge-verified {
  background: rgba(107, 124, 94, 0.15);
  color: var(--syrian-olive);
  border: 1px solid rgba(107, 124, 94, 0.25);
}

/* Ablaq striping for ticker rows */
.ablaq-rows .ticker-row:nth-child(odd) { background: #0f172a; }
.ablaq-rows .ticker-row:nth-child(even) { background: #131b2e; }
.ablaq-rows .ticker-row:hover { background: rgba(96, 165, 250, 0.05); }

/* Syrian color overrides for existing badges */
.breaking-badge {
  background: rgba(212, 168, 83, 0.15) !important;
  color: var(--syrian-gold) !important;
  border: 1px solid rgba(212, 168, 83, 0.25) !important;
}
/**
 * PATCH: public/styles.css — Fix Arabic/RTL toggle bug
 *
 * The lang button disappears when switching to Arabic because:
 *   1. Block A sets `.header-clock { flex-direction: row-reverse }` — misaligns clock
 *   2. `.lang-btn` has no min-width — the narrow ع character causes collapse
 *   3. Two conflicting RTL blocks (Block A ~line 11742 vs Block B ~line 12812)
 *      set contradictory values for .article-tags, .article-time, etc.
 *
 * HOW TO APPLY: Append the CSS below to the END of styles.css.
 * Because it comes last, it wins by cascade order — no need to delete old rules.
 */


/* ═══════════════════════════════════════════════════════════════════════════
   RTL FIX — Append to end of styles.css
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── 1. Lock entire header layout to LTR ──────────────────────────────────
   The header uses absolute-center logo + space-between for clock/controls.
   When the page flips to RTL, the flex layout reverses and .header-controls
   gets pushed off-screen. Locking the header to LTR keeps it stable.
   ─────────────────────────────────────────────────────────────────────── */
[dir="rtl"] #header {
  direction: ltr;
}

/* ── 2. Fix clock reversal ───────────────────────────────────────────────
   Block A sets row-reverse which puts the timezone before the time.
   Override back to normal row order.
   ─────────────────────────────────────────────────────────────────────── */
[dir="rtl"] .header-clock {
  flex-direction: row;
}

/* ── 3. Prevent lang button collapse ─────────────────────────────────────
   The ع character is very narrow → button shrinks to near-zero width.
   Force a minimum width and center the content.
   ─────────────────────────────────────────────────────────────────────── */
.lang-btn {
  min-width: 68px;
  justify-content: center;
}

.lang-option {
  display: inline-block;
  min-width: 20px;
  text-align: center;
}

/* ── 4. Resolve Block A vs Block B conflicts ─────────────────────────────
   These declarations use the correct RTL values.
   They override both Block A and Block B by cascade order.
   ─────────────────────────────────────────────────────────────────────── */

/* article-time: in RTL should be right-aligned (Block B was correct) */
[dir="rtl"] .article-time {
  text-align: right;
}

/* article-tags: in RTL should flow from the right (flex-start in RTL context) */
[dir="rtl"] .article-tags {
  direction: rtl;
  justify-content: flex-start;
}

/* preset-pills and window-pills: let direction handle it, don't reverse */
[dir="rtl"] .preset-pills,
[dir="rtl"] .window-pills {
  direction: rtl;
  flex-direction: row; /* remove row-reverse — direction:rtl handles it */
}

/* ── 5. Keep header controls and lang button always LTR ────────────────── */
[dir="rtl"] .header-controls {
  direction: ltr;
}

[dir="rtl"] .lang-btn {
  direction: ltr;
}

/* ── 6. Header brand text should be RTL (Arabic site name) ─────────────── */
[dir="rtl"] .header-brand {
  direction: rtl;
}

/* ── 7. Feed layout — let direction handle reversal ────────────────────── */
[dir="rtl"] .feed-layout {
  direction: rtl;
}

/* ── 8. Sidebar drawer RTL positioning ─────────────────────────────────── */
[dir="rtl"] .sidebar-left {
  border-right: none;
  border-left: 1px solid var(--border-subtle);
}

[dir="rtl"] .sidebar-right {
  border-left: none;
  border-right: 1px solid var(--border-subtle);
}

/* ── 9. Article card RTL — proper text alignment ───────────────────────── */
[dir="rtl"] .article-card {
  direction: rtl;
  text-align: right;
}

[dir="rtl"] .article-body {
  text-align: right;
  direction: rtl;
}

[dir="rtl"] .article-body h3,
[dir="rtl"] .article-body p {
  text-align: right;
}

/* English title stays LTR even in Arabic mode */
[dir="rtl"] .article-title-secondary,
[dir="rtl"] .article-title-en {
  direction: ltr !important;
  text-align: left !important;
}

/* Arabic primary title */
[dir="rtl"] .article-title-primary {
  direction: rtl;
  text-align: right;
}

/* Source and meta row — reverse layout */
[dir="rtl"] .article-meta {
  direction: rtl;
  flex-direction: row-reverse;
}

[dir="rtl"] .article-source {
  direction: rtl;
}

[dir="rtl"] .source-faction-label {
  margin-right: 0;
  margin-left: 4px;
}

/* ── 10. Sidebar headings and trending ─────────────────────────────────── */
[dir="rtl"] .sidebar-heading {
  text-align: right;
}

[dir="rtl"] .trending-item {
  direction: rtl;
  text-align: right;
}

[dir="rtl"] .trending-title,
[dir="rtl"] .trending-source {
  text-align: right;
}

[dir="rtl"] .trending-section {
  direction: rtl;
  text-align: right;
}

/* ── 11. Filter bar and nav ────────────────────────────────────────────── */
[dir="rtl"] .filter-pills,
[dir="rtl"] .feed-filter-bar,
[dir="rtl"] .feed-header,
[dir="rtl"] .window-nav {
  direction: rtl;
}

[dir="rtl"] .gov-select {
  direction: rtl;
  text-align: right;
  background-position: left 10px center;
  padding-left: 30px;
  padding-right: 12px;
}

/* ── 12. Sidebar nav alignment ─────────────────────────────────────────── */
[dir="rtl"] .sidebar-nav,
[dir="rtl"] .sidebar-nav a,
[dir="rtl"] .nav-about,
[dir="rtl"] .nav-sources,
[dir="rtl"] .nav-item {
  text-align: right;
  direction: rtl;
}

/* ── 13. Briefing content ──────────────────────────────────────────────── */
[dir="rtl"] .briefing-content {
  direction: rtl;
  text-align: right;
  font-family: 'Noto Naskh Arabic', serif;
}

[dir="rtl"] .briefing-meta {
  direction: rtl;
}

/* ── 14. Jobs cards ────────────────────────────────────────────────────── */
[dir="rtl"] .job-card {
  direction: rtl;
  text-align: right;
}

[dir="rtl"] .job-title {
  text-align: right;
}

/* ── 15. Map hint ──────────────────────────────────────────────────────── */
[dir="rtl"] .map-click-hint {
  direction: rtl;
  text-align: right;
}

/* ── 16. Stats bar ─────────────────────────────────────────────────────── */
[dir="rtl"] .stats-bar {
  direction: rtl;
}

[dir="rtl"] .stat {
  align-items: flex-end;
}

/* ── 17. Mobile RTL drawer ─────────────────────────────────────────────── */
@media (max-width: 1024px) {
  [dir="rtl"] .sidebar-left {
    left: auto;
    right: 0;
    transform: translateX(100%);
  }
  [dir="rtl"] .sidebar-left.drawer-open {
    transform: translateX(0);
  }
}

/* ── 18. Title language classes (replaces inline JS styles) ────────────── */
/* These classes are used by renderArticle() instead of inline style assignments.
   See rtl-fix.patch.js CHANGE 2 for the JS side. */
.article-title-ar {
  direction: rtl;
  text-align: right;
  font-family: 'Noto Naskh Arabic', serif;
}

.article-title-en {
  direction: ltr;
  text-align: left;
}

/* ── Syrian Color Application ─────────────────────────────────────── */

/* Timestamps / metadata → Desert Sand */
.article-time, .article-source-meta, .briefing-meta {
  color: var(--syrian-sand, #c2a67d);
}

/* Humanitarian / verified badges → Olive */
.topic-humanitarian, .badge-verified {
  color: var(--syrian-olive, #6b7c5e);
  border-color: rgba(107, 124, 94, 0.3);
}

/* Alert / critical → Damascene Rose */
.badge-alert, .priority-high {
  color: var(--syrian-rose, #c4566a);
}

/* Aleppo grey for secondary metadata */
.article-faction, .source-tier-badge {
  color: var(--syrian-aleppo, #8b9caa);
}

/* Ablaq striping for trending items + generic children */
.ablaq-rows > div:nth-child(odd) { background: #0f172a; }
.ablaq-rows > div:nth-child(even) { background: #131b2e; }
.ablaq-rows > div:hover { background: rgba(96, 165, 250, 0.05); }

/* ── RTL Article Title Alignment ──────────────────────────────────── */
[dir="rtl"] .article-title-primary,
[dir="rtl"] .article-title-ar {
  direction: rtl;
  text-align: right;
  font-family: 'Noto Naskh Arabic', serif;
}

[dir="rtl"] .article-title-secondary {
  text-align: right;
}

[dir="rtl"] .article-card .article-body {
  text-align: right;
}

[dir="rtl"] .article-source-row {
  direction: rtl;
}

/* ── RTL Ticker Scroll Direction ──────────────────────────────────── */
/* news-ticker already uses tickerScrollRTL keyframes via line 3397 */
[dir="rtl"] .breaking-ticker-scroll { animation-name: tickerScrollRTL; }
[dir="rtl"] .breaking-ticker-item { direction: rtl; }

/* ── RTL Ajami Panel ──────────────────────────────────────────────── */
[dir="rtl"] .ajami-panel-label {
  text-align: right;
  direction: rtl;
}

[dir="rtl"] .briefing-content {
  direction: rtl;
  text-align: right;
  font-family: 'Noto Naskh Arabic', serif;
}

/* ── Map Redesign: Choropleth Fill ─────────────────────────────────── */
.map-legend { display: flex; align-items: center; gap: 6px; padding: 6px 16px; font-size: 9px; color: var(--text-muted); }
.map-legend-bar { flex: 1; height: 4px; border-radius: 2px; background: linear-gradient(90deg, #1e293b 0%, #1e3a5f 25%, #2563eb 50%, #f59e0b 75%, #ef4444 100%); }
.map-faction-legend { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 16px 6px; font-size: 9px; }
.map-faction-dot { display: flex; align-items: center; gap: 3px; color: var(--text-muted); }
.map-faction-dot-circle { width: 6px; height: 6px; border-radius: 50%; }
#sidebar-map { background: #080810 !important; }

/* ── Map Hover Tooltip Card ───────────────────────────────────────── */
.map-tooltip {
  display: none;
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(96, 165, 250, 0.2);
  border-radius: 8px;
  padding: 10px 14px;
  min-width: 140px;
  z-index: 10;
  pointer-events: none;
  backdrop-filter: blur(8px);
}
.map-tooltip.visible { display: block; }
.map-tooltip-name { font-size: 13px; font-weight: 700; color: #f1f5f9; margin-bottom: 2px; }
.map-tooltip-count { font-size: 11px; color: #94a3b8; margin-bottom: 6px; }
.map-tooltip-factions { display: flex; flex-direction: column; gap: 2px; }
.map-tooltip-faction { display: flex; align-items: center; gap: 6px; font-size: 10px; color: #94a3b8; }
.map-tooltip-faction-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.map-tooltip-faction-bar { height: 3px; border-radius: 2px; }
.map-tooltip-faction-pct { margin-left: auto; font-weight: 600; color: #cbd5e1; }

/* ── Sidebar Navigation Redesign ──────────────────────────────────── */
.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-muted, #64748b);
  text-transform: uppercase;
  padding: 0 12px;
  margin-bottom: 8px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 0;
}

.sidebar-nav .nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text-secondary, #94a3b8);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.sidebar-nav .nav-item:hover {
  background: rgba(96, 165, 250, 0.08);
  color: var(--text-primary, #f1f5f9);
}

.sidebar-nav .nav-item.active {
  color: var(--accent, #60a5fa);
  background: rgba(96, 165, 250, 0.1);
}

.sidebar-nav .nav-item svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.sidebar-nav .nav-item.active svg {
  opacity: 1;
}

/* ── Sidebar Stats ────────────────────────────────────────────────── */
.sidebar-stats {
  padding: 16px 12px;
  border-top: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
}

.sidebar-stat {
  margin-bottom: 12px;
}

.sidebar-stat-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary, #f1f5f9);
  line-height: 1;
}

.sidebar-stat-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-muted, #64748b);
  text-transform: uppercase;
}

/* ── RTL Layout Swap — sidebars swap positions ────────────────────── */
[dir="rtl"] .feed-layout {
  flex-direction: row-reverse;
}

[dir="rtl"] .sidebar-nav .nav-item {
  flex-direction: row-reverse;
  text-align: right;
}

[dir="rtl"] .nav-section-label {
  text-align: right;
}

/* ── Faction Filter Bar (below tickers) ───────────────────────────── */
.faction-filter-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(15, 23, 42, 0.6);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.faction-filter-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  color: #94a3b8;
}

.faction-filter-btn:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.12);
  transform: translateY(-1px);
}

.faction-filter-btn.active {
  background: rgba(255,255,255,0.08);
  border-color: var(--fw-color, rgba(255,255,255,0.2));
  box-shadow: 0 0 8px rgba(var(--fw-color-rgb, 100,100,100), 0.15);
}

.faction-filter-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ── Bigger Logo ──────────────────────────────────────────────────── */
.header-logo .logo-ar {
  font-size: 26px !important;
}

.header-logo .logo-en {
  font-size: 14px !important;
  letter-spacing: 5px !important;
}

/* ═══════════════════════════════════════
   Social Pulse Sidebar Widget
   ═══════════════════════════════════════ */
@keyframes pulse-glow {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(107,124,94,0.5); }
  50% { opacity: 0.6; box-shadow: 0 0 0 4px rgba(107,124,94,0); }
}
.sidebar-pulse-section {
  padding: 0 !important;
  overflow: hidden;
}
.sidebar-pulse-header {
  padding: 10px 14px 8px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.pulse-sidebar-filters {
  display: flex;
  gap: 4px;
}
.sp-filter {
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.sp-filter:hover { border-color: var(--sy-gold); color: var(--text); }
.sp-filter.active {
  background: hsla(39 55% 58% / 0.12);
  border-color: hsla(39 55% 58% / 0.3);
  color: var(--sy-gold);
}
.sidebar-pulse-list {
  max-height: 480px;
  overflow-y: auto;
}
.sidebar-pulse-list::-webkit-scrollbar { width: 3px; }
.sidebar-pulse-list::-webkit-scrollbar-thumb { background: hsla(39 55% 58% / 0.2); border-radius: 2px; }
.sp-item {
  padding: 10px 14px;
  border-bottom: 1px solid hsla(0 0% 100% / 0.03);
  cursor: pointer;
  transition: background 0.15s;
  display: block;
  text-decoration: none;
  color: inherit;
}
.sp-item:hover { background: hsla(39 55% 58% / 0.04); }
.sp-item:last-child { border-bottom: none; }
.sp-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.sp-item-source {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
}
.sp-item-platform {
  width: 14px; height: 14px;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
}
.sp-item-platform.fb { background: hsla(221 70% 55% / 0.15); color: hsl(221 70% 55%); }
.sp-item-platform.tw { background: hsla(0 0% 100% / 0.08); color: var(--text-dim); }
.sp-item-time { font-size: 10px; color: var(--text-dim); opacity: 0.5; }
.sp-item-text {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sp-item-text[dir="rtl"] {
  font-family: var(--font-ar-body);
  font-size: 13px;
}
.sp-item-gov {
  margin-top: 4px;
  font-size: 10px;
  color: var(--sy-sand);
  opacity: 0.6;
}
