/*
Theme Name: Dariba 2026
Theme URI: https://dariba.co
Author: Dariba.co
Author URI: https://dariba.co
Description: The 2026 flagship theme for Dariba.co — Saudi Arabia's independent tax intelligence platform. Modern, editorial, authoritative.
Version: 2.1
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 8.0
License: Private
Text Domain: dariba
Tags: tax, finance, editorial, rtl-language-support, custom-colors, custom-logo
*/

/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  /* Brand */
  --navy:        #0a1f3d;
  --navy-mid:    #0d2b4e;
  --navy-light:  #12366b;
  --gold:        #c8922a;
  --gold-light:  #e3a83a;
  --gold-pale:   #f5e6c8;
  --cream:       #faf8f4;
  --off-white:   #f2ede4;
  --white:       #ffffff;

  /* Neutral */
  --ink:         #0f1923;
  --ink-mid:     #2d3d52;
  --ink-light:   #5a6e85;
  --border:      #ddd8cf;
  --border-dark: #c5bfb3;

  /* Regime Accents */
  --vat:         #1a6fa8;
  --zakat:       #1d7a5f;
  --wht:         #c8922a;
  --rett:        #7c3d9e;
  --tp:          #b33a2a;
  --cit:         #1a4fa8;

  /* Typography */
  --font-display:  'Playfair Display', Georgia, serif;
  --font-body:     'DM Sans', system-ui, sans-serif;
  --font-mono:     'JetBrains Mono', 'Courier New', monospace;

  /* Spacing */
  --space-xs:    4px;
  --space-sm:    8px;
  --space-md:    16px;
  --space-lg:    24px;
  --space-xl:    40px;
  --space-2xl:   64px;
  --space-3xl:   96px;
  --space-4xl:   128px;

  /* Container */
  --container:   1200px;
  --container-narrow: 760px;

  /* Radius */
  --r-sm:  4px;
  --r-md:  8px;
  --r-lg:  16px;
  --r-xl:  24px;
  --r-full: 999px;

  /* Shadow */
  --shadow-sm:  0 1px 3px rgba(10,31,61,.08);
  --shadow-md:  0 4px 16px rgba(10,31,61,.12);
  --shadow-lg:  0 12px 40px rgba(10,31,61,.16);
  --shadow-xl:  0 24px 72px rgba(10,31,61,.20);

  /* Transitions */
  --ease:     cubic-bezier(.22,.68,0,1.2);
  --ease-out: cubic-bezier(.16,1,.3,1);
  --dur-fast: 180ms;
  --dur-mid:  320ms;
  --dur-slow: 480ms;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--white);
  overflow-x: hidden;
  max-width: 100vw;
}

/* Prevent any child from causing horizontal overflow */
*, *::before, *::after {
  box-sizing: border-box;
  min-width: 0;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }
input, textarea, select { font: inherit; }

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
.d-display {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.02em;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-body);
  font-weight: 700;
  line-height: 1.25;
}

/* Entry / Article content */
.entry-content h1 { font-size: clamp(1.8rem, 3vw, 2.4rem); font-family: var(--font-display); margin-bottom: var(--space-lg); }
.entry-content h2 { font-size: clamp(1.4rem, 2.5vw, 1.8rem); margin: var(--space-2xl) 0 var(--space-md); }
.entry-content h3 { font-size: clamp(1.1rem, 2vw, 1.3rem); margin: var(--space-xl) 0 var(--space-md); }
.entry-content p  { margin-bottom: var(--space-lg); max-width: 70ch; }
.entry-content ul, .entry-content ol { margin: var(--space-lg) 0 var(--space-lg) var(--space-xl); }
.entry-content li { margin-bottom: var(--space-sm); }
.entry-content ul li { list-style: disc; }
.entry-content ol li { list-style: decimal; }
.entry-content a { color: var(--navy-light); text-decoration: underline; text-underline-offset: 3px; }
.entry-content strong { font-weight: 700; }
.entry-content table { width: 100%; border-collapse: collapse; margin: var(--space-xl) 0; font-size: .9rem; }
.entry-content table th { background: var(--navy); color: white; padding: 10px 14px; text-align: left; font-weight: 600; }
.entry-content table td { padding: 10px 14px; border-bottom: 1px solid var(--border); }
.entry-content table tr:nth-child(even) td { background: var(--cream); }
.entry-content blockquote { border-left: 4px solid var(--gold); padding: var(--space-lg) var(--space-xl); background: var(--cream); margin: var(--space-xl) 0; font-style: italic; }

