/**
 * Blog CSS - Dedicated stylesheet for blog pages
 * Includes styles for blog listing and blog post pages
 */

/* ============================================
   BLOG POST PAGE STYLES
   ============================================ */

/* Blog Post Hero Section - Updated for Dynamic Background */
.blog-post-hero {
    background-color: #2E7D32;
    /* Fallback color */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 150px 0 100px;
    /* Increased padding for better visual */
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    /* Full screen height */
    display: flex;
    align-items: center;
}

/* Adjust wave for blog post hero to be more subtle */
.blog-post-hero .wave-bottom {
    height: 200px;
    /* Reduced from default 280px */
}

.blog-post-hero .wave-svg {
    height: 200px;
    /* Match container height */
}

/* Dark Overlay for Readability */
.blog-post-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.7) 100%);
    z-index: 1;
}

/* Animated Bubble Background - Same as Homepage */
.blog-post-hero .geometric-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 1;
}

.blog-post-hero .geometric-background::before,
.blog-post-hero .geometric-background::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.blog-post-hero .geometric-background::before {
    background-image:
        /* Large prominent bubbles */
        radial-gradient(circle at 15% 40%, rgba(255, 255, 255, 0.35) 30px, rgba(255, 255, 255, 0.2) 32px, transparent 35px),
        radial-gradient(circle at 85% 30%, rgba(255, 255, 255, 0.3) 25px, rgba(255, 255, 255, 0.15) 27px, transparent 30px),
        radial-gradient(circle at 60% 70%, rgba(255, 255, 255, 0.4) 35px, rgba(255, 255, 255, 0.25) 37px, transparent 40px),
        radial-gradient(circle at 30% 85%, rgba(255, 255, 255, 0.25) 20px, rgba(255, 255, 255, 0.1) 22px, transparent 25px),
        radial-gradient(circle at 70% 15%, rgba(255, 255, 255, 0.32) 28px, rgba(255, 255, 255, 0.18) 30px, transparent 33px),

        /* Medium bubbles */
        radial-gradient(circle at 25% 60%, rgba(255, 255, 255, 0.2) 15px, rgba(255, 255, 255, 0.1) 17px, transparent 20px),
        radial-gradient(circle at 75% 50%, rgba(255, 255, 255, 0.22) 18px, rgba(255, 255, 255, 0.12) 20px, transparent 23px),
        radial-gradient(circle at 45% 20%, rgba(255, 255, 255, 0.18) 12px, rgba(255, 255, 255, 0.08) 14px, transparent 17px),
        radial-gradient(circle at 65% 80%, rgba(255, 255, 255, 0.24) 16px, rgba(255, 255, 255, 0.14) 18px, transparent 21px),

        /* Small bubbles */
        radial-gradient(circle at 10% 10%, rgba(255, 255, 255, 0.15) 8px, transparent 10px),
        radial-gradient(circle at 90% 80%, rgba(255, 255, 255, 0.15) 8px, transparent 10px),
        radial-gradient(circle at 50% 90%, rgba(255, 255, 255, 0.12) 6px, transparent 8px),
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.14) 7px, transparent 9px),
        radial-gradient(circle at 70% 60%, rgba(255, 255, 255, 0.16) 9px, transparent 11px);
    background-size: 100% 100%;
    animation: bubblesRise 20s linear infinite;
}

.blog-post-hero .geometric-background::after {
    background-image:
        radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.28) 22px, rgba(255, 255, 255, 0.15) 24px, transparent 27px),
        radial-gradient(circle at 80% 60%, rgba(255, 255, 255, 0.25) 28px, rgba(255, 255, 255, 0.12) 30px, transparent 33px),
        radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.2) 16px, transparent 20px),
        radial-gradient(circle at 65% 25%, rgba(255, 255, 255, 0.18) 14px, transparent 18px),
        radial-gradient(circle at 45% 65%, rgba(255, 255, 255, 0.17) 12px, transparent 15px),
        radial-gradient(circle at 15% 55%, rgba(255, 255, 255, 0.20) 16px, transparent 19px);
    background-size: 110% 110%;
    animation: bubblesRise 25s linear infinite reverse;
    animation-delay: -5s;
}

@keyframes bubblesRise {
    0% {
        transform: translateY(100vh) translateX(0) scale(0);
        opacity: 0;
    }

    10% {
        transform: translateY(90vh) translateX(-20px) scale(1);
        opacity: 1;
    }

    25% {
        transform: translateY(60vh) translateX(20px) scale(1.1);
    }

    50% {
        transform: translateY(30vh) translateX(-15px) scale(1);
    }

    75% {
        transform: translateY(10vh) translateX(25px) scale(0.9);
    }

    90% {
        transform: translateY(-10vh) translateX(0) scale(0.8);
        opacity: 1;
    }

    100% {
        transform: translateY(-20vh) translateX(0) scale(0);
        opacity: 0;
    }
}

.blog-post-header {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 2;
}

.blog-post-category {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 25px;
    font-weight: 600;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
}

.blog-post-title {
    color: white;
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    line-height: 1.2;
}

.blog-post-meta {
    display: flex;
    justify-content: center;
    gap: 30px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
}

.blog-post-meta span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.blog-post-meta i {
    font-size: 1rem;
}

/* ============================================
   NEW GRID LAYOUT SYSTEM
   ============================================ */

.blog-post-content-wrapper {
    background-color: #f8f9fa;
    background-image:
        radial-gradient(at 40% 20%, hsla(128, 100%, 74%, 0.1) 0px, transparent 50%),
        radial-gradient(at 80% 0%, hsla(189, 100%, 56%, 0.1) 0px, transparent 50%),
        radial-gradient(at 0% 50%, hsla(340, 100%, 76%, 0.1) 0px, transparent 50%);
    padding: 60px 0 100px;
    min-height: 100vh;
    position: relative;
}

