/* --- ULTRA-PREMIUM STYLES FOR BLOG LISTING PAGE --- */

/* CORRECTED #1 & #2: Hero Section Visibility and Sizing */
/* Hero Section */
.blog-hero {
    position: relative;
    height: 50vh; /* This sets the height to half of the DESKTOP screen */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--light-color);
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('media/blog/cover (cropped).jpg'); /* Make sure you have an image at this path */
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    filter: brightness(.5); /* Darkens the image so text is readable */
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2; /* Ensures text is on top */
    color: #ffffff; /* Forces the text color to be white */
    animation: fadeInHeroText 1.5s ease-out forwards;
}

@keyframes fadeInHeroText {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.hero-content p {
    font-size: 1.3rem;
    max-width: 600px;
    margin: 0 auto;
    opacity: 0.9;
    text-align: center;
}

/* CORRECTED #1: Blog Layout (Single Column, Image Left & Text Right) */
.blog-list {
    display: flex;
    flex-direction: column;
    gap: 60px; /* Space between posts */
}

.blog-card {
    background-color: var(--light-color);
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.07);
    display: flex; /* This is the key change */
    flex-direction: row; /* Aligns items side-by-side */
    align-items: center; /* Vertically centers the content */
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    opacity: 0;
    transform: translateY(40px);
    margin-bottom: 80px;
}

.blog-card.is-visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.blog-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
}

.card-image-link {
    flex: 0 0 40%; /* Image container takes up 40% of the width */
    align-self: stretch; /* Makes the image height match the text height */
    border-radius: 8px 0 0 8px; /* Rounds the left corners */
    overflow: hidden;
}

.card-image-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;;
}

.card-image-link img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures image fills the container without distortion */
    display: block;
}

.card-content {
    flex: 1; /* Text takes the remaining space */
    padding: 30px;
}

.card-title {
    font-size: 1.8rem;
    margin-bottom: 15px;
    line-height: 1.3;
}
.card-title a {
    text-decoration: none;
    color: var(--dark-color);
    transition: color 0.3s ease;
}
.card-title a:hover {
    color: var(--button-default-blue);
}

.card-excerpt {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #555;
    margin-bottom: 25px;
}

.read-more {
    font-weight: 600;
    font-size: 1.1rem;
    text-decoration: none;
    color: var(--button-default-blue);
}

.active-submenu {
    color: #a8cfff !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .blog-card {
        flex-direction: column; /* Stack vertically on mobile */
    }
    .blog-hero {
        height: 35vh; 
    }
    .hero-background {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-image: url('media/blog/cover (cropped).jpg'); /* Make sure you have an image at this path */
        background-size: cover;
        background-position: center;
        filter: brightness(.5); /* Darkens the image so text is readable */
        z-index: 1;
    }
    .card-image-link {
        width: 100%;
        height: 220px;
    }
    .hero-content h1 {
        font-size: 1.8rem;
        font-weight: 700;
        margin-bottom: 10px;
}

    .hero-content p {
        font-size: 0.9rem;
        max-width: 600px;
        margin: 0 auto;
        opacity: 0.9;
        padding: 0 15px; /* This adds a 15px gap on the left and right */
    }

    .card-title {
        font-size: 1.5rem;
        margin-bottom: 15px;
        line-height: 1.2;
    }
}

.section-title {
    font-size: 2 rem;
    color: var(--button-default-blue);
    margin-bottom: 15px;
    text-align: center; /* Center the section title */
}

.title-wrapper {
    display: flex;
    justify-content: center;
    
    align-items: center;
    margin-bottom: 10px; /* Space below the title */
}