/* ============================================================
   LAYOUT UTILITIES
   ============================================================ */
.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--space-xl); }
.container--narrow { max-width: var(--container-narrow); margin: 0 auto; padding: 0 var(--space-xl); }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-xl); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-xl); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-xl); }

.section { padding: var(--space-3xl) 0; }
.section--lg { padding: var(--space-4xl) 0; }
.section--sm { padding: var(--space-2xl) 0; }
.section--navy { background: var(--navy); color: var(--white); }
.section--cream { background: var(--cream); }
.section--off { background: var(--off-white); }

.reveal { opacity: 0; transform: translateY(28px); transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out); }
.reveal.in-view { opacity: 1; transform: none; }

/* ============================================================
   NAVIGATION
   ============================================================ */
#site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(10,31,61,.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 rgba(255,255,255,.08);
  transition: background var(--dur-mid), box-shadow var(--dur-mid), padding var(--dur-mid);
  padding: 0;
}

#site-header.scrolled {
  background: rgba(10,31,61,.99);
  box-shadow: 0 2px 20px rgba(0,0,0,.3);
}

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

.nav-logo { display: flex; align-items: center; gap: var(--space-md); }
.nav-logo img { height: 36px; width: auto; max-width: 180px; object-fit: contain; }
.nav-logo-text { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; color: var(--white); letter-spacing: -.01em; display: flex; flex-direction: column; line-height: 1.1; }
.nav-logo-text .logo-letter { color: var(--gold); }
.nav-logo-text .logo-sub { font-family: var(--font-body); font-size: .6rem; font-weight: 500; color: rgba(255,255,255,.5); letter-spacing: .1em; text-transform: uppercase; margin-top: 2px; }

.nav-menu { display: flex; align-items: center; gap: 2px; }

.nav-menu > li { position: relative; }

.nav-menu > li > a {
  display: flex; align-items: center; gap: 4px;
  color: rgba(255,255,255,.82);
  font-size: .875rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--r-md);
  transition: color var(--dur-fast), background var(--dur-fast);
}

.nav-menu > li > a:hover,
.nav-menu > li > a.active { color: white; background: rgba(255,255,255,.1); }

/* Dropdown */
.nav-dropdown {
  position: absolute; top: calc(100% + 8px); left: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xl);
  min-width: 220px;
  padding: var(--space-sm);
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateY(-8px);
  transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out), visibility var(--dur-fast);
}

.nav-menu > li:hover .nav-dropdown,
.nav-menu > li:focus-within .nav-dropdown { opacity: 1; visibility: visible; pointer-events: all; transform: none; }

.nav-dropdown a {
  display: flex; align-items: center; gap: var(--space-md);
  color: var(--ink);
  font-size: .875rem;
  padding: 9px 12px;
  border-radius: var(--r-md);
  transition: background var(--dur-fast);
}

.nav-dropdown a:hover { background: var(--cream); }

.nav-dropdown .regime-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

.nav-cta {
  background: var(--gold);
  color: var(--navy) !important;
  font-weight: 700 !important;
  padding: 8px 20px !important;
  border-radius: var(--r-full) !important;
  font-size: .8125rem !important;
  transition: background var(--dur-fast), transform var(--dur-fast) !important;
}

.nav-cta:hover { background: var(--gold-light) !important; transform: translateY(-1px); }

.nav-toggle { display: none; color: white; padding: var(--space-sm); }
.nav-toggle svg { width: 22px; height: 22px; }

/* Mobile menu */
.nav-mobile {
  position: fixed; inset: 0; z-index: 999;
  background: var(--navy);
  padding: 90px var(--space-xl) var(--space-xl);
  transform: translateX(100%);
  transition: transform var(--dur-mid) var(--ease-out);
  overflow-y: auto;
}

.nav-mobile.open { transform: none; }

.nav-mobile a {
  display: block; color: white;
  font-size: 1.25rem; font-weight: 600;
  padding: var(--space-md) 0;
  border-bottom: 1px solid rgba(255,255,255,.1);
}

