/* Radio South Africa — base stylesheet */

:root {
    --bg: #fbf7f4;
    --surface: #ffffff;
    --surface-alt: #f2ebe6;
    --text: #221d33;
    --text-muted: #6c6480;
    --border: #e7ded8;
    --brand: #1b1533;
    --brand-contrast: #ffffff;
    --accent: #ff5a5f;
    --accent-hover: #ec464b;
    --accent-contrast: #ffffff;
    --amber: #ffb020;
    --positive: #12b76a;
    --warn-bg: #fff4e0;
    --warn-border: #d59029;
    --ok-bg: #e6f7ee;
    --ok-border: #7fca9f;
    --danger: #d64550;

    --radius: 14px;
    --radius-sm: 9px;
    --container: 1120px;

    --shadow: 0 1px 2px rgba(26, 20, 51, 0.05), 0 10px 26px -14px rgba(26, 20, 51, 0.22);
    --shadow-lg: 0 24px 50px -18px rgba(26, 20, 51, 0.32);

    --font-display: "Space Grotesk", "Segoe UI", system-ui, -apple-system, sans-serif;
    --font-body: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #100e18;
        --surface: #191622;
        --surface-alt: #221d2e;
        --text: #ece9f5;
        --text-muted: #9d95b0;
        --border: #2c2740;
        --brand: #15111f;
        --brand-contrast: #ffffff;
        --accent: #ff6b70;
        --accent-hover: #ff8488;
        --amber: #ffc04d;
        --positive: #2dd48a;
        --warn-bg: #3a2f1c;
        --warn-border: #b78334;
        --ok-bg: #163024;
        --ok-border: #3f7a58;
        --danger: #f0797f;

        --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 14px 34px -14px rgba(0, 0, 0, 0.6);
        --shadow-lg: 0 28px 60px -18px rgba(0, 0, 0, 0.72);
    }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}


h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration: none; }

::selection { background: var(--accent); color: #fff; }

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 20px;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--accent);
    color: var(--accent-contrast);
    padding: 10px 16px;
    border-radius: 0 0 8px 0;
    z-index: 100;
}
.skip-link:focus { left: 0; top: 0; }

/* Header */
.site-header {
    background: var(--brand);
    color: var(--brand-contrast);
}
.site-header__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
}
.site-header__brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--brand-contrast);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.01em;
    text-decoration: none;
}
.site-header__logo {
    font-size: 1.15rem;
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(140deg, var(--accent), var(--amber));
}
.site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.site-nav a {
    color: var(--brand-contrast);
    text-decoration: none;
    opacity: 0.82;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.94rem;
    font-weight: 500;
    transition: background 0.15s ease, opacity 0.15s ease;
}
.site-nav a:hover { opacity: 1; background: rgba(255, 255, 255, 0.12); }

/* Main / footer */
.site-main { padding: 24px 20px 72px; min-height: 60vh; overflow-x: clip; }

.site-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    padding: 32px 0;
    font-size: 0.9rem;
}

/* Hero */
.hero {
    position: relative;
    isolation: isolate;
    text-align: center;
    padding: 44px 0 4px;
}
.hero::before {
    content: "";
    position: absolute;
    z-index: -1;
    left: 50%;
    top: -140px;
    width: min(1200px, 130vw);
    height: 520px;
    transform: translateX(-50%);
    background:
        radial-gradient(closest-side at 22% 40%, hsl(357deg 95% 64% / 0.30), transparent),
        radial-gradient(closest-side at 82% 30%, hsl(38deg 98% 56% / 0.26), transparent);
    filter: blur(4px);
    pointer-events: none;
}
@media (prefers-color-scheme: dark) {
    .hero::before {
        background:
            radial-gradient(closest-side at 22% 40%, hsl(357deg 90% 60% / 0.26), transparent),
            radial-gradient(closest-side at 82% 30%, hsl(282deg 82% 62% / 0.24), transparent);
    }
}
.hero h1 {
    font-size: clamp(2.1rem, 5.6vw, 3.5rem);
    letter-spacing: -0.035em;
    margin: 0 auto 14px;
    max-width: 18ch;
}
.hero__lead {
    color: var(--text-muted);
    font-size: 1.06rem;
    max-width: 48ch;
    margin: 0 auto;
}

