/* Defines the main grid container for the blog cards. */
.featured-blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin: 0 auto;
}

/* The main container for a single blog card, allowing the hover effect to be visible. */
.featured-blog-card {
    display: flex;
    flex-direction: column; 
    position: relative;
    overflow: visible;
    border-radius: 12px;
    z-index: 1;
}

/* Creates the background layer for the hover effect. */
.featured-blog-card::before {
    content: '';
    position: absolute;
    z-index: -1;
    inset: 0;
    background-color: rgba(255, 255, 255);
    border-radius: 12px;
    opacity: 0;
    transition: all 0.3s ease-out;
}

/* 
 * Defines the hover state, causing the ::before element to expand and fade in.
 * This is wrapped in a media query to only apply on devices that support hover (e.g., desktops with a mouse).
*/
@media (hover: hover) {
    .featured-blog-card:hover::before {
        inset: -10px;
        opacity: 1;
    }
}

/* The original overlay is no longer needed for the new hover effect. */
.featured-blog-card::after {
    display: none;
}

/* Creates a clickable overlay from the title's link to cover the entire card. */
.featured-blog-card__title a::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
}

/* A container for the card's thumbnail image. */
.featured-blog-card__thumbnail {
    position: relative;
    display: block;
}

/* Styles the thumbnail image itself. */
.featured-blog-card__thumbnail img {
    display: block;
    width: 100%;
    height: 240px;
    object-fit: cover;
    border-radius: 12px;
}

/* Styles the category label, ensuring it appears on top. */
.featured-blog-card__cat-label {
    position: relative;
    z-index: 3;
    display: inline-block;
    background-color: #1a2e2a;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 12px;
    border-radius: 4px;
    text-decoration: none;
    margin-top: 15px;
    width: fit-content; /* Add this */
    max-width: 100%; /* Add this to prevent overflow */
}

/* Styles the card's main title heading. */
.featured-blog-card__title {
    margin-top: 15px;
    margin-bottom: 15px;
    font-size: 1.5rem;
    line-height: 1.3;
}

/* Styles the link within the card's title. */
.featured-blog-card__title a {
    font-family: var(--font-heading);
    color: inherit;
    text-decoration: none;
}

/* Styles the excerpt text of the card. */
.featured-blog-card__excerpt {
    margin-top: 15px;
    font-size: 1rem;
    color: #46505B;
    line-height: 1.6;
    text-decoration: none;
    display: block;
}

/* Styles the "Read More" link at the bottom of the card. */
.featured-blog-card__cta {
    display: inline-block;
    font-size: 0.9rem;
    font-weight: 600;
    color: inherit;
    text-decoration: none;
}

/* Adds a decorative arrow after the CTA text. */
/*
.featured-blog-card__cta::after {
    content: ' →';
}
*/

/* A wrapper for the main button below the blog grid. */
.blog-cta-wrapper {
    margin-top: 30px;
}

/* Styles the main button within the CTA wrapper. */
.blog-cta-wrapper .btn {
    background-color: #111111;
    color: #f0f0f0;
    border: none;
    padding: 14px 40px;
    font-weight: 700;
    font-size: 1rem;
    border-radius: 6px;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

/* The hover state for the main button. */
.blog-cta-wrapper .btn:hover {
    opacity: 0.85;
}

@media (max-width: 1024px) {
    .featured-blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .featured-blog-card__thumbnail img {
        height: 300px;
    }
}

@media (max-width: 600px) {
    .featured-blog-grid {
        grid-template-columns: 1fr;
    }

    .featured-blog-card__thumbnail img {
        height: 200px;
    }

    .blog-cta-wrapper .btn-secondary {
        display: block;
        width: 100%;
    }
}