/* ============================================================
   TICKER / ALERT BAR
   ============================================================ */
.ticker-bar {
  background: var(--gold);
  color: var(--navy);
  font-size: .8125rem;
  font-weight: 600;
  height: 38px;
  overflow: hidden;
  display: flex;
  align-items: center;
  margin-top: 72px; /* push below fixed nav */
}

.ticker-track {
  display: flex;
  white-space: nowrap;
  animation: ticker-scroll 32s linear infinite;
}

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

.ticker-item {
  padding: 0 var(--space-2xl);
  display: flex; align-items: center; gap: var(--space-md);
}

.ticker-sep { opacity: .5; }

@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ============================================================
   HERO — HOMEPAGE
   ============================================================ */
.hero {
  position: relative;
  min-height: 88vh;
  display: flex; align-items: center;
  background: var(--navy);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 70% 40%, rgba(200,146,42,.12) 0%, transparent 65%),
    radial-gradient(ellipse 50% 40% at 20% 80%, rgba(18,54,107,.6) 0%, transparent 60%);
  pointer-events: none;
}

/* Geometric grid overlay */
.hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 64px 64px;
  pointer-events: none;
}

.hero-content { position: relative; z-index: 2; padding: var(--space-4xl) 0; }

.hero-eyebrow {
  display: inline-flex; align-items: center; gap: var(--space-sm);
  background: rgba(200,146,42,.18);
  border: 1px solid rgba(200,146,42,.4);
  color: var(--gold-light);
  font-size: .8125rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  padding: 6px 14px; border-radius: var(--r-full);
  margin-bottom: var(--space-xl);
}

.hero-eyebrow::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold-light);
  animation: pulse-dot 2s ease infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .5; transform: scale(.7); }
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 6vw, 5.2rem);
  font-weight: 700;
  color: var(--white);
  line-height: 1.08;
  letter-spacing: -.03em;
  margin-bottom: var(--space-xl);
  max-width: 820px;
}

.hero-title em {
  font-style: italic;
  color: var(--gold-light);
}

.hero-sub {
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  color: rgba(255,255,255,.7);
  max-width: 540px;
  line-height: 1.65;
  margin-bottom: var(--space-2xl);
}

.hero-badges {
  display: flex; flex-wrap: wrap; gap: var(--space-sm);
  margin-bottom: var(--space-2xl);
}

.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .8125rem; color: rgba(255,255,255,.7);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--r-full);
  padding: 5px 12px;
}

.hero-badge svg { color: var(--gold); }

.hero-ctas { display: flex; flex-wrap: wrap; gap: var(--space-md); margin-bottom: var(--space-3xl); }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: .9375rem;
  padding: 13px 28px; border-radius: var(--r-full);
  transition: all var(--dur-fast) var(--ease);
  white-space: nowrap;
}

.btn-primary {
  background: var(--gold);
  color: var(--navy);
}

.btn-primary:hover { background: var(--gold-light); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(200,146,42,.35); }

.btn-ghost {
  color: white;
  border: 1.5px solid rgba(255,255,255,.35);
}

.btn-ghost:hover { border-color: white; background: rgba(255,255,255,.08); }

.btn-sm { padding: 9px 18px; font-size: .875rem; }
.btn-navy { background: var(--navy); color: white; }
.btn-navy:hover { background: var(--navy-light); transform: translateY(-2px); box-shadow: var(--shadow-lg); }

/* Hero stats */
.hero-stats {
  display: flex; flex-wrap: wrap; gap: var(--space-2xl);
}

.hero-stat-num {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700; color: var(--white);
  line-height: 1;
  letter-spacing: -.02em;
}

.hero-stat-num span { color: var(--gold); }

.hero-stat-label {
  font-size: .8125rem;
  color: rgba(255,255,255,.55);
  margin-top: 4px;
}

/* Hero visual panel */
.hero-visual {
  position: absolute; right: 0; top: 0; bottom: 0;
  width: 42%;
  display: flex; align-items: center; justify-content: center;
  padding: var(--space-xl);
}

.hero-card {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--r-xl);
  padding: var(--space-xl);
  backdrop-filter: blur(12px);
  width: 100%; max-width: 380px;
}