.blog-layout {
    display: grid;
    grid-template-columns: 80px 1fr;
    /* Sidebar | Content */
    gap: 40px;
    max-width: 1100px;
    margin: -100px auto 0;
    /* Overlap hero */
    position: relative;
    z-index: 10;
}

/* Sidebar Styles */
.blog-sidebar {
    position: relative;
}

.sidebar-sticky {
    position: sticky;
    top: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.back-to-blog-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2E7D32;
    font-size: 1.2rem;
    box-shadow:
        0 10px 20px rgba(0, 0, 0, 0.1),
        0 6px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-decoration: none;
}

.back-to-blog-btn:hover {
    transform: scale(1.1) rotate(-10deg);
    box-shadow: 0 15px 30px rgba(46, 125, 50, 0.2);
    color: #1B5E20;
    text-decoration: none;
}

.share-vertical {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    background: white;
    padding: 20px 10px;
    border-radius: 30px;
    box-shadow:
        0 10px 20px rgba(0, 0, 0, 0.05),
        0 6px 6px rgba(0, 0, 0, 0.02);
}

.share-label {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    font-size: 0.75rem;
    font-weight: 700;
    color: #9CA3AF;
    letter-spacing: 2px;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.share-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6B7280;
    background: #F3F4F6;
    transition: all 0.3s ease;
    text-decoration: none;
}

.share-icon:hover {
    transform: translateY(-3px);
    color: white;
    text-decoration: none;
}

.share-icon.twitter:hover {
    background: #1DA1F2;
    box-shadow: 0 5px 15px rgba(29, 161, 242, 0.3);
}

.share-icon.facebook:hover {
    background: #4267B2;
    box-shadow: 0 5px 15px rgba(66, 103, 178, 0.3);
}

.share-icon.discord:hover {
    background: #5865F2;
    box-shadow: 0 5px 15px rgba(88, 101, 242, 0.3);
}

/* Main Content Card - Transparent */
.blog-post-main-card {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    overflow: visible;
    border: none;
}

.blog-image-container {
    width: 100%;
    height: 500px;
    position: relative;
    overflow: hidden;
    border-radius: 30px;
    /* Rounded corners */
    margin-top: 40px;
    /* Move down */
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    /* Restore some shadow for depth */
}

.blog-post-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.blog-post-main-card:hover .blog-post-image {
    transform: scale(1.03);
}

.blog-post-body {
    padding: 40px 0;
    font-size: 1.2rem;
    line-height: 1.8;
    color: #374151;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* Typography Enhancements */
.blog-post-body h1,
.blog-post-body h2,
.blog-post-body img {
    max-width: 100%;
    height: auto;
    border-radius: 25px;
    /* Increased rounding */
    margin: 30px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.blog-post-body img:hover {
    transform: translateY(-5px);
}

.blog-post-body ul,
.blog-post-body ol {
    margin-bottom: 25px;
    padding-left: 20px;
    color: #4b5563;
}

.blog-post-body li {
    margin-bottom: 12px;
    position: relative;
    padding-left: 15px;
}

.blog-post-body ul li::marker {
    color: #22C55E;
}

.blog-post-body h1 {
    font-size: 3rem;
}

.blog-post-body h2 {
    font-size: 2.25rem;
}

.blog-post-body h3 {
    font-size: 1.75rem;
}

.blog-post-body p {
    margin-bottom: 1.5rem;
    color: #4B5563;
}

/* Blockquotes */
.blog-post-body blockquote {
    border: none;
    background: #F0FDF4;
    padding: 40px;
    border-radius: 20px;
    margin: 40px 0;
    position: relative;
    font-size: 1.4rem;
    font-weight: 500;
    color: #166534;
    font-style: italic;
}

.blog-post-body blockquote::before {
    content: '"';
    position: absolute;
    top: 10px;
    left: 20px;
    font-size: 80px;
    color: #BBF7D0;
    font-family: serif;
    line-height: 1;
}

/* YouTube and iFrame embeds */
.blog-post-body iframe {
    max-width: 100%;
    border-radius: 25px;
    /* Increased rounding */
    margin: 30px 0;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

/* Ensure images inside sections are also rounded */
.blog-post-body .blogPostSection img,
.blogPostSection img {
    border-radius: 25px !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2) !important;
}

/* Project Sections */
.blog-post-body .blogPostSection,
.blogPostSection {
    border-radius: 30px !important;
    padding: 50px !important;
    margin: 50px -50px !important;
    /* Break out of container slightly */
    background: linear-gradient(135deg, #2E7D32 0%, #1B5E20 100%) !important;
    box-shadow:
        0 20px 40px rgba(46, 125, 50, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
    color: white !important;
    position: relative;
    overflow: hidden !important;
}

.blog-post-body .blogPostSection h1,
.blog-post-body .blogPostSection h2,
.blog-post-body .blogPostSection p {
    color: white !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}

/* Responsive Styles */
@media (max-width: 992px) {
    .blog-layout {
        grid-template-columns: 1fr;
        margin-top: -50px;
        padding: 0 20px;
    }

    .blog-sidebar {
        display: none;
        /* Hide sidebar on mobile for now, or move to bottom */
    }

    .blog-post-body {
        padding: 40px 30px;
    }

    .blog-post-main-card {
        border-radius: 30px;
    }

    .blog-post-body .blogPostSection {
        margin: 30px -20px !important;
        border-radius: 0 !important;
    }
}