/* ===== LAYOUT З SIDEBAR ===== */
.page-layout {
    display: grid;
    grid-template-columns: 1fr 240px;
    gap: 16px;
    align-items: start;
    margin-top: 10px;
}

.main-col {
    min-width: 0;
    /* запобігає переповненню grid */
}

/* ===== SIDEBAR ===== */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: static;
    top: 50px;
    max-height: calc(100vh - 50px);
    /*overflow-y: auto;*/
    scrollbar-width: none;
    margin-bottom: 10px;
}

.sidebar::-webkit-scrollbar {
    display: none;
}

/* Chrome */

/* ===== WIDGET ===== */
.sidebar-widget {
    background: var(--dark-surface, #1e293b);
    border-radius: 14px;
    border: 1px solid #bdbdbd;
    /*overflow: hidden;*/
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

body:not(.dark-mode) .sidebar-widget {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.sidebar-widget-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.15);
    color: var(--accent-color, #fbbf24);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

body:not(.dark-mode) .sidebar-widget-title {
    background: #f8fafc;
    border-bottom-color: #e2e8f0;
    color: #1e293b;
}

.sidebar-widget-body {
    padding: 12px 14px;
}

/* ===== АКТОР ДНЯ ===== */
.actor-day-photo-wrap {
    width: 100%;
    aspect-ratio: 1/1;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 10px;
}

.actor-day-photo {
    width: 100%;
    height: 100%;
    object-fit: none;
    object-position: top;
    display: block;
}

.actor-day-name {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--accent-color, #fbbf24);
}

.actor-day-text {
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--dark-text-muted, #94a3b8);
}

body:not(.dark-mode) .actor-day-text {
    color: #64748b;
}

/* ===== НОВИНИ ===== */
.news-item {
    display: block;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s;
}

body:not(.dark-mode) .news-item {
    border-bottom-color: #e2e8f0;
}

.news-item:last-child {
    border-bottom: none;
}

.news-item:hover {
    opacity: 0.75;
}

.news-item-date {
    font-size: 0.7rem;
    color: var(--dark-text-muted, #94a3b8);
    margin-bottom: 3px;
}

.news-item-title {
    font-size: 0.8rem;
    line-height: 1.4;
    font-weight: 500;
}


/* ===== СТАТИСТИКА =====  */
.stat-item {
    text-align: center;
    padding: 6px 0;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-color, #fbbf24);
    line-height: 1;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--dark-text-muted, #94a3b8);
    margin-top: 4px;
}

body:not(.dark-mode) .stat-label {
    color: #64748b;
}

/* ===== МОБІЛЬНА ВЕРСІЯ ===== */
@media (max-width: 900px) {
    body[data-page="index"] .container {
        display: grid;
        grid-template-columns: 1fr;
        gap: 16px;
    }

    body[data-page="index"] .page-layout,
    body[data-page="index"] .main-col,
    body[data-page="index"] .sidebar {
        display: contents !important;
    }

    body[data-page="index"] .logo-switch {
        order: 1 !important;
    }
    body[data-page="index"] .nav {
        order: 2 !important;
    }
    body[data-page="index"] .titlename {
        order: 3 !important;
    }
    
    body[data-page="index"] #news-widget {
        order: 10 !important;
        grid-column: 1 / -1;
    }
    
    body[data-page="index"] #actor-of-day {
        order: 20 !important;
        grid-column: 1 / -1;
    }

    body[data-page="index"] .sort-container {
        order: 30 !important;
        grid-column: 1 / -1;
    }

    body[data-page="index"] .carousel-wrapper {
        order: 35 !important;
        grid-column: 1 / -1;
    }

    body[data-page="index"] .user-container {
        order: 40 !important;
        grid-column: 1 / -1;
    }

    body[data-page="index"] #stats-widget {
        order: 50 !important;
        grid-column: 1 / -1;
    }

    body[data-page="index"] .footer {
        order: 60 !important;
        grid-column: 1 / -1;
    }
}