/* Spolek Za rozvoj Konské – gallery performance / lightbox v0.9.34 */
.gallery-view-hint {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 6px 0 16px;
    padding: 12px 15px;
    border: 1px solid var(--ds-border, #dbe6e0);
    border-radius: var(--ds-radius-control, 10px);
    background: var(--ds-surface-soft, #f4f8f6);
    color: var(--ds-text-muted, #5e6f66);
    font-size: 13px;
}

.gallery-view-hint strong {
    color: var(--ds-text, #173228);
}

.photo-grid > a {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: var(--ds-radius-card, 14px);
    background: #edf3f0;
    aspect-ratio: 4 / 3;
    cursor: zoom-in;
}

.photo-grid > a::after {
    content: "↗";
    position: absolute;
    right: 9px;
    bottom: 9px;
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 999px;
    background: rgba(0, 45, 30, .72);
    color: #fff;
    font-size: 14px;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity .18s ease, transform .18s ease;
}

.photo-grid > a:hover::after,
.photo-grid > a:focus-visible::after {
    opacity: 1;
    transform: translateY(0);
}

.photo-grid img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
    transition: transform .22s ease;
}

.photo-grid > a:hover img {
    transform: scale(1.025);
}

.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 28px 76px 54px;
    background: rgba(4, 13, 10, .94);
    color: #fff;
}

.gallery-lightbox.is-open {
    display: flex;
}

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

.gallery-lightbox__stage {
    position: relative;
    display: flex;
    width: min(1500px, 100%);
    height: min(86vh, 980px);
    align-items: center;
    justify-content: center;
}

.gallery-lightbox__image {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .42);
}

.gallery-lightbox__close,
.gallery-lightbox__nav {
    position: absolute;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .14);
    color: #fff;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: background .16s ease, transform .16s ease;
}

.gallery-lightbox__close:hover,
.gallery-lightbox__nav:hover,
.gallery-lightbox__close:focus-visible,
.gallery-lightbox__nav:focus-visible {
    background: rgba(255, 255, 255, .24);
    outline: 2px solid rgba(255, 255, 255, .65);
    outline-offset: 2px;
}

.gallery-lightbox__close {
    top: 18px;
    right: 20px;
    width: 46px;
    height: 46px;
    font-size: 26px;
}

.gallery-lightbox__nav {
    top: 50%;
    width: 50px;
    height: 50px;
    transform: translateY(-50%);
    font-size: 29px;
}

.gallery-lightbox__nav:hover {
    transform: translateY(-50%) scale(1.04);
}

.gallery-lightbox__prev { left: 15px; }
.gallery-lightbox__next { right: 15px; }

.gallery-lightbox__footer {
    position: absolute;
    right: 20px;
    bottom: 16px;
    left: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-height: 32px;
    font-size: 13px;
    color: rgba(255, 255, 255, .78);
}

.gallery-lightbox__caption {
    max-width: min(680px, 70vw);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gallery-lightbox__original {
    color: #fff;
    font-weight: 750;
    text-decoration: underline;
    text-underline-offset: 3px;
}

@media (max-width: 760px) {
    .gallery-view-hint {
        display: grid;
        gap: 3px;
        font-size: 13px;
    }

    .photo-grid {
        gap: 8px;
    }

    .photo-grid > a::after {
        opacity: 1;
        transform: none;
        width: 28px;
        height: 28px;
        right: 7px;
        bottom: 7px;
        font-size: 12px;
    }

    .gallery-lightbox {
        padding: 62px 8px 72px;
    }

    .gallery-lightbox__stage {
        width: 100%;
        height: calc(100dvh - 142px);
    }

    .gallery-lightbox__close {
        top: 9px;
        right: 9px;
        width: 44px;
        height: 44px;
    }

    .gallery-lightbox__nav {
        top: auto;
        bottom: 12px;
        width: 46px;
        height: 46px;
        transform: none;
    }

    .gallery-lightbox__nav:hover {
        transform: scale(1.03);
    }

    .gallery-lightbox__prev { left: 9px; }
    .gallery-lightbox__next { right: 9px; }

    .gallery-lightbox__footer {
        right: 64px;
        bottom: 20px;
        left: 64px;
        display: grid;
        justify-items: center;
        gap: 1px;
        line-height: 1.25;
        text-align: center;
    }

    .gallery-lightbox__caption {
        max-width: 100%;
        font-size: 12px;
    }
}

@media (max-width: 430px) {
    .photo-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .photo-grid > a {
        border-radius: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .photo-grid img,
    .photo-grid > a::after,
    .gallery-lightbox__close,
    .gallery-lightbox__nav {
        transition: none;
    }
}