/* Notices */
.notice {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    margin: 20px 0;
    background: var(--surface);
    box-shadow: var(--shadow);
}
.notice h2 { margin: 0 0 8px; font-size: 1.1rem; }
.notice p { margin: 0 0 10px; }
.notice p:last-child { margin-bottom: 0; }
.notice pre {
    background: var(--surface-alt);
    padding: 12px 14px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 0;
}
.notice code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.notice--warn { background: var(--warn-bg); border-color: var(--warn-border); }
.notice--ok { background: var(--ok-bg); border-color: var(--ok-border); }

/* Intro cards (setup screen) */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 28px;
}
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}
.card h3 { margin: 0 0 8px; }
.card p { margin: 0; color: var(--text-muted); }

/* Breadcrumb */
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.88rem;
    margin-bottom: 18px;
}
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }

/* Sub-bar search */
.site-subbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 12px 20px;
}

/* Search form */
.search-form {
    display: flex;
    gap: 8px;
    align-items: center;
}
.search-form__label {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden; clip: rect(0 0 0 0);
}
.search-form__input {
    flex: 1;
    min-width: 0;
    padding: 11px 16px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 1rem;
}
.search-form__input:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
    border-color: transparent;
}
.search-form__submit {
    padding: 11px 22px;
    border: 0;
    border-radius: 999px;
    background: var(--accent);
    color: var(--accent-contrast);
    font: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.12s ease;
}
.search-form__submit:hover { background: var(--accent-hover); transform: translateY(-1px); }

.search-form--hero {
    max-width: 580px;
    margin: 28px auto 0;
}
.search-form--hero .search-form__input {
    padding: 16px 22px;
    font-size: 1.05rem;
    border-color: transparent;
    box-shadow: var(--shadow);
}
.search-form--hero .search-form__submit { padding: 16px 26px; }

/* Quick category chips */
.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 18px;
}
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: var(--shadow);
    transition: transform 0.12s ease, border-color 0.12s ease;
}
.chip:hover { transform: translateY(-2px); border-color: var(--accent); }

/* Sections */
.section { margin: 44px 0; }
.section:first-child { margin-top: 24px; }
.section__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 18px;
}
.section h2 {
    margin: 0 0 18px;
    font-size: 1.4rem;
}
.section__head h2 { margin-bottom: 0; }
.section__count { color: var(--text-muted); margin: 0; font-size: 0.9rem; }

/* Station grid + cards */
.station-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
    gap: 20px 16px;
}
.station-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
}
.station-card__art {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-alt);
    box-shadow: var(--shadow);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.station-card:hover .station-card__art,
.station-card:focus-visible .station-card__art {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.station-card__art img { width: 100%; height: 100%; object-fit: cover; }
.station-card__initials {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.7rem, 5vw, 2.5rem);
    color: #fff;
    letter-spacing: 0.01em;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.22);
}
.station-card__play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    background: rgba(20, 16, 40, 0.32);
    opacity: 0;
    transition: opacity 0.16s ease;
}
.station-card:hover .station-card__play,
.station-card:focus-visible .station-card__play { opacity: 1; }
.station-card__name {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.98rem;
    line-height: 1.25;
}
.station-card__meta {
    display: block;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 1px;
}

/* Browse lists */
.browse-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}
.browse-list--wrap { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); }
.browse-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 13px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    box-shadow: var(--shadow);
    transition: transform 0.12s ease, border-color 0.12s ease;
}
.browse-list a:hover { transform: translateY(-2px); border-color: var(--accent); }
.browse-list__count {
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    font-size: 0.85rem;
    background: var(--surface-alt);
    border-radius: 999px;
    padding: 1px 9px;
}

/* Page head */
.page-head { margin-bottom: 26px; }
.page-head h1 { margin: 0 0 8px; font-size: clamp(1.7rem, 4vw, 2.3rem); }
.page-head__intro { color: var(--text-muted); margin: 0 0 8px; max-width: 60ch; }
.page-head__count { color: var(--text-muted); font-size: 0.9rem; margin: 8px 0 0; }
.search-form--page { margin-top: 14px; max-width: 560px; }

