/* Goddestination — companion site of the YouTube channel.
   Palette: warm parchment + deep green + gold (the "destination" mark). Logical properties so
   Persian/Urdu/Pashto/Hebrew pages mirror correctly without a second stylesheet. */

:root {
    --bg: #f7f2e8;
    --bg-glow: #efe4cf;
    --surface: #fffdf8;
    --surface-2: #f3ebdc;
    --ink: #17211d;
    --ink-soft: #55655e;
    --line: #e4d9c4;
    --brand: #0d3b2e;
    --brand-2: #12553f;
    --brand-ink: #f7f2e8;
    --gold: #b3862c;
    --gold-soft: #f4e6c6;
    --danger: #9c2f2f;
    --radius: 20px;
    --radius-sm: 12px;
    --shadow: 0 18px 40px -24px rgba(23, 33, 29, .45);
    --font-body: "Vazirmatn", "Segoe UI", system-ui, -apple-system, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
    --font-ar: "Amiri Quran", "Scheherazade New", "Noto Naskh Arabic", "Traditional Arabic", "Times New Roman", serif;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0b1512;
        --bg-glow: #102019;
        --surface: #10201a;
        --surface-2: #16291f;
        --ink: #eef3ec;
        --ink-soft: #a7b8af;
        --line: #23372b;
        --brand: #bfe3cf;
        --brand-2: #8fd0b1;
        --brand-ink: #08120e;
        --gold: #e0bb68;
        --gold-soft: #2a2415;
        --shadow: 0 18px 40px -24px rgba(0, 0, 0, .8);
        color-scheme: dark;
    }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background:
        radial-gradient(1200px 600px at 15% -10%, var(--bg-glow), transparent 60%),
        radial-gradient(900px 500px at 100% 0%, var(--gold-soft), transparent 55%),
        var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: none; }

img { max-width: 100%; display: block; }

h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; font-weight: 750; letter-spacing: -.01em; }
h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.6rem); }
h2 { font-size: clamp(1.15rem, 1rem + .6vw, 1.45rem); }
p { margin: 0 0 .75rem; }

.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0 0 0 0);
    white-space: nowrap; border: 0;
}

.shell { max-width: 1160px; margin: 0 auto; padding: 0 20px 48px; }

/* ── top bar ───────────────────────────────────────────────────────────────── */
.topbar {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 14px 0;
    margin-bottom: 26px;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid transparent;
}
.topbar::after {
    content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 1px;
    background: linear-gradient(90deg, transparent, var(--line), transparent);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .01em; }
.brand-mark {
    display: inline-grid; place-items: center;
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--brand); color: var(--gold);
    font-size: 1rem;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold) 40%, transparent);
}
.brand-name { font-size: 1.05rem; }
.topnav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lang-pill {
    font-size: .82rem; color: var(--ink-soft);
    padding: 5px 12px; border-radius: 999px;
    background: var(--surface-2); border: 1px solid var(--line);
}

/* ── buttons & chips ───────────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 18px; border-radius: 999px;
    border: 1px solid transparent; cursor: pointer;
    font: inherit; font-weight: 650; font-size: .92rem;
    transition: transform .12s ease, background-color .2s ease, color .2s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand-2); }
.btn-ghost { background: transparent; color: var(--ink-soft); border-color: var(--line); }
.btn-ghost:hover { color: var(--ink); border-color: var(--gold); }
.btn-small { padding: 7px 14px; font-size: .82rem; }
.chip {
    display: inline-block; padding: 2px 10px; border-radius: 999px;
    background: var(--surface-2); border: 1px solid var(--line);
    color: var(--ink-soft); font-size: .75rem; white-space: nowrap;
}
.eyebrow {
    margin: 0 0 6px;
    font-size: .78rem; letter-spacing: .16em; text-transform: uppercase;
    color: var(--gold); font-weight: 700;
}

/* ── hero ──────────────────────────────────────────────────────────────────── */
.hero { padding: 18px 0 30px; max-width: 760px; }
.hero-sub { color: var(--ink-soft); font-size: 1.05rem; max-width: 60ch; }
.hero-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; }

