.aerobel-gallery {
    padding: 34px 0 76px;
    color: #1f2821;
}

.aerobel-gallery__heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 30px;
}

.aerobel-gallery__title {
    margin: 0 0 12px;
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.08;
    font-weight: 700;
}

.aerobel-gallery__lead {
    max-width: 850px;
    margin: 0;
    color: #626c64;
    font-size: 17px;
    line-height: 1.55;
}

.aerobel-gallery__admin {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-height: 46px;
    padding: 11px 18px;
    border: 1px solid #58b947;
    border-radius: 11px;
    color: #398d2f;
    font-weight: 600;
    text-decoration: none;
    transition: background-color .2s ease, color .2s ease, transform .2s ease;
}

.aerobel-gallery__admin:hover {
    background: #58b947;
    color: #fff;
    transform: translateY(-1px);
}

.aerobel-gallery__tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 26px;
    padding: 5px;
    overflow-x: auto;
    border-radius: 15px;
    background: #f2f6f1;
    scrollbar-width: thin;
}

.aerobel-gallery__tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 160px;
    min-height: 50px;
    padding: 10px 20px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: #4a554c;
    font: inherit;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease, box-shadow .2s ease;
}

.aerobel-gallery__tab:hover {
    color: #318227;
}

.aerobel-gallery__tab.is-active {
    background: #58b947;
    color: #fff;
    box-shadow: 0 7px 20px rgba(53, 145, 44, .22);
}

.aerobel-gallery__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .2);
    font-size: 13px;
}

.aerobel-gallery__tab:not(.is-active) .aerobel-gallery__count {
    background: #fff;
    color: #68716a;
}

.aerobel-gallery__panel[hidden] {
    display: none;
}

.aerobel-gallery__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.aerobel-gallery__card {
    display: flex;
    min-width: 0;
    overflow: hidden;
    flex-direction: column;
    border: 1px solid #e6ebe5;
    border-radius: 13px;
    background: #fff;
    color: #202822;
    text-align: left;
    box-shadow: 0 8px 24px rgba(31, 53, 34, .07);
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.aerobel-gallery__card:hover {
    border-color: rgba(88, 185, 71, .6);
    transform: translateY(-4px);
    box-shadow: 0 16px 34px rgba(31, 53, 34, .14);
}

.aerobel-gallery__image-wrap:focus-visible,
.aerobel-gallery__card-nav:focus-visible,
.aerobel-gallery__tab:focus-visible,
.aerobel-gallery-modal button:focus-visible {
    outline: 3px solid rgba(88, 185, 71, .42);
    outline-offset: 3px;
}

.aerobel-gallery__card-carousel {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #edf1ed;
}

.aerobel-gallery__image-wrap {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border: 0;
    background: #edf1ed;
    cursor: zoom-in;
}

.aerobel-gallery__image-wrap[hidden] {
    display: none;
}

.aerobel-gallery__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .45s ease;
}

.aerobel-gallery__card:hover .aerobel-gallery__image {
    transform: scale(1.045);
}

.aerobel-gallery__zoom {
    position: absolute;
    right: 15px;
    bottom: 15px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .2s ease, transform .2s ease;
}

.aerobel-gallery__zoom::before,
.aerobel-gallery__zoom::after {
    content: '';
    position: absolute;
}

.aerobel-gallery__zoom::before {
    left: 12px;
    top: 10px;
    width: 13px;
    height: 13px;
    border: 2px solid #449e38;
    border-radius: 50%;
}

.aerobel-gallery__zoom::after {
    left: 25px;
    top: 25px;
    width: 9px;
    height: 2px;
    background: #449e38;
    transform: rotate(45deg);
    transform-origin: left center;
}

.aerobel-gallery__card:hover .aerobel-gallery__zoom,
.aerobel-gallery__image-wrap:focus-visible .aerobel-gallery__zoom {
    opacity: 1;
    transform: translateY(0);
}

.aerobel-gallery__card-nav {
    position: absolute;
    z-index: 3;
    top: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .94);
    color: #35882b;
    font: inherit;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transform: translateY(-50%);
    box-shadow: 0 5px 16px rgba(0, 0, 0, .18);
    transition: color .2s ease, background-color .2s ease, opacity .2s ease;
}

.aerobel-gallery__card:hover .aerobel-gallery__card-nav,
.aerobel-gallery__card-nav:focus-visible {
    opacity: 1;
}

.aerobel-gallery__card-nav:hover {
    background: #58b947;
    color: #fff;
}

.aerobel-gallery__card-nav--prev {
    left: 12px;
}

.aerobel-gallery__card-nav--next {
    right: 12px;
}

.aerobel-gallery__card-position {
    position: absolute;
    z-index: 2;
    right: 12px;
    bottom: 12px;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(22, 29, 23, .7);
    color: #fff;
    font-size: 12px;
    line-height: 1;
}

.aerobel-gallery__caption {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    flex-direction: column;
    gap: 7px;
    min-height: 74px;
    padding: 16px 18px;
    font-size: 16px;
    line-height: 1.4;
    font-weight: 600;
}

.aerobel-gallery__photo-count {
    color: #778078;
    font-size: 13px;
    font-weight: 400;
}