.hero-rate-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

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

.hero-rate-name { font-size: .875rem; color: rgba(255,255,255,.7); }
.hero-rate-val { font-size: 1.125rem; font-weight: 700; color: white; }
.hero-rate-badge { font-size: .6875rem; font-weight: 700; padding: 3px 8px; border-radius: var(--r-full); }
.badge-active { background: rgba(29,122,95,.3); color: #4ade80; border: 1px solid rgba(74,222,128,.25); }
.badge-info { background: rgba(26,111,168,.3); color: #7dd3fc; border: 1px solid rgba(125,211,252,.25); }

/* ============================================================
   SEGMENT CARDS — "What's your situation?"
   ============================================================ */
.segments { padding: var(--space-3xl) 0; background: var(--cream); }

.section-header { margin-bottom: var(--space-2xl); }
.section-eyebrow {
  display: inline-block;
  font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--gold); margin-bottom: var(--space-sm);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  font-weight: 700; color: var(--navy);
  letter-spacing: -.02em; line-height: 1.15;
}

.section-sub { font-size: 1.0625rem; color: var(--ink-light); max-width: 560px; margin-top: var(--space-md); }

.segment-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--space-2xl);
  display: flex; flex-direction: column;
  transition: border-color var(--dur-mid), box-shadow var(--dur-mid), transform var(--dur-mid);
  position: relative; overflow: hidden;
}

.segment-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--dur-mid) var(--ease-out);
}

.segment-card:hover { border-color: var(--gold); box-shadow: var(--shadow-lg); transform: translateY(-4px); }
.segment-card:hover::before { transform: scaleX(1); }

.segment-icon {
  width: 48px; height: 48px;
  background: var(--navy);
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: var(--space-lg);
  color: var(--gold);
}

.segment-tag {
  font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--gold);
  margin-bottom: var(--space-sm);
}

.segment-card h3 { font-size: 1.25rem; color: var(--navy); margin-bottom: var(--space-sm); }
.segment-card p { color: var(--ink-light); font-size: .9375rem; flex-grow: 1; margin-bottom: var(--space-lg); }
.segment-link { color: var(--navy); font-weight: 700; font-size: .9rem; display: inline-flex; align-items: center; gap: 6px; }
.segment-link:hover { color: var(--gold); }

/* ============================================================
   TAX REGIMES
   ============================================================ */
.regimes { background: var(--navy); padding: var(--space-3xl) 0; }
.regimes .section-title { color: white; }
.regimes .section-eyebrow { color: var(--gold); }
.regimes .section-sub { color: rgba(255,255,255,.6); }

.regime-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-lg); }

.regime-card {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--r-xl);
  padding: var(--space-xl);
  transition: background var(--dur-mid), border-color var(--dur-mid), transform var(--dur-mid);
  display: flex; flex-direction: column;
}

.regime-card:hover { background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.2); transform: translateY(-3px); }

.regime-icon {
  width: 44px; height: 44px;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; font-weight: 800;
  margin-bottom: var(--space-lg);
  font-family: var(--font-display);
  flex-shrink: 0;
}

.regime-card h3 { color: white; font-size: 1.0625rem; margin-bottom: var(--space-sm); }
.regime-card p { color: rgba(255,255,255,.6); font-size: .875rem; line-height: 1.6; flex-grow: 1; margin-bottom: var(--space-lg); }

.regime-rate {
  display: inline-block;
  font-size: .875rem; font-weight: 700;
  padding: 4px 12px; border-radius: var(--r-full);
  margin-bottom: var(--space-md);
}

.regime-link { color: rgba(255,255,255,.5); font-size: .8125rem; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; transition: color var(--dur-fast); }
.regime-link:hover { color: white; }

/* ============================================================
   TOOLS SECTION
   ============================================================ */
.tools { background: var(--off-white); }

.tools-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-md); }

.tool-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--space-lg) var(--space-xl);
  display: flex; align-items: center; gap: var(--space-lg);
  transition: all var(--dur-fast);
}

.tool-card:hover { border-color: var(--navy); box-shadow: var(--shadow-md); transform: translateX(3px); }

.tool-icon {
  width: 42px; height: 42px;
  background: var(--cream);
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  color: var(--navy); flex-shrink: 0;
}

