/* ==========================================================================
   SIDEBAR STYLING
   ========================================================================== */

/* Main Layout med Sidebar */
.site-content {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    min-height: 60vh;
}

/* Layout utan Sidebar (enspaltig) */
.site-content.no-sidebar {
    grid-template-columns: 1fr;
    max-width: 900px;
}

.main-content {
    min-width: 0; /* Viktigt för grid overflow */
}

.site-sidebar {
    /* Ingen sticky - följ sidan naturligt */
}

/* Widget Styling */
.sidebar-widget {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.widget-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e5e5e5;
}

.widget-title svg {
    color: #4267b2;
    flex-shrink: 0;
}

/* Röd header för widgets */
.widget-title-red {
    font-size: 18px;
    font-weight: 700;
    margin: -20px 0 0 0;
    padding: 15px 20px;
    background: #c1272d;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 8px 8px 0 0;
}

/* Blå header för Artikelserier */
.widget-series .widget-title-red {
    background: #4267b2;
}

.widget-content {
    margin-top: 15px;
}

/* Senaste Nytt Widget */
.widget-latest {
    padding: 20px 0 10px 0;
}

.widget-latest .widget-content {
    margin-top: 0;
    padding: 0 20px;
}

.latest-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.latest-item {
    border-bottom: 1px solid #f0f0f0;
    padding: 15px 0;
    position: relative;
    padding-left: 15px;
}

.latest-item:before {
    content: '';
    position: absolute;
    left: 0;
    top: 22px;
    width: 6px;
    height: 6px;
    background: #c1272d;
    border-radius: 50%;
}

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

.latest-link {
    text-decoration: none;
    color: #333;
    display: block;
}

.latest-link:hover .latest-title {
    color: #c1272d;
}

.latest-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 5px;
    font-size: 12px;
    color: #666;
}

.latest-time {
    font-weight: 600;
}

.latest-category {
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.3px;
}

.latest-category:before {
    content: '•';
    margin-right: 8px;
}

.latest-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    color: #1a1a1a;
    transition: color 0.2s ease;
    margin: 0;
}

/* Artikelserier Widget - Samma stil som Senaste Nytt */
.widget-series {
    padding: 20px 0 10px 0;
}

.widget-series .widget-content {
    margin-top: 0;
    padding: 0 20px;
}

.series-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.series-item {
    border-bottom: 1px solid #f0f0f0;
    padding: 15px 0;
    position: relative;
    padding-left: 15px;
}

.series-item:before {
    content: '';
    position: absolute;
    left: 0;
    top: 22px;
    width: 6px;
    height: 6px;
    background: #4267b2;
    border-radius: 50%;
}

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

.series-link {
    text-decoration: none;
    color: #333;
    display: block;
}

.series-link:hover .series-name {
    color: #4267b2;
}

.series-name {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    color: #1a1a1a;
    transition: color 0.2s ease;
    display: block;
    margin-bottom: 5px;
}

.series-count {
    font-size: 12px;
    color: #666;
    font-weight: 600;
}

.no-series {
    color: #666;
    font-size: 14px;
    text-align: center;
    padding: 20px 10px;
}

/* Responsive */
@media (max-width: 1024px) {
    .site-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .site-sidebar {
        position: static;
        max-height: none;
        overflow-y: visible;
    }
    
    /* Visa sidebar under huvudinnehåll på mindre skärmar */
    .main-content {
        order: 1;
    }
    
    .site-sidebar {
        order: 2;
        max-width: 40rem;
        justify-self: center;
    }


}

@media (max-width: 768px) {
    .site-content {
        margin-top: 20px;
        margin-bottom: 80px;
        padding: 0 15px;
    }
    
    .sidebar-widget {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .widget-title {
        font-size: 16px;
    }

    .widget-title-red {
        margin: -15px -15px 0 -15px;
    }
}

/* Scrollbar styling för sidebar */
.site-sidebar::-webkit-scrollbar {
    width: 6px;
}

.site-sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.site-sidebar::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.site-sidebar::-webkit-scrollbar-thumb:hover {
    background: #999;
}
