/* ═══════════════════════════════════════════════
   SERIALDATA — Home Page Design System
   ═══════════════════════════════════════════════ */
:root {
    --bg:      #1A1917;
    --surf:    #211F1D;
    --card:    #211F1D;
    --hover:   #2A2825;
    --brdr:    rgba(255,255,255,0.07);
    --brdr2:   rgba(255,255,255,0.13);
    --text:    #E4E1DA;
    --sub:     #9D988E;
    --muted:   #9D988E;
    --acc:     #C9A96E;
    --new:     #8FAE96;
    --fin:     #C9A96E;
    --cont:    #C9A96E;
    --r:       8px;
}

/* ── Base ── */
.sd-home * { box-sizing: border-box; }
.sd-home {
    font-family: 'Montserrat', system-ui, sans-serif, system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 13px;
    line-height: 1.5;
    padding-bottom: 60px;
    overflow-x: hidden;
    width: 100%;
}

/* ── Layout ── */
.sd-page {
    display: grid;
    grid-template-columns: 1fr 272px;
    gap: 0;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 20px;
    align-items: start;
    width: 100%;
}
.sd-main    { padding-top: 24px; padding-right: 20px; min-width: 0; }

/* ══════════════════════════════════════
   STICKY SIDEBAR
══════════════════════════════════════ */
.sd-sidebar {
    padding-top: 24px; 
    padding-left: 20px; 
    border-left: 1px solid var(--brdr);
    position: sticky; 
    top: 20px; 
    align-self: start;
    height: fit-content;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--brdr) transparent;
}
/* Стилизация скроллбара для WebKit */
.sd-sidebar::-webkit-scrollbar {
    width: 6px;
}
.sd-sidebar::-webkit-scrollbar-track {
    background: transparent;
}
.sd-sidebar::-webkit-scrollbar-thumb {
    background: var(--brdr);
    border-radius: 3px;
}
.sd-sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--brdr2);
}

