/* Gallery section */

#gallery {
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.12), transparent 34%),
        linear-gradient(135deg, #AA0041 0%, #7D0030 100%);
    padding: 90px 0 100px;
    color: #FFFFFF;
}

#gallery h2 {
    text-align: center;
    font-size: 36px;
    line-height: 1.2;
    font-weight: var(--font-black);
    margin-bottom: 14px;
}

#gallery h2::after {
    content: "";
    display: block;
    width: 82px;
    height: 5px;
    margin: 18px auto 0;
    border-radius: 999px;
    background: #FFFFFF;
    opacity: 0.9;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 34px;
    margin-top: 48px;
    padding: 34px;
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 24px 70px rgba(27, 31, 38, 0.28);
    backdrop-filter: blur(6px);
}

.gallery-item {
    width: 100%;
    aspect-ratio: 4 / 3;
    height: auto;
    display: block;
    object-fit: cover;
    object-position: center;
    border-radius: 18px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.18);
    cursor: pointer;
    transition:
        transform 0.35s ease,
        filter 0.35s ease,
        box-shadow 0.35s ease,
        opacity 0.25s ease;
}

.gallery-item:hover {
    transform: scale(1.045);
    filter: brightness(1.06);
    box-shadow: 0 18px 34px rgba(27, 31, 38, 0.32);
}

.gallery-item.is-hidden {
    display: none;
}

.gallery-more-wrap {
    display: flex;
    justify-content: center;
    margin-top: 34px;
}

.gallery-more-btn {
    min-width: 210px;
    min-height: 46px;
    padding: 12px 28px;
    border: 2px solid rgba(255, 255, 255, 0.75);
    border-radius: 999px;
    background: #FFFFFF;
    color: #AA0041;
    font-family: var(--font-main);
    font-size: 16px;
    font-weight: var(--font-bold);
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.gallery-more-btn:hover {
    transform: translateY(-2px);
    background: transparent;
    color: #FFFFFF;
}

.gallery-more-btn.is-hidden {
    display: none;
}

/* Fullscreen modal */

body.gallery-open {
    overflow: hidden;
}

.gallery-modal {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 34px;
    background: rgba(27, 31, 38, 0.88);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s ease, visibility 0.28s ease;
}

.gallery-modal.active {
    opacity: 1;
    visibility: visible;
}

.gallery-modal__image {
    max-width: min(1100px, 94vw);
    max-height: 86vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 18px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
    cursor: zoom-out;
    transform: scale(0.96);
    transition: transform 0.28s ease;
}

.gallery-modal.active .gallery-modal__image {
    transform: scale(1);
}

.gallery-modal__close {
    position: fixed;
    top: 24px;
    right: 28px;
    z-index: 5001;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: #FFFFFF;
    color: #1B1F26;
    font-size: 34px;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
}

.gallery-modal__close:hover {
    transform: scale(1.08);
    background: #E1E1E2;
}

@media (max-width: 1024px) {
    .gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 26px;
        padding: 26px;
    }
}

@media (max-width: 620px) {
    #gallery {
        padding: 64px 0 72px;
    }

    #gallery h2 {
        font-size: 29px;
    }

    .gallery {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 18px;
        border-radius: 20px;
    }

    .gallery-item {
        aspect-ratio: 3 / 2;
        border-radius: 15px;
        padding: 7px;
    }

    .gallery-modal {
        padding: 18px;
    }

    .gallery-modal__close {
        top: 14px;
        right: 14px;
    }
}