.gallery-section {
    padding: 100px 0;
    /* background: #f3f3f3; */
}

.gallery-section .section-header {
    text-align: center;
    margin-bottom: 55px;
}

.gallery-section .section-header h2 {
    margin: 0;
    font-family: 'Cardo', serif;
    font-size: 38px;
    font-weight: 400;
    line-height: 1.2;
    color: #2a2a2a;
}

.gallery-section .section-header .divider {
    display: block;
    width: 34px;
    height: 2px;
    margin: 16px auto 0;
    background: #2f3f86;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

.gallery-item {
    display: block;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    text-align: left;
    appearance: none;
}

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

.gallery-item__image-wrap {
    position: relative;
    display: block;
    overflow: hidden;
    background: #ddd;
    aspect-ratio: 1 / 1;
}

.gallery-item__image-wrap::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to top, rgba(9, 16, 60, 0.38), rgba(9, 16, 60, 0.05) 45%, rgba(255,255,255,0) 75%);
    opacity: 0;
    transition: opacity 0.45s ease;
    z-index: 2;
    pointer-events: none;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform: scale(1);
    transition:
        transform 0.85s cubic-bezier(0.2, 0.65, 0.2, 1),
        filter 0.45s ease;
    will-change: transform;
}

.gallery-item__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 18, 78, 0.18);
    opacity: 0;
    transition: opacity 0.35s ease;
    z-index: 3;
}

.gallery-item__icon {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Cardo', serif;
    font-size: 34px;
    line-height: 1;
    color: #fff;
    background: rgba(10, 18, 78, 0.88);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.22);
    transform: translateY(12px) scale(0.88);
    transition: transform 0.4s ease;
}

.gallery-item:hover .gallery-item__overlay,
.gallery-item:focus-visible .gallery-item__overlay {
    opacity: 1;
}

.gallery-item:hover .gallery-item__image-wrap::before,
.gallery-item:focus-visible .gallery-item__image-wrap::before {
    opacity: 1;
}

.gallery-item:hover img,
.gallery-item:focus-visible img {
    transform: scale(1.08);
    filter: brightness(0.93);
}

.gallery-item:hover .gallery-item__icon,
.gallery-item:focus-visible .gallery-item__icon {
    transform: translateY(0) scale(1);
}

.gallery-item:focus-visible {
    outline: 2px solid #2f3f86;
    outline-offset: 4px;
}

.gallery-actions {
    text-align: center;
    margin-top: 42px;
}

.gallery-load-more.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 280px;
    padding: 16px 30px;
    border: 0;
    background: #0b1460;
    color: #fff;
    font-family: 'Cardo', serif;
    font-size: 18px;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition:
        background 0.3s ease,
        transform 0.3s ease,
        box-shadow 0.3s ease;
}

.gallery-load-more.btn-primary:hover,
.gallery-load-more.btn-primary:focus-visible {
    background: #16247d;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(11, 20, 96, 0.18);
}

.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
        opacity 0.3s ease,
        visibility 0.3s ease;
}

.gallery-lightbox.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.gallery-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(7px);
}

.gallery-lightbox__dialog {
    position: relative;
    z-index: 2;
    width: min(92vw, 1100px);
    height: min(90vh, 920px);
    margin: 4vh auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-lightbox__content {
    position: relative;
    width: 100%;
    height: 100%;
    padding: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-lightbox__image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    display: block;
    background: #fff;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.28);
}

.gallery-lightbox__close {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 5;
    width: 58px;
    height: 58px;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 54px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 54px;
    height: 54px;
    border: 0;
    border-radius: 50%;
    background: rgba(11, 20, 96, 0.82);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.25s ease, transform 0.25s ease;
}

.gallery-lightbox__nav:hover,
.gallery-lightbox__nav:focus-visible {
    background: rgba(22, 36, 125, 0.95);
}

.gallery-lightbox__nav--prev {
    left: -10px;
}

.gallery-lightbox__nav--next {
    right: -10px;
}

.gallery-lightbox__counter {
    position: absolute;
    left: 18px;
    bottom: 0;
    color: #fff;
    font-size: 14px;
    line-height: 1.2;
}

body.gallery-lightbox-open {
    overflow: hidden;
}

@media (max-width: 1199px) {
    .gallery-section {
        padding: 85px 0;
    }

    .gallery-grid {
        gap: 18px;
    }
}

@media (max-width: 991px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .gallery-section .section-header h2 {
        font-size: 34px;
    }

    .gallery-lightbox__dialog {
        width: min(94vw, 900px);
        height: min(88vh, 780px);
    }
}

@media (max-width: 767px) {
    .gallery-section {
        padding: 70px 0;
    }

    .gallery-section .section-header {
        margin-bottom: 38px;
    }

    .gallery-section .section-header h2 {
        font-size: 30px;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .gallery-item__image-wrap {
        aspect-ratio: 1 / 1;
    }

    .gallery-load-more.btn-primary {
        min-width: 100%;
        padding: 15px 24px;
        font-size: 16px;
    }

    .gallery-lightbox__dialog {
        width: 96vw;
        height: 88vh;
        margin: 6vh auto;
    }

    .gallery-lightbox__content {
        padding: 10px;
    }

    .gallery-lightbox__nav {
        width: 46px;
        height: 46px;
        font-size: 24px;
    }

    .gallery-lightbox__nav--prev {
        left: 6px;
    }

    .gallery-lightbox__nav--next {
        right: 6px;
    }

    .gallery-lightbox__close {
        top: 4px;
        right: 4px;
        width: 50px;
        height: 50px;
        font-size: 42px;
    }

    .gallery-lightbox__counter {
        left: 12px;
        bottom: 8px;
        font-size: 13px;
    }
}