/* Fullscreen photo lightbox (Sotheby's-style) — no Tailwind utilities required */

.objekt-gallery-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    flex-direction: column;
    width: 100%;
    height: 100%;
    height: 100dvh;
    overflow: hidden;
    background-color: rgba(12, 13, 28, 0.97);
    color: #fff;
    isolation: isolate;
}

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

.objekt-gallery-lightbox__backdrop {
    position: absolute;
    inset: 0;
    z-index: 0;
    cursor: pointer;
    background-color: rgba(12, 13, 28, 0.4);
}

.objekt-gallery-lightbox__toolbar {
    position: relative;
    z-index: 2;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 3.25rem;
    padding: 0.75rem 1.25rem 0.25rem;
}

.objekt-gallery-lightbox__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: transparent;
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.objekt-gallery-lightbox__close:hover {
    border-color: #d6b66e;
    color: #d6b66e;
}

.objekt-gallery-lightbox__close:focus-visible {
    outline: 2px solid #d6b66e;
    outline-offset: 2px;
}

.objekt-gallery-lightbox__counter {
    margin: 0;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-variant-numeric: tabular-nums;
    color: rgba(255, 255, 255, 0.85);
}

.objekt-gallery-lightbox__stage {
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: minmax(3rem, auto) minmax(0, 1fr) minmax(3rem, auto);
    align-items: center;
    gap: 0.5rem;
    min-height: 0;
    width: 100%;
    padding: 0 0.5rem 0.75rem;
}

.objekt-gallery-lightbox__frame {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 0;
    height: 100%;
    max-height: calc(100dvh - 9.5rem);
    margin: 0;
    padding: 0;
}

.objekt-gallery-lightbox__img {
    display: block;
    max-width: 100%;
    max-height: calc(100dvh - 9.5rem);
    width: auto;
    height: auto;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
}

.objekt-gallery-lightbox__arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.92);
    cursor: pointer;
    transition: color 0.15s ease, opacity 0.15s ease;
}

.objekt-gallery-lightbox__arrow:hover:not(:disabled) {
    color: #d6b66e;
}

.objekt-gallery-lightbox__arrow:focus-visible {
    outline: 2px solid #d6b66e;
    outline-offset: 2px;
}

.objekt-gallery-lightbox__arrow svg {
    width: 2rem;
    height: 2rem;
}

.objekt-gallery-lightbox__arrow:disabled {
    opacity: 0.2;
    cursor: default;
}

.objekt-gallery-lightbox__thumbs {
    position: relative;
    z-index: 2;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0.5rem 1rem 1.25rem;
    background: linear-gradient(to top, rgba(12, 13, 28, 1), rgba(12, 13, 28, 0.55));
}

.objekt-gallery-lightbox__thumbs::-webkit-scrollbar {
    display: none;
}

.objekt-gallery-lightbox__thumbs-inner {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 3px;
}

.objekt-gallery-lightbox__thumb {
    position: relative;
    flex: 0 0 auto;
    width: 4.75rem;
    aspect-ratio: 4 / 3;
    padding: 0;
    border: none;
    cursor: pointer;
    background: #181938;
    opacity: 0.65;
    transition: opacity 0.18s ease, box-shadow 0.18s ease;
}

.objekt-gallery-lightbox__thumb.is-active {
    opacity: 1;
    box-shadow: inset 0 0 0 2px #d6b66e;
}

.objekt-gallery-lightbox__thumb:hover {
    opacity: 1;
}

.objekt-gallery-lightbox__thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (min-width: 640px) {
    .objekt-gallery-lightbox__stage {
        grid-template-columns: minmax(4rem, auto) minmax(0, 1fr) minmax(4rem, auto);
        gap: 1rem;
        padding: 0 1rem 1rem;
    }

    .objekt-gallery-lightbox__thumb {
        width: 5.75rem;
    }

    .objekt-gallery-lightbox__arrow svg {
        width: 2.25rem;
        height: 2.25rem;
    }
}

/* Hero: click hint + open button (hidden while lightbox is open) */
.objekt-gallery-main--lightbox-open {
    cursor: zoom-in;
}

.objekt-gallery-open-lightbox {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    padding: 0.4rem 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(24, 25, 56, 0.72);
    color: #fff;
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    cursor: pointer;
    backdrop-filter: blur(2px);
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.objekt-gallery-open-lightbox:hover {
    border-color: #d6b66e;
    color: #d6b66e;
    background: rgba(24, 25, 56, 0.9);
}

.objekt-gallery-open-lightbox:focus-visible {
    outline: 2px solid #d6b66e;
    outline-offset: 2px;
}

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

.objekt-floorplan-lightbox .objekt-gallery-lightbox__stage,
.objekt-floorplan-lightbox .objekt-gallery-lightbox__arrow {
    pointer-events: auto;
}

.objekt-floorplan-lightbox .objekt-floorplan-lightbox__arrow--prev[hidden],
.objekt-floorplan-lightbox .objekt-floorplan-lightbox__arrow--next[hidden] {
    display: none !important;
}

body.pfi-floorplan-lightbox-open {
    overflow: hidden !important;
}

.objekt-virtual-tour-lightbox .objekt-gallery-lightbox__stage {
    grid-template-columns: minmax(0, 1fr);
    place-items: center;
    padding: 0.5rem 1rem 1rem;
}

.objekt-virtual-tour-lightbox .objekt-virtual-tour-lightbox__frame {
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(94vw, 75rem);
    height: min(76dvh, 43rem);
    max-width: 100%;
    max-height: 100%;
    margin: 0 auto;
    background: #000;
}

.objekt-virtual-tour-lightbox .objekt-virtual-tour-lightbox__media {
    display: block;
    width: 100%;
    height: 100%;
    max-height: none;
    aspect-ratio: 16 / 9;
    border: 0;
    background: #000;
}

.objekt-virtual-tour-lightbox .objekt-virtual-tour-lightbox__media:not(iframe) {
    object-fit: contain;
}

@media (max-width: 768px) {
    .objekt-virtual-tour-lightbox .objekt-gallery-lightbox__stage {
        padding: 0.25rem 0.5rem 0.75rem;
    }

    .objekt-virtual-tour-lightbox .objekt-virtual-tour-lightbox__frame {
        width: 96vw;
        height: min(62dvh, 32rem);
    }
}

body.pfi-virtual-tour-lightbox-open {
    overflow: hidden !important;
}

body.pfi-gallery-lightbox-open .objekt-gallery-arrow,
body.pfi-gallery-lightbox-open .objekt-gallery-open-lightbox,
body.pfi-gallery-lightbox-open .objekt-gallery-counter,
body.pfi-gallery-lightbox-open .objekt-gallery-thumbs {
    visibility: hidden;
    pointer-events: none;
}