.search-wrap { flex: 1 1 260px; max-width: 420px; }
.search {
    width: 100%; padding: 12px 16px;
    border-radius: 999px; border: 1px solid var(--line);
    background: var(--surface); color: var(--ink);
    font: inherit; font-size: .95rem;
    box-shadow: var(--shadow);
}
.search:focus { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ── language chooser ──────────────────────────────────────────────────────── */
.lang-grid {
    display: grid; gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    margin: 8px 0 34px;
}
.lang-card {
    position: relative;
    display: grid; gap: 6px;
    padding: 16px 16px 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform .15s ease, border-color .15s ease;
}
.lang-card:hover { transform: translateY(-3px); border-color: var(--gold); }
.lang-endonym { font-size: 1.15rem; font-weight: 750; }
.lang-meta { font-size: .78rem; color: var(--ink-soft); display: flex; gap: 8px; align-items: baseline; justify-content: space-between; }
.lang-count { color: var(--gold); font-weight: 700; white-space: nowrap; }

/* ── page hero / crumbs ────────────────────────────────────────────────────── */
.crumbs { display: flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--ink-soft); margin-bottom: 16px; flex-wrap: wrap; }
.crumbs a:hover { color: var(--gold); }
.page-hero, .surah-hero {
    display: flex; align-items: flex-end; justify-content: space-between; gap: 18px;
    flex-wrap: wrap;
    padding: 22px 0 20px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 22px;
}
.surah-heading h1 { font-size: clamp(1.8rem, 1.3rem + 2.2vw, 3rem); }
.meta-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--ink-soft); font-size: .85rem; margin: 0; }

/* ── cards / lists ─────────────────────────────────────────────────────────── */
.card-block { margin: 26px 0; }
.section-title { font-size: 1.05rem; margin-bottom: 14px; }

.surah-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.surah-row {
    display: grid;
    grid-template-columns: 44px 1fr auto 20px;
    align-items: center; gap: 12px;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    transition: border-color .15s ease, transform .12s ease;
}
.surah-row:hover { border-color: var(--gold); transform: translateX(2px); }
[dir="rtl"] .surah-row:hover { transform: translateX(-2px); }
.surah-number {
    display: grid; place-items: center;
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--surface-2); color: var(--gold);
    font-size: .85rem; font-weight: 700;
}
.surah-main { display: grid; gap: 2px; min-width: 0; }
.surah-name { font-weight: 700; font-size: 1.02rem; }
.surah-meaning { color: var(--ink-soft); font-size: .82rem; }
.surah-meta { display: flex; align-items: center; gap: 8px; color: var(--ink-soft); font-size: .8rem; flex-wrap: wrap; justify-content: flex-end; }
.surah-go { color: var(--gold); font-size: 1.3rem; }
[dir="rtl"] .surah-go, [dir="rtl"] .pager-link span[aria-hidden] { transform: scaleX(-1); }
.is-upcoming { opacity: .72; }

.language-row-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.language-row {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 10px 14px; border-radius: var(--radius-sm);
    background: var(--surface); border: 1px solid var(--line);
    font-size: .9rem;
}
.language-row:hover { border-color: var(--gold); }
.language-row.is-current { border-color: var(--gold); background: var(--gold-soft); }
.language-row-title { color: var(--ink-soft); font-size: .82rem; }

/* ── player ────────────────────────────────────────────────────────────────── */
.player-card {
    margin: 0 0 26px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.player-facade {
    position: relative; display: block; width: 100%;
    aspect-ratio: 16 / 9; padding: 0; border: 0; cursor: pointer;
    background: #000;
}
.player-thumb { width: 100%; height: 100%; object-fit: cover; }
.player-scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.02) 30%, rgba(0,0,0,.72)); }
.player-play {
    position: absolute; inset-block-start: 50%; inset-inline-start: 50%;
    translate: -50% -50%;
    width: 78px; height: 78px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--gold); color: #1b1408;
    font-size: 1.5rem;
    box-shadow: 0 12px 30px rgba(0,0,0,.35);
    transition: transform .15s ease;
}
.player-facade:hover .player-play { transform: scale(1.06); }
.player-hint {
    position: absolute; inset-block-end: 16px; inset-inline-start: 16px;
    color: #fff; font-size: .85rem; font-weight: 650;
    text-shadow: 0 2px 10px rgba(0,0,0,.6);
}
.player-frame { aspect-ratio: 16 / 9; }
.player-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.player-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 14px;
    border-top: 1px solid var(--line);
    background: var(--surface-2);
}
.player-now { font-size: .82rem; color: var(--ink-soft); }

