/* =============================================================================
   v3_soundlist.css — стили /category/ landing (v3_MainSound_admin.php)
   =============================================================================
   Скоупится под `body.zg-soundlist-on` чтобы не задеть другие шаблоны.
   Подключается через registerCssFile() в v3_MainSound_admin.php ПОСЛЕ
   v3_category.css (порядок важен для override-каскада).

   Источник стилей: etalon prod-snd/snd-block.css. Переведено на токены сайта
   (--pr-blue, --br, --border-card, --l-blue) где они есть, fallback'и сохранены.

   Двух-секционная структура:
     .snd-overview — sticky-якоря (6 пилюль супергрупп, scroll-spy)
     .snd-content  — рейлы с группами и категориями (всё в DOM, не JS-рендер)
   ============================================================================= */

/* ── Локальные токены, дополняющие глобальные --pr-blue/--br/--border-card ── */
body.zg-soundlist-on {
    --snd-card: #ffffff;
    --snd-text: #0f172a;
    --snd-text-2: #2c2c2c;
    --snd-text-3: #334155;
    --snd-mute: #6a6e8f;
    --snd-faint: #94a3b8;
    --snd-border: var(--border-card, #dfe7f3);
    --snd-border-2: #eef2f7;
    --snd-primary: var(--pr-blue, #2e58ef);
    --snd-primary-50: var(--l-blue, #eef4f9);
    --snd-radius-card: 12px;
    --snd-radius-btn: var(--br, 8px);
    --snd-shadow-card: 0 1px 2px rgba(15, 23, 42, .04), 0 6px 18px -6px rgba(15, 23, 42, .06);
}

/* === Hero / интро уже в .page-container — оставляем как есть, отступы только ниже === */
body.zg-soundlist-on .page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 20px 0;
}

/* Старая статическая разметка категорий — прячем (рендер новый, ниже) */
body.zg-soundlist-on .content-card { display: none !important; }

/* ===================== OVERVIEW — пилюли супергрупп ===================== */
body.zg-soundlist-on .snd-overview {
    margin: 16px 0 20px;
}
body.zg-soundlist-on .snd-overview-card {
    background: var(--snd-card);
    border: 1px solid var(--snd-border);
    border-radius: var(--snd-radius-card);
    padding: 14px;
    box-shadow: var(--snd-shadow-card);
}
body.zg-soundlist-on .snd-overview-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}

body.zg-soundlist-on .snd-super-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--snd-radius-btn);
    background: transparent;
    color: var(--snd-text-2);
    text-decoration: none;
    transition: all .15s ease;
}
body.zg-soundlist-on .snd-super-pill:hover {
    background: #f6f8fb;
    color: var(--snd-text-2);
}
body.zg-soundlist-on .snd-super-pill.is-active {
    background: var(--snd-primary-50);
    color: var(--snd-primary);
}
body.zg-soundlist-on .snd-super-pill .lbl {
    font-weight: 600;
    font-size: 13px;
    line-height: 1.2;
}
body.zg-soundlist-on .snd-super-pill .num {
    color: var(--snd-mute);
    font-size: 11px;
    font-weight: 500;
    margin-top: 1px;
}

