@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@100..900&family=Titan+One&display=swap');

* {
    box-sizing: border-box;
}


html, body {
    margin: 0;
    height: 100%;
}

body {
    background-image: linear-gradient(to right, rgb(159, 215, 149), rgb(105, 231, 187));
    width: 95vw;
    margin: auto;
}

.flex-ctr {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40%;
    height: 100%;
    float: left;
    align-content: center;
    gap: 10px; /* Add this to control spacing between flex items */
}

.box {
    font-family: "Titan One", sans-serif;
    border: 2px solid green;
    padding: 5px;
    border-radius: 10px;
    background-color: rgb(218, 255, 215);
    font-size: 2em;
    color: green;
    box-shadow: 4px 4px 5px;
}

/* Add this class for the description text styling */
.description {
    text-align: center;
    margin-top: 5px; /* Small top margin */
    max-width: 50%; /* Control width of description text */
    font-family: cursive;
}

/* Grid for images*/
.grid-ctr {
    display: grid;
    height: 90%;
    padding: 1%;
    border: 4px solid rgb(39, 86, 14);
    border-radius: 10px;
    box-shadow: 4px 4px 5px gray;
    background-color:lemonchiffon;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr 1fr;
    gap: 4px;
}

.grid {
    width: 50%;
    padding-left: 3%;
}

/* Fix for the grid items to establish positioning context */
.grid-item {
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 10px;
    position: relative; /* Add this to make it a positioning context */
}

/* Images within grid items */
.grid-item img {
    position: relative;
    width: 100%;
    height: 100%;
    object-fit: cover; /* This ensures images cover their container */
    filter: brightness(70%);
    transition: all 2s ease;
}

/*Hover effect*/
.grid-item:hover img{
    filter: brightness(130%);
    transform: scale(1.2); /* Optional: slight zoom effect */
    z-index: 1;
}

/* Fixes for the text overlay */
.text {
    position: absolute;
    font-family: "Outfit", sans-serif;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* Center the text properly */
    display: none;
    color: white; /* Change to white for better visibility */
    padding: 8px 12px;
    border-radius: 5px;
    font-weight: bold;
    font-size: 0.8em;
    z-index: 2;
    pointer-events: none; /* Prevents text from interfering with hover */
    text-align: center;
}

/* Ensure text is not inheriting the global background */
.text {
    background-color: rgba(0, 0, 0, 0.2) !important; /* Override any inherited backgrounds */
}

.grid-item:hover .text {
    display: block;
}

@media (max-width: 700px) {
    .flex-ctr {
        flex-direction: row;
        width: 100%;
        height: fit-content;
        float: none;
    }

    .heading {
        margin-top: 20px;
        margin-bottom: 60px;
    }

    .description {
        font-family: "Outfit", sans-serif;
    }

    .grid-ctr {
        height: fit-content;
        width: 100%;
    }

    .grid {
        width: 100%;
        padding-left: 0;
    }

    .grid-item {
        width: 100%;
        height: auto;
        overflow: hidden;
        border-radius: 10px;
        position: relative; /* Add this to make it a positioning context */
        aspect-ratio: 1/1;
    }
}