.tool-card h4 { font-size: .9375rem; color: var(--navy); margin-bottom: 2px; }
.tool-card span { font-size: .8125rem; color: var(--ink-light); }

.tool-badge {
  margin-left: auto; flex-shrink: 0;
  font-size: .6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  padding: 3px 8px; border-radius: var(--r-full);
  background: rgba(200,146,42,.15); color: var(--gold);
  border: 1px solid rgba(200,146,42,.3);
}

/* ============================================================
   RATE REFERENCE TABLE
   ============================================================ */
.rates { background: var(--white); }

.rates-table {
  width: 100%; border-collapse: collapse;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.rates-table thead th {
  background: var(--navy);
  color: white;
  padding: 14px 20px;
  font-size: .875rem; font-weight: 600;
  text-align: left;
}

.rates-table tbody td {
  padding: 14px 20px;
  font-size: .9375rem;
  border-bottom: 1px solid var(--border);
}

.rates-table tbody tr:last-child td { border-bottom: none; }
.rates-table tbody tr:hover td { background: var(--cream); }

.rate-pill {
  display: inline-block;
  font-weight: 800; font-size: 1rem;
  color: var(--navy);
}

/* ============================================================
   DEADLINES
   ============================================================ */
.deadlines { background: var(--cream); }

.deadline-list { display: flex; flex-direction: column; gap: var(--space-md); }

.deadline-item {
  display: flex; align-items: center; gap: var(--space-xl);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--space-lg) var(--space-xl);
  transition: box-shadow var(--dur-fast);
}

.deadline-item:hover { box-shadow: var(--shadow-md); }

.deadline-regime-badge {
  font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em;
  padding: 5px 12px; border-radius: var(--r-full);
  white-space: nowrap;
}

.deadline-item h4 { font-size: .9375rem; color: var(--navy); }
.deadline-item p { font-size: .875rem; color: var(--ink-light); margin-top: 2px; }
.deadline-date { margin-left: auto; font-size: .875rem; font-weight: 700; color: var(--ink-mid); white-space: nowrap; }

/* ============================================================
   ARTICLE GRID
   ============================================================ */
.articles { background: var(--white); }

.articles-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-xl); }

.article-card {
  display: flex; flex-direction: column;
  border-radius: var(--r-xl);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: box-shadow var(--dur-mid), transform var(--dur-mid);
  background: var(--white);
}

.article-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); }

.article-thumb {
  aspect-ratio: 16/9;
  background: var(--navy);
  position: relative; overflow: hidden;
  flex-shrink: 0;
}

.article-thumb-inner {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: flex-start; justify-content: flex-end;
  padding: var(--space-lg);
  background: linear-gradient(135deg, var(--navy-mid) 0%, rgba(12,27,50,.95) 100%);
}

.article-regime-tag {
  font-size: .6875rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  padding: 4px 10px; border-radius: var(--r-full);
  margin-bottom: var(--space-sm);
}

.article-thumb-title {
  font-family: var(--font-display);
  font-size: 1.0625rem; color: white; line-height: 1.3;
}

.article-body { padding: var(--space-lg); flex-grow: 1; display: flex; flex-direction: column; }
.article-meta { display: flex; align-items: center; gap: var(--space-md); font-size: .8125rem; color: var(--ink-light); margin-bottom: var(--space-sm); }
.article-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--border-dark); }
.article-excerpt { font-size: .9rem; color: var(--ink-mid); line-height: 1.6; flex-grow: 1; }
.article-footer { margin-top: var(--space-lg); display: flex; align-items: center; justify-content: space-between; }
.read-more { font-size: .875rem; font-weight: 700; color: var(--navy); display: inline-flex; align-items: center; gap: 6px; }
.read-more:hover { color: var(--gold); }
.read-time { font-size: .8125rem; color: var(--ink-light); }

/* ============================================================
   WHY DARIBA — TRUST SECTION
   ============================================================ */
.trust { background: var(--navy); overflow: hidden; }

.trust-split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4xl); align-items: center; }

.trust-text .section-title { color: white; }
.trust-text .section-sub { color: rgba(255,255,255,.6); }

.trust-items { display: flex; flex-direction: column; gap: var(--space-xl); margin-top: var(--space-2xl); }

