/* ==============================================================
   Goranikurdi public website — base styles.
   Mirrors the admin panel's design tokens (indigo, Vazirmatn) with
   the addition of an RTL-first layout, page-level chrome (header,
   footer), and content cards used across catalogue/search/track
   pages. The landing page layers Stellar-style flourishes on top
   via /css/landing.css.
   ============================================================== */

:root {
    /* surfaces */
    --bg:           #F4F6FB;
    --surface:      #FFFFFF;
    --surface-2:    #F8FAFC;
    --surface-hover:#F1F5F9;

    /* text */
    --text:         #0F172A;
    --text-2:       #334155;
    --muted:        #64748B;
    --muted-2:      #94A3B8;

    /* lines */
    --line:         #E5E9F0;
    --line-strong:  #CBD5E1;

    /* accents — same indigo as the panel */
    --accent:       #4F46E5;
    --accent-hover: #4338CA;
    --accent-soft:  #EEF2FF;
    --accent-soft-2:#E0E7FF;

    /* secondary palette for icons/tiles */
    --c1: #4F46E5;
    --c2: #06B6D4;
    --c3: #F59E0B;
    --c4: #10B981;
    --c5: #EC4899;
    --c6: #8B5CF6;
    --c7: #EF4444;

    /* depth */
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 12px rgba(15, 23, 42, 0.05);
    --shadow-lg: 0 4px 16px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(15, 23, 42, 0.06);

    /* radii + sizing */
    --r-sm: 6px;
    --r:    10px;
    --r-lg: 14px;
    --r-xl: 18px;
    --shell-w: 1140px;
    --header-h: 64px;
}

html[data-theme="dark"] {
    --bg:           #0F172A;
    --surface:      #1E293B;
    --surface-2:    #111827;
    --surface-hover:#334155;
    --text:         #F1F5F9;
    --text-2:       #CBD5E1;
    --muted:        #94A3B8;
    --muted-2:      #64748B;
    --line:         #334155;
    --line-strong:  #475569;
    --accent:       #818CF8;
    --accent-hover: #A5B4FC;
    --accent-soft:  #312E81;
    --accent-soft-2:#3730A3;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.30);
    --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.30), 0 4px 12px rgba(0, 0, 0, 0.40);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.45), 0 1px 3px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    /* Vazirmatn first because the site is Sorani-only; Inter as a Latin
       fallback for digits + romanised metadata; system sans last. */
    font-family: 'Vazirmatn', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color .25s ease, color .25s ease;
}

/* Latin numerals + romanised text get Inter for readability;
   Vazirmatn handles Sorani for everything else via per-glyph
   fallback. */
.muted { color: var(--muted); }
.lat   { font-family: 'Inter', 'Vazirmatn', sans-serif; direction: ltr; unicode-bidi: isolate; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

button { font-family: inherit; cursor: pointer; }

::selection { background: var(--accent-soft); color: var(--text); }

/* Visually-hidden — for SR-only labels. */
.visually-hidden {
    position: absolute !important; width: 1px; height: 1px;
    overflow: hidden; clip: rect(1px,1px,1px,1px); white-space: nowrap;
}

/* ============================================================== shell */

.shell {
    width: 100%;
    max-width: var(--shell-w);
    margin: 0 auto;
    padding: 0 24px;
}
.shell--narrow { max-width: 760px; }
.shell--header {
    display: flex;
    align-items: center;
    gap: 24px;
    height: var(--header-h);
}
.shell--footer {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 48px;
    padding-top: 56px;
    padding-bottom: 32px;
}
@media (max-width: 640px) {
    .shell { padding: 0 16px; }
    .shell--footer { grid-template-columns: 1fr; gap: 24px; }
}

/* ============================================================== header */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: saturate(140%) blur(12px);
    -webkit-backdrop-filter: saturate(140%) blur(12px);
    border-bottom: 1px solid var(--line);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 700;
    font-size: 17px;
}
.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: var(--r-sm);
    background: linear-gradient(135deg, var(--c1), var(--c5));
    color: white;
    box-shadow: var(--shadow-sm);
}
.brand-name { letter-spacing: .2px; }

.site-nav {
    display: flex;
    gap: 4px;
    margin-inline-start: auto;
    margin-inline-end: 8px;
}
.site-nav a {
    color: var(--text-2);
    padding: 8px 14px;
    border-radius: var(--r-sm);
    font-size: 14px;
    font-weight: 500;
    transition: background .15s ease, color .15s ease;
}
.site-nav a:hover { background: var(--surface-hover); color: var(--text); }
.site-nav a[aria-current="page"] {
    background: var(--accent-soft);
    color: var(--accent);
}

.header-actions { display: flex; align-items: center; gap: 8px; }

@media (max-width: 720px) {
    .site-nav a { padding: 8px 10px; font-size: 13px; }
    .brand-name { display: none; }
    .header-actions .btn--small { padding: 6px 10px; font-size: 12px; }
}

