/* Mizan | ميزان — shared styles for the home pages and every debate page. */

:root {
  --bg: #faf7f0;
  --surface: #ffffff;
  --surface-2: #f3eee3;
  --ink: #1b2333;
  --muted: #5b6474;
  --line: #e6dfd0;
  --accent: #c08f2e;          /* brass: the scale pans */
  --accent-ink: #8a6216;
  --primary: #1b2333;
  --primary-ink: #faf7f0;
  --side-0: #1f7a72;          /* debate sides */
  --side-1: #b5523b;
  --side-2: #4b5ba6;
  --side-3: #6b7a2a;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(27, 35, 51, .06), 0 6px 24px rgba(27, 35, 51, .06);
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "IBM Plex Serif", Georgia, serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12161f;
    --surface: #1a2030;
    --surface-2: #20283a;
    --ink: #ece8df;
    --muted: #a3a9b5;
    --line: #2b3346;
    --accent: #d9a94a;
    --accent-ink: #e7c27a;
    --primary: #ece8df;
    --primary-ink: #12161f;
    --side-0: #4fb3a9;
    --side-1: #e08a72;
    --side-2: #8e9be0;
    --side-3: #a9b85c;
    --shadow: none;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #12161f; --surface: #1a2030; --surface-2: #20283a; --ink: #ece8df; --muted: #a3a9b5;
  --line: #2b3346; --accent: #d9a94a; --accent-ink: #e7c27a; --primary: #ece8df; --primary-ink: #12161f;
  --side-0: #4fb3a9; --side-1: #e08a72; --side-2: #8e9be0; --side-3: #a9b85c; --shadow: none;
  color-scheme: dark;
}

