/* General Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #f8f4ff;
    margin: 0;
    padding: 0;
    font-family: 'Montserrat', sans-serif;
    overflow-x: hidden;
}

.container {
    background: #f8f4ff;
    width: 88%;
    margin: 40px auto;
    margin-top: 8rem;
}

.section-title {
    font-size: 4rem;
    margin-bottom: 40px;
    text-align: left;
    color: #333;
    font-weight: 700;
}

.blog-grid {
    display: flex;
    gap: 30px;
    margin-top: 5rem;
    flex-wrap: wrap;
}

/* Columns */
.left-column {
    flex: 1;
    min-width: 300px;
    max-width: 500px;
    display: flex;
    align-items: flex-start;
    padding-top: 20px;
}

.center-column {
    flex: 2;
    min-width: 300px;
    max-width: 680px;
}

.right-column {
    flex: 1;
    min-width: 300px;
    max-width: 430px;
}

/* Blog Text Content */
.blog-text-content {
    padding: 20px 30px;
    height: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    margin-top: -30px;
}

/* Blog Cards */
.blog-card {
    position: relative;
    cursor: pointer;
    opacity: 0;
    transform: translateY(50px);
    overflow: hidden;
    border-radius: 10px;
    background: white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.blog-title {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: #222;
    font-weight: 600;
}

.right-blog .blog-title {
    font-size: 1.4rem;
    padding: 0 20px 20px;
}

.blog-excerpt {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #555;
    margin-bottom: 20px;
}

.date {
    color: #777;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Image Containers */
.center-blog .blog-image {
    width: 100%;
    height: 0;
    padding-top: 91.18%;
    background-size: cover;
    background-position: center;
    transition: transform 0.5s ease;
}

.right-blog .blog-image {
    width: 100%;
    height: 0;
    padding-top: 79.07%;
    background-size: cover;
    background-position: center;
    margin-bottom: 0;
    transition: transform 0.5s ease;
}

/* Latest Posts Grid */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 4rem;
}

.post-card {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.post-card:hover {
    transform: translateY(-5px);
}

.post-image-container {
    position: relative;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
}

.post-image {
    width: 100%;
    height: 0;
    padding-top: 65%;
    background-size: cover;
    background-position: center;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.post-card:hover .post-image {
    transform: scale(1.05);
}

.post-content {
    padding: 20px;
}

.post-title {
    font-size: 1.4rem;
    margin: 0 0 0.5rem;
    color: #222;
    font-weight: 600;
}

.post-date {
    display: block;
    color: #666;
    font-size: 0.9rem;
}

/* Popup Styles */
.popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    z-index: 1000;
}

.popup-content {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px;
    width: 90%;
    max-width: 1000px;
    max-height: 80vh;
    text-align: left;
    position: relative;
    color: #333;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    overflow-y: auto;
    transform: translateY(-20px);
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

.popup.show {
    opacity: 1;
}

.popup.show .popup-content {
    transform: translateY(0);
}

.popup-content img {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: cover;
    border-radius: 15px;
    margin-bottom: 25px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.1);
}

.popup-content h2 {
    font-size: 2.2rem;
    margin-bottom: 20px;
    font-weight: 700;
    color: #222;
}

.popup-content p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #444;
    margin-bottom: 20px;
    white-space: pre-line;
}

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 30px;
    cursor: pointer;
    color: #333;
    transition: color 0.3s;
}

.close:hover {
    color: #ff0000;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .blog-grid {
        gap: 40px;
    }

    .left-column,
    .center-column,
    .right-column {
        max-width: 100%;
        flex: 1 1 100%;
    }

    .blog-text-content {
        margin-top: 0;
        padding: 30px;
    }

    .section-title {
        font-size: 3.5rem;
    }
}

@media (max-width: 1024px) {
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .container {
        margin-top: 7rem;
    }

    .section-title {
        font-size: 2.5rem;
        margin-bottom: 30px;
    }

    .blog-grid {
        margin-top: 3rem;
        gap: 30px;
    }

    .posts-grid {
        grid-template-columns: 1fr;
        max-width: 500px;
        margin: 4rem auto 0;
    }

    .center-blog .blog-image {
        padding-top: 100%;
    }

    .right-blog .blog-image {
        padding-top: 90%;
    }

    .popup-content {
        padding: 30px 20px;
    }

    .popup-content h2 {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: 2rem;
    }

    .blog-grid {
        gap: 20px;
    }

    .blog-title {
        font-size: 1.5rem;
    }

    .post-title {
        font-size: 1.2rem;
    }
}