/* ============================================================== buttons */

.btn {
    --btn-bg: var(--surface);
    --btn-color: var(--text);
    --btn-border: var(--line-strong);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--btn-bg);
    color: var(--btn-color);
    border: 1px solid var(--btn-border);
    border-radius: var(--r-sm);
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    transition: transform .12s ease, background .15s ease, border-color .15s ease, box-shadow .2s ease;
    cursor: pointer;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); }
.btn--accent {
    --btn-bg: var(--accent);
    --btn-color: #fff;
    --btn-border: var(--accent);
}
.btn--accent:hover { --btn-bg: var(--accent-hover); --btn-border: var(--accent-hover); color: #fff; }
.btn--ghost {
    --btn-bg: transparent;
    --btn-color: var(--text);
    --btn-border: var(--line-strong);
}
.btn--small { padding: 6px 12px; font-size: 13px; border-radius: var(--r-sm); }
.btn--lg    { padding: 14px 26px; font-size: 16px; border-radius: var(--r); }

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    color: var(--text-2);
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.icon-btn:hover { background: var(--surface-hover); color: var(--text); }
.icon-btn .icon-sun  { display: block; }
.icon-btn .icon-moon { display: none; }
html[data-theme="dark"] .icon-btn .icon-sun  { display: none; }
html[data-theme="dark"] .icon-btn .icon-moon { display: block; }

/* ============================================================== sections */

main { min-height: calc(100vh - var(--header-h)); }

.section {
    padding: 72px 0;
}
.section--alt {
    background: var(--surface-2);
    border-block: 1px solid var(--line);
}
.section--page {
    padding: 48px 0 80px;
}
.section--center {
    text-align: center;
    padding: 120px 0;
}

.section__head { margin-bottom: 32px; }
.section__head h1, .section__head h2 {
    font-size: clamp(24px, 3vw, 32px);
    margin: 0 0 8px;
    font-weight: 700;
    letter-spacing: -.01em;
}
.section__head h1 { font-size: clamp(28px, 4vw, 38px); }
.section__sub { margin: 0; color: var(--muted); font-size: 16px; max-width: 56ch; }
.section__sub-h {
    font-size: 18px;
    font-weight: 600;
    margin: 32px 0 12px;
    color: var(--text);
}

@media (max-width: 640px) {
    .section { padding: 56px 0; }
    .section--page { padding: 32px 0 56px; }
}

/* ============================================================== cards / grids */

.track-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}
.track-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    color: var(--text);
    box-shadow: var(--shadow-sm);
    transition: transform .15s ease, border-color .15s ease, box-shadow .2s ease;
    position: relative;
}
.track-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent-soft-2);
    box-shadow: var(--shadow-md);
    color: var(--text);
}
.track-card__title { font-weight: 600; font-size: 15px; }
.track-card__artist { color: var(--text-2); font-size: 14px; }
.track-card__meta { color: var(--muted); font-size: 12px; margin-top: 4px; }
.track-card .badge {
    position: absolute;
    inset-inline-start: 12px;
    inset-block-start: 12px;
    padding: 3px 8px;
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

/* Letter picker */

.letter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
    gap: 10px;
    margin-bottom: 32px;
}
.letter {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 14px 8px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    color: var(--text);
    transition: transform .15s ease, border-color .15s ease, background .15s ease, color .15s ease;
}
.letter:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    color: var(--text);
}
.letter--current {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.letter--current .letter__count { color: rgba(255,255,255,.85); }
.letter__char { font-size: 22px; font-weight: 700; }
.letter__count { font-size: 11px; color: var(--muted); }
.letter-heading {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 16px;
    color: var(--accent);
}

/* Artist + track lists */

.artist-list, .track-list {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: var(--surface);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.artist-row, .track-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    color: var(--text);
    border-bottom: 1px solid var(--line);
    transition: background .12s ease;
}
.artist-row:last-child, .track-row:last-child { border-bottom: 0; }
.artist-row:hover, .track-row:hover { background: var(--surface-hover); color: var(--text); }
.artist-row__name, .track-row__title { flex: 1; font-weight: 500; }
.artist-row__count, .track-row__album, .track-row__year { font-size: 13px; }
.track-row__chip {
    padding: 2px 8px;
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: 999px;
    font-size: 12px;
}

/* Artist head */
.artist-head {
    display: flex;
    align-items: center;
    gap: 18px;
    margin: 16px 0 32px;
}
.artist-head__mark, .artist-head__avatar {
    width: 84px;
    height: 84px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: var(--r);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}
.artist-head__mark {
    background: linear-gradient(135deg, var(--c1), var(--c6));
    color: white;
    font-size: 32px;
    font-weight: 800;
}
.artist-head__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.artist-head__name { font-size: 28px; margin: 0 0 2px; font-weight: 700; }

.back-link {
    display: inline-block;
    margin-bottom: 16px;
    color: var(--muted);
    font-size: 14px;
}
.back-link:hover { color: var(--accent); }

/* Track page */
.track-head { margin-bottom: 24px; }
.track-head__title { font-size: clamp(24px, 3vw, 34px); margin: 0 0 4px; font-weight: 700; }
.track-head__artist { color: var(--accent); font-size: 17px; font-weight: 500; }

.track-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin: 20px 0 0;
}
.track-meta > div {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    padding: 10px 12px;
}
.track-meta dt {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
    margin: 0 0 2px;
}
.track-meta dd { margin: 0; font-weight: 500; }

