.farnost-lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
}

.farnost-lightbox-overlay.is-open {
    display: block;
}

.farnost-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
}

.farnost-lightbox-content {
    position: relative;
    z-index: 2;
    box-sizing: border-box;
    width: min(92vw, 36rem);
    max-height: min(90vh, 40rem);
    margin: 5vh auto;
    padding: 2.5rem 1.5rem 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.farnost-lightbox-image {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: min(75vh, 32rem);
    margin: 0 auto;
    object-fit: contain;
    border-radius: 8px;
    background: #fff;
    padding: 0.75rem;
}

.farnost-lightbox-caption {
    margin: 0;
    color: #fff;
    text-align: center;
    font-size: 0.95rem;
    line-height: 1.4;
    min-height: 1.1em;
}

.farnost-lightbox-caption[hidden] {
    display: none;
}

.farnost-lightbox-close {
    position: absolute;
    top: -0.2rem;
    right: 0;
    width: 46px;
    height: 46px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
}

.farnost-lightbox-close:hover,
.farnost-lightbox-close:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.7);
    outline-offset: 2px;
}

body.farnost-lightbox-no-scroll {
    overflow: hidden;
}

body.farnost-lightbox-no-scroll .farnost-header {
    padding-right: var(--farnost-scrollbar-gutter, 0px);
}

@media (max-width: 767px) {
    .farnost-lightbox-content {
        width: 96vw;
        max-height: 92vh;
        padding: 2.25rem 1rem 1rem;
    }

    .farnost-lightbox-image {
        max-height: min(70vh, 28rem);
    }
}
