/* ============================================
   BLOG POST PAGE - Individual Article Styling
   v1.0 - Cosmic Article Layout
   ============================================ */

/* --- POST HERO SECTION --- */
.post-hero-section {
    position: relative;
    min-height: 45vh;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    overflow: hidden;
    padding: 140px 0 60px;
    background-color: #080912;
}

/* Hero Background Image */
.post-hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.post-hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.5;
}

/* Hero Overlay */
.post-hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(to bottom,
            rgba(5, 5, 8, 0.4) 0%,
            rgba(5, 5, 8, 0.6) 50%,
            #080912 100%);
}

/* Hero Content */
.post-hero-content {
    position: relative;
    z-index: 5;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

.post-category-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    padding: 8px 18px;
    border-radius: 25px;
    margin-bottom: 20px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.post-category-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.post-hero-content h1 {
    font-size: clamp(2rem, 4.5vw, 3rem);
    color: #fff;
    margin-bottom: 25px;
    font-weight: 700;
    line-height: 1.25;
}

/* Post Meta */
.post-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

.post-meta-item {
    display: flex;
    align-items: center;
}

.post-author-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.post-author-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(168, 85, 247, 0.5);
}

.post-author-avatar-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a855f7, #2dd4bf);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    color: white;
}

.post-author-name {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

.post-meta-separator {
    color: rgba(255, 255, 255, 0.3);
}


/* ============================================
   POST CONTENT SECTION
   ============================================ */

.post-content-section {
    position: relative;
    padding: 80px 0 100px;
    background: #080912;
}

/* Article Container */
.post-article {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Prose Styling */
.post-prose {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
    line-height: 1.9;
}

.post-prose p {
    margin-bottom: 1.8rem;
}

.post-prose h2 {
    font-size: 1.8rem;
    color: #fff;
    margin: 3rem 0 1.5rem;
    font-weight: 600;
    padding-left: 15px;
    border-left: 3px solid #a855f7;
}

.post-prose h3 {
    font-size: 1.4rem;
    color: #fff;
    margin: 2.5rem 0 1.2rem;
    font-weight: 600;
}

.post-prose strong {
    color: #fff;
    font-weight: 600;
}

.post-prose a {
    color: #2dd4bf;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.3s ease;
}

.post-prose a:hover {
    color: #a855f7;
}

/* Lists */
.post-prose ul,
.post-prose ol {
    margin: 1.5rem 0;
    padding-left: 1.5rem;
}

.post-prose li {
    margin-bottom: 0.8rem;
    position: relative;
}

.post-prose ul li::marker {
    color: #a855f7;
}

.post-prose ol li::marker {
    color: #2dd4bf;
    font-weight: 600;
}

/* Blockquote */
.post-prose blockquote {
    margin: 2rem 0;
    padding: 25px 30px;
    background: rgba(168, 85, 247, 0.08);
    border-left: 4px solid #a855f7;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: rgba(255, 255, 255, 0.85);
}

.post-prose blockquote p:last-child {
    margin-bottom: 0;
}

/* Code Blocks */
.post-prose code {
    background: rgba(45, 212, 191, 0.1);
    color: #2dd4bf;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9em;
}

.post-prose pre {
    margin: 2rem 0;
    padding: 25px;
    background: rgba(10, 12, 20, 0.8);
    border: 1px solid rgba(45, 212, 191, 0.2);
    border-radius: 10px;
    overflow-x: auto;
}

.post-prose pre code {
    background: none;
    padding: 0;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Images */
.post-prose img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 2rem 0;
}

.post-prose figure {
    margin: 2.5rem 0;
}

.post-prose figcaption {
    text-align: center;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 10px;
    font-style: italic;
}

/* Highlight Box */
.highlight-box {
    margin: 2rem 0;
    padding: 25px;
    background: linear-gradient(135deg,
            rgba(45, 212, 191, 0.1) 0%,
            rgba(168, 85, 247, 0.05) 100%);
    border: 1px solid rgba(45, 212, 191, 0.2);
    border-radius: 10px;
}

.highlight-box h4 {
    color: #2dd4bf;
    margin-bottom: 15px;
    font-size: 1.1rem;
}


/* ============================================
   POST META (CATEGORY & TAGS) - Premium Design
   ============================================ */

.post-meta-footer {
    margin-top: 50px;
    padding: 24px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    backdrop-filter: blur(10px);
}

/* Category Row */
.post-meta-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.post-meta-row:last-child {
    margin-bottom: 0;
}

.post-meta-label {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 75px;
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-top: 6px;
}

.post-meta-label svg {
    width: 14px;
    height: 14px;
    opacity: 0.6;
}

/* Category Link */
.post-category-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--cat-color, #a855f7);
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    transition: all 0.2s ease;
}

.post-category-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.25);
}

