/* ==========================================================================
   WASM TV — Arabic / RTL overrides
   Loaded only on /ar/ after styles.css (pre-deck-style build). Everything here mirrors physical
   left/right rules from the base stylesheet and adapts typography for Arabic.
   ========================================================================== */

:root {
  --font: "IBM Plex Sans Arabic", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* --------------------------------------------------------------------------
   Typography — Arabic is a connected script: no tracking, more leading.
   -------------------------------------------------------------------------- */
html[dir="rtl"] * { letter-spacing: 0 !important; }
html[dir="rtl"] body { font-family: var(--font); }

html[dir="rtl"] h1 { font-size: clamp(2.8rem, 4.2vw, 4.6rem); line-height: 1.22; font-weight: 700; }
html[dir="rtl"] h2 { font-size: clamp(2.2rem, 4vw, 4rem); line-height: 1.24; font-weight: 700; }
html[dir="rtl"] h3 { line-height: 1.35; }
html[dir="rtl"] .closing h2 { font-size: clamp(2.6rem, 5.4vw, 5.4rem); line-height: 1.22; }
html[dir="rtl"] .format-copy h3 { line-height: 1.28; }
html[dir="rtl"] .gd-title,
html[dir="rtl"] .lt-body strong,
html[dir="rtl"] .story-body strong,
html[dir="rtl"] .portrait-caption strong,
html[dir="rtl"] .sponsor-aside > strong,
html[dir="rtl"] .partnership-photo .tag strong,
html[dir="rtl"] .revenue-line,
html[dir="rtl"] .hero-badge strong,
html[dir="rtl"] .proof-detail strong { line-height: 1.35; }
html[dir="rtl"] .flow-core strong { line-height: 1.1; }
html[dir="rtl"] .body-lg { line-height: 1.8; }
html[dir="rtl"] .body, html[dir="rtl"] .hero-lede, html[dir="rtl"] .format-copy p { line-height: 1.85; }
html[dir="rtl"] .ai-card p, html[dir="rtl"] .revenue-card p, html[dir="rtl"] .step p, html[dir="rtl"] .proof-detail > div { line-height: 1.7; }

/* Small uppercase labels are unreadable at 9–10px in Arabic — nudge them up. */
html[dir="rtl"] .eyebrow { font-size: .84rem; }
html[dir="rtl"] .index { font-size: .78rem; }
html[dir="rtl"] .hero-meta small, html[dir="rtl"] .format-stats div small, html[dir="rtl"] .intel-stats div small,
html[dir="rtl"] .hero-badge small, html[dir="rtl"] .board-head, html[dir="rtl"] .sample-bar,
html[dir="rtl"] .channels-inner .item, html[dir="rtl"] .tab .num, html[dir="rtl"] .ai-card .marker,
html[dir="rtl"] .revenue-card small, html[dir="rtl"] .engine-head, html[dir="rtl"] .flow-col > small,
html[dir="rtl"] .flow-core small, html[dir="rtl"] .portrait-caption span, html[dir="rtl"] .ai-portrait .badge,
html[dir="rtl"] .partnership-photo .tag small, html[dir="rtl"] .custom-caption, html[dir="rtl"] .board-media .tag,
html[dir="rtl"] .step span, html[dir="rtl"] .proof-detail b, html[dir="rtl"] .ai-mini small,
html[dir="rtl"] .swatches span, html[dir="rtl"] .sponsor-media span, html[dir="rtl"] .ai-note { font-size: .78rem; }
html[dir="rtl"] .channels-inner .item { font-size: .86rem; }
html[dir="rtl"] .pressure span { width: 26px; font-size: .78rem; }
html[dir="rtl"] .proof-stat span { font-size: 1.05rem; }
html[dir="rtl"] .sponsor-aside > small { font-size: .78rem; line-height: 1.6; }

/* Numeric-only strings keep left-to-right order inside RTL text. */
html[dir="rtl"] .index, html[dir="rtl"] .ratio-badges, html[dir="rtl"] .pills[dir="ltr"] { direction: ltr; unicode-bidi: isolate; }

/* Mirrored arrow icons on buttons and text links */
html[dir="rtl"] .button .icon, html[dir="rtl"] .text-link .icon { transform: scaleX(-1); }

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
html[dir="rtl"] .skip { left: auto; right: 1rem; }
html[dir="rtl"] .brand { direction: ltr; }              /* keep the Latin logo lock-up mark → wordmark → TV */
html[dir="rtl"] .main-nav { margin-left: 0; margin-right: auto; }
html[dir="rtl"] .main-nav a::after { left: 100%; right: 0; transition: left .25s var(--ease); }
html[dir="rtl"] .main-nav a:hover::after, html[dir="rtl"] .main-nav a.active::after { left: 0; }
html[dir="rtl"] .header-cta { margin-left: 0; margin-right: .5rem; }
html[dir="rtl"] .menu-button { margin-left: 0; margin-right: auto; }
html[dir="rtl"] .lang-switch[lang="en"] { font-family: "Inter", var(--font); font-size: .8rem; font-weight: 700; }

/* --------------------------------------------------------------------------
   Hero — the photo (presenter + Middle East globe) must not be mirrored, so the
   copy stays over the dark left half with right-aligned Arabic text.
   -------------------------------------------------------------------------- */
html[dir="rtl"] .hero-copy { max-width: 600px; margin-inline-start: auto; }
html[dir="rtl"] .hero-lede { max-width: 600px; }
html[dir="rtl"] .hero-meta { max-width: none; }
html[dir="rtl"] .hero-badge { padding: .85rem .9rem .85rem 1.1rem; }

/* --------------------------------------------------------------------------
   01 Opportunity
   -------------------------------------------------------------------------- */
html[dir="rtl"] .problem-conclusion {
  border-left: 0; border-right: 3px solid var(--brand);
  background: linear-gradient(270deg, rgba(254, 194, 14, .09), transparent);
  border-radius: var(--radius) 0 0 var(--radius);
}
html[dir="rtl"] .board-media .tag { left: auto; right: 1.4rem; }
html[dir="rtl"] .pressure .icon { margin-left: 0; margin-right: auto; }

/* --------------------------------------------------------------------------
   02 Formats & broadcast mock-ups
   -------------------------------------------------------------------------- */
html[dir="rtl"] .tab { text-align: right; }

/* On-screen graphics: Arabic channels place the bug top-right, clock top-left. */
html[dir="rtl"] .bug { left: auto; right: 3.5%; padding: .45rem .55rem .45rem .7rem; }
html[dir="rtl"] .bug .live { margin-left: 0; margin-right: .4rem; padding-left: 0; padding-right: .6rem; border-left: 0; border-right: 1px solid rgba(160, 196, 230, .3); }
html[dir="rtl"] .clock { right: auto; left: 3.5%; }
html[dir="rtl"] .side-panel.left { left: auto; right: 3.5%; }
html[dir="rtl"] .side-panel div .icon { margin-left: 0; margin-right: auto; }
html[dir="rtl"] .lt-accent { border-radius: 0 3px 0 0; }
html[dir="rtl"] .lt-body { border-left: 1px solid rgba(160, 196, 230, .25); border-right: 0; background: linear-gradient(270deg, rgba(4, 12, 24, .92), rgba(6, 22, 42, .82)); }
html[dir="rtl"] .ticker-label { border-right: 0; border-left: 1px solid rgba(254, 194, 14, .4); }
html[dir="rtl"] .ticker-track span { padding-left: 0; padding-right: 100%; animation-name: ticker-rtl; }
html[dir="rtl"] .ticker-track b { margin: 0 1.4rem 0 .6rem; }
@keyframes ticker-rtl { to { transform: translateX(100%); } }
html[dir="rtl"] .gd-brand { left: auto; right: 3.5%; }
html[dir="rtl"] .gd::after { background: linear-gradient(270deg, rgba(4, 12, 24, .45), rgba(4, 12, 24, .1) 60%, rgba(4, 12, 24, .3)); }

/* Social stage */
html[dir="rtl"] .ratio-badges { left: auto; right: 1rem; }
html[dir="rtl"] .platform-badges { right: auto; left: 1rem; }
html[dir="rtl"] .story-actions { right: auto; left: 10px; }

/* Digital stage — cards keep their slots (they avoid the devices in the photo). */
html[dir="rtl"] .dg-alert span small { text-align: right; }

/* --------------------------------------------------------------------------
   03 Custom
   -------------------------------------------------------------------------- */
html[dir="rtl"] .custom-caption { left: auto; right: 6%; }
html[dir="rtl"] .brand-preview { left: 5%; right: 30%; }
html[dir="rtl"] .swatches span { margin-right: 0; margin-left: .3rem; }

/* --------------------------------------------------------------------------
   04 AI
   -------------------------------------------------------------------------- */
html[dir="rtl"] .ai-portrait .badge { left: auto; right: 1.4rem; }
html[dir="rtl"] .ai-card::before { background: linear-gradient(270deg, var(--brand), transparent 70%); }
html[dir="rtl"] .ai-mini .pills { margin-left: 0; margin-right: auto; }
html[dir="rtl"] .ai-mini[dir="ltr"] { font-family: "Inter", var(--font); font-size: .72rem; }
html[dir="rtl"] .ai-mini[dir="ltr"] small { letter-spacing: .16em !important; }
html[dir="rtl"] .portrait-caption .langs span[lang="en"] { letter-spacing: .1em !important; font-family: "Inter", var(--font); }
html[dir="rtl"] .ai-note { text-align: left; }

/* --------------------------------------------------------------------------
   05 Intelligence
   -------------------------------------------------------------------------- */
html[dir="rtl"] .section-photo::after { background: linear-gradient(270deg, #030918 0%, rgba(3, 9, 24, .82) 35%, rgba(3, 9, 24, .4) 70%, rgba(3, 9, 24, .6)), linear-gradient(0deg, #030918, transparent 25%), linear-gradient(180deg, #030918, transparent 25%); }
html[dir="rtl"] .flow-core span { font-size: .7rem; }

/* --------------------------------------------------------------------------
   06 Revenue
   -------------------------------------------------------------------------- */
html[dir="rtl"] .sponsor-slot { right: auto; left: 3.5%; }
html[dir="rtl"] .sponsor-screen .lt-side b { margin-left: 0; margin-right: .4rem; }

/* --------------------------------------------------------------------------
   07 Proof
   -------------------------------------------------------------------------- */
html[dir="rtl"] .proof-bg::after { background: linear-gradient(270deg, rgba(3, 9, 22, .96) 0%, rgba(3, 9, 22, .82) 38%, rgba(3, 9, 22, .3) 72%, rgba(3, 9, 22, .15) 100%), linear-gradient(0deg, #040b1c 0%, rgba(4, 11, 28, .5) 22%, transparent 45%), linear-gradient(180deg, #040b1c 0%, transparent 25%); }
html[dir="rtl"] .proof-client { padding: .6rem .7rem .6rem .9rem; }
html[dir="rtl"] .proof-stat .stat-num { display: inline; font: inherit; color: inherit; margin: 0; max-width: none; unicode-bidi: isolate; }

/* --------------------------------------------------------------------------
   08 Partnership
   -------------------------------------------------------------------------- */
html[dir="rtl"] .partnership-photo .tag { left: auto; right: 1.3rem; }
html[dir="rtl"] .steps::before { background: linear-gradient(270deg, var(--brand), #c9d6e2 60%, #c9d6e2); }
html[dir="rtl"] .step .dot { left: auto; right: 0; }

/* --------------------------------------------------------------------------
   Closing
   -------------------------------------------------------------------------- */
html[dir="rtl"] .closing-bg::after { background: linear-gradient(270deg, rgba(2, 7, 14, .92), rgba(2, 7, 14, .6) 55%, rgba(2, 7, 14, .25)), linear-gradient(0deg, var(--bg-0), transparent 30%), linear-gradient(180deg, var(--bg-0), transparent 30%); }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1240px) {
  html[dir="rtl"] .main-nav a { font-size: .84rem; }
}
@media (max-width: 1100px) {
  html[dir="rtl"] .hero-copy { max-width: none; }
}
@media (max-width: 800px) {
  html[dir="rtl"] h1 { font-size: clamp(2.6rem, 9vw, 4.2rem); }
  html[dir="rtl"] .ai-note { text-align: right; }
}
@media (max-width: 520px) {
  html[dir="rtl"] h1 { font-size: 2.6rem; }
  html[dir="rtl"] h2 { font-size: 2.2rem; }
  html[dir="rtl"] .closing h2 { font-size: 2.5rem; }
}
