/* Blog Feed Styles */
.blog-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.blog-header {
    text-align: center;
    margin-bottom: 3rem;
}

.blog-header h1 {
    font-size: 2.5rem;
    background: linear-gradient(45deg, #39ff14, #00ff80);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
}

.blog-header p {
    color: #94a3b8;
    font-size: 1.1rem;
}

/* Blog Controls */
.blog-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.blog-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.filter-label {
    color: #f8fafc;
    font-weight: 500;
    margin-right: 0.5rem;
}

/* Category Dropdown Styles */
.filter-category {
    position: relative;
    display: inline-block;
}

.category-button {
    background: #2a2a2a;
    border: 1px solid rgba(255,255,255,0.1);
    color: #e2e8f0;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.category-button:hover {
    border-color: rgba(57, 255, 20, 0.5);
    color: #39ff14;
}

.category-button.has-active {
    background: linear-gradient(90deg, rgba(57, 255, 20, 0.1), rgba(0, 255, 128, 0.1));
    border-color: rgba(57, 255, 20, 0.3);
    color: #39ff14;
}

.category-arrow {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

.category-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.5rem;
    background: #2a2a2a;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 0.5rem;
    min-width: 200px;
    z-index: 10;
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}

.category-dropdown.open {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.filter-tag {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.1);
    color: #e2e8f0;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.85rem;
    font-weight: 400;
    text-align: left;
    width: 100%;
}

.filter-tag:hover {
    border-color: rgba(57, 255, 20, 0.5);
    color: #39ff14;
    background: rgba(57, 255, 20, 0.05);
}

.filter-tag.active {
    background: linear-gradient(90deg, rgba(57, 255, 20, 0.15), rgba(0, 255, 128, 0.15));
    border-color: rgba(57, 255, 20, 0.4);
    color: #39ff14;
}

.blog-sort {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-label {
    color: #94a3b8;
    font-size: 0.9rem;
}

.sort-btn {
    background: #2a2a2a;
    border: 1px solid rgba(255,255,255,0.1);
    color: #e2e8f0;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-btn:hover {
    border-color: rgba(57, 255, 20, 0.5);
    color: #39ff14;
}

.sort-btn .sort-icon {
    transition: transform 0.3s ease;
}

.sort-btn.oldest .sort-icon {
    transform: rotate(180deg);
}

/* Blog Posts Feed */
.blog-feed {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.blog-post {
    background: #2a2a2a;
    border-radius: 12px;
    padding: 2rem;
    border: 1px solid rgba(255,255,255,0.1);
    transition: all 0.3s ease;
}

.blog-post:hover {
    border-color: rgba(57, 255, 20, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}

.post-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.post-header h2 {
    color: #f8fafc;
    margin-bottom: 0.75rem;
    font-size: 1.75rem;
    font-weight: 600;
}

.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.post-meta time {
    color: #94a3b8;
    font-size: 0.95rem;
}

.post-meta .tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.post-content {
    color: #e2e8f0;
    line-height: 1.8;
}

.post-content p {
    margin-bottom: 1rem;
    color: #e2e8f0;
}

.post-content code {
    font-size: 1rem;
}

.post-content li{
    margin-left: 2rem;
    margin-right: 1rem;
}

.post-content p:last-child {
    margin-bottom: 0;
}

/* ==================== */
/* Section Styles       */
/* ==================== */

.post-section {
    margin-bottom: 2rem;
}

.post-section:last-child {
    margin-bottom: 0;
}

.section-heading {
    color: #f8fafc;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(57, 255, 20, 0.2);
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.section-note {
    font-size: 0.85rem;
    font-weight: 400;
    color: #94a3b8;
    font-style: italic;
}

/* ==================== */
/* Image Block Styles   */
/* ==================== */

.post-image {
    margin: 1.5rem 0;
}

.post-image img {
    width: 100%;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    transition: transform 0.3s ease;
}

.post-image img:hover {
    transform: scale(1.02);
}

.post-image figcaption {
    margin-top: 0.5rem;
    color: #94a3b8;
    font-size: 0.9rem;
    font-style: italic;
    text-align: center;
    white-space: pre-line;
}

/* Single image size variants */
.post-image.image-small {
    max-width: 300px;
}

.post-image.image-medium {
    max-width: 500px;
}

.post-image.image-large {
    max-width: 100%;
}

/* Centered single images when sized */
.post-image.image-small,
.post-image.image-medium {
    margin-left: auto;
    margin-right: auto;
}

/* Multiple images container */
.post-images {
    margin: 1.5rem 0;
}

/* Side by side layout */
.post-images.images-side-by-side {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

/* Center images within their grid cells */
.post-images.images-side-by-side .post-image {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Grid layout (for 3+ images) */
.post-images.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.post-images.images-grid .post-image {
    margin: 0;
}

/* Stacked layout (default) */
.post-images.images-stack {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.post-images.images-stack .post-image {
    margin: 0;
}

/* Size variants for images container */
.post-images.images-small {
    max-width: 400px;
}

.post-images.images-medium {
    max-width: 600px;
}

.post-images.images-small,
.post-images.images-medium {
    margin-left: auto;
    margin-right: auto;
}

/* Individual image sizes within a group */
.post-images .post-image.image-small img {
    max-width: 200px;
}

.post-images .post-image.image-medium img {
    max-width: 350px;
}

/* ==================== */
/* Video Block Styles   */
/* ==================== */

.post-video {
    margin: 1.5rem 0;
}

.post-video iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
}

.post-video video {
    width: 100%;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
}

/* Video size variants */
.post-video.video-small {
    max-width: 300px;
}

.post-video.video-medium {
    max-width: 500px;
}

.post-video.video-small,
.post-video.video-medium {
    margin-left: auto;
    margin-right: auto;
}

.video-caption {
    margin-top: 0.5rem;
    color: #94a3b8;
    font-size: 0.9rem;
    font-style: italic;
    text-align: center;
    white-space: pre-line;
}

/* ==================== */
/* Code Block Styles    */
/* ==================== */

.post-code {
    margin: 1.5rem 0;
    position: relative;
}

.code-language {
    position: absolute;
    top: 0;
    right: 0;
    background: rgba(57, 255, 20, 0.1);
    color: #39ff14;
    padding: 0.25rem 0.75rem;
    border-radius: 0 8px 0 8px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.post-code pre {
    background: #1a1a1a;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 1.25rem;
    overflow-x: auto;
    margin: 0;
}

.post-code code {
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #e2e8f0;
}

.code-caption {
    margin-top: 0.5rem;
    color: #94a3b8;
    font-size: 0.85rem;
    font-style: italic;
    text-align: center;
}

/* ==================== */
/* Gist Embed Styles    */
/* ==================== */

.post-gist {
    margin: 1.5rem 0;
}

.post-gist .gist {
    background: transparent !important;
}

.post-gist .gist .gist-file {
    border: 1px solid rgba(255,255,255,0.1) !important;
    border-radius: 8px !important;
    overflow: hidden;
}

.post-gist .gist .gist-data {
    background: #1a1a1a !important;
    border: none !important;
}

.post-gist .gist .gist-meta {
    background: #2a2a2a !important;
    color: #94a3b8 !important;
}

.post-gist .gist .gist-meta a {
    color: #39ff14 !important;
}

/* Gist dark mode syntax highlighting */
.post-gist .gist .blob-code {
    background: #1a1a1a !important;
    color: #e2e8f0 !important;
}

.post-gist .gist .blob-num {
    background: #252525 !important;
    color: #64748b !important;
    border-right: 1px solid rgba(255,255,255,0.1) !important;
}

.post-gist .gist .blob-wrapper {
    background: #1a1a1a !important;
}

.post-gist .gist .pl-c { color: #6b7280 !important; }
.post-gist .gist .pl-c1 { color: #f472b6 !important; }
.post-gist .gist .pl-s { color: #a5f3a6 !important; }
.post-gist .gist .pl-en { color: #93c5fd !important; }
.post-gist .gist .pl-k { color: #c4b5fd !important; }
.post-gist .gist .pl-smi { color: #e2e8f0 !important; }
.post-gist .gist .pl-pds { color: #a5f3a6 !important; }
.post-gist .gist .pl-v { color: #fbbf24 !important; }

.gist-caption {
    margin-top: 0.5rem;
    color: #94a3b8;
    font-size: 0.85rem;
    font-style: italic;
    text-align: center;
}

/* Tabbed multi-file gist styles */
.gist-tab-bar {
    display: flex;
    background: #1a1a1a;
    border: 1px solid rgba(255,255,255,0.1);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    overflow-x: auto;
}

.gist-tab {
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 0.6rem 1.2rem;
    cursor: pointer;
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
}

.gist-tab:hover {
    color: #e2e8f0;
    background: rgba(255,255,255,0.05);
}

.gist-tab.active {
    color: #39ff14;
    border-bottom-color: #39ff14;
    background: rgba(57, 255, 20, 0.05);
}

.gist-tabbed .gist-file {
    border-radius: 0 0 8px 8px !important;
    margin-bottom: 0 !important;
}

/* Gist size variants */
.post-gist.gist-small {
    max-width: 400px;
}

.post-gist.gist-medium {
    max-width: 600px;
}

.post-gist.gist-large {
    max-width: 100%;
}

.post-gist.gist-small,
.post-gist.gist-medium {
    margin-left: auto;
    margin-right: auto;
}

/* ==================== */
/* Link Block Styles    */
/* ==================== */

.post-link {
    margin: 1rem 0;
}

.post-content a, .post-link a {
    color: #39ff14;
    text-decoration: none;
    border-bottom: 1px solid rgba(57, 255, 20, 0.3);
    transition: all 0.3s ease;
}

.post-content a:hover, .post-link a:hover {
    border-bottom-color: #39ff14;
}

/* ==================== */
/* Callout Block Styles */
/* ==================== */

.post-callout {
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    border-left: 4px solid;
}

.post-callout p {
    margin: 0;
}

.callout-title {
    display: block;
    margin-bottom: 0.5rem;
}

.callout-info {
    background: rgba(59, 130, 246, 0.1);
    border-color: #3b82f6;
}

.callout-info .callout-title {
    color: #3b82f6;
}

.callout-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: #f59e0b;
}

.callout-warning .callout-title {
    color: #f59e0b;
}

.callout-success {
    background: rgba(57, 255, 20, 0.1);
    border-color: #39ff14;
}

.callout-success .callout-title {
    color: #39ff14;
}

.callout-note {
    background: rgba(148, 163, 184, 0.1);
    border-color: #94a3b8;
}

.callout-note .callout-title {
    color: #f8fafc;
}

/* ==================== */
/* Filter Buttons       */
/* ==================== */

.filter-btn {
    background: #2a2a2a;
    border: 1px solid rgba(255,255,255,0.1);
    color: #e2e8f0;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
}

.filter-btn:hover {
    border-color: rgba(57, 255, 20, 0.5);
    color: #39ff14;
}

.filter-btn.active {
    background: linear-gradient(90deg, rgba(57, 255, 20, 0.1), rgba(0, 255, 128, 0.1));
    border-color: rgba(57, 255, 20, 0.3);
    color: #39ff14;
}

.filter-btn.clear-filters {
    background: rgba(255, 59, 48, 0.1);
    border-color: rgba(255, 59, 48, 0.3);
    color: #ff3b30;
}

.filter-btn.clear-filters:hover {
    background: rgba(255, 59, 48, 0.2);
    border-color: rgba(255, 59, 48, 0.5);
}

/* Tag links in posts */
.tag-link {
    cursor: pointer;
    transition: all 0.3s ease;
}

.tag-link:hover {
    background: linear-gradient(90deg, rgba(57, 255, 20, 0.2), rgba(0, 255, 128, 0.2));
    border-color: rgba(57, 255, 20, 0.4);
    transform: translateY(-2px);
}

/* Loading and empty states */
.loading, .no-posts {
    text-align: center;
    padding: 3rem;
    color: #94a3b8;
    font-style: italic;
}

/* ==================== */
/* Assignment Details   */
/* ==================== */

.assignment-details {
    margin-top: 2rem;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    overflow: hidden;
}

.assignment-toggle {
    width: 100%;
    background: rgba(57, 255, 20, 0.05);
    border: none;
    color: #39ff14;
    padding: 0.75rem 1rem;
    text-align: left;
    cursor: pointer;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.assignment-toggle:hover {
    background: rgba(57, 255, 20, 0.1);
}

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

.assignment-details.open .toggle-icon {
    transform: rotate(180deg);
}

.assignment-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: rgba(0,0,0,0.2);
}

.assignment-details.open .assignment-content {
    max-height: 1000px;
    padding: 1rem;
    overflow-y: auto;
}

.assignment-content p {
    color: #94a3b8;
    font-size: 0.9rem;
    line-height: 1.6;
    font-style: italic;
    margin: 0;
}

/* ==================== */
/* Responsive Styles    */
/* ==================== */

@media (max-width: 768px) {
    .blog-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .blog-filters {
        justify-content: center;
    }

    .blog-sort {
        justify-content: center;
    }

    .blog-post {
        padding: 1.5rem;
    }

    .post-header h2 {
        font-size: 1.5rem;
    }

    .post-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Stack side-by-side images on mobile */
    .post-images.images-side-by-side {
        grid-template-columns: 1fr;
    }

    .post-images.images-grid {
        grid-template-columns: 1fr;
    }

    .section-heading {
        flex-direction: column;
        gap: 0.25rem;
    }
}