/* ===== Blog Card Hover ===== */
.blog-card-img-wrapper:hover img {
    transform: scale(1.08) !important;
}

/* ===== Article Overlay (injected on body, OUTSIDE #swup) ===== */
.article-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99990;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.article-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Backdrop */
.article-overlay-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: pointer;
}

/* Panel (the card itself) */
.article-overlay-panel {
    position: relative;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    background: rgba(18, 18, 18, 0.97);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 24px;
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}
.article-overlay.active .article-overlay-panel {
    transform: scale(1);
}

/* Close button */
.article-overlay-close {
    position: absolute;
    right: 16px;
    top: 16px;
    z-index: 10;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(10px);
    color: #fff;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}
.article-overlay-close:hover {
    background: rgba(255,60,60,0.7);
    border-color: rgba(255,60,60,0.5);
    transform: scale(1.1);
}

/* Scrollable body */
.article-overlay-body {
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

/* Hero image */
.article-overlay-hero {
    position: relative;
    height: 300px;
    width: 100%;
    flex-shrink: 0;
}
.article-overlay-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.article-overlay-hero-gradient {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.1) 40%, rgba(18,18,18,1) 100%);
    z-index: 1;
}
.article-overlay-hero-title {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 2rem;
    z-index: 2;
}

/* Footer */
.article-overlay-footer {
    flex-shrink: 0;
    padding: 12px 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.25);
    border-radius: 0 0 24px 24px;
}

/* Article content styles */
.article-overlay-content-wrap {
    padding: 1.5rem 2rem;
}
.article-overlay .article-content {
    line-height: 1.8;
    font-size: 1.08rem;
    color: rgba(255,255,255,0.85);
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.article-overlay .article-content a {
    color: var(--accent-blue, #2997ff);
    text-decoration: underline;
    text-underline-offset: 4px;
}
.article-overlay .article-content a:hover {
    color: var(--accent-purple, #bf5af2);
}

/* Scrollbar styling */
.article-overlay-body::-webkit-scrollbar {
    width: 6px;
}
.article-overlay-body::-webkit-scrollbar-track {
    background: transparent;
}
.article-overlay-body::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 3px;
}
.article-overlay-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.3);
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .article-overlay {
        padding: 0;
    }
    .article-overlay-panel {
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        border: none;
        transform: scale(0.98);
    }
    .article-overlay.active .article-overlay-panel {
        transform: scale(1);
    }
    .article-overlay-hero {
        height: 200px;
    }
    .article-overlay-close {
        right: 12px;
        top: 12px;
        width: 36px;
        height: 36px;
        background: rgba(0,0,0,0.8);
    }
    .article-overlay-hero-title {
        padding: 1rem 1.25rem;
    }
    .article-overlay-content-wrap {
        padding: 1.25rem;
    }
    .article-overlay-footer {
        padding: 12px 1.25rem;
        border-radius: 0;
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    }
}