.trust-item { display: flex; gap: var(--space-lg); }

.trust-icon {
  width: 40px; height: 40px; flex-shrink: 0;
  background: rgba(200,146,42,.18);
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  color: var(--gold);
}

.trust-item h4 { font-size: .9375rem; color: white; margin-bottom: 4px; }
.trust-item p { font-size: .875rem; color: rgba(255,255,255,.55); line-height: 1.6; }

.trust-visual { position: relative; }

.trust-rate-panel {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--r-xl);
  padding: var(--space-xl);
  backdrop-filter: blur(10px);
}

.trust-rate-label { font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); margin-bottom: var(--space-lg); }

.trust-rate-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.06); }
.trust-rate-item:last-child { border-bottom: none; }
.trust-rate-name { font-size: .875rem; color: rgba(255,255,255,.7); }
.trust-rate-num { font-size: 1.25rem; font-weight: 800; color: white; font-family: var(--font-display); }

/* ============================================================
   GLOSSARY TEASER
   ============================================================ */
.glossary { background: var(--cream); }

.glossary-tags { display: flex; flex-wrap: wrap; gap: var(--space-sm); margin-bottom: var(--space-2xl); }

.glossary-tag {
  background: var(--white); border: 1.5px solid var(--border);
  border-radius: var(--r-full);
  padding: 7px 16px;
  font-size: .875rem; color: var(--ink-mid);
  transition: all var(--dur-fast);
  cursor: pointer;
}

.glossary-tag:hover { border-color: var(--navy); color: var(--navy); background: var(--cream); }

/* ============================================================
   NEWSLETTER CTA
   ============================================================ */
.newsletter {
  background: var(--navy);
  padding: var(--space-3xl) 0;
  position: relative; overflow: hidden;
}

.newsletter::before {
  content: '';
  position: absolute; top: -40%; right: -10%;
  width: 600px; height: 600px;
  background: radial-gradient(ellipse, rgba(200,146,42,.1) 0%, transparent 65%);
  pointer-events: none;
}

.newsletter-inner { max-width: 640px; margin: 0 auto; text-align: center; position: relative; }

.newsletter-title { font-family: var(--font-display); font-size: clamp(1.8rem, 3vw, 2.4rem); color: white; margin-bottom: var(--space-md); }
.newsletter-sub { color: rgba(255,255,255,.6); font-size: 1.0625rem; margin-bottom: var(--space-2xl); }

.newsletter-form { display: flex; gap: var(--space-sm); max-width: 480px; margin: 0 auto; }

.newsletter-input {
  flex-grow: 1;
  background: rgba(255,255,255,.1);
  border: 1.5px solid rgba(255,255,255,.25);
  border-radius: var(--r-full);
  padding: 12px 20px;
  color: white;
  font-size: .9375rem;
  transition: border-color var(--dur-fast);
}

.newsletter-input::placeholder { color: rgba(255,255,255,.4); }
.newsletter-input:focus { outline: none; border-color: var(--gold); }

.newsletter-note { font-size: .8125rem; color: rgba(255,255,255,.4); margin-top: var(--space-md); }

/* ============================================================
   FOOTER
   ============================================================ */
#site-footer {
  background: var(--ink);
  color: rgba(255,255,255,.65);
  font-size: .875rem;
  padding: var(--space-3xl) 0 var(--space-xl);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-2xl);
  padding-bottom: var(--space-2xl);
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.footer-brand p { line-height: 1.7; margin-top: var(--space-lg); max-width: 280px; color: rgba(255,255,255,.5); }

.footer-col h5 {
  font-size: .8125rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: rgba(255,255,255,.4); margin-bottom: var(--space-lg);
}

.footer-col ul { display: flex; flex-direction: column; gap: var(--space-sm); }
.footer-col a { color: rgba(255,255,255,.6); transition: color var(--dur-fast); }
.footer-col a:hover { color: white; }

.footer-bottom {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: var(--space-xl);
  font-size: .8125rem; color: rgba(255,255,255,.35);
}

.footer-bottom a { color: rgba(255,255,255,.4); transition: color var(--dur-fast); }
.footer-bottom a:hover { color: rgba(255,255,255,.7); }
.footer-bottom-links { display: flex; gap: var(--space-xl); }