/* ── ayahs ─────────────────────────────────────────────────────────────────── */
.basmala {
    padding: 18px 20px;
    margin-bottom: 12px;
    border-radius: var(--radius-sm);
    background: var(--gold-soft);
    border: 1px solid color-mix(in srgb, var(--gold) 30%, var(--line));
    text-align: center;
}
.basmala-ar { font-family: var(--font-ar); font-size: clamp(1.3rem, 1.1rem + 1vw, 1.75rem); margin: 0 0 4px; }
.basmala-ph { color: var(--ink-soft); font-size: .86rem; margin: 0; }
.basmala-tr { color: var(--ink-soft); font-size: .86rem; margin: 4px 0 0; }

.ayah-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ayah {
    position: relative;
    padding: 16px 18px 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-inline-start: 3px solid var(--line);
    border-radius: var(--radius-sm);
    transition: border-color .2s ease, background-color .2s ease;
}
.ayah.is-active {
    border-inline-start-color: var(--gold);
    background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--gold-soft) 55%, var(--surface)));
}
.ayah-head { display: grid; grid-template-columns: 34px 28px 1fr; gap: 10px; align-items: start; }
.ayah-play {
    width: 32px; height: 32px; border-radius: 50%;
    border: 1px solid var(--line); background: var(--surface-2);
    color: var(--gold); cursor: pointer; font-size: .72rem;
    display: grid; place-items: center;
    transition: background-color .15s ease, color .15s ease;
}
.ayah-play:hover { background: var(--gold); color: #1b1408; }
.ayah-num {
    display: grid; place-items: center;
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--surface-2); color: var(--gold);
    font-size: .78rem; font-weight: 700;
}
.ayah-arabic {
    font-family: var(--font-ar);
    font-size: clamp(1.25rem, 1.05rem + 1vw, 1.7rem);
    line-height: 2.1;
    text-align: start;
    padding-inline-start: 6px;
}
.ayah-phonetic { margin: 8px 0 0; color: var(--ink-soft); font-size: .88rem; font-style: italic; }
.ayah-translation { margin: 4px 0 0; color: var(--ink-soft); font-size: .95rem; }
.ayah-copy {
    position: absolute; inset-block-start: 12px; inset-inline-end: 12px;
    width: 30px; height: 30px; border-radius: 8px;
    border: 1px solid transparent; background: transparent;
    color: var(--ink-soft); cursor: pointer; font-size: .9rem;
    opacity: 0; transition: opacity .15s ease;
}
.ayah:hover .ayah-copy, .ayah.is-active .ayah-copy { opacity: 1; }
.ayah-copy:hover { border-color: var(--line); color: var(--gold); }

/* ── notice / empty / pager / footer ───────────────────────────────────────── */
.notice-card, .empty-state {
    margin: 34px auto; max-width: 640px; text-align: center;
    padding: 34px 24px;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow);
}
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 30px 0; }
.pager-link {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 16px; border-radius: 999px;
    border: 1px solid var(--line); background: var(--surface);
    font-size: .9rem; font-weight: 650;
}
.pager-link:hover { border-color: var(--gold); color: var(--gold); }

.footer {
    margin-top: 56px; padding-top: 24px;
    border-top: 1px solid var(--line);
    color: var(--ink-soft); font-size: .82rem;
}
.footer-about { max-width: 70ch; }
.footer-rights { max-width: 70ch; opacity: .8; }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-links a { text-decoration: underline; text-underline-offset: 3px; }
.footer-links a:hover { color: var(--gold); }

.fineprint { font-size: .8rem; color: var(--ink-soft); }

/* toast for "copied" */
.toast {
    position: fixed; inset-block-end: 22px; inset-inline-start: 50%;
    translate: -50% 0;
    padding: 10px 18px; border-radius: 999px;
    background: var(--brand); color: var(--brand-ink);
    font-size: .85rem; font-weight: 650;
    box-shadow: var(--shadow); z-index: 50;
    opacity: 0; transition: opacity .2s ease;
    pointer-events: none;
}
.toast.is-visible { opacity: 1; }

@media (max-width: 640px) {
    .surah-row { grid-template-columns: 38px 1fr 18px; }
    .surah-meta { display: none; }
    .topnav .btn-ghost { display: none; }
    .ayah-copy { opacity: 1; }
    .player-play { width: 62px; height: 62px; }
}

@media (prefers-reduced-motion: reduce) {
    * { scroll-behavior: auto !important; transition: none !important; }
}
