
/* KŠD Lipa Chronicle lightbox gallery */
.chronicle-photo-link {
    display: block;
    position: relative;
    cursor: zoom-in;
}

.chronicle-photo-link img {
    display: block;
}

.chronicle-photo-link::after {
    content: "⌕";
    position: absolute;
    right: .65rem;
    bottom: .65rem;
    width: 2rem;
    height: 2rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(0,0,0,.72);
    color: #fff;
    font-size: 1.25rem;
    opacity: 0;
    transition: opacity .18s ease;
    pointer-events: none;
}

.chronicle-photo-link:hover::after { opacity: 1; }

body.gallery-open { overflow: hidden; }

.chronicle-lightbox[hidden] { display: none !important; }

.chronicle-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
}

.chronicle-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.92);
}

.chronicle-lightbox__panel {
    position: relative;
    z-index: 1;
    width: min(96vw, 1800px);
    height: min(95vh, 1200px);
    display: grid;
    grid-template-rows: auto 1fr auto;
    background: #111;
    color: #fff;
    box-shadow: 0 20px 70px rgba(0,0,0,.5);
}

.chronicle-lightbox__topbar,
.chronicle-lightbox__caption {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .75rem 1rem;
    background: #111;
}

.chronicle-lightbox__scope {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
}

.gallery-scope-btn,
.gallery-original,
.gallery-close {
    border: 1px solid rgba(255,255,255,.35);
    background: transparent;
    color: #fff;
    text-decoration: none;
}

.gallery-scope-btn {
    padding: .45rem .7rem;
    font-size: .78rem;
    font-weight: 800;
}

.gallery-scope-btn.active {
    background: var(--accent, #BDCB48);
    border-color: var(--accent, #BDCB48);
    color: #111;
}

.chronicle-lightbox__actions {
    display: flex;
    align-items: center;
    gap: .6rem;
}

.gallery-original {
    padding: .45rem .7rem;
    font-size: .8rem;
}

.gallery-close {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 2rem;
    line-height: 1;
}

.chronicle-lightbox__stage {
    min-height: 0;
    position: relative;
    display: grid;
    grid-template-columns: 4rem 1fr 4rem;
    align-items: center;
    overflow: hidden;
    background: #050505;
}

.chronicle-lightbox__image-wrap {
    width: 100%;
    height: 100%;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    overscroll-behavior: contain;
}

#galleryImage {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
}

.gallery-nav {
    z-index: 2;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 4rem;
    height: 100%;
    opacity: .75;
}

.gallery-nav:hover { opacity: 1; }
.gallery-nav:disabled { opacity: .15; cursor: default; }

.chronicle-lightbox__caption strong {
    display: block;
    font-size: .95rem;
}

#galleryEvent {
    display: block;
    margin-top: .2rem;
    color: #bbb;
    font-size: .8rem;
}

.gallery-counter {
    white-space: nowrap;
    color: #bbb;
    font-size: .8rem;
}

@media (max-width: 700px) {
    .chronicle-lightbox__panel {
        width: 100vw;
        height: 100dvh;
    }

    .chronicle-lightbox__topbar {
        align-items: flex-start;
    }

    .chronicle-lightbox__stage {
        grid-template-columns: 2.8rem 1fr 2.8rem;
    }

    .gallery-nav { font-size: 3rem; }

    .gallery-original {
        font-size: .72rem;
    }

    .chronicle-lightbox__caption {
        align-items: flex-start;
        font-size: .85rem;
    }

    .chronicle-photo-link::after { opacity: .75; }
}



/* Main/featured photograph */
.featured-photo {
    width: 100%;
    max-width: 100%;
    margin: 0 0 28px 0;
}

.featured-photo .chronicle-photo-link {
    width: 100%;
    max-width: 100%;
}

.featured-photo .hero {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
}

.featured-photo figcaption,
.article-photo figcaption {
    margin-top: 7px;
    font-size: 0.85rem;
    line-height: 1.4;
    color: #666;
}

/* Other event photographs */
.event-photo-grid {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.article-photo {
    min-width: 0;
    max-width: 100%;
}

.article-photo .chronicle-photo-link {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.article-photo img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
}



/* Featured event image - always show the complete photograph */
.featured-photo {
    width: 100%;
    max-width: 100%;
    text-align: center;
}

.featured-photo .chronicle-photo-link {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 100%;
}

.featured-photo img.hero {
    display: block;

    width: auto;
    height: auto;

    max-width: 100%;
    max-height: 70vh;

    object-fit: contain;
    object-position: center;
}

/* Secondary event photos - show complete photo, limit width and height */
.article-photo {
    width: 100%;
    max-width: 100%;
    text-align: center;
}

.article-photo .chronicle-photo-link {
    display: flex;
    justify-content: center;
    align-items: center;

    width: 100%;
    max-width: 100%;
}

.article-photo img {
    display: block;

    width: auto;
    height: auto;

    max-width: 100%;
    max-height: 55vh;

    object-fit: contain;
    object-position: center;
}