.player-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 20px;
    margin-bottom: 32px;
    box-shadow: var(--shadow-sm);
}
.player-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.player-card__label {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 4px 10px;
    border-radius: 999px;
}
.player-card__audio { width: 100%; }
.player-card__note { font-size: 13px; margin: 10px 0 0; }

.lyrics-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.lyrics-tabs .tab-row {
    display: inline-flex;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    padding: 4px;
    margin-bottom: 16px;
}
.tab {
    border: 0;
    background: transparent;
    padding: 6px 14px;
    border-radius: var(--r-sm);
    color: var(--text-2);
    font-weight: 500;
    transition: background .15s ease, color .15s ease;
}
.tab:hover { color: var(--text); }
.tab--current { background: var(--accent); color: white; }

.lyrics-body {
    display: none;
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 2;
    font-size: 16px;
    /* No <pre> monospace — Telegram lesson applies here too. */
    font-family: 'Vazirmatn', 'Inter', sans-serif;
}
.lyrics-body--lt { font-family: 'Inter', 'Vazirmatn', sans-serif; }
.lyrics-body.is-active { display: block; }

/* Search */

.search-form {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}
.search-input {
    flex: 1;
    padding: 14px 18px;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--r);
    font-size: 16px;
    color: var(--text);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.search-results { display: flex; flex-direction: column; gap: 36px; }
.search-block h2 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 12px;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: .08em;
}

/* CTA / about cards */

.cta-card {
    background: linear-gradient(135deg, var(--accent-soft), var(--accent-soft-2));
    border: 1px solid var(--accent-soft-2);
    border-radius: var(--r-lg);
    padding: 32px;
    text-align: center;
    margin-top: 32px;
}
.cta-card h2 { margin: 0 0 8px; }
.cta-card p { color: var(--text-2); margin: 0 0 20px; }

.prose p { margin: 0 0 16px; line-height: 1.85; font-size: 16px; }

.empty-state {
    padding: 32px;
    text-align: center;
    background: var(--surface);
    border: 1px dashed var(--line-strong);
    border-radius: var(--r);
}

/* Top-100 leaderboard */
.top-list {
    list-style: none;
    margin: 0;
    padding: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    counter-reset: top;
}
.top-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
}
.top-row:last-child { border-bottom: 0; }
.top-row:hover { background: var(--surface-hover); }
.top-row__rank {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: 50%;
    font-weight: 700;
    font-family: 'Inter', 'Vazirmatn', sans-serif;
}
.top-row:nth-child(1) .top-row__rank,
.top-row:nth-child(2) .top-row__rank,
.top-row:nth-child(3) .top-row__rank {
    background: linear-gradient(135deg, var(--c3), var(--c5));
    color: white;
}
.top-row__main {
    flex: 1;
    display: flex;
    flex-direction: column;
    color: var(--text);
    min-width: 0;
}
.top-row__main:hover { color: var(--text); }
.top-row__title {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.top-row__artist { color: var(--muted); font-size: 13px; }
.top-row__plays {
    flex-shrink: 0;
    font-size: 13px;
    color: var(--muted);
    font-family: 'Inter', 'Vazirmatn', sans-serif;
}
.top-row__plays small { font-family: 'Vazirmatn', sans-serif; margin-inline-start: 4px; }

.section-more {
    margin-top: 24px;
    text-align: center;
}

/* ============================================================== footer */

.site-footer {
    margin-top: 80px;
    border-top: 1px solid var(--line);
    background: var(--surface);
}
.site-footer h3 {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
    margin: 0 0 12px;
}
.site-footer p { color: var(--text-2); margin: 0; line-height: 1.7; }
.link-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.link-list a { color: var(--text-2); }
.link-list a:hover { color: var(--accent); }

.footer-bar {
    border-top: 1px solid var(--line);
    background: var(--surface-2);
    padding: 14px 0;
}
.footer-bar .shell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
}

/* ============================================================== reveal animation */

[data-reveal] {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity .6s ease, transform .6s ease;
}
[data-reveal].is-revealed {
    opacity: 1;
    transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    [data-reveal] { opacity: 1; transform: none; }
    html { scroll-behavior: auto; }
}