.footer-logo { display: flex; align-items: center; gap: var(--space-md); }
.footer-logo-text { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; color: white; }
.footer-logo-text span { color: var(--gold); }

.social-links { display: flex; gap: var(--space-sm); margin-top: var(--space-lg); }
.social-link {
  width: 36px; height: 36px;
  background: rgba(255,255,255,.08); border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.5);
  transition: background var(--dur-fast), color var(--dur-fast);
}
.social-link:hover { background: rgba(255,255,255,.15); color: white; }

/* ============================================================
   SINGLE POST
   ============================================================ */
.post-hero {
  background: var(--navy);
  padding: 120px 0 var(--space-3xl);
  position: relative; overflow: hidden;
}

.post-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 70% 80% at 80% 50%, rgba(200,146,42,.1) 0%, transparent 60%);
}

.post-hero-inner { position: relative; z-index: 2; }

.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: .8125rem; color: rgba(255,255,255,.5); margin-bottom: var(--space-xl); }
.breadcrumb a { color: rgba(255,255,255,.5); transition: color var(--dur-fast); }
.breadcrumb a:hover { color: white; }
.breadcrumb-sep { opacity: .4; }

.post-regime-tag {
  display: inline-block; font-size: .75rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  padding: 5px 12px; border-radius: var(--r-full); margin-bottom: var(--space-lg);
}

.post-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.5vw, 3rem);
  font-weight: 700; color: white; line-height: 1.15;
  letter-spacing: -.02em; max-width: 800px;
  margin-bottom: var(--space-lg);
}

.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-lg); font-size: .875rem; color: rgba(255,255,255,.55); }
.post-meta-sep { opacity: .3; }

.post-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: var(--space-3xl);
  padding: var(--space-3xl) 0;
  align-items: start;
}

.post-sidebar { position: sticky; top: 96px; }

.sidebar-card {
  background: var(--cream); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.sidebar-card h4 { font-size: .875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--navy); margin-bottom: var(--space-lg); }

.toc-list { display: flex; flex-direction: column; gap: 4px; }
.toc-list a { font-size: .875rem; color: var(--ink-light); padding: 5px 8px; border-radius: var(--r-sm); display: block; transition: all var(--dur-fast); }
.toc-list a:hover, .toc-list a.active { color: var(--navy); background: white; }
.toc-list a.active { font-weight: 600; }

.sidebar-rate-row { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: .875rem; }
.sidebar-rate-row:last-child { border-bottom: none; }
.sidebar-rate-row span:last-child { font-weight: 700; color: var(--navy); }

/* Reading progress */
.reading-progress {
  position: fixed; top: 72px; left: 0; right: 0; z-index: 999;
  height: 3px; background: transparent;
}
.reading-progress-bar {
  height: 100%; width: 0%; background: var(--gold);
  transition: width .1s linear;
}

/* ============================================================
   ARCHIVE
   ============================================================ */
.archive-header {
  background: var(--navy);
  padding: 120px 0 var(--space-2xl);
}

.archive-header h1 { font-family: var(--font-display); font-size: clamp(2rem, 4vw, 3rem); color: white; }
.archive-header p { color: rgba(255,255,255,.6); margin-top: var(--space-md); font-size: 1.0625rem; }

.filter-bar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 72px; z-index: 100;
  padding: var(--space-md) 0;
}

.filter-inner { display: flex; align-items: center; gap: var(--space-sm); overflow-x: auto; }
.filter-inner::-webkit-scrollbar { display: none; }

.filter-btn {
  white-space: nowrap;
  padding: 7px 16px; border-radius: var(--r-full);
  font-size: .8125rem; font-weight: 600;
  border: 1.5px solid var(--border);
  color: var(--ink-mid);
  transition: all var(--dur-fast);
}

.filter-btn:hover, .filter-btn.active { border-color: var(--navy); background: var(--navy); color: white; }

.archive-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
  padding: var(--space-3xl) 0;
}

/* ============================================================
   404
   ============================================================ */
.error-page {
  min-height: 80vh;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  background: var(--navy);
  color: white;
  padding: var(--space-4xl) var(--space-xl);
}