/* Номерная эмблема с акцентом из --accent (инлайн на пилюле) */
body.zg-soundlist-on .snd-super-pill .emb {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--snd-radius-btn);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .05em;
    font-variant-numeric: tabular-nums;
    background: color-mix(in srgb, var(--accent, var(--snd-primary)) 12%, #fff);
    color: var(--accent, var(--snd-primary));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent, var(--snd-primary)) 18%, transparent);
}
body.zg-soundlist-on .snd-super-pill.is-active .emb {
    background: color-mix(in srgb, var(--accent, var(--snd-primary)) 18%, #fff);
}

/* ===================== CONTENT — рейлы супергрупп ===================== */
body.zg-soundlist-on .snd-content {
    margin: 0 0 48px;
}
body.zg-soundlist-on .snd-content-card {
    background: var(--snd-card);
    border: 1px solid var(--snd-border);
    border-radius: var(--snd-radius-card);
    padding: 28px 28px 36px;
    box-shadow: var(--snd-shadow-card);
}

body.zg-soundlist-on .snd-rail {
    margin-bottom: 40px;
    scroll-margin-top: 88px;
}
body.zg-soundlist-on .snd-rail:last-child {
    margin-bottom: 0;
}

body.zg-soundlist-on .snd-rail-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--snd-border);
}
body.zg-soundlist-on .snd-rail-head h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--snd-text);
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: -.01em;
    margin: 0;
}
body.zg-soundlist-on .snd-rail-emb {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .04em;
    font-variant-numeric: tabular-nums;
    background: color-mix(in srgb, var(--accent, var(--snd-primary)) 12%, #fff);
    color: var(--accent, var(--snd-primary));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent, var(--snd-primary)) 18%, transparent);
}

body.zg-soundlist-on .snd-rail-meta {
    color: var(--snd-mute);
    font-size: 13px;
    font-weight: 500;
}
body.zg-soundlist-on .snd-rail-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

body.zg-soundlist-on .snd-rail-bulk {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent, var(--snd-primary));
    background: transparent;
    border: 1px solid var(--accent, var(--snd-primary));
    border-radius: var(--snd-radius-btn);
    cursor: pointer;
    transition: all .12s ease;
}
body.zg-soundlist-on .snd-rail-bulk:hover {
    background: color-mix(in srgb, var(--accent, var(--snd-primary)) 8%, #fff);
}
body.zg-soundlist-on .snd-rail-bulk svg {
    transition: transform .2s ease;
}
body.zg-soundlist-on .snd-rail.is-all-open .snd-rail-bulk svg {
    transform: rotate(180deg);
}

/* ===================== STRIP — одна группа категорий ===================== */
body.zg-soundlist-on .snd-strip-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
body.zg-soundlist-on .snd-strip {
    border: 1px solid var(--snd-border);
    border-radius: 10px;
    transition: background .15s ease, border-color .15s ease;
}
body.zg-soundlist-on .snd-strip:not(.is-open):hover {
    background: #f6f8fb;
}

body.zg-soundlist-on .snd-strip-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 14px;
    row-gap: 4px;
    padding: 14px 18px;
    cursor: pointer;
}
body.zg-soundlist-on .snd-strip.is-open .snd-strip-row {
    padding: 14px 18px 10px;
    border-bottom: 1px solid var(--snd-border-2);
}

body.zg-soundlist-on .snd-strip-titlewrap {
    grid-column: 1;
    grid-row: 1;
    align-self: baseline;
    min-width: 0;
}
body.zg-soundlist-on .snd-strip-title {
    font-weight: 700;
    font-size: 16px;
    color: var(--snd-text);
    line-height: 1.3;
    letter-spacing: -.005em;
}
body.zg-soundlist-on .snd-strip-title a {
    color: inherit;
    text-decoration: none;
}
body.zg-soundlist-on .snd-strip-title a:hover {
    color: var(--snd-primary);
}
body.zg-soundlist-on .snd-strip-hint {
    font-size: 13px;
    font-weight: 400;
    color: var(--snd-mute);
    line-height: 1.35;
}
body.zg-soundlist-on .snd-strip:not(.is-open) .snd-strip-hint {
    display: none;
}
body.zg-soundlist-on .snd-strip-hint--row::before {
    content: "·";
    color: var(--snd-faint);
    margin: 0 7px;
}

