/* =========================================================
   IsharaGo — brand theme overlay
   Loaded AFTER css/style.css on /isharago/* pages only.

   style.css is frozen: the live XAUUSD pages depend on it
   byte-for-byte. This file therefore re-declares the same
   custom properties under [data-brand="isharago"], which
   outranks :root on specificity, so every component class
   in style.css re-renders in the IsharaGo palette without
   a single component rule being rewritten.

   NOTE: --gold keeps its name and holds teal. Renaming it
   would mean editing style.css, which is not permitted.
   Values mirror src/design/colors.ts in the app repo.
   ========================================================= */

[data-brand="isharago"] {
  color-scheme: light;

  --bg: #FAF7F1;
  --bg-alt: #F4EFE7;
  --surface: #FFFFFF;
  --surface-2: #F7F3EC;
  --border: #E5DED3;
  --border-soft: #EEE8DF;

  --text: #122536;
  --text-muted: #647482;
  --text-faint: #8694A0;

  /* Accent: teal, under the inherited gold token names.
     --gold-bright is used by style.css for link text and small glyphs;
     bright gold reads fine on black, but teal on cream needs the darker
     accent for contrast, so it maps to accentDark rather than a lighter tint. */
  --gold: #1AAE8A;
  --gold-bright: #087961;
  --gold-deep: #087961;
  --gold-glow: rgba(26, 174, 138, 0.28);

  --buy: #178C68;
  --buy-bright: #1AAE8A;
  --sell: #D94D55;
  --sell-bright: #E06A71;

  --gradient-gold: linear-gradient(135deg, #2FD0A6 0%, #1AAE8A 45%, #123047 100%);
  --gradient-hero:
    radial-gradient(circle at 15% 20%, rgba(26, 174, 138, 0.14), transparent 45%),
    radial-gradient(circle at 85% 0%, rgba(18, 48, 71, 0.08), transparent 40%),
    radial-gradient(circle at 50% 100%, rgba(201, 130, 22, 0.06), transparent 45%);

  --shadow-soft: 0 10px 30px rgba(18, 37, 54, 0.08);
  --shadow-gold: 0 12px 40px rgba(26, 174, 138, 0.16);
}

/* ---------- Light-theme corrections ----------
   style.css assumes a dark canvas in a few places where a literal colour
   or a translucent white was used instead of a token. */

[data-brand="isharago"] body {
  background: var(--bg);
  color: var(--text);
}

[data-brand="isharago"] .navbar {
  background: rgba(250, 247, 241, 0.82);
  border-bottom: 1px solid var(--border);
}

[data-brand="isharago"] .navbar.is-scrolled {
  background: rgba(250, 247, 241, 0.94);
  box-shadow: var(--shadow-soft);
}

[data-brand="isharago"] .nav-links a { color: var(--text-muted); }
[data-brand="isharago"] .nav-links a:hover { color: var(--text); }

[data-brand="isharago"] .brand img {
  background: transparent;
}

[data-brand="isharago"] .btn-primary { color: #FFFFFF; }

[data-brand="isharago"] .btn-ghost {
  border-color: var(--border);
  color: var(--text);
}

[data-brand="isharago"] .btn-ghost:hover {
  border-color: var(--gold);
  color: var(--gold-bright);
}

[data-brand="isharago"] .btn-disabled {
  color: var(--text-faint);
  border-color: var(--border);
}

[data-brand="isharago"] footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
}

[data-brand="isharago"] .back-to-top {
  background: var(--surface);
  border: 1px solid var(--border);
}

/* ---------- Trading-only elements ----------
   The particle canvas is XAUUSD's hero treatment. IsharaGo pages do not
   include the element; hidden defensively in case shared markup carries it. */

[data-brand="isharago"] #particle-canvas { display: none !important; }

/* ---------- IsharaGo-only additions ---------- */

/* style.css has no alternating-section modifier; the XAUUSD page relies on
   the hero gradient for rhythm instead. IsharaGo has more sections, so it
   needs one. Scoped to the brand so it can never affect XAUUSD pages. */
[data-brand="isharago"] .section-alt {
  background: var(--bg-alt);
  border-block: 1px solid var(--border-soft);
}

.lesson-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-soft);
}

.lesson-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.lesson-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-soft);
}

.lesson-row:last-of-type { border-bottom: 0; }

.lesson-row .idx {
  flex: 0 0 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--surface-2);
  color: var(--text-muted);
}

.lesson-row.is-done .idx {
  background: var(--gold);
  color: #FFFFFF;
}

.lesson-row .label { flex: 1; font-size: 0.92rem; }

.lesson-row .tag {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--text-muted);
  white-space: nowrap;
}

.lesson-row .tag.free {
  background: rgba(26, 174, 138, 0.12);
  color: var(--gold-bright);
}

.progress-track {
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  overflow: hidden;
  margin-top: 18px;
}

.progress-fill {
  height: 100%;
  width: 62%;
  border-radius: var(--radius-pill);
  background: var(--gradient-gold);
}

.edu-note {
  margin-top: 28px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.7;
}

.edu-note strong { color: var(--text); }

/* Long unbroken Arabic strings can overflow narrow viewports. */
[data-brand="isharago"] .legal-body p,
[data-brand="isharago"] .legal-body li {
  overflow-wrap: anywhere;
}

/* ---------- Gold literals that tokens cannot reach ----------
   style.css hardcodes rgba(240, 192, 74, …) inside several component rules.
   A custom-property override cannot reach a literal, so every such selector
   that an IsharaGo page uses needs an explicit override here. tools/verify.sh
   (check_gold_leak) fails the build if a new one appears. */

[data-brand="isharago"] .eyebrow {
  background: rgba(26, 174, 138, 0.10);
  border: 1px solid rgba(26, 174, 138, 0.25);
  color: var(--gold-bright);
}

[data-brand="isharago"] .price-card.featured {
  border-color: rgba(26, 174, 138, 0.45);
  background: linear-gradient(180deg, rgba(26, 174, 138, 0.07), var(--surface) 60%);
}

[data-brand="isharago"] .brand img {
  box-shadow: 0 4px 16px rgba(26, 174, 138, 0.20);
}

[data-brand="isharago"] .feature-card:hover {
  border-color: rgba(26, 174, 138, 0.35);
}

[data-brand="isharago"] .btn-primary:hover {
  box-shadow: 0 10px 28px rgba(26, 174, 138, 0.28);
}

[data-brand="isharago"] .soon-tag {
  background: rgba(18, 37, 54, 0.07);
  color: var(--text-faint);
}

/* ---------- Mobile nav panel ----------
   style.css opens the menu with a near-black panel, which reads as broken
   over the cream IsharaGo canvas. */

@media (max-width: 720px) {
  [data-brand="isharago"] .nav-links.is-open {
    background: rgba(250, 247, 241, 0.98);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
  }
}

/* ---------- Grid arities ----------
   style.css sizes these for the XAUUSD page's item counts: 4 steps and 3
   pricing tiers. IsharaGo has 5 steps and 2 tiers, which would orphan a card. */

[data-brand="isharago"] .steps {
  grid-template-columns: repeat(5, 1fr);
}

[data-brand="isharago"] .pricing-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 860px;
  margin-inline: auto;
}

@media (max-width: 980px) {
  [data-brand="isharago"] .steps { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  [data-brand="isharago"] .steps,
  [data-brand="isharago"] .pricing-grid { grid-template-columns: 1fr; }
}
