#header-search-form {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 600px;
    margin: 0px auto;
    gap: 10px;
    padding: 0px 30px;
}

#header-search-input {
    padding: 15px 20px;
    width: 100%;
    border: none;
    border-radius: 15px;
    box-shadow: 0px 0px 30px 10px rgb(0 0 0 / 2%);
    font-size: 1em;
    background-color: #e9e9e9;
}

/* --- FEATURED --- */

#featured-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 330px);
    gap: 20px;
    margin: 40px auto 0px auto;
    padding: 0px 40px;
    max-width: 1200px;
}

.featured-item {
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
    
    /* Added position and overflow for overlay logic */
    position: relative;
    overflow: hidden;
    text-decoration: none;
    
    background-size: cover;          /* makes the image fill the div */
    background-position: center;     /* centers the image */
    background-repeat: no-repeat;    /* prevents tiling */
    background-color: white;
}

.featured-item:hover {
    opacity: 0.8;
    transform: scale(0.98);
}

/* 🔑 NEW: Text Overlay Gradient for Visibility */
.overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgb(0 0 0 / 45%), rgb(0 0 0 / 0%));
    padding: 40px 25px 25px 25px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

/* Reset or adjust margin for h2 inside the overlay */
#featured-section a h2 {
    margin: 5px; /* Clear margin from the global rule below */
    color: white;
}

.featured-item .feature-image {
    /* Placeholder for background image if not set on .featured-item directly */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}

#featured-1 {
    grid-area: 1 / 1 / 2 / 2;
    border-radius: 10px;
    background-image: url('../Images/Featured/1.png');
}

#featured-2 {
    grid-area: 1 / 2 / 2 / 3;
    border-radius: 10px;
    background-image: url('../Images/Featured/2.png');
}

#featured-3 {
    grid-area: 2 / 1 / 2 / 3;
    border-radius: 10px;
    background-image: url('../Images/Featured/3.png');
}

#featured-4 {
    grid-area: 1 / 3 / 3 / 4;
    border-radius: 10px;
    background-image: url('../Images/Featured/4.png');
}


@media (max-width: 600px) {
    #featured-section {
        display: grid;
        grid-template-columns: 1fr;
        grid-template-rows: repeat(4, 200px);
        gap: 18px;
        margin: 40px auto 0px auto;
        padding: 30px 30px 50px 30px;
        max-width: 1350px;
    }
    
    /* Adjusted padding for the overlay on mobile */
    .overlay {
        padding: 20px 15px 15px 15px; 
    }

    #featured-1 {
        grid-area: 1 / 1 / 2 / 2;
        border-radius: 15px;
    }
    #featured-2 {
        grid-area: 2 / 1 / 2 / 2;
        border-radius: 15px;
    }
    #featured-3 {
        grid-area: 4 / 1 / 3 / 2;
        border-radius: 15px;
    }
    #featured-4 {
        grid-area: 4 / 1 / 4 / 2;
        border-radius: 15px;
    }
}