.aerobel-gallery__empty {
    padding: 52px 24px;
    border: 1px solid #e0e7df;
    border-radius: 13px;
    background: #f6faf5;
    text-align: center;
}

.aerobel-gallery__empty h2 {
    margin: 0 0 10px;
}

.aerobel-gallery__empty p {
    margin: 0 0 22px;
    color: #68716a;
}

.aerobel-gallery-modal {
    position: fixed;
    z-index: 10050;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 76px;
    visibility: hidden;
    opacity: 0;
    transition: opacity .2s ease, visibility .2s ease;
}

.aerobel-gallery-modal.is-open {
    visibility: visible;
    opacity: 1;
}

.aerobel-gallery-modal__backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: rgba(15, 20, 16, .88);
    cursor: zoom-out;
}

.aerobel-gallery-modal__content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(1280px, 100%);
    height: min(88vh, 900px);
}

.aerobel-gallery-modal__figure {
    display: flex;
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
    flex-direction: column;
    border-radius: 13px;
    background: #111611;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .4);
}

.aerobel-gallery-modal__image {
    display: block;
    width: 100%;
    min-height: 0;
    flex: 1 1 auto;
    object-fit: contain;
}

.aerobel-gallery-modal__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 68px;
    padding: 15px 20px;
    background: #fff;
}

.aerobel-gallery-modal__title {
    font-size: 16px;
    line-height: 1.4;
    font-weight: 600;
}

.aerobel-gallery-modal__position {
    flex: 0 0 auto;
    color: #737b74;
    font-size: 14px;
}

.aerobel-gallery-modal__close,
.aerobel-gallery-modal__nav {
    position: absolute;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .95);
    color: #253028;
    cursor: pointer;
    box-shadow: 0 7px 22px rgba(0, 0, 0, .24);
    transition: background-color .2s ease, color .2s ease, transform .2s ease;
}

.aerobel-gallery-modal__close:hover,
.aerobel-gallery-modal__nav:hover {
    background: #58b947;
    color: #fff;
}

.aerobel-gallery-modal__close {
    top: -17px;
    right: -17px;
    width: 46px;
    height: 46px;
    font-size: 34px;
    line-height: 1;
}

.aerobel-gallery-modal__nav {
    top: 50%;
    width: 52px;
    height: 52px;
    font-size: 42px;
    transform: translateY(-50%);
}

.aerobel-gallery-modal__nav:hover {
    transform: translateY(-50%) scale(1.06);
}

.aerobel-gallery-modal__nav--prev {
    left: -66px;
}

.aerobel-gallery-modal__nav--next {
    right: -66px;
}

body.aerobel-gallery-modal-open {
    overflow: hidden;
}

@media (max-width: 991px) {
    .aerobel-gallery__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px;
    }

    .aerobel-gallery-modal {
        padding: 20px 58px;
    }

    .aerobel-gallery-modal__nav--prev {
        left: -52px;
    }

    .aerobel-gallery-modal__nav--next {
        right: -52px;
    }
}

@media (max-width: 640px) {
    .aerobel-gallery {
        padding: 22px 0 52px;
    }

    .aerobel-gallery__heading {
        display: block;
        margin-bottom: 22px;
    }

    .aerobel-gallery__lead {
        font-size: 15px;
    }

    .aerobel-gallery__admin {
        width: 100%;
        margin-top: 18px;
    }

    .aerobel-gallery__tabs {
        margin-right: -15px;
        margin-left: -15px;
        padding-right: 15px;
        padding-left: 15px;
        border-radius: 0;
    }

    .aerobel-gallery__tab {
        min-width: 138px;
        min-height: 46px;
        padding: 9px 15px;
    }

    .aerobel-gallery__grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .aerobel-gallery__caption {
        min-height: 64px;
        padding: 14px 16px;
        font-size: 15px;
    }

    .aerobel-gallery__zoom {
        opacity: 1;
        transform: none;
    }

    .aerobel-gallery__card-nav {
        width: 38px;
        height: 38px;
        opacity: 1;
    }

    .aerobel-gallery-modal {
        padding: 54px 10px 12px;
    }

    .aerobel-gallery-modal__content {
        height: 100%;
    }

    .aerobel-gallery-modal__figure {
        border-radius: 10px;
    }

    .aerobel-gallery-modal__footer {
        align-items: flex-start;
        min-height: 78px;
        padding: 13px 15px;
    }

    .aerobel-gallery-modal__title {
        font-size: 14px;
    }

    .aerobel-gallery-modal__close {
        top: -45px;
        right: 0;
        width: 40px;
        height: 40px;
        font-size: 30px;
    }

    .aerobel-gallery-modal__nav {
        top: auto;
        bottom: 92px;
        width: 44px;
        height: 44px;
        background: rgba(255, 255, 255, .9);
        font-size: 36px;
        transform: none;
    }

    .aerobel-gallery-modal__nav:hover {
        transform: none;
    }

    .aerobel-gallery-modal__nav--prev {
        left: 12px;
    }

    .aerobel-gallery-modal__nav--next {
        right: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .aerobel-gallery *,
    .aerobel-gallery *::before,
    .aerobel-gallery *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}