body.zg-soundlist-on .snd-strip-preview {
    grid-column: 1 / -1;
    grid-row: 2;
    align-self: baseline;
    white-space: normal;
    color: var(--snd-text-3);
    font-size: 13px;
    min-width: 0;
}
body.zg-soundlist-on .snd-strip-preview a {
    color: inherit;
    text-decoration: none;
}
body.zg-soundlist-on .snd-strip-preview a:hover {
    color: var(--snd-primary);
}
body.zg-soundlist-on .snd-strip-preview a:not(:last-child)::after {
    content: " · ";
    color: var(--snd-faint);
}
body.zg-soundlist-on .snd-strip-preview .plus {
    color: var(--snd-faint);
    margin-left: 4px;
}

body.zg-soundlist-on .snd-strip-toggle {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px 6px 12px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    color: var(--snd-text-3);
    background: var(--snd-card);
    border: 1px solid var(--snd-border);
    border-radius: var(--snd-radius-btn);
    cursor: pointer;
    transition: all .12s ease;
}
body.zg-soundlist-on .snd-strip-toggle .num {
    color: var(--snd-text);
    font-weight: 700;
}
body.zg-soundlist-on .snd-strip-toggle:hover {
    color: var(--accent, var(--snd-primary));
    border-color: var(--accent, var(--snd-primary));
    background: color-mix(in srgb, var(--accent, var(--snd-primary)) 6%, #fff);
}
body.zg-soundlist-on .snd-strip-toggle:hover .num {
    color: var(--accent, var(--snd-primary));
}
body.zg-soundlist-on .snd-strip-toggle svg {
    transition: transform .2s ease;
}
body.zg-soundlist-on .snd-strip.is-open .snd-strip-toggle {
    color: var(--snd-mute);
    border-color: var(--snd-border);
    background: transparent;
}
body.zg-soundlist-on .snd-strip.is-open .snd-strip-toggle .num {
    color: var(--snd-text-3);
}
body.zg-soundlist-on .snd-strip.is-open .snd-strip-toggle svg {
    transform: rotate(180deg);
}
body.zg-soundlist-on .snd-strip.is-open .snd-strip-toggle:hover {
    color: var(--snd-text-3);
    border-color: var(--snd-text-3);
}

/* Full-list — ВСЕГДА в DOM (для SEO), переключаемся через .is-open */
body.zg-soundlist-on .snd-strip-full {
    display: none;
    padding: 12px 18px 14px 18px;
}
body.zg-soundlist-on .snd-strip.is-open .snd-strip-full {
    display: block;
}
body.zg-soundlist-on .snd-strip.is-open .snd-strip-preview {
    display: none;
}

body.zg-soundlist-on .snd-strip-cols {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}
body.zg-soundlist-on .snd-strip-cols a {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--snd-text-3);
    background: #f7f9fc;
    padding: 11px 14px;
    line-height: 1.3;
    border-radius: var(--snd-radius-btn);
    border: 1px solid #e6ebf3;
    text-decoration: none;
    transition: background .12s ease, color .12s ease, border-color .12s ease;
    min-width: 0;
}
body.zg-soundlist-on .snd-strip-cols a .lbl {
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
body.zg-soundlist-on .snd-strip-cols a .arr {
    flex: 0 0 auto;
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity .12s ease, transform .12s ease;
}
body.zg-soundlist-on .snd-strip-cols a:hover {
    background: #fff;
    color: var(--snd-primary);
    border-color: var(--snd-primary);
}
body.zg-soundlist-on .snd-strip-cols a:hover .arr {
    opacity: 1;
    transform: translateX(0);
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 1100px) {
    body.zg-soundlist-on .snd-strip-cols { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1080px) {
    body.zg-soundlist-on .snd-overview-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1024px) {
    body.zg-soundlist-on .snd-content-card { padding: 24px 24px 32px; }
}
@media (max-width: 880px) {
    body.zg-soundlist-on .snd-content-card { padding: 22px 20px 28px; }
    body.zg-soundlist-on .snd-rail { margin-bottom: 32px; }
    body.zg-soundlist-on .snd-rail-head { gap: 10px; }
    body.zg-soundlist-on .snd-rail-head h2 { font-size: 20px; }
}
@media (max-width: 760px) {
    body.zg-soundlist-on .snd-strip-cols { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    body.zg-soundlist-on .snd-rail-head { flex-wrap: wrap; align-items: flex-start; padding-bottom: 10px; }
    body.zg-soundlist-on .snd-rail-head h2 { font-size: 19px; gap: 10px; }
    body.zg-soundlist-on .snd-rail-emb { width: 30px; height: 30px; font-size: 11px; border-radius: 8px; }
    body.zg-soundlist-on .snd-rail-actions { width: 100%; justify-content: space-between; margin-top: 2px; }
    body.zg-soundlist-on .snd-strip-row { padding: 12px 14px; column-gap: 10px; row-gap: 4px; }
    body.zg-soundlist-on .snd-strip.is-open .snd-strip-row { padding: 12px 14px 8px; }
    body.zg-soundlist-on .snd-strip-full { padding: 10px 14px 12px; }
    body.zg-soundlist-on .snd-strip-title { font-size: 15px; }
    body.zg-soundlist-on .snd-strip-hint--row::before { margin: 0 5px; }
    body.zg-soundlist-on .snd-strip-preview { font-size: 12.5px; }
}
@media (max-width: 600px) {
    body.zg-soundlist-on .snd-overview-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    body.zg-soundlist-on .snd-overview-card { padding: 10px; }
    body.zg-soundlist-on .snd-overview-grid { gap: 6px; }
    body.zg-soundlist-on .snd-super-pill { padding: 8px 10px; gap: 8px; }
    body.zg-soundlist-on .snd-super-pill .lbl { font-size: 12.5px; }
    body.zg-soundlist-on .snd-content-card { padding: 16px 14px 22px; border-radius: 10px; }
    body.zg-soundlist-on .snd-content { margin-bottom: 32px; }
    body.zg-soundlist-on .snd-rail { margin-bottom: 26px; }
    body.zg-soundlist-on .snd-rail-head h2 { font-size: 18px; }
    body.zg-soundlist-on .snd-rail-meta { font-size: 12px; }
    body.zg-soundlist-on .snd-rail-bulk { padding: 6px 8px; gap: 4px; }
    body.zg-soundlist-on .snd-rail-bulk .lbl { font-size: 12px; }
    body.zg-soundlist-on .snd-strip-toggle { padding: 5px 8px 5px 10px; font-size: 12px; }
    body.zg-soundlist-on .snd-strip-toggle > span:first-child { display: none; }
    body.zg-soundlist-on .snd-strip-cols { grid-template-columns: 1fr; }
    body.zg-soundlist-on .snd-strip-cols a { padding: 10px 12px; font-size: 13.5px; }
}

/* ===================== HERO — мобильная адаптация (≤768) ===================== */
/* Перекрываем легаси _catlistmorda2.scss — там карточка-в-карточке и большие отступы */
@media (max-width: 768px) {
    body.zg-soundlist-on .hero-section {
        background: transparent !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        padding: 8px 0 14px !important;
        margin-bottom: 12px !important;
    }
    body.zg-soundlist-on .hero-title {
        font-size: 22px !important;
        line-height: 1.18 !important;
        letter-spacing: -0.01em !important;
        text-align: left !important;
        margin: 0 0 8px !important;
        text-wrap: balance;
    }
    body.zg-soundlist-on .hero-description {
        font-size: 14px !important;
        line-height: 1.5 !important;
        text-align: left !important;
        color: var(--snd-text-2) !important;
        margin: 0 0 14px !important;
        max-width: none !important;
    }
    /* Search: плоско, без card-in-card */
    body.zg-soundlist-on .search-container .box1.srchbox {
        background: var(--snd-card) !important;
        border: 1px solid var(--snd-border) !important;
        border-radius: var(--snd-radius-card) !important;
        box-shadow: none !important;
        padding: 8px !important;
        transition: none !important;
    }
    body.zg-soundlist-on .search-container .box1.srchbox:focus-within {
        transform: none !important;
        box-shadow: 0 0 0 3px rgba(46,88,239,.12) !important;
        border-color: var(--snd-primary) !important;
    }
    body.zg-soundlist-on .search-container .box1.srchbox form {
        flex-direction: row !important;
        gap: 6px !important;
    }
    body.zg-soundlist-on .search-container .box1.srchbox form input[type="search"],
    body.zg-soundlist-on .search-container .box1.srchbox form input[name="s"] {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        padding: 10px 12px !important;
        font-size: 15px !important;
    }
    body.zg-soundlist-on .hero-section .search-container .box1.srchbox form button[type="submit"],
    body.zg-soundlist-on .search-container .box1.srchbox form button[type="submit"] {
        flex: 0 0 auto !important;
        width: auto !important;
        padding: 10px 16px !important;
        font-size: 14px !important;
        border-radius: var(--snd-radius-btn) !important;
    }
}
@media (max-width: 480px) {
    body.zg-soundlist-on .hero-title { font-size: 20px !important; }
    body.zg-soundlist-on .hero-description { font-size: 13.5px !important; margin-bottom: 12px !important; }
    body.zg-soundlist-on .search-container .box1.srchbox form button[type="submit"] {
        padding: 10px 14px !important;
        font-size: 13.5px !important;
    }
}

/* ===================== PREVIEW — мобильная адаптация (чипы) ===================== */
/* На десктопе preview = inline-текст с разделителями «·». На мобайле — chip-grid: */
/*   каждая ссылка превращается в маленькую таб-кнопку, разделители убираем, */
/*   высота tap-target ≥ 32px, перенос строк естественный. */
@media (max-width: 768px) {
    body.zg-soundlist-on .snd-strip-preview {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 6px;
        font-size: 12.5px;
        margin-top: 2px;
    }
    body.zg-soundlist-on .snd-strip-preview a {
        display: inline-flex;
        align-items: center;
        padding: 8px 12px;
        background: #f7f9fc;
        border: 1px solid #e6ebf3;
        border-radius: var(--snd-radius-btn);
        color: var(--snd-text-3);
        font-weight: 500;
        line-height: 1.25;
        white-space: nowrap;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    body.zg-soundlist-on .snd-strip-preview a:hover {
        background: #fff;
        color: var(--snd-primary);
        border-color: var(--snd-primary);
    }
    body.zg-soundlist-on .snd-strip-preview a:active {
        background: var(--snd-primary-50);
        color: var(--snd-primary);
        border-color: var(--snd-primary);
    }
    /* Убираем точки-разделители — они нужны только в desktop-inline-варианте */
    body.zg-soundlist-on .snd-strip-preview a:not(:last-child)::after {
        content: none;
    }
    body.zg-soundlist-on .snd-strip-preview .plus {
        padding: 8px 10px;
        color: var(--snd-mute);
        font-weight: 600;
        font-size: 12.5px;
        margin-left: 0;
    }
}

/* ≤520: даже SFX (open_all) визуально свёрнут — JS уже снимает .is-open, */
/* но если is-all-open всё-таки задержится, страхуемся CSS-ом */
@media (max-width: 520px) {
    body.zg-soundlist-on .snd-strip:not(.is-open) .snd-strip-full { display: none; }
}

/* Touch — стрелка всегда полу-видима */
@media (hover: none) {
    body.zg-soundlist-on .snd-strip-cols a .arr { opacity: .35; transform: none; }
    body.zg-soundlist-on .snd-strip-cols a:hover { background: #f7f9fc; color: var(--snd-text-3); border-color: #e6ebf3; }
    body.zg-soundlist-on .snd-strip-cols a:active { background: var(--snd-primary-50); color: var(--snd-primary); border-color: var(--snd-primary); }
    body.zg-soundlist-on .snd-strip-cols a:active .arr { opacity: 1; }
}