.empty-state {
    color: var(--text-muted);
    padding: 32px 0;
    font-size: 1.02rem;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 40px;
}
.pagination__pages {
    display: flex;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.pagination__page, .pagination__step {
    display: inline-block;
    padding: 9px 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text);
    background: var(--surface);
    font-weight: 500;
    transition: border-color 0.12s ease;
}
.pagination__page.is-current {
    background: var(--accent);
    color: var(--accent-contrast);
    border-color: var(--accent);
}
.pagination a:hover { border-color: var(--accent); }

/* Station detail */
.station__header {
    display: flex;
    gap: 24px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
.station__logo {
    flex-shrink: 0;
    width: 150px;
    height: 150px;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
}
.station__logo img { width: 100%; height: 100%; object-fit: cover; }
.station__logo-initials {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.22);
}
.station__heading { flex: 1; min-width: 240px; }
.station__heading h1 { margin: 0 0 6px; font-size: clamp(1.9rem, 4.5vw, 2.7rem); }
.station__tagline { margin: 0 0 12px; color: var(--text-muted); font-size: 1.05rem; }
.station__facts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.station__facts span:not(:last-child)::after {
    content: "·";
    margin-left: 14px;
    opacity: 0.6;
}
.station__player { margin-bottom: 28px; }
.station__report { margin: 10px 0 0; font-size: 0.9rem; }

/* Player */
.player {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow);
}
.player--empty { color: var(--text-muted); }
.player--empty .player__report { margin-top: 6px; }

.player__toggle {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 0;
    background: var(--accent);
    color: #fff;
    font-size: 1.15rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 22px -8px var(--accent);
    transition: background 0.15s ease, transform 0.12s ease;
}
.player__toggle:hover { background: var(--accent-hover); transform: scale(1.04); }
.player__toggle:disabled { opacity: 0.7; cursor: default; transform: none; }
.player[data-state="playing"] .player__toggle {
    background: var(--positive);
    box-shadow: 0 10px 22px -8px var(--positive);
}

.player__icon { display: none; line-height: 1; }
.player[data-state="idle"]    .player__icon--play,
.player[data-state="error"]   .player__icon--play,
.player[data-state="playing"] .player__icon--stop,
.player[data-state="loading"] .player__icon--load { display: block; }

.player__icon--load {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: player-spin 0.8s linear infinite;
}
@keyframes player-spin { to { transform: rotate(360deg); } }

