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

.gallery-card__button {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.gallery-card__button--static {
    cursor: default;
}

.gallery-card__button:hover,
.gallery-card__button:focus-visible {
    background: transparent;
}

.collection-photo .related-news__slide {
    display: flex;
    height: auto;
}

.collection-photo .related-news__slide > * {
    width: 100%;
    height: 100%;
}

.collection-photo .news-card {
    height: 100%;
}

.collection-photo .gallery-card__button,
.collection-photo .gallery-card__button--static {
    align-items: stretch;
    min-height: 100%;
}

.collection-photo .gallery-card__button,
.collection-photo .gallery-card__button * {
    cursor: pointer;
}

.collection-photo .gallery-card__button--static,
.collection-photo .gallery-card__button--static * {
    cursor: default;
}

.collection-photo .gallery-card__content {
    display: grid;
    grid-template-rows: minmax(2.1em, auto) minmax(4.95rem, auto);
    align-content: start;
    min-height: 0;
}

.collection-photo .gallery-card__meta {
    min-height: 2.1em;
}

.collection-photo .gallery-card__title {
    min-height: 4.95rem;
}

.collection-photo .gallery-card__image-wrap {
    margin-top: auto;
}

.photo-modal-shell {
    position: fixed;
    inset: 0;
    z-index: 100;
}

.photo-modal-shell[hidden] {
    display: none;
}

.photo-modal-shell__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 26, 22, 0.72);
}

.photo-modal-shell__dialog {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    padding: 16px;
}

.photo-modal-shell__panel {
    position: relative;
    width: min(100%, 1320px);
    max-height: calc(100vh - 32px);
    padding: 24px;
    overflow-y: auto;
    background: var(--color-surface);
}

.photo-modal-shell__close {
    position: sticky;
    top: 16px;
    margin-left: auto;
    display: block;
    width: 44px;
    height: 44px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    z-index: 5;
}

.photo-modal-shell__close::before,
.photo-modal-shell__close::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 18px;
    height: 2px;
    background: currentColor;
}

.photo-modal-shell__close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.photo-modal-shell__close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.photo-modal-shell__body.is-loading {
    min-height: 320px;
}

.photo-modal-shell__error {
    padding: 48px 24px;
    font-size: 1.5rem;
    text-align: center;
}

.photo-modal-content {
    display: grid;
    gap: 28px;
}

.photo-modal-content__header {
    position: sticky;
    top: -24px;
    z-index: 4;
    margin: -24px -24px 0;
    padding: 24px 76px 16px 24px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(53, 107, 57, 0.12);
}

.photo-modal-content__meta {
    display: grid;
    gap: 8px;
}

.photo-modal-content__date {
    color: var(--color-text-muted);
    font-size: 1.125rem;
}

.photo-modal-content__title {
    margin: 0;
    font-size: clamp(2rem, 3vw, 3rem);
    line-height: 1.1;
}

.photo-modal-content__viewer {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) 64px;
    align-items: center;
    gap: 18px;
}

.photo-modal-content__caption {
    margin: -8px 0 0;
    min-height: 1.5em;
    color: var(--color-text-muted);
    font-size: 1.5rem;
    line-height: 1.5;
    text-align: center;
}

.photo-modal-content__caption.is-empty {
    visibility: hidden;
}