/* ── Section titles ── */
.sd-sec { margin-bottom: 28px; }
.sd-sec-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 12px;
    gap: 12px;
}
.sd-sec-head-l { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.sd-sec-head h2 { font-size: 15px; font-weight: 700; }
.sd-sec-count {
    font-size: 11px; font-weight: 600;
    padding: 2px 9px; border-radius: 20px;
    background: var(--surf); border: 1px solid var(--brdr);
    color: var(--sub);
}
.sd-sec-link { font-size: 11px; font-weight: 600; color: var(--cont); text-decoration: none; }

/* ── Section label (hr-style) ── */
.sd-lbl {
    font-size: 9px; font-weight: 700; letter-spacing: 2px;
    text-transform: uppercase; color: var(--muted);
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 10px;
}
.sd-lbl::after { content:''; flex:1; height:1px; background:var(--brdr); }

/* ══════════════════════════════════════
   ACCORDION — Week Schedule
══════════════════════════════════════ */
.sd-schedule { margin-bottom: 28px; }

.sd-day-wrap { margin-bottom: 2px; }

/* The tab row */
.sd-day-row {
    display: flex; align-items: center; gap: 0;
    cursor: pointer; user-select: none;
}

/* Tab label (like the screenshots) */
.sd-day-tab {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 11px 5px 10px;
    border-radius: 6px 6px 0 0;
    font-size: 12px; font-weight: 600;
    background: var(--surf);
    border: 1px solid var(--brdr);
    border-bottom: none;
    white-space: nowrap;
    transition: background .15s;
    position: relative; z-index: 2;
}
.sd-day-row:hover .sd-day-tab { background: var(--hover); }

/* TODAY — green */
.sd-day-tab.is-today {
    background: rgba(143,174,150,.1);
    border-color: rgba(143,174,150,.3);
    color: var(--new);
}
/* TOMORROW — blue */
.sd-day-tab.is-tomorrow {
    background: rgba(201,169,110,.1);
    border-color: rgba(201,169,110,.25);
    color: var(--cont);
}
/* OPEN state */
.sd-day-tab.is-open {
    background: var(--card);
    border-color: var(--brdr2);
}
.sd-day-tab.is-today.is-open  { background: rgba(143,174,150,.12); }
.sd-day-tab.is-tomorrow.is-open { background: rgba(201,169,110,.12); }

.sd-day-label { font-weight: 700; }
.sd-day-date  { font-weight: 400; opacity: .65; font-size: 11px; }
.sd-day-cnt   {
    font-size: 10px; font-weight: 700;
    padding: 1px 6px; border-radius: 10px;
    background: rgba(255,255,255,.08);
}
.sd-day-tab.is-today   .sd-day-cnt { background: rgba(143,174,150,.2);  color: var(--new); }
.sd-day-tab.is-tomorrow .sd-day-cnt { background: rgba(201,169,110,.2); color: var(--cont); }

/* Line extending from tab */
.sd-day-line {
    flex: 1; height: 1px; background: var(--brdr);
    display: flex; align-items: center; gap: 7px;
    padding-left: 8px;
    min-width: 0;
}
.sd-day-row.is-open .sd-day-line { background: var(--brdr2); }

/* Type pills shown when collapsed */
.sd-day-pills { display: flex; gap: 3px; flex-wrap: wrap; }
.sdp {
    font-size: 9px; font-weight: 800; padding: 2px 5px; border-radius: 3px;
    letter-spacing: .4px; text-transform: uppercase;
}
.sdp-new  { background: rgba(143,174,150,.12);  color: var(--new); }
.sdp-cont { background: rgba(201,169,110,.12); color: var(--cont); }
.sdp-fin  { background: rgba(184,174,156,.12); color: var(--fin); }

/* Chevron */
.sd-day-chv {
    font-size: 10px; color: var(--muted);
    margin-left: 10px; flex-shrink: 0;
    transition: transform .2s, color .15s;
}
.sd-day-row.is-open .sd-day-chv { transform: rotate(180deg); color: var(--sub); }

/* Accordion body */
.sd-day-body {
    display: none;
    border: 1px solid var(--brdr2);
    border-top: none;
    border-radius: 0 var(--r) var(--r) var(--r);
    background: var(--card);
    overflow: hidden;
    margin-bottom: 6px;
}
.sd-day-body.is-open { display: block; }

/* ── Release row inside accordion ── */
.sd-rel {
    display: flex; align-items: center; gap: 11px;
    padding: 9px 13px;
    border-bottom: 1px solid var(--brdr);
    text-decoration: none; color: inherit;
    transition: background .13s;
    position: relative;
}
.sd-rel:last-child { border-bottom: none; }
.sd-rel:hover { background: var(--hover); }

/* Thumbnail */
.sd-rel-thumb {
    width: 38px; height: 52px;
    border-radius: 5px; overflow: hidden; flex-shrink: 0;
    background: var(--surf);
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; color: var(--muted);
}
.sd-rel-thumb img { width:100%; height:100%; object-fit:cover; display:block; }

/* Type stripe */
.sd-rel-stripe {
    width: 3px; height: 36px; border-radius: 2px; flex-shrink: 0;
}
.srs-new  { background: var(--new); }
.srs-cont { background: var(--cont); }
.srs-fin  { background: var(--fin); }

/* Index */
.sd-rel-idx {
    width: 20px; flex-shrink: 0;
    font-size: 10px; font-weight: 700; color: var(--muted); text-align: right;
}

.sd-rel-info { flex: 1; min-width: 0; }
.sd-rel-title {
    font-size: 13px; font-weight: 700;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    margin-bottom: 3px;
}
/* NEW highlight */
.sd-rel.is-new .sd-rel-title { color: var(--new); }

.sd-rel-sub { font-size: 11px; color: var(--sub); }
.sd-rel-sub .dot { color: var(--muted); margin: 0 3px; }

.sd-rel-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.sd-badge {
    padding: 2px 6px; border-radius: 3px;
    font-size: 9px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase;
}
.sb-new  { background: var(--new); color: #000; }
.sb-fin  { background: var(--fin); color: #000; }
.sb-rec  { background: var(--acc); color: #E4E1DA; }

.sd-plat {
    padding: 3px 8px; background: var(--surf); border-radius: 5px;
    font-size: 11px; font-weight: 600; color: var(--sub);
    white-space: nowrap;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Channel icon badge */
.sd-ch-icon {
    width: 18px; height: 18px; border-radius: 3px;
    object-fit: contain; vertical-align: middle;
}

/* Day empty */
.sd-day-empty {
    padding: 18px 14px; text-align: center;
    font-size: 12px; color: var(--muted); font-style: italic;
}

/* ══════════════════════════════════════
   CARDS: Soon / Expected
══════════════════════════════════════ */
.sd-cs-list { display: flex; flex-direction: column; gap: 3px; margin-bottom: 28px; }

.sd-cs {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 11px; background: var(--card); border: 1px solid var(--brdr);
    border-radius: var(--r); text-decoration: none; color: inherit;
    transition: background .13s;
    position: relative; overflow: hidden;
}
.sd-cs::before {
    content:''; position: absolute; left:0; top:0; bottom:0; width:3px;
    background: var(--cont); opacity:0; transition: opacity .15s;
}
.sd-cs.is-new::before { background: var(--new); }
.sd-cs:hover { background: var(--hover); }
.sd-cs:hover::before { opacity: 1; }

.sd-cs-thumb {
    width: 34px; height: 46px; border-radius: 5px; overflow: hidden; flex-shrink: 0;
    background: var(--surf); display: flex; align-items: center; justify-content: center;
    font-size: 15px; color: var(--muted);
}
.sd-cs-thumb img { width:100%; height:100%; object-fit:cover; display:block; }

.sd-cs-body { flex: 1; min-width: 0; }
.sd-cs-title {
    font-size: 13px; font-weight: 700;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px;
}
.sd-cs.is-new .sd-cs-title { color: var(--fin); }
.sd-cs-meta { font-size: 11px; color: var(--sub); }

.sd-cs-right { text-align: right; flex-shrink: 0; min-width: 54px; }
.sd-cs-pill {
    display: inline-block; padding: 2px 8px; border-radius: 20px;
    font-size: 10px; font-weight: 700; border: 1px solid var(--brdr);
    background: var(--surf); color: var(--text); white-space: nowrap; margin-bottom: 2px;
}
.sd-cs-pill.is-soon { background: rgba(201,169,110,.1); border-color: rgba(201,169,110,.3); color: var(--cont); }
.sd-cs-pill.is-near { background: rgba(143,174,150,.1);  border-color: rgba(143,174,150,.3);  color: var(--new); }
.sd-cs-days { font-size: 10px; color: var(--muted); }

/* ══════════════════════════════════════
   SIDEBAR
══════════════════════════════════════ */
.sd-sb-block {
    background: var(--card); border: 1px solid var(--brdr);
    border-radius: var(--r); overflow: hidden; margin-bottom: 14px;
}
.sd-sb-hdr {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 12px; border-bottom: 1px solid var(--brdr);
}
.sd-sb-title {
    font-size: 9px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase;
    color: var(--sub); display: flex; align-items: center; gap: 6px;
}
.sd-sb-title i { color: var(--acc); }
.sd-sb-link { font-size: 11px; color: var(--cont); text-decoration: none; font-weight: 600; }

/* Rec cards in sidebar */
.sd-rec {
    display: flex; align-items: center; gap: 9px;
    padding: 8px 12px; border-bottom: 1px solid var(--brdr);
    text-decoration: none; color: inherit; transition: background .13s;
    position: relative;
}
.sd-rec:last-child { border-bottom: none; }
.sd-rec:hover { background: var(--hover); }
.sd-rec-thumb {
    width: 32px; height: 44px; border-radius: 4px; overflow: hidden; flex-shrink: 0;
    background: var(--surf); display: flex; align-items: center; justify-content: center;
    font-size: 13px; color: var(--muted);
}
.sd-rec-thumb img { width:100%; height:100%; object-fit:cover; display:block; }
.sd-rec-star { position: absolute; top:6px; right:6px; color:#C9A96E; font-size:10px; }
.sd-rec-body { flex:1; min-width:0; }
.sd-rec-title {
    font-size: 11px; font-weight: 700;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom:1px;
}
.sd-rec-sub { font-size: 10px; color: var(--sub); }

/* Categories */
.sd-cats { display: flex; flex-direction: column; }
.sd-cat {
    display: flex; align-items: center; justify-content: space-between;
    padding: 7px 12px; border-bottom: 1px solid var(--brdr);
    text-decoration: none; color: var(--text); transition: background .13s;
    font-size: 12px; font-weight: 500;
}
.sd-cat:last-child { border-bottom: none; }
.sd-cat:hover { background: var(--hover); }
.sd-cat-name { }
.sd-cat-cnt { font-size: 10px; font-weight: 700; color: var(--muted); }

/* ══════════════════════════════════════
   EMPTY / UTILITY
══════════════════════════════════════ */
.sd-empty {
    padding: 40px 20px; text-align: center; color: var(--muted);
    font-size: 13px; font-style: italic;
}

/* ══════════════════════════════════════
   VIEW TOGGLE (Desktop only)
══════════════════════════════════════ */
.sd-vtoggle {
    display: flex; gap: 2px;
    background: var(--surf); border: 1px solid var(--brdr);
    border-radius: 7px; padding: 3px; flex-shrink: 0;
}
.sd-vtab {
    width: 32px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    border: none; background: transparent; color: var(--sub);
    border-radius: 5px; cursor: pointer; font-size: 12px;
    transition: all .15s;
}
.sd-vtab:hover { color: var(--text); }
.sd-vtab.is-on { background: var(--acc); color: white; }

/* ══════════════════════════════════════
   GRID VIEW MODE (Desktop only)
══════════════════════════════════════ */
.sd-day-body.view-grid {
    background: none; border: none; border-radius: 0;
    padding: 8px 0;
}
.sd-day-body.view-grid .sd-rel-grid-wrap {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px,1fr));
    gap: 8px;
    padding: 0;
}
/* Grid card */
.sd-rel-gc {
    background: var(--card); border: 1px solid var(--brdr);
    border-radius: var(--r); overflow: hidden;
    text-decoration: none; color: inherit;
    transition: all .18s; display: block;
}
.sd-rel-gc:hover { transform: translateY(-3px); border-color: rgba(199,154,124,.3); box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.sd-rel-gc-poster {
    aspect-ratio: 2/3; overflow: hidden; position: relative;
    background: var(--surf); display: flex; align-items: center; justify-content: center;
    font-size: 28px; color: var(--muted);
}
.sd-rel-gc-poster img { width:100%; height:100%; object-fit:cover; display:block; }
.sd-rel-gc-badges { position: absolute; top:6px; left:6px; display:flex; gap:3px; }
.sd-rel-gc-body { padding: 8px 9px 9px; }
.sd-rel-gc-title {
    font-size: 12px; font-weight: 700;
    overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    margin-bottom: 3px; line-height: 1.3;
}
.sd-rel-gc.is-new .sd-rel-gc-title { color: var(--new); }
.sd-rel-gc-sub { font-size: 10px; color: var(--sub); display: flex; align-items:center; justify-content:space-between; }

/* Sidebar soon item */
.sd-soon-item {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 12px; border-bottom: 1px solid var(--brdr);
    text-decoration: none; color: inherit; transition: background .13s;
}
.sd-soon-item:last-child { border-bottom: none; }
.sd-soon-item:hover { background: var(--hover); }
.sd-soon-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink:0; background: var(--cont); }
.sd-soon-dot.is-new { background: var(--new); }
.sd-soon-body { flex:1; min-width:0; }
.sd-soon-title {
    font-size: 11px; font-weight: 700;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 1px;
}
.sd-soon-ep { font-size: 10px; color: var(--sub); }
.sd-soon-date { font-size: 10px; font-weight: 700; color: var(--cont); white-space:nowrap; }

/* Sidebar blog item */
.sd-blog-item {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 12px; border-bottom: 1px solid var(--brdr);
    text-decoration: none; color: inherit; transition: background .13s;
}
.sd-blog-item:last-child { border-bottom: none; }
.sd-blog-item:hover { background: var(--hover); }
.sd-blog-thumb {
    width: 42px; height: 30px; border-radius: 4px; overflow: hidden; flex-shrink:0;
    background: var(--surf); display: flex; align-items: center; justify-content: center;
    font-size: 11px; color: var(--muted);
}
.sd-blog-thumb img { width:100%; height:100%; object-fit:cover; display:block; }
.sd-blog-body { flex:1; min-width:0; }
.sd-blog-title {
    font-size: 11px; font-weight: 600; line-height: 1.35;
    overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    margin-bottom: 1px;
}
.sd-blog-date { font-size: 10px; color: var(--muted); }

/* ══════════════════════════════════════
   RESPONSIVE — MOBILE OPTIMIZED
══════════════════════════════════════ */
@media (max-width: 1023px) {
    .sd-home {
        overflow-x: hidden;
    }
    .sd-page { 
        grid-template-columns: 1fr; 
        padding: 0 12px;
        width: 100%;
        max-width: 100%;
    }
    .sd-main  { 
        padding-right: 0; 
        padding-top: 16px;
        min-width: 0;
        width: 100%;
    }
    /* На мобильном сайдбар не липкий */
    .sd-sidebar { 
        border-left: none; 
        border-top: 1px solid var(--brdr); 
        padding-left: 0; 
        padding-top: 20px; 
        margin-top: 16px; 
        position: static; 
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        width: 100%;
        max-height: none;
        overflow-y: visible;
    }
    .sd-sb-block {
        margin-bottom: 0;
        min-width: 0;
    }
    /* Hide view toggle on mobile — always list view */
    .sd-vtoggle {
        display: none !important;
    }
    /* Disable grid view on mobile */
    .sd-day-body.view-grid,
    .sd-day-body.view-grid .sd-rel-grid-wrap,
    .sd-rel-gc {
        display: none !important;
    }
    /* Force list view always visible */
    .sd-rel[data-hidden="1"] {
        display: flex !important;
    }
    /* Fix day row overflow */
    .sd-day-row {
        flex-wrap: nowrap;
    }
    .sd-day-tab {
        flex-shrink: 0;
    }
    .sd-day-line {
        min-width: 0;
    }
    .sd-day-pills {
        display: none; /* Hide pills on mobile to save space */
    }
}

@media (max-width: 680px) {
    .sd-page { 
        padding: 0 8px; 
    }
    
    /* Mobile-optimized list items */
    .sd-rel {
        padding: 10px 8px;
        gap: 8px;
        min-height: 68px;
    }
    .sd-rel-thumb {
        width: 44px;
        height: 58px;
        border-radius: 5px;
    }
    .sd-rel-stripe {
        height: 40px;
        width: 3px;
    }
    .sd-rel-idx {
        display: none; /* Hide index on mobile */
    }
    .sd-rel-info {
        min-width: 0;
        flex: 1;
    }
    .sd-rel-title {
        font-size: 13px;
        font-weight: 600;
        margin-bottom: 3px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .sd-rel-sub {
        font-size: 11px;
        color: var(--sub);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .sd-rel-right {
        flex-direction: column;
        align-items: flex-end;
        gap: 3px;
        flex-shrink: 0;
    }
    .sd-badge {
        font-size: 8px;
        padding: 2px 5px;
    }
    .sd-plat {
        font-size: 9px;
        padding: 2px 6px;
        max-width: 80px;
    }
    
    /* Mobile day tabs */
    .sd-day-tab {
        padding: 6px 10px;
        font-size: 12px;
    }
    .sd-day-date {
        font-size: 11px;
    }
    .sd-day-cnt {
        font-size: 10px;
        padding: 1px 5px;
    }
    .sd-day-chv {
        margin-left: 6px;
    }
    
    /* Mobile Coming Soon */
    .sd-cs {
        padding: 10px 8px;
        gap: 10px;
    }
    .sd-cs-thumb {
        width: 40px;
        height: 52px;
    }
    .sd-cs-title {
        font-size: 13px;
    }
    .sd-cs-meta {
        font-size: 11px;
    }
    
    /* Section headers */
    .sd-sec-head {
        flex-wrap: wrap;
        gap: 8px;
    }
    .sd-sec-head h2 {
        font-size: 15px;
    }
    .sd-sec-count {
        font-size: 10px;
    }
    
    /* Sidebar single column on small mobile */
    .sd-sidebar {
        grid-template-columns: 1fr;
        padding: 16px 0 0 0;
    }
}

@media (max-width: 480px) {
    .sd-page {
        padding: 0 6px;
    }
    /* Extra small screens */
    .sd-rel {
        padding: 8px 6px;
        gap: 6px;
        min-height: 60px;
    }
    .sd-rel-thumb {
        width: 36px;
        height: 48px;
    }
    .sd-rel-stripe {
        height: 32px;
        width: 3px;
    }
    .sd-rel-title {
        font-size: 12px;
    }
    .sd-rel-sub {
        font-size: 10px;
    }
    .sd-plat {
        font-size: 9px;
        padding: 2px 4px;
        max-width: 70px;
    }
    .sd-day-tab {
        padding: 5px 8px;
        font-size: 11px;
    }
}