.error-code {
  font-family: var(--font-display);
  font-size: clamp(6rem, 15vw, 12rem);
  font-weight: 700; line-height: 1;
  color: rgba(200,146,42,.3); letter-spacing: -.05em;
  margin-bottom: var(--space-xl);
}

.error-page h1 { font-size: clamp(1.5rem, 3vw, 2.2rem); margin-bottom: var(--space-md); }
.error-page p { color: rgba(255,255,255,.6); margin-bottom: var(--space-2xl); max-width: 400px; margin-left: auto; margin-right: auto; }

/* ============================================================
   SEARCH
   ============================================================ */
.search-header {
  background: var(--navy); padding: 120px 0 var(--space-2xl);
}

.search-header h1 { font-family: var(--font-display); font-size: clamp(1.8rem, 3vw, 2.6rem); color: white; }
.search-header p { color: rgba(255,255,255,.6); margin-top: var(--space-md); }
.search-results { padding: var(--space-3xl) 0; }

/* ============================================================
   RTL SUPPORT (Arabic)
   ============================================================ */
[dir="rtl"] body { font-family: 'Noto Sans Arabic', var(--font-body); }
[dir="rtl"] .nav-inner { direction: rtl; }
[dir="rtl"] .hero-title, [dir="rtl"] .section-title { text-align: right; }
[dir="rtl"] .nav-menu { flex-direction: row-reverse; }
[dir="rtl"] .footer-grid { direction: rtl; }
[dir="rtl"] .post-layout { direction: rtl; }
[dir="rtl"] .entry-content { direction: rtl; text-align: right; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .hero-visual { display: none; }
  .hero-title { max-width: 100%; }
  .trust-split { grid-template-columns: 1fr; }
  .trust-visual { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .post-layout { grid-template-columns: 1fr; }
  .post-sidebar { display: none; }
  .regime-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root { --space-xl: 20px; --space-2xl: 36px; --space-3xl: 56px; }
  
  /* Layout — prevent overflow */
  html, body { overflow-x: hidden; width: 100%; }
  .container, .container--narrow { padding: 0 16px; width: 100%; max-width: 100%; }
  
  /* Grids */
  .grid-2, .grid-3, .articles-grid, .tools-grid, .archive-grid, .regime-grid { grid-template-columns: 1fr; }
  .segments .grid-3 { grid-template-columns: 1fr; }
  
  /* Nav */
  .nav-menu { display: none; }
  .nav-toggle { display: flex; }
  .nav-inner { padding: 0 16px; }
  
  /* Hero */
  .hero { min-height: 100svh; padding-left: 16px; padding-right: 16px; overflow: hidden; }
  .hero-title { font-size: clamp(2rem, 8vw, 3.5rem); }
  .hero-stats { gap: var(--space-xl); flex-wrap: wrap; }
  .hero .container { padding: 0 16px; }
  
  /* Ticker — prevent overflow */
  .ticker-bar { overflow: hidden; }
  .ticker-track { white-space: nowrap; }
  
  /* Footer */
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: var(--space-md); text-align: center; }
  
  /* Forms */
  .newsletter-form { flex-direction: column; }
  
  /* Deadlines */
  .deadline-item { flex-wrap: wrap; gap: var(--space-sm); }
  .deadline-date { margin-left: 0; }
  
  /* Archive */
  .filter-bar { top: 72px; }
  .filter-inner { padding: 0 16px; }
  
  /* Single post */
  .post-hero { padding: 100px 16px 48px; }
  .post-hero h1 { font-size: clamp(1.6rem, 6vw, 2.5rem); }
  
  /* Sections */
  .section { padding: 48px 0; }
  .section--lg { padding: 64px 0; }
  
  /* Rates table scroll on mobile */
  .rates-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .rates-table { min-width: 520px; }
  
  /* Segment / regime cards */
  .segment-card, .regime-card, .tool-card, .article-card { width: 100%; }
  
  /* Trust section */
  .trust-stats { grid-template-columns: repeat(2, 1fr); gap: var(--space-lg); }
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  #site-header, #site-footer, .post-sidebar, .ticker-bar, .newsletter { display: none !important; }
  .post-layout { grid-template-columns: 1fr !important; }
  body { font-size: 12pt; color: black; }
  a { color: inherit; text-decoration: none; }
}
