#gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
    padding: 10px;
}

#gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 1/1;
    cursor: pointer;
    border-radius: 8px;
    transition: transform 0.2s;
}

#gallery img:hover {
    transform: scale(1.05);
}

.gallery-tabs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    margin-bottom: 40px;
}

button.gallery-tab {
    background-color: #fff;
    color: #54576d;
    padding: 10px 20px;
    border-radius: 0 0 6px 6px;
    text-decoration: none;
    font-weight: 600;
    outline: none;
    border: none;
    cursor: pointer;
    font-family: "Montserrat", sans-serif;
    font-size: min(max(14px, 1.2vw), 16px);
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

button.gallery-tab:hover {
    background-color: #f7f8fb;
    color: #070a37;
}

button.gallery-tab:focus {
    background-color: #f0f1f9;
    color: #070a37;
}

button.gallery-tab.active {
    background-image: linear-gradient(to top, #c7cade, #f0f1f9);
    background-size: 100% 100%;
    background-position: 0% 0%;
    background-repeat: no-repeat;
    color: #070a37;
}

.gallery-btn {
    position: absolute;
    background-color: #fff;
    border: none;
    border-radius: 50%;
    padding: 10px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.gallery-btn:hover {
    background-color: #e4e4e4;
}

.gallery-btn.prev {
    top: 50%;
    transform: translateY(-50%);
    left: 10px;
}

.gallery-btn.next {
    top: 50%;
    transform: translateY(-50%);
    right: 10px;
}

.gallery-btn.exit {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: inherit;
    background-color: transparent;
    padding: 0;
    color: #fff;
}

.gallery-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media all and (max-width: 880px) {
    button.gallery-tab {
        border-radius: 999px;
    }
    .gallery-tabs {
        gap: 6px;
        margin-top: 14px;
        margin-bottom: 20px;
    }
}
