.gallery-item-trigger {
    position: absolute;
    z-index: 2;
    inset: 0;
    width: 100%;
    border: 0;
    border-radius: inherit;
    background: transparent;
    cursor: zoom-in;
}

.gallery-item-trigger:focus-visible {
    outline: 4px solid #55d9ff;
    outline-offset: -6px;
}

.home-gallery__item:has(.gallery-item-trigger:hover) img {
    transform: scale(1.035);
}

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

.service-gallery-modal {
    position: fixed;
    z-index: 1000;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
}

.service-gallery-modal[hidden] {
    display: none;
}

.service-gallery-modal__backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    border: 0;
    background: rgba(2, 11, 35, .82);
    backdrop-filter: blur(6px);
    cursor: default;
}

.service-gallery-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(1080px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 30px 90px rgba(0, 0, 0, .45);
}

.service-gallery-modal__close {
    position: absolute;
    z-index: 3;
    top: 16px;
    right: 16px;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 50%;
    background: rgba(3, 17, 61, .78);
    color: #fff;
    font-size: 25px;
    cursor: pointer;
}

.service-gallery-modal__content {
    display: grid;
    grid-template-columns: minmax(260px, .8fr) minmax(0, 1.35fr);
    min-height: 540px;
}

.service-gallery-modal__text {
    display: flex;
    justify-content: center;
    flex-direction: column;
    padding: 55px 42px;
}

.service-gallery-modal__text h2 {
    margin: 14px 0 18px;
    color: #06163f;
    font-size: clamp(28px, 4vw, 46px);
    line-height: 1.05;
    letter-spacing: -2px;
}

.service-gallery-modal__text p {
    margin: 0;
    color: #687690;
    font-size: 16px;
    line-height: 1.75;
    white-space: pre-line;
}

.service-gallery-modal__media {
    min-height: 540px;
    background: #06132f;
}

.service-gallery-modal__media img {
    display: block;
    width: 100%;
    height: 100%;
    max-height: calc(100vh - 48px);
    object-fit: contain;
}

.service-gallery-modal__content.is-image-only {
    grid-template-columns: 1fr;
}

.service-gallery-modal__content.is-image-only .service-gallery-modal__text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

@media (max-width: 760px) {
    .service-gallery-modal {
        padding: 12px;
    }

    .service-gallery-modal__dialog {
        max-height: calc(100vh - 24px);
    }

    .service-gallery-modal__content {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .service-gallery-modal__text {
        padding: 34px 24px 26px;
    }

    .service-gallery-modal__media {
        min-height: 300px;
        order: -1;
    }

    .service-gallery-modal__media img {
        max-height: 55vh;
    }
}
