/* ==========================================================================
   BLOG SPECIFIC STYLES
   (Relies on styles.css for Header, Footer, and Resets)
   ========================================================================== */

/* Blog Hero */
.blog-hero-section {
    display: flex;
    justify-content: flex-start;
    padding-top: 8rem;
    padding-bottom: 1rem;
    position: relative;
}

.blog-hero-content {
    max-width: 1150px;
    margin: 0;
    text-align: left;
    padding-left: 0rem;
}

.blog-hero-title {
    font-size: 2rem;
    font-weight: 400;
    line-height: 1.2;
    margin-bottom: 3rem;
    color: #ffffff;
    letter-spacing: -0.02em;
}

.blog-hero-description {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-left: 0rem;
}

.blog-hero-description p {
    font-size: 1.25rem;
    font-weight: 400;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: -0.01em;
}

/* Blog Posts Section */
.blog-posts-section {
    padding: 6rem 0;
    background-color: #0a0a0a;
    position: relative;
}

/* Vertical lines for blog section */
.blog-posts-section::before {
    content: '';
    position: absolute;
    left: 49.3%;
    top: 96px;
    bottom: -39px;
    width: 1px;
    background: rgba(255,255,255,0.1);
    z-index: 1;
}

.blog-posts-section::after {
    content: '';
    position: absolute;
    left: 50.7%;
    top: 96px;
    bottom: -39px;
    width: 1px;
    background: rgba(255,255,255,0.1);
    z-index: 1;
}

.blog-header {
    display: flex;
    justify-content: flex-start;
}

.blog-title {
    font-size: 1.5rem;
    font-weight: 500;
    color: #ffffff;
    letter-spacing: -0.01em;
}

/* Blog Cards */
.blog-card {
    margin-top: 0;
    margin-bottom: 0;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(.4,0,.2,1);
    position: relative;
    cursor: pointer;
}

.blog-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.2);
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem 3rem;
    max-width: 1150px;
    margin: 2rem auto 0rem auto;
}

/* Horizontal dividers */
.blog-row-divider {
    grid-column: 1 / -1;
    height: 23px;
    background: transparent;
    margin: 0rem calc(-50vw + 50%);
    position: relative;
}

.blog-row-divider::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255,255,255,0.1);
}

.blog-row-divider::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255,255,255,0.1);
}

.blog-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.blog-card-image {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.blog-card:hover .blog-card-image img {
    transform: scale(1.05);
}

.blog-card-content {
    padding: 1.5rem;
}

.blog-card-title {
    font-size: 1.125rem;
    font-weight: 500;
    color: #ffffff;
    line-height: 1.4;
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
    transition: color 0.3s ease;
}

.blog-card-date {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 400;
}

.blog-card-image:empty::before {
    content: "📝";
    font-size: 3rem;
    opacity: 0.3;
}

/* Filler Card Styles */
.blog-card-filler {
    border: 1px dashed rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.02);
    cursor: default;
    pointer-events: none;
}

.blog-card-filler:hover {
    transform: none;
    border-color: rgba(255, 255, 255, 0.2);
}

.filler-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 2rem;
    min-height: 320px;
}

.filler-icon-img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    opacity: 0.7;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

.filler-title {
    font-size: 1.25rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.75rem;
    letter-spacing: -0.01em;
}

.filler-text {
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.6;
    max-width: 280px;
}

/* Blog Modal */
.blog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.blog-overlay.active {
    opacity: 1;
    visibility: visible;
}

.blog-modal {
    position: relative;
    width: 90%;
    max-width: 800px;
    height: 90vh;
    margin: 5vh auto;
    background: linear-gradient(
        135deg,
        rgba(26, 26, 26, 0.95) 0%,
        rgba(20, 20, 20, 0.92) 50%,
        rgba(15, 15, 15, 0.95) 100%
    );
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(0.95) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.blog-overlay.active .blog-modal {
    transform: scale(1) translateY(0);
}

.blog-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.blog-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    transform: rotate(90deg);
}

.blog-content {
    height: 100%;
    overflow-y: auto;
    padding: 3rem;
    padding-right: 2.5rem;
}

.blog-content::-webkit-scrollbar {
    width: 6px;
}

.blog-content::-webkit-scrollbar-track {
    background: transparent;
}

.blog-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.blog-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.blog-post-header {
    margin-bottom: 2rem;
}

.blog-post-title {
    font-size: 2.5rem;
    font-weight: 500;
    color: #ffffff;
    line-height: 1.2;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.blog-post-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
}

.blog-date,
.blog-read-time {
    font-weight: 400;
}

.blog-separator {
    color: rgba(255, 255, 255, 0.3);
}

.blog-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.blog-tag {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.blog-divider {
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    margin: 2rem 0;
}

.blog-body {
    font-size: 1.125rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 400;
}

.blog-body h2 {
    font-size: 1.875rem;
    font-weight: 500;
    color: #ffffff;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
}

.blog-body h3 {
    font-size: 1.5rem;
    font-weight: 500;
    color: #ffffff;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    letter-spacing: -0.01em;
}

.blog-body p {
    margin-bottom: 1.5rem;
}

.blog-body a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.3);
    text-underline-offset: 3px;
    transition: all 0.2s ease;
}

.blog-body a:hover {
    color: #ffffff;
    text-decoration-color: rgba(255, 255, 255, 0.6);
}

.blog-body ul,
.blog-body ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.blog-body li {
    margin-bottom: 0.5rem;
}

.blog-body blockquote {
    border-left: 3px solid rgba(255, 255, 255, 0.3);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: rgba(255, 255, 255, 0.7);
}

.blog-body code {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', monospace;
    font-size: 0.9em;
}

.blog-body pre {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.blog-body pre code {
    background: none;
    padding: 0;
}

.blog-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 2rem 0;
}

.blog-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #ffffff 0%, rgba(255, 255, 255, 0.8) 100%);
    width: 0%;
    transition: width 0.1s ease;
    border-radius: 0 3px 3px 0;
}

.blog-content-image {
    width: 100%;
    max-width: 800px;
    height: auto;
    margin: 2rem auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.blog-image-wrapper {
    margin: 2rem auto;
    max-width: 800px;
    text-align: center;
}

.blog-image-wrapper img {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.blog-image-wrapper figcaption {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
    margin-top: 0.5rem;
}

/* Responsive Overrides */
@media (max-width: 768px) {
    .blog-posts-section::before,
    .blog-posts-section::after {
        display: none;
    }
    
    .blog-row-divider {
        display: none;
    }
    
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 2rem 0;
    }

    .blog-hero-title {
        font-size: 1.75rem;
        margin-bottom: 2rem;
    }

    .blog-hero-description p {
        font-size: 1.125rem;
    }

    .blog-posts-section {
        padding: 4rem 0;
    }

    .blog-modal {
        width: 95%;
        height: 95vh;
        margin: 2.5vh auto;
        border-radius: 12px;
    }

    .blog-content {
        padding: 2rem 1.5rem;
    }

    .blog-close {
        top: 1rem;
        right: 1rem;
        width: 36px;
        height: 36px;
    }

    .blog-post-title {
        font-size: 1.875rem;
    }

    .blog-body {
        font-size: 1rem;
    }

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

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

    .blog-content-image,
    .blog-image-wrapper {
        margin: 1.5rem 0;
    }

    .blog-card-filler {
        display: none;
    }
}

@media (max-width: 480px) {
    .blog-hero-title {
        font-size: 1.5rem;
    }

    .blog-hero-description p {
        font-size: 1rem;
    }
}