/* Blog Page Layout */
body {
    overflow-y: auto;
    height: auto;
    /* Apply background directly to body for robustness */
    background: #0b0f14 url('../background.webp') no-repeat center center fixed;
    background-size: cover;
    margin: 0;
    padding: 0;
    font-family: "Inter", sans-serif;
    color: #e8ecf1;
}

/* Background Noise - removed separate div styling since we use body */
.background {
    display: none;
}

#noise {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    /* Above background */
    pointer-events: none;
    opacity: 0.05;
}

/* Main Layout Grid */
.blog-wrapper {
    display: flex;
    width: 90%;
    /* Occupy 90% of the screen width */
    max-width: 1800px;
    /* Increased max constraint */
    margin: 0 auto;
    padding: 4em 0;
    /* Reduced side padding since width is % */
    gap: 2em;
    /* Reduced gap slightly for better proportions */
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

/* Sidebar Navigation */
.blog-sidebar {
    width: 280px;
    flex-shrink: 0;
    position: sticky;
    top: 4em;
    height: fit-content;
    padding: 1.5em;
    background: rgba(0, 0, 0, 0.6);
    /* Darker, black background */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    margin-bottom: auto;
}

.blog-sidebar.collapsed {
    width: 50px;
    height: 50px;
    padding: 0;
    border-radius: 50%;
    /* Optional: make it round or keep square? User said square before. Let's keep square but centered. */
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 1.5em;
    transition: all 0.3s;
}

.blog-sidebar.collapsed .sidebar-header {
    margin-bottom: 0;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.sidebar-title {
    font-family: "SUSE Mono", sans-serif;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
    white-space: nowrap;
    opacity: 1;
    transition: opacity 0.2s;
}

.blog-sidebar.collapsed .sidebar-title {
    opacity: 0;
    width: 0;
    height: 0;
    overflow: hidden;
    margin: 0;
    display: none;
    /* Force hide */
}

.sidebar-toggle {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 0;
    width: auto;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s, transform 0.3s;
}

.sidebar-toggle:hover {
    color: #fff;
}

.blog-sidebar.collapsed .sidebar-toggle {
    transform: rotate(180deg);
    width: 100%;
    height: 100%;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.8em;
    opacity: 1;
    transition: opacity 0.2s;
}

.blog-sidebar.collapsed .sidebar-nav {
    opacity: 0;
    pointer-events: none;
    display: none;
}

/* ... styles ... */

/* Main Content Area */
.article-container {
    flex-grow: 1;
    max-width: 100%;
    /* Pure black background with transparency */
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    padding: 3em;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Typography Overrides */
h1 {
    font-family: "Russo One", sans-serif;
    /* Match H2 style: 1.5em size, specific margins */
    font-size: 1.5em;
    margin-top: 0;
    /* Header top margin usually 0 if it's top of article */
    margin-bottom: 0.8em;
    color: #fff;
    text-transform: none;
    /* H2 didn't have uppercase forced, assuming user wants exact match */
    line-height: 1.4;
    letter-spacing: normal;
}

h2 {
    font-family: "Russo One", sans-serif;
    margin-top: 2em;
    margin-bottom: 0.8em;
    color: #fff;
    font-size: 1.5em;
    /* Reduced size */
}

.article-content {
    font-family: "Inter", sans-serif;
    font-size: 1.1em;
    line-height: 1.6;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.9);
}

.article-content p {
    margin-bottom: 1.5em;
}

.article-content ul {
    margin-bottom: 1.5em;
    padding-left: 1.5em;
}

.article-content li {
    margin-bottom: 0.5em;
    color: rgba(255, 255, 255, 0.8);
}

.article-content strong {
    color: #fff;
    font-weight: 600;
}

.article-content a {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-color: rgba(255, 255, 255, 0.3);
    transition: all 0.2s;
}

.article-content a:hover {
    text-decoration-color: #fff;
    color: #4facfe;
}

/* Next Post Block */
.next-post {
    margin-top: 4em;
    padding: 2em;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: block;
    position: relative;
    overflow: hidden;
}

.next-post:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.1);
}

.next-post .label {
    font-family: "SUSE Mono", sans-serif;
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 0.5em;
    display: block;
    letter-spacing: 1px;
}

.next-post .title {
    font-family: "Russo One", sans-serif;
    font-size: 1.5em;
    color: #fff;
    display: block;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .blog-wrapper {
        flex-direction: column;
        gap: 2em;
        padding: 2em 1em;
    }

    .blog-sidebar {
        width: 100%;
        position: relative;
        top: 0;
        margin-bottom: 2em;
    }

    .blog-sidebar.collapsed {
        display: none;
    }

    .article-container {
        padding: 0;
    }
}

/* Community CTA Block */
.community-cta {
    margin-top: 3em;
    padding: 0;
    /* Remove padding */
    background: transparent;
    text-align: center;
    /* Centered as requested */
    border: none;
    /* No borders at all */
}

.community-cta p {
    font-family: "Inter", sans-serif;
    font-size: 0.95em;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 1em;
    /* Small space before footer */
    font-style: normal;
    /* Removed italic if default wasn't desired */
}

.community-cta a {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 4px;
    font-weight: 600;
    transition: color 0.3s;
}

.community-cta a:hover {
    color: #4facfe;
}

/* Footer Social Icons */
.blog-footer {
    margin-top: 10px;
    /* Minimal margin from CTA text */
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    /* Separator is here now */
    display: flex;
    justify-content: center;
    /* Reverted to center */
    gap: 30px;
}

.social-icon img {
    /* Adaptive size: min 50px, preferred 8vw, max 90px */
    width: clamp(50px, 8vw, 90px);
    height: clamp(50px, 8vw, 90px);
    opacity: 0.5;
    transition: opacity 0.3s, transform 0.3s;
}

.social-icon:hover img {
    opacity: 1;
    transform: scale(1.1);
}

.icon-label {
    font-family: "SUSE Mono", sans-serif;
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.3s;
}

/* Random Header Image */
.random-header-image {
    width: 100%;
    height: 300px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    margin-bottom: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    background-color: rgba(255, 255, 255, 0.05);
    /* Placeholder while loading */
    position: relative;
    overflow: hidden;
    display: none;
    /* Hidden by default until JS loads image */
}

.random-header-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    pointer-events: none;
}

@media (max-width: 768px) {
    .random-header-image {
        height: 250px;
    }
}