/* Sidebar-specific styles to avoid conflicting with global widget rules */
.sidebar .widget-area {
    padding: 18px;
    background: transparent; /* Let the site card background show through */
}

.sidebar .widget {
    margin-bottom: 18px;
    padding: 18px;
    background: var(--card-bg, #0b1220);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.04);
    box-shadow: 0 6px 18px rgba(2,6,23,0.35);
}

.sidebar .widget:last-child {
    margin-bottom: 0;
}

.sidebar .widget-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-white, #fff);
    margin-bottom: 12px;
}

/* Recent Posts Widget (compact and readable) */
.sidebar .recent-posts-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar .recent-post-item {
    display: block;
    background: transparent;
    border-radius: 8px;
    overflow: hidden;
}

.sidebar .recent-post-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s ease, transform 0.15s ease;
}

.sidebar .recent-post-link:hover {
    background: rgba(255,255,255,0.02);
    transform: translateY(-2px);
}

.sidebar .recent-post-thumbnail {
    flex: 0 0 64px;
    height: 64px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--secondary-dark);
}

.sidebar .recent-post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sidebar .recent-post-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0 0 4px;
    color: var(--text-white);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sidebar .recent-post-date {
    font-size: 0.78rem;
    color: var(--text-light);
}

/* Categories Widget - clean list style */
.sidebar .categories-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.sidebar .categories-list li {
    margin: 0;
}

.sidebar .categories-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    text-decoration: none;
    color: var(--text-white);
    background: rgba(255,255,255,0.02);
    border-radius: 8px;
    transition: background 0.12s ease, color 0.12s ease;
}

.sidebar .categories-list a:hover {
    background: rgba(255,255,255,0.04);
    color: var(--accent-blue, #60a5fa);
}

.sidebar .categories-list .count,
.sidebar .categories-list .post-count {
    background: rgba(255,255,255,0.03);
    color: var(--text-white);
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
}

/* Make sidebar widgets stack cleanly on small screens */
@media (max-width: 900px) {
    .sidebar .widget {
        padding: 14px;
        border-radius: 10px;
        box-shadow: none;
        border: 1px solid rgba(255,255,255,0.02);
    }
    .sidebar .recent-post-thumbnail {
        flex: 0 0 56px;
        height: 56px;
    }
}

/* Accessibility tweaks */
.sidebar .widget a:focus {
    outline: 3px solid rgba(96,165,250,0.15);
    outline-offset: 3px;
}