/* Startups Arabia website layout.
   Built on the design system: tokens.css (colour, type, spacing) and
   components.css (sa-* components). Flat surfaces, no shadows, no gradients. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { font: var(--text-body); min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
img { max-width: 100%; display: block; }
a { color: var(--saffron-strong); }
h1, h2, h3, p { margin: 0; }
.wrap { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--space-6); }
@media (max-width: 719px) { .wrap { padding: 0 var(--space-4); } }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hidden { display: none !important; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--saffron); color: var(--on-saffron); padding: 8px 12px; border-radius: var(--radius-sm); z-index: 100; }
.skip:focus { left: 8px; }
.icon { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 40; background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header .sa-header { border: 0; padding: var(--space-4) 0; background: transparent; gap: var(--space-4); }
.sa-logo svg { flex: none; }
.sa-nav a:not(.sa-btn) { padding: 4px 0; }
.sa-nav a:not(.sa-btn):hover { color: var(--saffron-strong); }
.icon-btn { background: none; border: 0; color: var(--ink); cursor: pointer; padding: 6px; border-radius: var(--radius-sm); display: inline-grid; place-items: center; }
.icon-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.theme-toggle .moon { display: none; }
[data-theme="dark"] .theme-toggle .moon { display: block; }
[data-theme="dark"] .theme-toggle .sun { display: none; }
.menu-btn { display: none; }
.header-actions { display: flex; align-items: center; gap: var(--space-2); }
@media (max-width: 719px) {
  .menu-btn { display: inline-grid; }
  .sa-nav .nav-link { display: none; }
  .site-header.open .sa-nav { position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; background: var(--surface); border-bottom: 1px solid var(--line); padding: var(--space-2) var(--space-4) var(--space-4); }
  .site-header.open .sa-nav .nav-link { display: block; padding: var(--space-3) 0; border-bottom: 1px solid var(--line); }
  .site-header.open .sa-nav .sa-btn { display: none; }
}

/* ---------- Sections ---------- */
.section { padding: var(--space-20) 0; }
@media (max-width: 719px) { .section { padding: var(--space-12) 0; } }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-8); flex-wrap: wrap; }
.h2-text { font: var(--text-h2); }
.h1-text { font: var(--text-h1); letter-spacing: -0.01em; }
.lead { font: var(--text-body-lg); color: var(--ink-muted); }
.muted { color: var(--ink-muted); }
.small-text { font: var(--text-small); }
.measure { max-width: var(--measure); }
.stack-2 > * + * { margin-top: var(--space-2); }
.stack-4 > * + * { margin-top: var(--space-4); }
.stack-6 > * + * { margin-top: var(--space-6); }

/* ---------- Hero ---------- */
.hero-outer { padding-top: var(--space-8); }
.sa-hero { display: grid; grid-template-columns: 1fr; gap: var(--space-8); align-items: center; }
@media (min-width: 720px) { .sa-hero { padding: var(--space-20); } }
@media (min-width: 1000px) { .sa-hero.has-art { grid-template-columns: 1fr 300px; } }
.sa-hero h1 { color: var(--on-brand); }
.hero-art { display: none; }
@media (min-width: 1000px) {
  .hero-art { display: block; width: 300px; aspect-ratio: 1; border-radius: var(--radius-lg); overflow: hidden; background: var(--night-ink); }
  .hero-art img { width: 100%; height: 100%; object-fit: cover; }
}
@media (max-width: 719px) {
  .sa-hero h1 { font-size: 40px; line-height: 48px; }
  .sa-hero p { font: var(--text-body); }
}

/* ---------- Page heading (inner pages) ---------- */
.page-head { padding: var(--space-12) 0 var(--space-8); }
.page-head .lead { margin-top: var(--space-3); max-width: var(--measure); }

/* ---------- Episode list ---------- */
.ep-list { display: grid; grid-template-columns: 1fr; gap: var(--space-3); }
@media (min-width: 900px) { .ep-list { grid-template-columns: 1fr 1fr; gap: var(--space-4); } }
.sa-ep { min-width: 0; }
.sa-ep > div { min-width: 0; }
.sa-ep-art { object-fit: cover; background: var(--night-ink); }
.sa-ep h3 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sa-ep h3 a { color: var(--ink); text-decoration: none; }
.sa-ep h3 a:hover { text-decoration: underline; text-decoration-color: var(--saffron); text-underline-offset: 3px; }
@media (max-width: 479px) {
  .sa-ep { grid-template-columns: 64px 1fr auto; gap: var(--space-3); padding: var(--space-3); }
  .sa-ep-art { width: 64px; height: 64px; }
  .sa-ep h3 { font-size: 17px; line-height: 24px; }
}
.sa-play .pause { display: none; }
.sa-play[aria-pressed="true"] .play { display: none; }
.sa-play[aria-pressed="true"] .pause { display: block; }
.sa-play .pause { width: 18px; height: 18px; margin: 0; fill: currentColor; }
.loading { color: var(--ink-muted); padding: var(--space-6) 0; }