/* Tags Container */
.post-tags-wrap {
    display: flex;
    align-items: flex-start;
    flex: 1;
    gap: 8px;
    flex-wrap: wrap;
}

.post-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
}

.post-tag {
    display: inline-block;
    padding: 5px 11px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    transition: all 0.2s ease;
}

.post-tag:hover {
    background: rgba(45, 212, 191, 0.12);
    border-color: rgba(45, 212, 191, 0.35);
    color: #2dd4bf;
}

/* Hidden Tags */
.post-tag.hidden-tag {
    display: none;
}

.post-tags-list.expanded .post-tag.hidden-tag {
    display: inline-block;
}

/* Toggle Button */
.tags-toggle-btn {
    flex-shrink: 0;
    padding: 5px 10px;
    background: rgba(168, 85, 247, 0.08);
    border: 1px solid rgba(168, 85, 247, 0.15);
    border-radius: 14px;
    font-size: 0.7rem;
    font-weight: 500;
    color: #a855f7;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.tags-toggle-btn:hover {
    background: rgba(168, 85, 247, 0.15);
    border-color: rgba(168, 85, 247, 0.25);
}

.tags-toggle-btn.expanded {
    background: rgba(168, 85, 247, 0.05);
}


/* ============================================
   SHARE SECTION
   ============================================ */

.post-share {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 30px;
}

.post-share-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
}

.post-share-links {
    display: flex;
    gap: 10px;
}

.share-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.share-link:hover {
    background: rgba(168, 85, 247, 0.15);
    border-color: rgba(168, 85, 247, 0.3);
    color: #a855f7;
    transform: translateY(-2px);
}


/* ============================================
   RELATED POSTS
   ============================================ */

.related-posts-section {
    padding: 80px 0;
    background: #080912;
}

.related-posts-header {
    text-align: center;
    margin-bottom: 50px;
}

.related-posts-header h2 {
    font-size: 2rem;
    color: #fff;
    font-weight: 600;
}

.related-posts-header .text-glow {
    background: linear-gradient(135deg, #a855f7 0%, #2dd4bf 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}


/* ============================================
   FOOTER WRAPPER
   ============================================ */

.post-footer-wrapper {
    background-color: #080912;
    position: relative;
    z-index: 5;
}

.post-footer-wrapper .nebula-footer {
    padding-top: 100px;
}

.post-footer-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 200px;
    background: linear-gradient(to bottom,
            #080912 0%,
            rgba(8, 9, 18, 0.5) 30%,
            transparent 100%);
    z-index: 10;
    pointer-events: none;
}


/* ============================================
   POST GALLERY
   ============================================ */

.post-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    max-width: 1000px;
    margin: 0 auto;
}

.gallery-thumb {
    position: relative;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-thumb::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2) 0%, rgba(45, 212, 191, 0.2) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.gallery-thumb::after {
    content: '+';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.5);
    font-size: 2.5rem;
    font-weight: 300;
    color: #fff;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 2;
}

.gallery-thumb:hover {
    transform: scale(1.03);
    box-shadow: 0 10px 40px rgba(168, 85, 247, 0.3);
}

.gallery-thumb:hover::before,
.gallery-thumb:hover::after {
    opacity: 1;
}

