/* ==========================================
   BLOG V3 - CLEAN GRID SYSTEM
   ========================================== */

/* --- 1. Main Layout --- */
.blog-experience {
    padding-bottom: 100px;
    position: relative;
    background: linear-gradient(180deg, #f4f8ff 0%, #edf2fb 100%);
}

.blog-bg-pattern {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(47, 129, 243, 0.04) 0%, transparent 50%),
        radial-gradient(circle at 90% 80%, rgba(255, 201, 19, 0.03) 0%, transparent 50%);
    z-index: 0;
    pointer-events: none;
}

/* --- 2. Blog Title Header --- */
.blog-header-compact {
    padding-top: 0;
    padding-bottom: 40px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.blog-header-compact h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    margin: 0;
    color: var(--ink, #0d1b2a);
    font-family: var(--font-display, 'Syne', sans-serif);
}

.highlight {
    color: #2f81f3;
}

/* --- 3. Grid Container (Sidebar + Cards) --- */
.blog-container {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 48px;
    align-items: start;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    position: relative;
    z-index: 1;
    padding: 0 20px;
}

/* --- 4. Sidebar --- */
.blog-sidebar {
    position: sticky;
    top: 100px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(47, 129, 243, 0.1);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    border-radius: 20px;
    padding: 28px 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sidebar-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #2f81f3;
    font-weight: 800;
    display: block;
    margin-bottom: 6px;
    opacity: 0.8;
}

.sidebar-heading {
    font-family: var(--font-display, 'Syne', sans-serif);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--ink, #0d1b2a);
    margin: 0;
}

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    text-decoration: none;
    color: #4b5563;
    font-weight: 500;
    font-size: 0.92rem;
    transition: all 0.2s ease;
    cursor: pointer;
    user-select: none;
}

.nav-item:hover {
    background: rgba(47, 129, 243, 0.06);
    color: #2f81f3;
    transform: translateX(3px);
}

.nav-item.active {
    background: rgba(47, 129, 243, 0.1);
    color: #2f81f3;
    font-weight: 700;
    box-shadow: inset 3px 0 0 0 #2f81f3;
}

.nav-icon {
    font-size: 1rem;
    width: 18px;
    text-align: center;
}

.nav-text {
    flex: 1;
}

.nav-counter {
    font-size: 0.72rem;
    background: #fff;
    padding: 2px 7px;
    border-radius: 99px;
    color: #6b7280;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.sidebar-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.07), transparent);
}

/* Archive */
.sidebar-archive h4.archive-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #2f81f3;
    font-weight: 800;
    margin: 0 0 12px;
    opacity: 0.8;
}

.archive-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.archive-dropdown summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    color: #1f2937;
    transition: background 0.2s;
    list-style: none;
    -webkit-user-select: none;
    user-select: none;
}

.archive-dropdown summary::-webkit-details-marker {
    display: none;
}

.archive-dropdown summary:hover {
    background: rgba(0, 0, 0, 0.03);
}

.toggle-icon {
    font-size: 0.65rem;
    transition: transform 0.3s ease;
    opacity: 0.45;
}

.archive-dropdown[open] .toggle-icon {
    transform: rotate(180deg);
}

.archive-list {
    list-style: none;
    padding: 4px 0 4px 14px;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.archive-list li a {
    display: flex;
    justify-content: space-between;
    font-size: 0.88rem;
    color: #4b5563;
    text-decoration: none;
    padding: 5px 14px;
    border-radius: 8px;
    transition: color 0.2s, background 0.2s;
}

.archive-list li a:hover {
    color: #2f81f3;
    background: rgba(47, 129, 243, 0.04);
}

.archive-list .count {
    opacity: 0.45;
    font-size: 0.78rem;
}

/* --- 5. Cards Grid --- */
.blog-display {
    position: relative;
    z-index: 2;
}

.wrapper {
    width: 100%;
}

.inner {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    align-items: start;
}

/* --- 6. Card --- */
.card {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.07);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
        box-shadow 0.3s ease,
        border-color 0.3s ease;
    display: flex;
    flex-direction: column;
    /* Filter animation */
    animation: cardFadeIn 0.35s ease forwards;
}

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card.hidden {
    display: none;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 36px rgba(11, 75, 179, 0.12);
    border-color: rgba(47, 129, 243, 0.2);
    cursor: pointer;
}

.card a.card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.card-visual {
    height: 200px;
    overflow: hidden;
    position: relative;
    background: #e8edf5;
    flex-shrink: 0;
}

.visual-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.card:hover .visual-image {
    transform: scale(1.06);
}

.card-content {
    padding: 18px 18px 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.meta-tag {
    font-size: 0.63rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    font-weight: 800;
    background: rgba(47, 129, 243, 0.08);
    color: #2f81f3;
    padding: 3px 8px;
    border-radius: 5px;
}

.meta-date {
    font-size: 0.68rem;
    color: #9ca3af;
    font-weight: 500;
}

.card-title {
    font-family: var(--font-display, 'Syne', sans-serif);
    font-size: 0.98rem;
    line-height: 1.35;
    margin-bottom: 6px;
    font-weight: 700;
    color: #0d1b2a;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s;
}

.card:hover .card-title {
    color: #2f81f3;
}

.card-excerpt {
    font-size: 0.86rem;
    color: #4b5563;
    line-height: 1.55;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 10px;
}

.card-footer-info {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.76rem;
    color: #6b7280;
}

.read-time {
    display: flex;
    align-items: center;
    gap: 4px;
}

.read-time::before {
    content: "⏱";
    font-size: 0.82em;
}

.author-mini {
    font-weight: 600;
    color: #374151;
    font-size: 0.76rem;
}

/* No results message */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
    font-size: 1rem;
    display: none;
}

.no-results.visible {
    display: block;
}

/* --- 7. Responsive --- */
@media (max-width: 1024px) {
    .blog-container {
        grid-template-columns: 220px 1fr;
        gap: 32px;
    }
}

@media (max-width: 768px) {
    .blog-container {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 0 16px;
    }

    .blog-sidebar {
        display: none;
    }

    .inner {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .card-visual {
        height: 160px;
    }
}

@media (max-width: 500px) {
    .inner {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .card-visual {
        height: 180px;
    }
}