.photo-modal-content__nav {
    width: 60px;
    min-width: 60px;
    height: 60px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-text, #000000);
    border-radius: 50%;
    background: var(--color-surface, #ffffff);
    color: var(--color-accent, #009b7c);
    transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out, color 0.2s ease-in-out, opacity 0.2s ease-in-out;
}

.photo-modal-content__nav svg {
    width: 27px;
    height: 27px;
    display: block;
}

.photo-modal-content__nav:hover,
.photo-modal-content__nav:focus-visible {
    color: #ffffff;
    border-color: var(--color-accent, #009b7c);
    background: var(--color-accent, #009b7c);
}

.photo-modal-content__stage {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 520px;
    background: #eef3ed;
    overflow: hidden;
}

.photo-modal-content__stage-image {
    display: block;
    width: 100%;
    height: 100%;
    max-height: 720px;
    object-fit: contain;
}

.photo-modal-content__thumbs {
    display: flex;
    gap: 18px;
    overflow-x: auto;
    padding-inline: calc(50% - 80px);
    padding-bottom: 8px;
    scroll-behavior: smooth;
}

.photo-modal-content__thumb {
    flex: 0 0 160px;
    height: 160px;
    padding: 0;
    border: 2px solid transparent;
    background: transparent;
    overflow: hidden;
}

.photo-modal-content__thumb.is-active {
    border-color: var(--color-accent-strong);
    box-shadow: 0 0 0 2px rgba(53, 107, 57, 0.16);
}

.photo-modal-content__thumb-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-modal-related {
    display: grid;
    gap: 18px;
    padding-top: 12px;
}

.photo-modal-related__title {
    margin: 0;
    font-size: clamp(1.75rem, 2.6vw, 2.4rem);
    line-height: 1.1;
}

.photo-modal-related__slider {
    position: relative;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    padding-inline: 88px;
}

.photo-modal-related__grid {
    display: flex;
    align-items: flex-start;
}

.photo-modal-related__slide {
    height: auto;
}

.photo-modal-related__nav {
    position: absolute;
    top: 50%;
    z-index: 2;
    transform: translateY(-50%);
    width: 60px;
    min-width: 60px;
    height: 60px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-text, #000000);
    border-radius: 50%;
    background: var(--color-surface, #ffffff);
    color: var(--color-accent, #009b7c);
    transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out, color 0.2s ease-in-out, opacity 0.2s ease-in-out;
}

.photo-modal-related__nav--prev {
    left: 0;
}

.photo-modal-related__nav svg,
.photo-modal-content__nav svg {
    width: 27px;
    height: 27px;
    display: block;
}

.photo-modal-related__nav--next {
    right: 0;
}

.photo-modal-related__nav.swiper-button-disabled {
    opacity: .35;
    pointer-events: none;
}

.photo-modal-related__nav.swiper-button-lock {
    display: none;
}

.photo-modal-related__nav:hover,
.photo-modal-related__nav:focus-visible {
    color: #ffffff;
    border-color: var(--color-accent, #009b7c);
    background: var(--color-accent, #009b7c);
}

.photo-modal-related-card__button {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 240px;
    padding: 0;
    border: 0;
    background: transparent;
    text-align: left;
    margin: 0 auto;
    gap: 0;
}

.photo-modal-related-card__button--static {
    cursor: default;
}

.photo-modal-related-card__image {
    width: 100%;
    aspect-ratio: 1 / 0.82;
    object-fit: cover;
    object-position: center;
    background: var(--color-surface-muted);
}

.photo-modal-related-card__title {
    display: block;
    margin-top: 8px;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
}

@media (max-width: 991px) {
    .photo-modal-shell__panel {
        padding: 20px;
    }

    .photo-modal-content__header {
        top: -20px;
        margin: -20px -20px 0;
        padding: 20px 72px 16px 20px;
    }

    .photo-modal-content__viewer {
        grid-template-columns: 48px minmax(0, 1fr) 48px;
        gap: 12px;
    }

    .photo-modal-content__nav {
        width: 48px;
        height: 48px;
    }

    .photo-modal-content__stage {
        min-height: 420px;
    }

    .photo-modal-related__slider {
        padding-inline: 56px;
    }

}

@media (max-width: 767px) {
    .photo-modal-shell__dialog {
        padding: 0;
    }

    .photo-modal-shell__panel {
        width: 100%;
        max-height: 100vh;
        padding: 18px;
    }

    .photo-modal-content__header {
        top: -18px;
        margin: -18px -18px 0;
        padding: 18px 64px 14px 18px;
    }

    .photo-modal-content__viewer {
        grid-template-columns: 1fr;
    }

    .photo-modal-content__nav {
        position: absolute;
        top: 50%;
        z-index: 1;
        transform: translateY(-50%);
    }

    .photo-modal-content__nav--prev {
        left: 12px;
    }

    .photo-modal-content__nav--next {
        right: 12px;
    }

    .photo-modal-content__stage {
        position: relative;
        min-height: 280px;
    }

    .photo-modal-content__thumb {
        flex-basis: 96px;
        height: 96px;
    }

    .photo-modal-content__thumbs {
        padding-inline: calc(50% - 48px);
    }

    .photo-modal-content__caption {
        font-size: 1.25rem;
    }

    .photo-modal-related__nav {
        display: none;
    }

    .photo-modal-related__slider {
        padding-inline: 0;
    }

    .photo-modal-related-card__title {
        font-size: 1.125rem;
    }

}
