/* ===== Links & general ===== */
a {
    text-decoration: none;
    /* "unset" can be inconsistent */
    transition: all 0.15s;
    color: black !important;
    font-size: 1.5vh;
}


/* ===== Main container ===== */
main {
    text-align: center;
    padding-top: 150px;
}

main h2 {
    font-size: 20px;
    margin-bottom: 20px;
    justify-content: center;
}

/* ===== Filters ===== */
.filters {
    margin: 20px 0;
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    /* allow wrapping on very small screens */
}

.filters span {
    cursor: pointer;
    padding-bottom: 5px;
    position: relative;
    font-size: 20px;
    transition: color 0.3s;
}

.filters .active {
    font-weight: bold;
    color: #000;
}

.filters .active::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background: #000;
    bottom: -3px;
    left: 0;
}

/* ===== Image Grid ===== */
.image-grid {
    display: grid;
    gap: 20px;
    /* spacing between items */
    max-width: 2000px;
    margin: 0 auto;
    /* center container */
    padding: 0 20px;
    /* always have space on left/right */
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 2000px) {
    main h2 {
        font-size: 18px;
    }

    .filters span {
        font-size: 15px;
    }

    .image-grid {
        grid-template-columns: repeat(2, 1fr);
        padding: 0 50px;
        /* slightly smaller on tablet */
    }

    .image-grid {
        display: grid;
        gap: 20px;
        /* spacing between items */
        max-width: 1400px;
        margin: 0 auto;
        /* center container */
        padding: 0 20px;
        /* always have space on left/right */
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 596px) {
    main h2 {
        font-size: 18px;
    }

    .filters span {
        font-size: 15px;
    }


    .image-grid {
        grid-template-columns: 1fr;
        padding: 0 20px;
        /* smaller on mobile */
    }
}


/* ===== Image Cards ===== */
.image-card {
    position: relative;
    cursor: pointer;
}

.image-wrapper {
    position: relative;
    overflow: hidden;
}

.image-card,
.image-grid {
    box-sizing: border-box;
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    display: block;
    transition: transform 0.4s ease, filter 0.4s ease;
    object-fit: cover;
    /* ensure image fills the card without stretching */
}

.image-wrapper .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: background 0.4s ease;
    pointer-events: none;
}

@media (min-width: 1201px) {
    .image-wrapper .overlay {
        background: rgba(0, 0, 0, 0.2);
    }
}


/* Hover effect: dim overlay disappears, image slightly zooms */
.image-card:hover .overlay {
    background: rgba(0, 0, 0, 0);
    /* remove overlay on hover */
}

.image-card:hover img {
    transform: scale(1.05);
}

/* Fixed height for images with object-fit cover */
.image-card img {
    width: 100%;
    height: 400px;
}

@media (max-width: 768px) {
    .image-card img {
        width: 100%;
        height: 400px;
    }
}

@media (max-width: 450px) {
    .image-card img {
        width: 100%;
        height: 300px;
    }
}


/* ===== Text below images ===== */
.text {
    text-align: center;
    margin-top: 10px;
}

.text h3 {
    font-size: 1.5rem;
    margin: 0;
    letter-spacing: 0.5px;
}

.text p {
    font-size: 1.3rem;
    color: #666;
    margin: 3px 0 0;
}

@media only screen and (max-width: 576px) {
    .text h3 {
        font-size: 3rem;
        margin: 0;
        letter-spacing: 0.5px;
    }

    .text p {
        font-size: 2.5rem;
        color: #666;
        margin: 3px 0 0;
    }
}

/* ===== Responsive adjustments ===== */
@media only screen and (max-width: 1200px) {
    main {
        padding-top: 120px;
    }
}

@media only screen and (max-width: 395px) {
    main {
        padding-top: 100px;
    }

    .filters {
        padding-left: 0;
        gap: 15px;
    }
}