body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow-x: hidden;
}

.topic-area {
    flex: 1 1 auto; /* Flex grow, shrink and basis set to auto */
    text-decoration: none;
    color: white;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease-in-out;
    height: 100%; /* Ensures equal division of height among three buttons */
}

.topic-area:hover {
    transform: scale(1.05);
    z-index: 2;
}

.topic-area::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(0, 0, 0, 0.7); /* Dark overlay for better text visibility */
    transition: all 0.3s ease-in-out;
}

.topic-area:hover::before {
    background: rgba(0, 0, 0, 0.5);
}

.overlay {
    position: relative;
    z-index: 1;
    /*background-color: rgba(0, 0, 0, 0.5);  Slight background to enhance text readability */
    padding: 20px;
    border-radius: 10px;
    font-size: 26px;
    font-weight: bold; /* Bold text for better visibility */
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7); /* Text shadow for depth */
}

@media only screen and (max-width: 600px) {
    .topic-area:hover {
        transform: none;
    }
    .overlay {
        font-size: 20px; /* Adjust font size for smaller screens */
    }
}

#concrete-technology-media {
    background: url('https://i.imgur.com/AGVHaaU.png') no-repeat center center;
    background-size: cover;
    width: 100%;
}

#environmental {
    background: url('https://i.imgur.com/ipKLu3h.png') no-repeat center center;
    background-size: cover;
    width: 100%;
}

#water-resource {
    background: url('https://i.imgur.com/f6PjG8J.png') no-repeat center center;
    background-size: cover;
    width: 100%;
}

.title-description {
    flex-shrink: 0;
}

.section {
    text-align: center;
    /* Other styling as needed */
}

#section0{
    /* background-image: url(../images/gallery/environmental-background-dimmed.png); */
    background-color: #999DA0;
    background-size: cover;
    color: white;
}

#section0 h1 {
    color: white;
    /* Other styling as needed */
}

.buttons {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    margin-top: 1rem;
    width: 100%;
    flex-grow: 1;
}

@media only screen and (max-width: 768px) {
    .buttons {
        flex-direction: column;
    }

    .title-description h1 {
        font-size: 1.2rem; /* Slightly larger font size for readability */
    }

    .title-description p {
        font-size: 0.9rem;
    }

    .topic-area {
        height: calc(100vh / 5); /* Each button takes one-third of the screen height */
    }
}

/* Further adjustments for very small screens */
@media only screen and (max-width: 600px) {
    .title-description h1 {
        font-size: 1rem;
    }

    .title-description p {
        font-size: 0.8rem;
    }

    .overlay {
        font-size: 16px; /* Smaller font size in overlays for better fit */
        padding: 10px; /* Reduce padding to save space */
    }
}