.gallery-thumb:hover::after {
    transform: translate(-50%, -50%) scale(1);
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-thumb:hover img {
    transform: scale(1.1);
}

/* ============================================
   LIGHTBOX MODAL
   ============================================ */

.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(10px);
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.lightbox-overlay.active .lightbox-content img {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
    z-index: 10001;
}

.lightbox-close:hover {
    background: rgba(239, 68, 68, 0.8);
    transform: scale(1.1);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
    z-index: 10001;
}

.lightbox-nav:hover {
    background: rgba(168, 85, 247, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-nav.prev {
    left: 20px;
}

.lightbox-nav.next {
    right: 20px;
}

.lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 16px;
    border-radius: 20px;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .post-hero-section {
        min-height: 40vh;
        padding: 120px 0 50px;
    }

    .post-hero-content h1 {
        font-size: 1.7rem;
    }

    .post-meta {
        gap: 15px;
        font-size: 0.85rem;
    }

    .post-content-section {
        padding: 60px 0 80px;
    }

    .post-prose {
        font-size: 1rem;
    }

    .post-prose h2 {
        font-size: 1.5rem;
    }

    .post-prose h3 {
        font-size: 1.25rem;
    }

    /* Gallery responsive */
    .post-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .post-inline-gallery {
        padding: 20px;
        margin: 30px -10px;
        border-radius: 12px;
    }

    .post-inline-gallery .gallery-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    /* Lightbox responsive */
    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .lightbox-nav.prev {
        left: 10px;
    }

    .lightbox-nav.next {
        right: 10px;
    }

    .lightbox-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .post-hero-content h1 {
        font-size: 1.5rem;
    }

    .post-meta {
        flex-direction: column;
        gap: 10px;
    }

    .post-prose blockquote {
        padding: 20px;
    }
}

/* ============================================
   READING PROGRESS BAR
   ============================================ */

.reading-progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    z-index: 9998;
}

#reading-progress {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #a855f7, #2dd4bf);
    transition: width 0.1s ease-out;
}

/* ============================================
   TOAST NOTIFICATION
   ============================================ */

.toast-notification {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: linear-gradient(135deg, rgba(45, 212, 191, 0.95), rgba(168, 85, 247, 0.95));
    color: #fff;
    padding: 14px 28px;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 500;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    z-index: 10000;
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55), opacity 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    font-size: 12px;
}

/* ============================================
   INLINE GALLERY (within content)
   ============================================ */

.post-inline-gallery {
    margin: 40px 0;
    padding: 30px;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.08), rgba(45, 212, 191, 0.08));
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 16px;
}

.post-inline-gallery .gallery-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.post-inline-gallery .gallery-header h4 {
    font-size: 1.1rem;
    color: #fff;
    margin: 0;
    font-weight: 600;
}

.post-inline-gallery .gallery-header .gallery-count {
    font-size: 0.8rem;
    color: var(--color-text-muted, rgba(255, 255, 255, 0.5));
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 10px;
    border-radius: 12px;
}


/* ============================================
   HERO GALLERY SECTION (Optimized Layout)
   ============================================ */

.hero-gallery-section {
    padding: 20px 0 40px;
    background: #080912;
}

.hero-gallery-layout {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
    align-items: start;
}

/* Main Large Image */
.hero-gallery-main {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 16/9;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.hero-gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.2s ease;
}

/* Expand Button */
.gallery-expand-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
}

.gallery-expand-btn:hover {
    background: rgba(168, 85, 247, 0.7);
    transform: scale(1.1);
}

.gallery-expand-btn svg {
    pointer-events: none;
}

/* Thumbnail Strip (Compact) */
.hero-gallery-thumbs {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 70px;
}

.hero-gallery-thumb {
    position: relative;
    width: 70px;
    height: 52px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s ease, opacity 0.2s ease;
    opacity: 0.65;
}

.hero-gallery-thumb:hover {
    opacity: 1;
}

.hero-gallery-thumb.active {
    border-color: #a855f7;
    opacity: 1;
}

.hero-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* More Images Overlay */
.thumb-more-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-gallery-layout {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .hero-gallery-main {
        border-radius: 10px;
    }

    .hero-gallery-thumbs {
        flex-direction: row;
        width: 100%;
        justify-content: flex-start;
    }

    .hero-gallery-thumb {
        width: 60px;
        height: 45px;
    }
}

@media (max-width: 480px) {
    .hero-gallery-section {
        padding: 15px 0 30px;
    }

    .hero-gallery-layout {
        padding: 0 15px;
    }

    .hero-gallery-thumb {
        width: 50px;
        height: 38px;
    }

    .gallery-expand-btn {
        width: 32px;
        height: 32px;
        bottom: 8px;
        right: 8px;
    }

    .gallery-expand-btn svg {
        width: 14px;
        height: 14px;
    }
}