﻿/* ============================================================================
   هرکجا | رادیو هرکجا — استایل اختصاصی
   ----------------------------------------------------------------------------
   ⚠️ همه کلاس‌ها با پیشوند «rd-» و داخل اسکوپ .rd-page هستند تا هیچ‌کدام از
      استایل‌های موجود سایت (Header/Footer/کارت‌ها) خراب نشود.
   ⚠️ هیچ CSS عمومی پروژه (style.css / home.css) تغییر نکرده است.
   تم: روشن، شیشه‌ای (glass)، مینیمال. از توکن‌های رنگی موجود سایت استفاده می‌کند.
   ============================================================================ */

.rd-page {
    /* فقط توکن‌های محلی رادیو — از متغیرهای سراسری سایت ارث می‌برد */
    --rd-radius: 26px;
    --rd-glass: rgba(255, 255, 255, .72);
    --rd-glass-strong: rgba(255, 255, 255, .9);
    --rd-line: rgba(226, 232, 240, .9);
    --rd-ink: var(--ink, #0f172a);
    --rd-soft: var(--muted, #64748b);
    --rd-brand: var(--brand, #006a0d);
    --rd-accent: var(--accent, #ee8d1a);
    --rd-shadow: 0 18px 50px rgba(20, 33, 61, .10);
    color: var(--rd-ink);
}

/* پس‌زمینه نرم و روشن — بدون دست‌زدن به body */
.rd-page {
    position: relative;
    padding-block: 34px 70px;
    background:
        radial-gradient(1100px 380px at 15% -8%, rgba(45, 108, 223, .07), transparent 62%),
        radial-gradient(900px 340px at 88% 4%, rgba(245, 158, 11, .07), transparent 60%);
}


/* ============================================================================
   ویدئوی رادیو — هدر، کادر، و نوار پایین
   ============================================================================ */
.rd-video { padding: 20px 22px 18px; }

.rd-video-head {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 16px;
}
.rd-video-badge {
    width: 40px; height: 40px; flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(245,158,11,.16), rgba(249,97,0,.12));
    color: var(--brand, #f96100);
    font-size: 1rem;
}
.rd-video-titles { min-width: 0; flex: 1; }
.rd-video-titles h2 {
    font-size: 1.05rem; font-weight: 700; margin: 0;
    color: var(--rd-ink, #16283f);
}
.rd-video-titles small { color: var(--rd-muted, #6b7a8d); font-size: .76rem; }
.rd-video-date {
    flex: 0 0 auto;
    font-size: .74rem; color: var(--rd-muted, #6b7a8d);
    background: rgba(22,40,63,.045);
    border-radius: 999px; padding: 5px 11px;
}

.rd-video-foot {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin-top: 14px;
}
.rd-video-chip {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: .76rem; font-weight: 600;
    padding: 7px 12px; border-radius: 999px;
    background: rgba(22,40,63,.045); color: var(--rd-muted, #6b7a8d);
}
.rd-video-chip.is-link {
    text-decoration: none; color: var(--rd-ink, #16283f);
    border: 1px solid rgba(22,40,63,.08);
    background: #fff;
    transition: border-color .2s, color .2s, background .2s;
}
.rd-video-chip.is-link:hover {
    color: var(--brand, #f96100);
    border-color: rgba(249,97,0,.35);
    background: rgba(245,158,11,.06);
}

/* ---------- پلیر صوتی: دکمه‌های گرد و یکدست ---------- */
.rd-controls { display: flex; align-items: center; justify-content: center; gap: 14px; }
.rd-play {
    border: 0; border-radius: 50%; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--brand, #f96100), #ee8d1a);
    color: #fff;
    box-shadow: 0 8px 22px rgba(249,97,0,.30);
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}
.rd-play:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(249,97,0,.38); filter: brightness(1.04); }
.rd-play:active { transform: translateY(0); }
.rd-skip {
    border: 1px solid rgba(22,40,63,.10); border-radius: 999px;
    background: #fff; color: var(--rd-ink, #16283f);
    display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
    font-weight: 600;
    transition: border-color .18s, color .18s, background .18s, transform .18s;
}
.rd-skip:hover {
    color: var(--brand, #f96100);
    border-color: rgba(249,97,0,.35);
    background: rgba(245,158,11,.06);
    transform: translateY(-1px);
}

/* ---------- موبایل ---------- */
@media (max-width: 620px) {
    .rd-video { padding: 16px 16px 14px; }
    .rd-video-head { gap: 10px; margin-bottom: 13px; }
    .rd-video-badge { width: 34px; height: 34px; border-radius: 10px; font-size: .9rem; }
    .rd-video-titles h2 { font-size: .96rem; }
    .rd-video-date { display: none; }
    .rd-video-foot { gap: 6px; margin-top: 12px; }
    .rd-video-chip { font-size: .72rem; padding: 6px 10px; }
}

/* ---------- کارت شیشه‌ای پایه ---------- */
.rd-glass {
    background: var(--rd-glass);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
    backdrop-filter: blur(16px) saturate(150%);
    border: 1px solid var(--rd-line);
    border-radius: var(--rd-radius);
    box-shadow: var(--rd-shadow);
}

/* ============================================================================
   هدر صفحه — تصویر + عنوان
   ============================================================================ */
.rd-hero {
    display: grid;
    grid-template-columns: minmax(0, 330px) minmax(0, 1fr);
    gap: 28px;
    align-items: center;
    padding: 22px;
    margin-bottom: 26px;
}

.rd-hero-img {
    position: relative;
    aspect-ratio: 16 / 10;
    border-radius: 20px;
    overflow: hidden;
    background: linear-gradient(135deg, #e8effb, #f6f8fc);
    border: 1px solid var(--rd-line);
}
.rd-hero-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rd-hero-img .rd-noimg {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    color: var(--rd-brand); font-size: 2.4rem; opacity: .45;
}

.rd-eyebrow {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(45, 108, 223, .09);
    color: var(--rd-brand);
    font-size: .78rem; font-weight: 700;
    margin-bottom: 12px;
}

.rd-hero h1 {
    font-size: clamp(1.35rem, 3.2vw, 2.05rem);
    line-height: 1.5;
    font-weight: 800;
    margin: 0 0 10px;
    overflow-wrap: anywhere;
}

.rd-hero .rd-lead {
    color: var(--rd-soft);
    font-size: .97rem;
    line-height: 1.9;
    margin: 0 0 14px;
    overflow-wrap: anywhere;
}

.rd-meta {
    display: flex; flex-wrap: wrap; gap: 8px 16px;
    color: var(--rd-soft); font-size: .82rem;
}
.rd-meta span { display: inline-flex; align-items: center; gap: 6px; }
.rd-meta i { color: var(--rd-brand); }

/* ============================================================================
   پخش‌کننده صوت — تمرکز اصلی صفحه
   ============================================================================ */
.rd-player {
    padding: 26px 24px 22px;
    margin-bottom: 22px;
    background: var(--rd-glass-strong);
}

.rd-player-head {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 18px;
}
.rd-player-disc {
    width: 50px; height: 50px; flex: none;
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--rd-brand), #4f8ce8);
    color: #fff; font-size: 1.2rem;
    box-shadow: 0 10px 24px rgba(45, 108, 223, .28);
}
.rd-player-title { min-width: 0; }
.rd-player-title strong {
    display: block; font-size: 1.02rem; font-weight: 700;
    overflow-wrap: anywhere;
}
.rd-player-title small { color: var(--rd-soft); font-size: .8rem; }

/* نوار پیشرفت */
.rd-track {
    position: relative;
    height: 8px;
    border-radius: 999px;
    background: rgba(45, 108, 223, .12);
    cursor: pointer;
    margin: 6px 0 8px;
}
.rd-track-fill {
    position: absolute; inset-inline-start: 0; top: 0; bottom: 0;
    width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--rd-brand), #5b9bf0);
}
.rd-track-knob {
    position: absolute; top: 50%;
    width: 15px; height: 15px;
    margin-inline-start: -7.5px;
    transform: translateY(-50%);
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--rd-brand);
    box-shadow: 0 2px 8px rgba(20, 33, 61, .22);
    opacity: 0; transition: opacity .2s;
}
.rd-track:hover .rd-track-knob, .rd-page.is-playing .rd-track-knob { opacity: 1; }

.rd-times {
    display: flex; justify-content: space-between;
    color: var(--rd-soft); font-size: .8rem;
    font-variant-numeric: tabular-nums;
    margin-bottom: 16px;
}

/* کنترل‌ها */
.rd-controls {
    display: flex; align-items: center; justify-content: center;
    gap: 14px; flex-wrap: wrap;
}
.rd-skip {
    display: inline-flex; align-items: center; gap: 6px;
    height: 44px; padding: 0 16px;
    border-radius: 999px;
    border: 1px solid var(--rd-line);
    background: rgba(255, 255, 255, .8);
    color: var(--rd-ink);
    font-size: .84rem; font-weight: 700;
    cursor: pointer;
    transition: all .22s ease;
}
.rd-skip:hover { border-color: var(--rd-brand); color: var(--rd-brand); transform: translateY(-1px); }
.rd-skip:active { transform: scale(.96); }
.rd-skip i { font-size: .8rem; }

.rd-play {
    width: 68px; height: 68px; flex: none;
    border: 0; border-radius: 50%;
    background: linear-gradient(135deg, var(--rd-brand), #3f7ee0);
    color: #fff; font-size: 1.4rem;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer;
    box-shadow: 0 14px 32px rgba(45, 108, 223, .34);
    transition: transform .2s ease, box-shadow .2s ease;
}
.rd-play:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 18px 38px rgba(45, 108, 223, .42); }
.rd-play:active { transform: scale(.96); }

/* نوار وضعیت (Resume / وضعیت پخش) */
.rd-resume {
    display: none;
    align-items: center; gap: 8px;
    margin-top: 16px;
    padding: 11px 15px;
    border-radius: 14px;
    background: rgba(45, 108, 223, .07);
    color: var(--rd-brand);
    font-size: .83rem;
}
.rd-resume.show { display: flex; }
.rd-resume button {
    margin-inline-start: auto;
    border: 0; background: transparent;
    color: var(--rd-brand); font-weight: 700; cursor: pointer;
    font-size: .82rem;
}

/* ============================================================================
   Like / Save
   ============================================================================ */
.rd-actions {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 16px 20px;
    margin-bottom: 22px;
}
.rd-act {
    display: inline-flex; align-items: center; gap: 9px;
    height: 46px; padding: 0 20px;
    border-radius: 999px;
    border: 1px solid var(--rd-line);
    background: rgba(255, 255, 255, .82);
    color: var(--rd-ink);
    font-size: .9rem; font-weight: 700;
    cursor: pointer;
    transition: all .22s ease;
}
.rd-act:hover { transform: translateY(-1px); border-color: var(--rd-brand); color: var(--rd-brand); }
.rd-act .rd-count {
    min-width: 24px; height: 24px; padding: 0 7px;
    border-radius: 999px;
    background: rgba(45, 108, 223, .1);
    color: var(--rd-brand);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .76rem; font-weight: 800;
    font-variant-numeric: tabular-nums;
}
.rd-act.is-on { background: var(--rd-brand); border-color: var(--rd-brand); color: #fff; }
.rd-act.is-on .rd-count { background: rgba(255, 255, 255, .24); color: #fff; }
.rd-act.is-on.like { background: #e0245e; border-color: #e0245e; }
.rd-act.is-on.save { background: var(--rd-accent); border-color: var(--rd-accent); color: #3a2a00; }
.rd-act.is-on.save .rd-count { background: rgba(0, 0, 0, .16); color: #3a2a00; }
.rd-act[disabled] { opacity: .65; cursor: wait; }

/* ============================================================================
   محتوای متنی
   ============================================================================ */
.rd-content { padding: 26px 24px; margin-bottom: 22px; }
.rd-content h2 {
    font-size: 1.08rem; margin: 0 0 14px;
    display: flex; align-items: center; gap: 9px;
}
.rd-content h2 i { color: var(--rd-brand); }
.rd-body {
    color: #334155; font-size: .95rem; line-height: 2.05;
    overflow-wrap: anywhere;
}
/* استایل محتوای HTML ذخیره‌شده (مثل سایر بخش‌های سایت) */
.rd-body p { margin: 0 0 14px; }
.rd-body ul, .rd-body ol { padding-inline-start: 22px; margin: 0 0 14px; }
.rd-body li { margin-bottom: 6px; }
.rd-body img { max-width: 100%; height: auto; border-radius: 14px; }
.rd-body table { width: 100%; border-collapse: collapse; margin-bottom: 14px; }
.rd-body td, .rd-body th { border: 1px solid var(--rd-line); padding: 8px 10px; }
.rd-body h1, .rd-body h2, .rd-body h3, .rd-body h4 { margin: 18px 0 10px; font-size: 1.05rem; }
.rd-body b, .rd-body strong { font-weight: 800; }
.rd-body a { color: var(--rd-brand); }
/* جلوگیری از سرریز افقی روی موبایل */
.rd-body { overflow-x: auto; }

/* ============================================================================
   کسب‌وکارهای منتخب
   ============================================================================ */
.rd-suggest { padding: 26px 24px; margin-bottom: 22px; }
.rd-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 16px;
}
.rd-card {
    display: block;
    border: 1px solid var(--rd-line);
    border-radius: 18px;
    overflow: hidden;
    background: rgba(255, 255, 255, .85);
    transition: all .24s ease;
}
.rd-card:hover { transform: translateY(-4px); box-shadow: 0 14px 34px rgba(20, 33, 61, .12); }
.rd-card-img {
    position: relative; aspect-ratio: 4/3; overflow: hidden;
    background: linear-gradient(135deg, #eef3fb, #f8fafd);
}
.rd-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rd-card-rank {
    position: absolute; top: 10px; inset-inline-start: 10px;
    min-width: 26px; height: 26px; padding: 0 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .93);
    color: var(--rd-brand);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .76rem; font-weight: 800;
    box-shadow: 0 3px 10px rgba(20, 33, 61, .12);
}
.rd-card-body { padding: 13px 14px 15px; }
.rd-card-body h3 {
    font-size: .95rem; font-weight: 700; margin: 0 0 6px;
    overflow-wrap: anywhere;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.rd-card-loc { color: var(--rd-soft); font-size: .78rem; display: flex; align-items: center; gap: 6px; }
.rd-card-loc i { color: var(--rd-brand); }
.rd-card-go {
    margin-top: 10px;
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--rd-brand); font-size: .78rem; font-weight: 700;
}

/* ============================================================================
   ویدئوی پیش‌نمایش (فقط وقتی URL دارد)
   ============================================================================ */
.rd-video { padding: 26px 24px; margin-bottom: 22px; }
.rd-video-frame {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: 18px;
    overflow: hidden;
    background: #0f172a;
    border: 1px solid var(--rd-line);
}
.rd-video-frame iframe,
.rd-video-frame video { width: 100%; height: 100%; border: 0; display: block; }

/* ============================================================================
   لیست رادیوها (صفحه Index)
   ============================================================================ */
.rd-list-head { margin-bottom: 24px; }
.rd-list-head h1 { font-size: clamp(1.4rem, 3.4vw, 2rem); font-weight: 800; margin: 0 0 8px; }
.rd-list-head p { color: var(--rd-soft); margin: 0; }

.rd-item {
    display: flex; gap: 16px; align-items: center;
    padding: 14px;
    margin-bottom: 14px;
    border-radius: 20px;
    background: var(--rd-glass);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
    backdrop-filter: blur(16px) saturate(150%);
    border: 1px solid var(--rd-line);
    transition: all .24s ease;
}
.rd-item:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(20, 33, 61, .11); }
.rd-item-img {
    width: 132px; flex: none; aspect-ratio: 16/10;
    border-radius: 15px; overflow: hidden;
    background: linear-gradient(135deg, #eef3fb, #f8fafd);
}
.rd-item-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rd-item-body { min-width: 0; flex: 1; }
.rd-item-body h3 { font-size: 1.02rem; font-weight: 700; margin: 0 0 7px; overflow-wrap: anywhere; }
.rd-item-body p {
    color: var(--rd-soft); font-size: .86rem; line-height: 1.85; margin: 0 0 9px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.rd-item-foot { display: flex; flex-wrap: wrap; gap: 8px 15px; color: var(--rd-soft); font-size: .78rem; }
.rd-item-foot span { display: inline-flex; align-items: center; gap: 5px; }
.rd-item-foot i { color: var(--rd-brand); }
.rd-item-play {
    flex: none; width: 48px; height: 48px; border-radius: 50%;
    background: linear-gradient(135deg, var(--rd-brand), #4f8ce8);
    color: #fff; display: inline-flex; align-items: center; justify-content: center;
    font-size: 1rem; box-shadow: 0 10px 24px rgba(45, 108, 223, .28);
}

/* ============================================================================
   پنل کاربر — رادیوهای ذخیره‌شده
   ============================================================================ */
.rd-saved-item {
    display: flex; gap: 14px; align-items: center;
    padding: 12px;
    border: 1px solid var(--rd-line);
    border-radius: 16px;
    background: #fff;
    margin-bottom: 12px;
    transition: all .22s ease;
}
.rd-saved-item:hover { border-color: var(--rd-brand); }
.rd-saved-thumb {
    width: 96px; flex: none; aspect-ratio: 16/10;
    border-radius: 12px; overflow: hidden; background: #eef3fb;
}
.rd-saved-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rd-saved-body { min-width: 0; flex: 1; }
.rd-saved-body h5 { font-size: .95rem; margin: 0 0 5px; font-weight: 700; overflow-wrap: anywhere; }
.rd-saved-body small { color: var(--rd-soft); font-size: .78rem; }
.rd-saved-btn {
    flex: none;
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 15px; border-radius: 999px;
    background: var(--rd-brand); color: #fff;
    font-size: .8rem; font-weight: 700;
    text-decoration: none;
}
.rd-saved-btn:hover { color: #fff; opacity: .92; }
.rd-empty {
    text-align: center; padding: 44px 20px; color: var(--rd-soft);
}
.rd-empty i { font-size: 2.4rem; color: rgba(45, 108, 223, .3); display: block; margin-bottom: 14px; }

/* ============================================================================
   پیام ورود موردنیاز
   ============================================================================ */
.rd-modal {
    position: fixed; inset: 0; z-index: 1200;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    background: rgba(20, 33, 61, .34);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    opacity: 0; visibility: hidden;
    transition: opacity .26s ease, visibility .26s;
}
.rd-modal.open { opacity: 1; visibility: visible; }
.rd-modal-card {
    width: 100%; max-width: 400px;
    background: #fff; border-radius: 24px;
    padding: 26px 24px 22px;
    box-shadow: 0 26px 60px rgba(20, 33, 61, .24);
    transform: translateY(14px) scale(.98);
    transition: transform .3s cubic-bezier(.2, .7, .2, 1);
    text-align: center;
}
.rd-modal.open .rd-modal-card { transform: translateY(0) scale(1); }
.rd-modal-ico {
    width: 56px; height: 56px; margin: 0 auto 14px;
    border-radius: 18px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(45, 108, 223, .1); color: var(--rd-brand);
    font-size: 1.4rem;
}
.rd-modal-card h4 { font-size: 1.05rem; margin: 0 0 8px; font-weight: 800; }
.rd-modal-card p { color: var(--rd-soft); font-size: .88rem; line-height: 1.9; margin: 0 0 18px; }
.rd-modal-actions { display: flex; gap: 10px; }
.rd-modal-actions .btn { flex: 1; border-radius: 999px; font-weight: 700; }

/* توست کوچک */
.rd-toast {
    position: fixed; inset-inline-start: 50%; bottom: 84px;
    transform: translateX(50%) translateY(14px);
    z-index: 1300;
    padding: 11px 20px; border-radius: 999px;
    background: rgba(20, 33, 61, .9);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    color: #fff; font-size: .84rem; font-weight: 600;
    opacity: 0; visibility: hidden;
    transition: all .28s ease;
    max-width: calc(100vw - 40px);
}
.rd-toast.show { opacity: 1; visibility: visible; transform: translateX(50%) translateY(0); }

/* ============================================================================
   Responsive
   ============================================================================ */
@media (max-width: 900px) {
    .rd-hero { grid-template-columns: 1fr; gap: 18px; }
    .rd-hero-img { max-width: 420px; margin-inline: auto; width: 100%; }
}
@media (max-width: 600px) {
    .rd-page { padding-block: 22px 100px; }
    .rd-hero, .rd-player, .rd-actions, .rd-content, .rd-suggest, .rd-video {
        padding: 18px 15px;
        border-radius: 20px;
    }
    .rd-hero-img { aspect-ratio: 16/9; }
    .rd-play { width: 60px; height: 60px; font-size: 1.25rem; }
    .rd-skip { height: 40px; padding: 0 13px; font-size: .78rem; }
    .rd-controls { gap: 9px; }
    .rd-actions { gap: 9px; }
    .rd-act { height: 42px; padding: 0 15px; font-size: .84rem; flex: 1; justify-content: center; }
    .rd-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .rd-item { flex-direction: column; align-items: stretch; }
    .rd-item-img { width: 100%; }
    .rd-item-play { align-self: flex-start; }
    .rd-saved-item { flex-wrap: wrap; }
    .rd-saved-thumb { width: 76px; }
    .rd-saved-btn { width: 100%; justify-content: center; }
    .rd-modal-actions { flex-direction: column; }
}
@media (max-width: 420px) {
    .rd-grid { grid-template-columns: 1fr; }
}

/* ============================================================================
   پلیر چسبان (Sticky Player) — نسخه نهایی
   ----------------------------------------------------------------------------
   • bottom با فاصله از منوی ناوبری پایین موبایل و نوار سِیف‌اریا
   • z-index بالاتر از همه (منوی پایین ۹۵، هدر ۱۰۰) → ۹۹۹
   • هاله آبی (glow) وقتی فیکس شده تا کاربر بفهمد چسبیده
   • حالت is-unstuck برای خروج نرم (بدون لرزش)
   ============================================================================ */
.rd-player { transition: box-shadow .28s ease, border-color .28s ease, transform .28s ease; }

.rd-player.is-stuck {
    position: fixed;
    inset-inline: 12px;
    /* پایین صفحه: منوی ناوبری موبایل ~۶۴px + نوار ایمنی + فاصله */
    bottom: calc(90px + env(safe-area-inset-bottom));
    z-index: 999;
    margin: 0 auto;
    max-width: 940px;
    padding: 12px 14px;
    border-radius: 18px;
    background: rgba(255,255,255,.97);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(45,108,223,.28);
    /* هاله آبی — نشانه «الان چسبیده است» */
    box-shadow:
        0 0 0 1px rgba(45,108,223,.10),
        0 14px 40px rgba(20,33,61,.18),
        0 0 26px rgba(45,108,223,.35);
    animation: rdStickIn .26s ease;
}
.rd-player.is-stuck::before {
    content: '';
    position: absolute; inset: -1px;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(45,108,223,.5), rgba(245,158,11,.4));
    opacity: .5;
    z-index: -1;
    filter: blur(10px);
}

@keyframes rdStickIn {
    from { transform: translateY(16px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* خروج نرم — کلاس گذرا از JS */
.rd-player.is-unstuck {
    animation: rdUnstickOut .24s ease;
}
@keyframes rdUnstickOut {
    from { transform: translateY(0);    opacity: 1; }
    to   { transform: translateY(16px); opacity: 0; }
}

/* حالت چسبان فشرده‌تر تا ارتفاع کم بماند */
.rd-player.is-stuck .rd-player-head { margin-bottom: 8px; }
.rd-player.is-stuck .rd-player-disc { width: 36px; height: 36px; font-size: .95rem; }
.rd-player.is-stuck .rd-player-title strong { font-size: .88rem; }
.rd-player.is-stuck .rd-player-title small { display: none; }
.rd-player.is-stuck .rd-resume { display: none !important; }
.rd-player.is-stuck .rd-track { margin-block: 8px 6px; }
.rd-player.is-stuck .rd-controls { gap: 10px; }
.rd-player.is-stuck .rd-play { width: 46px; height: 46px; font-size: 1.05rem; }
.rd-player.is-stuck .rd-skip { height: 38px; padding: 0 12px; font-size: .78rem; }

/* ============================================================================
   دکمه پین پلیر (همیشه دیده می‌شود) + دکمه بستن (فقط در حالت پین)
   ============================================================================ */
.rd-pin-btn {
    position: absolute; inset-inline-end: 12px; top: 12px;
    width: 30px; height: 30px;
    border: 1px solid rgba(22,40,63,.10);
    border-radius: 50%;
    background: rgba(255,255,255,.85);
    color: #94a3b8;
    /* ⚠️ کاربر: «میخوام وقتی اسکرول کرد نشونش بده و پین بشه»
       پس دکمهٔ پین فقط در حالت چسبان دیده میشود — نه در حالت عادی. */
    display: none;
    align-items: center; justify-content: center;
    cursor: pointer; font-size: .78rem;
    z-index: 3;
    transition: color .2s, background .2s, border-color .2s, transform .2s;
}
/* در حالت چسبان: پین سمت راست، ضربدر سمت چپ — بدون تداخل */
.rd-player.is-stuck .rd-pin-btn { display: inline-flex; }
.rd-pin-btn:hover {
    color: var(--brand, #006a0d);
    border-color: rgba(0,106,13,.4);
    background: #fff;
}
.rd-pin-btn.is-on {
    color: #fff;
    background: var(--brand, #006a0d);
    border-color: var(--brand, #006a0d);
    transform: rotate(-25deg);
}


/* ============================================================================
   دکمه بستن پلیر همراه + لایک/سیو کوچک داخل پلیر چسبان
   ----------------------------------------------------------------------------
   کاربر: «وقتی پلیر ثابت سر جایش هست، دکمه ضربدر را اصلاً نشان نده؛
          فقط وقتی استیکی شد نشان بده.»
   پس پیش‌فرض مخفی است و فقط در حالت is-stuck نمایش داده می‌شود.
   ============================================================================ */
.rd-stick-close {
    position: absolute; inset-inline-end: 12px; top: 12px;
    width: 30px; height: 30px;
    border: 1px solid rgba(22,40,63,.10);
    border-radius: 50%;
    background: rgba(255,255,255,.85);
    color: #94a3b8;
    display: none;                     /* فقط در حالت چسبان دیده می‌شود */
    align-items: center; justify-content: center;
    cursor: pointer; font-size: .72rem; z-index: 3;
    transition: color .2s, background .2s, border-color .2s, opacity .2s;
}
.rd-player.is-stuck .rd-stick-close { display: inline-flex; }
.rd-stick-close:hover { color: #e11d48; border-color: rgba(225,29,72,.35); background: #fff; }

/* دکمه‌های کوچک تعامل — فقط در حالت چسبان دیده می‌شوند */
/* ----------------------------------------------------------------------------
   لایک/ذخیره — داخل نوار کنترل (.rd-controls)، دو طرف دکمه‌های ۱۵ ثانیه.
   کاربر: «افتاده روی rd-player-head؛ بهتره توی rd-controls باشه دو طرف ۱۵ ثانیه جلو و قبل»
   پس دیگر absolute گوشه نیست؛ یک آیتم عادی flex در همان ردیف است.
   ---------------------------------------------------------------------------- */
.rd-mini {
    display: inline-flex; align-items: center; gap: 5px;
    height: 34px; padding: 0 12px;
    border: 1px solid rgba(22,40,63,.10);
    border-radius: 999px;
    background: #fff;
    color: #64748b;
    cursor: pointer; font-size: .74rem; font-weight: 700;
    transition: color .18s, background .18s, border-color .18s, transform .18s;
}
.rd-mini:hover { transform: translateY(-1px); }
.rd-mini.like:hover  { color: #e11d48; border-color: rgba(225,29,72,.35); }
.rd-mini.save:hover  { color: var(--brand, #006a0d); border-color: rgba(0,106,13,.35); }
.rd-mini.like.is-on  { background: #ffe4e6; border-color: #fda4af; color: #be123c; }
.rd-mini.save.is-on  { background: rgba(0,106,13,.10); border-color: rgba(0,106,13,.38); color: var(--brand, #006a0d); }
.rd-mini i { font-size: .78rem; }
.rd-mini span { font-size: .7rem; }

/* ----------------------------------------------------------------------------
   چیدمان دکمه‌های گوشهٔ پلیر چسبان (بدون تداخل)
   ----------------------------------------------------------------------------
   کاربر: «اصلا خیلی تداخل داره با ضربدر».
   دو دکمه هم‌اندازه (۳۰px) با فاصلهٔ ۸px از هم و ۱۰px از لبه:
     ضربدر  → inset-inline-end: 10px              (سمت شروع در RTL = راست)
     پین    → inset-inline-end: 48px  (10 + 30 + 8)  کنارش، بدون همپوشانی
   در موبایل همان ۳۰px می‌ماند تا فاصله حفظ شود (قبلاً ۲۸px بود و می‌چسبید).
   ---------------------------------------------------------------------------- */
.rd-player.is-stuck .rd-stick-close { inset-inline-end: 10px; top: 10px; }
.rd-player.is-stuck .rd-pin-btn     { inset-inline-end: 48px; top: 10px; }

/* در حالت چسبان، دکمه پین همیشه چرخیده است (چه پین‌شده چه آزاد) */
.rd-player.is-stuck .rd-pin-btn { transform: rotate(-25deg); }

@media (max-width: 700px) {
    .rd-mini { height: 30px; padding: 0 9px; font-size: .68rem; }
    .rd-player.is-stuck .rd-stick-close { inset-inline-end: 8px;  top: 8px; width: 30px; height: 30px; }
    .rd-player.is-stuck .rd-pin-btn     { inset-inline-end: 46px; top: 8px; width: 30px; height: 30px; }
}

/* موبایل: فاصله از لبه کمتر، ولی همچنان بالای منوی ناوبری */
@media (max-width: 700px) {
    .rd-player.is-stuck {
        inset-inline: 8px;
        bottom: calc(90px + env(safe-area-inset-bottom));
        padding: 10px 12px;
        border-radius: 16px;
    }
    .rd-player.is-stuck .rd-player-head { margin-bottom: 6px; }
    .rd-player.is-stuck .rd-player-title strong { font-size: .82rem; }
    .rd-player.is-stuck .rd-play { width: 42px; height: 42px; }
    .rd-player.is-stuck .rd-skip { height: 34px; padding: 0 10px; font-size: .74rem; }
    .rd-player.is-stuck .rd-times { font-size: .72rem; }
}

/* اگر کاربر انیمیشن کم می‌خواهد (احترام به تنظیم سیستم) */
@media (prefers-reduced-motion: reduce) {
    .rd-player.is-stuck,
    .rd-player.is-unstuck { animation: none; }
}

/* ============================================================================
   ویدئوی پیش‌نمایش — نسبت تصویر بر اساس جهت ویدئو
   ----------------------------------------------------------------------------
   ویدئوی افقی (16:9) و عمودی (9:16) کادر متفاوت می‌گیرند.
   نسبت واقعی با JS از متادیتای ویدئو خوانده و روی .rd-video-frame ست می‌شود
   (aspect-ratio). مقدار پیش‌فرض 16:9 است تا قبل از لود، پرش نداشته باشیم.
   ============================================================================ */
.rd-video-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 70vh;
    margin-inline: auto;
    border-radius: 16px;
    overflow: hidden;
    background: #0b1220;
}
.rd-video-frame > iframe,
.rd-video-frame > video {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    border: 0; display: block;
    object-fit: contain;
}

/* ویدئوی عمودی/مربعی — کادر باریک‌تر و وسط‌چین می‌شود تا کناره‌ها خالی نماند */
.rd-video-frame.is-vertical {
    aspect-ratio: 9 / 16;
    max-width: 420px;
}
.rd-video-frame.is-square {
    aspect-ratio: 1 / 1;
    max-width: 620px;
}

@media (max-width: 700px) {
    .rd-video-frame { border-radius: 13px; max-height: 60vh; }
    .rd-video-frame.is-vertical { aspect-ratio: 9 / 16; max-width: 100%; }
}

/* ============================================================================
   ناوبری بین قسمت‌های رادیو (قبلی / بعدی)
   ============================================================================ */
.rd-nav-episodes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 26px;
}
.rd-ep {
    display: flex; align-items: center; gap: 11px;
    padding: 13px 15px;
    border-radius: 16px;
    background: rgba(255,255,255,.72);
    border: 1px solid var(--rd-line, #E6EAF1);
    text-decoration: none;
    color: var(--rd-ink, #16283f);
    transition: border-color .2s, box-shadow .2s, transform .2s, background .2s;
    min-width: 0;
}
.rd-ep:hover {
    background: #fff;
    border-color: var(--brand, #006a0d);
    box-shadow: 0 8px 22px rgba(45,108,223,.1);
    transform: translateY(-1px);
    color: var(--rd-ink, #16283f);
}
.rd-ep > i { flex: 0 0 auto; font-size: .82rem; color: var(--brand, #006a0d); }

.rd-ep-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rd-ep-text small { font-size: 11px; color: #94a3b8; font-weight: 600; }
.rd-ep-text strong {
    font-size: .9rem; font-weight: 700; line-height: 1.5;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* دکمهٔ بعدی به سمت چپ (RTL) → متن راست‌چین و آیکن آخر */
.rd-ep-next { justify-content: flex-end; text-align: left; }
.rd-ep-next .rd-ep-text { align-items: flex-end; }

/* جای خالی وقتی قسمت قبلی/بعدی وجود ندارد */
.rd-ep-empty { border: 0; background: transparent; pointer-events: none; }

@media (max-width: 620px) {
    /* در موبایل هم قبلی/بعدی کنار هم می‌مانند (نه هر کدام یک سطر) */
    .rd-nav-episodes { grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 20px; }
    .rd-ep { padding: 10px 11px; border-radius: 14px; gap: 8px; }
    .rd-ep > i { font-size: .72rem; }
    .rd-ep-text small { font-size: 10px; }
    .rd-ep-text strong { font-size: .78rem; letter-spacing: -.2px; }
}