.player__body { flex: 1; min-width: 150px; }
.player__station { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; }
.player__status {
    margin: 3px 0 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.player[data-state="playing"] .player__status { color: var(--positive); font-weight: 600; }
.player[data-state="error"] .player__status { color: var(--danger); }
.player__note { margin: 4px 0 0; font-size: 0.82rem; color: var(--warn-border); }

/* Equalizer — only while playing */
.player__eq { display: none; align-items: flex-end; gap: 2px; height: 14px; }
.player[data-state="playing"] .player__eq { display: inline-flex; }
.player__eq i {
    width: 3px;
    height: 4px;
    background: currentColor;
    border-radius: 2px;
    animation: player-eq 0.9s ease-in-out infinite;
}
.player__eq i:nth-child(2) { animation-delay: 0.18s; }
.player__eq i:nth-child(3) { animation-delay: 0.36s; }
.player__eq i:nth-child(4) { animation-delay: 0.12s; }
@keyframes player-eq {
    0%, 100% { height: 4px; }
    50% { height: 14px; }
}
@media (prefers-reduced-motion: reduce) {
    .player__eq i { animation: none; height: 10px; }
    .station-card__art, .search-form__submit, .chip, .browse-list a { transition: none; }
}

.player__volume {
    display: flex;
    align-items: center;
    gap: 8px;
}
.player__mute {
    border: 0;
    background: transparent;
    font-size: 1.1rem;
    cursor: pointer;
    line-height: 1;
    color: inherit;
}
.player__volume-label {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden; clip: rect(0 0 0 0);
}
.player__volume input[type="range"] { width: 110px; accent-color: var(--accent); }

.player__fallback { font-size: 0.9rem; }

@media (max-width: 480px) {
    .player__volume { width: 100%; }
    .player__volume input[type="range"] { flex: 1; width: auto; }
}

.station__section { margin: 26px 0; }
.station__section h2 { font-size: 1.15rem; margin: 0 0 10px; }

.tag-list, .link-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0;
    margin: 0;
}
.tag-list a, .link-list a {
    display: inline-block;
    padding: 7px 14px;
    background: var(--surface-alt);
    border-radius: 999px;
    text-decoration: none;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.12s ease, color 0.12s ease;
}
.tag-list a:hover, .link-list a:hover { background: var(--accent); color: #fff; }

/* Forms */
.form-page { max-width: 640px; }
.form { margin-top: 8px; }
.form__section {
    font-family: var(--font-display);
    font-size: 1.05rem;
    margin: 30px 0 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}
.form__section:first-of-type { margin-top: 8px; }
.form__row {
    display: grid;
    gap: 0 16px;
    grid-template-columns: 1fr 1fr;
}
@media (max-width: 520px) {
    .form__row { grid-template-columns: 1fr; }
}

.field { margin: 15px 0; }
.field__label { display: block; font-weight: 600; margin-bottom: 5px; }
.field__req { color: var(--accent); }
.field__hint { margin: 0 0 6px; font-size: 0.85rem; color: var(--text-muted); }
.field__control {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font: inherit;
}
.field__control:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
    border-color: transparent;
}
textarea.field__control { resize: vertical; min-height: 92px; }
.field--error .field__control { border-color: var(--danger); }
.field__error { margin: 5px 0 0; font-size: 0.85rem; color: var(--danger); }

.form__submit {
    margin-top: 22px;
    padding: 13px 28px;
    border: 0;
    border-radius: 999px;
    background: var(--accent);
    color: var(--accent-contrast);
    font: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.12s ease;
}
.form__submit:hover { background: var(--accent-hover); transform: translateY(-1px); }

/* Honeypot — hidden from people, not from bots via display:none */
.form-hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Footer nav */
.site-footer__nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin-bottom: 14px;
}
.site-footer__nav a { color: var(--text-muted); text-decoration: none; }
.site-footer__nav a:hover { color: var(--accent); }

/* Ads */
.ad-leaderboard { margin: 16px auto 0; }
.ad-slot {
    margin: 28px 0;
    min-height: 90px;
    text-align: center;
    overflow: hidden;
}
.ad-slot::before {
    content: "Advertisement";
    display: block;
    font-size: 0.68rem;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.ad-slot .adsbygoogle { display: block; }

/* Cookie notice */
.cookie-notice {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 50;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    max-width: 720px;
    margin: 0 auto;
    padding: 14px 18px;
    background: var(--brand);
    color: var(--brand-contrast);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}
.cookie-notice p { margin: 0; font-size: 0.9rem; }
.cookie-notice a { color: var(--brand-contrast); }
.cookie-notice button {
    border: 0;
    background: var(--accent);
    color: #fff;
    border-radius: 999px;
    padding: 8px 18px;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    flex-shrink: 0;
}
.cookie-notice button:hover { background: var(--accent-hover); }

/* Long-form pages (privacy, terms) */
.prose { max-width: 68ch; }
.prose h1 { margin: 0 0 4px; font-size: clamp(1.8rem, 4vw, 2.4rem); }
.prose__meta { color: var(--text-muted); font-size: 0.9rem; margin: 0 0 24px; }
.prose h2 { margin: 30px 0 8px; font-size: 1.3rem; }
.prose p, .prose li { line-height: 1.75; }
.prose ul { padding-left: 1.2em; }

/* Error page */
.error-page { text-align: center; padding: 56px 0; }
.error-page__code {
    font-family: var(--font-display);
    font-size: 4rem;
    font-weight: 700;
    background: linear-gradient(140deg, var(--accent), var(--amber));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin: 0;
}
.error-page h1 { margin: 8px 0 16px; }