/* Season filter */
.filter { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-bottom: var(--space-6); }
.filter button { font: var(--text-small); font-weight: 600; padding: 6px 14px; border-radius: var(--radius-pill); border: 1px solid var(--line); background: var(--surface-raised); color: var(--ink); cursor: pointer; }
.filter button[aria-pressed="true"] { background: var(--saffron); border-color: var(--saffron); color: var(--on-saffron); }
.filter button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- Platforms ---------- */
.platforms { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.social-links { display: flex; flex-wrap: wrap; gap: var(--space-6); margin-top: var(--space-6); font: var(--text-small); }
.social-links a { color: var(--saffron-strong); font-weight: 600; }

/* ---------- Brand strip ---------- */
.strip { border-radius: var(--radius-lg); padding: var(--space-12) var(--space-8); display: flex; align-items: center; justify-content: space-between; gap: var(--space-6); flex-wrap: wrap; }
.strip p { font: var(--text-h3); color: var(--on-brand); max-width: 620px; }

/* ---------- Episode page ---------- */
.player { width: 100%; margin: var(--space-6) 0 var(--space-8); }
.notes { max-width: var(--measure); }
.notes p { margin-bottom: var(--space-4); }
.notes > p:first-child { font: var(--text-body-lg); }
.notes ul, .notes ol { padding-left: 1.25em; margin: 0 0 var(--space-4); }
.notes a { word-break: break-word; }
.notes .ts { color: var(--saffron-strong); font-weight: 600; font-variant-numeric: tabular-nums; }
.ep-hero-art { width: 160px; height: 160px; border-radius: var(--radius-md); object-fit: cover; margin-bottom: var(--space-6); background: var(--night-ink); }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-12); }
@media (min-width: 900px) { .about-grid { grid-template-columns: minmax(0, var(--measure)) 320px; justify-content: space-between; } }
.about-grid ul { padding-left: 1.25em; margin: 0; }
.about-grid li + li { margin-top: var(--space-2); }
.host-photo { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: top; border-radius: var(--radius-lg); }
.host-card { background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-4); align-self: start; }
.host-card .stack-2 { padding: var(--space-4) var(--space-2) var(--space-2); }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-12); }
@media (min-width: 900px) { .form-grid { grid-template-columns: minmax(0, 620px) 1fr; } }
.field { margin-bottom: var(--space-4); }
.field label { display: block; font: var(--text-small); font-weight: 600; margin-bottom: var(--space-2); }
.field input, .field textarea { width: 100%; font: var(--text-body); color: var(--ink); background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: var(--space-3); }
.field input:focus-visible, .field textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.aside-block + .aside-block { margin-top: var(--space-8); }
.aside-block h2 { font: var(--text-h3); margin-bottom: var(--space-2); }

/* ---------- Footer ---------- */
.site-footer { margin-top: var(--space-20); padding: var(--space-12) 0 var(--space-8); }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-8); }
@media (min-width: 900px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1.4fr; } }
.footer-logo { width: 200px; height: auto; }
.site-footer h2 { font: var(--text-label); text-transform: uppercase; color: var(--saffron); margin-bottom: var(--space-3); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li + li { margin-top: var(--space-2); }
.site-footer a:not(.sa-btn) { color: var(--on-brand); text-decoration: none; }
.site-footer a:not(.sa-btn):hover { color: var(--saffron); }
.site-footer p { color: var(--on-brand-muted); font: var(--text-small); }
.footer-base { margin-top: var(--space-12); padding-top: var(--space-6); border-top: 1px solid rgba(246, 239, 227, 0.16); color: var(--on-brand-muted); font: var(--text-small); }

/* ---------- Global player bar ---------- */
.player-bar { position: sticky; bottom: 0; z-index: 50; padding: var(--space-3) 0; border-top: 1px solid var(--line); }
.player-bar .wrap { display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap; }
.player-bar .now { font: var(--text-small); color: var(--on-brand-muted); min-width: 0; flex: 1 1 220px; }
.player-bar .now strong { display: block; color: var(--on-brand); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-bar audio { flex: 2 1 320px; height: 40px; }
.form-intro { margin: var(--space-3) 0 var(--space-8); }
.social-links.flush { margin-top: 0; }
.ep-title-gap { margin-top: var(--space-2); }
.sa-ep .sa-eyebrow { color: var(--saffron-strong); }
.sa-nav a.sa-btn-primary, .sa-nav a.sa-btn-primary:hover { color: var(--on-saffron); }

.form-status { margin-top: var(--space-4); font: var(--text-small); min-height: 22px; }
.form-status.is-ok { color: var(--oasis); font-weight: 600; }
.form-status.is-error { color: var(--saffron-strong); font-weight: 600; }
.sa-form button[disabled] { opacity: .6; cursor: wait; }