/* Arabic pages use the Arabic member of the same type family. */
html[lang="ar"] {
  --font: "IBM Plex Sans Arabic", "IBM Plex Sans", system-ui, sans-serif;
  --font-display: "IBM Plex Sans Arabic", "IBM Plex Serif", serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
}
html[lang="ar"] body { font-size: 18px; line-height: 1.8; }
a { color: var(--accent-ink); }
img, svg, audio { max-width: 100%; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.wrap.narrow { max-width: 760px; }

/* ---------- Header / footer ---------- */
.site-header {
  max-width: 1040px; margin: 0 auto; padding: 18px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.logo-mark { width: 38px; height: 38px; color: var(--ink); flex: none; }
.brand-name { font-family: "IBM Plex Serif", Georgia, serif; font-weight: 600; font-size: 21px; letter-spacing: .2px; }
.brand-name [lang="ar"] { font-family: "IBM Plex Sans Arabic", sans-serif; }
.brand-sep { color: var(--accent); font-weight: 400; margin: 0 2px; }
.lang-switch {
  color: var(--ink); text-decoration: none; font-weight: 500; font-size: 15px;
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; background: var(--surface);
}
.lang-switch[lang="ar"] { font-family: "IBM Plex Sans Arabic", sans-serif; }
.lang-switch[lang="en"] { font-family: "IBM Plex Sans", sans-serif; }
.lang-switch:hover { border-color: var(--accent); }

.site-footer { border-top: 1px solid var(--line); margin-top: 72px; padding: 28px 16px 40px; text-align: center; color: var(--muted); font-size: 14px; }
.site-footer p { margin: 4px 0; }

/* ---------- Buttons / cards ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 22px; border-radius: 999px; font: inherit; font-weight: 600; font-size: 16px;
  text-decoration: none; cursor: pointer; border: 1px solid transparent; transition: transform .15s ease, background .15s ease;
  white-space: nowrap;
}
.btn.primary { background: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--accent); }
.btn:focus-visible, .lang-switch:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

.tag {
  display: inline-block; margin: 0 0 10px; padding: 3px 12px; border-radius: 999px;
  background: var(--surface-2); color: var(--accent-ink); font-size: 13px; font-weight: 600; letter-spacing: .3px;
}
.fine { color: var(--muted); font-size: 14px; }

/* ---------- Home page ---------- */
.hero { padding: 40px 0 24px; }
.hero h1 {
  font-family: var(--font-display); font-weight: 600; letter-spacing: -.5px;
  font-size: clamp(34px, 6vw, 58px); line-height: 1.1; margin: 8px 0 18px; max-width: 16ch;
}
html[lang="ar"] .hero h1 { letter-spacing: 0; line-height: 1.35; max-width: 18ch; }
.hero .lead { font-size: clamp(18px, 2.2vw, 21px); color: var(--muted); max-width: 58ch; margin: 0 0 26px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.price-note { color: var(--muted); font-size: 15px; }

.section { padding: 48px 0 8px; }
.section > h2, .section-title {
  font-family: var(--font-display); font-weight: 600; font-size: clamp(26px, 3.4vw, 34px); margin: 0 0 8px; letter-spacing: -.2px;
}
.section-sub { color: var(--muted); margin: 0 0 24px; max-width: 60ch; }

.samples { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.sample { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.sample h3 { margin: 0; font-size: 19px; line-height: 1.4; }
.sample .meta { margin: 0; }
.sample audio { width: 100%; }
.sample .read { font-weight: 600; text-decoration: none; }
.sample .read:hover { text-decoration: underline; }

.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; counter-reset: step; }
.steps li { padding: 22px; counter-increment: step; }
.steps li::before {
  content: counter(step); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 600; margin-bottom: 12px;
}
.steps h3 { margin: 0 0 6px; font-size: 18px; }
.steps p { margin: 0; color: var(--muted); }

.meaning { display: flex; gap: 20px; align-items: center; padding: 26px; }
.meaning .big { font-family: "IBM Plex Sans Arabic", sans-serif; font-size: 54px; line-height: 1; color: var(--accent-ink); flex: none; }
.meaning p { margin: 0; }

.buy { text-align: center; padding: 36px 22px; }
.buy .amount { font-family: var(--font-display); font-size: 52px; font-weight: 600; margin: 4px 0; }
.buy ul { list-style: none; padding: 0; margin: 14px auto 24px; max-width: 420px; text-align: start; }
.buy li { padding: 7px 0; border-bottom: 1px solid var(--line); }
.buy li::before { content: "✓"; color: var(--side-0); font-weight: 700; margin-inline-end: 10px; }

.faq details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 17px; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent-ink); font-size: 22px; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 10px 0 2px; color: var(--muted); }

/* ---------- Debate page ---------- */
.debate-title { font-family: var(--font-display); font-weight: 600; font-size: clamp(28px, 4.6vw, 42px); line-height: 1.2; margin: 0 0 10px; }
html[lang="ar"] .debate-title { line-height: 1.45; }
.meta { color: var(--muted); font-size: 15px; margin: 0 0 22px; }
.player { padding: 18px; }
.player audio { width: 100%; display: block; }
.player-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.ai-note { color: var(--muted); font-size: 14px; margin: 14px 2px 0; }

.transcript { margin-top: 34px; }
.transcript h2 { font-family: var(--font-display); font-size: 26px; margin: 0 0 14px; }
.round {
  display: flex; align-items: center; gap: 12px; color: var(--accent-ink); font-size: 14px; font-weight: 600;
  letter-spacing: .6px; text-transform: uppercase; margin: 28px 0 12px;
}
.round::before, .round::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.turn { padding: 14px 18px; margin: 10px 0; border-radius: 12px; }
.turn p { margin: 0 0 10px; }
.turn p:last-child { margin-bottom: 0; }
.turn .speaker { font-weight: 600; font-size: 14px; letter-spacing: .3px; margin-bottom: 4px; }
.turn.host { background: var(--surface-2); color: var(--muted); font-size: 16px; }
.turn.host .speaker { color: var(--ink); }
.turn.side { background: var(--surface); border: 1px solid var(--line); border-inline-start: 4px solid var(--side-color); }
.turn.side .speaker { color: var(--side-color); }
.side-0 { --side-color: var(--side-0); }
.side-1 { --side-color: var(--side-1); }
.side-2 { --side-color: var(--side-2); }
.side-3 { --side-color: var(--side-3); }

.cta { margin-top: 40px; padding: 28px; text-align: center; }
.cta h2 { font-family: var(--font-display); margin: 0 0 8px; font-size: 26px; }
.cta p { color: var(--muted); margin: 0 auto 20px; max-width: 52ch; }

@media (max-width: 560px) {
  body { font-size: 16px; }
  .meaning { flex-direction: column; align-items: flex-start; }
  .btn { width: 100%; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .player-actions .btn { width: auto; flex: 1; }
}

@media (prefers-reduced-motion: reduce) { .btn { transition: none; } }
