/* ------------------------------------------------------------------
   Sysprotec — Project Gallery Lightbox
   Self-contained, dependency-free lightbox for projekte.html
------------------------------------------------------------------ */

/* Make the project image clickable-looking */
.project-card {
    position: relative;
    scroll-margin-top: 120px; /* keeps the fixed navbar from covering an anchor-linked project card */
}
.project-card a.lightbox-link {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: 5px;
    cursor: zoom-in;
}
.project-card a.lightbox-link img {
    transition: transform .35s ease;
    display: block;
    width: 100%;
}
.project-card a.lightbox-link:hover img {
    transform: scale(1.035);
}

/* Zoom hint icon shown on hover */
.lightbox-zoom-hint {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(15, 23, 42, .55);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity .25s ease, transform .25s ease;
    pointer-events: none;
}
.project-card a.lightbox-link:hover .lightbox-zoom-hint {
    opacity: 1;
    transform: translateY(0);
}

/* ------------------------------------------------------------------
   Overlay
------------------------------------------------------------------ */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 12, 18, .94);
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility 0s linear .3s;
    padding: 40px;
}
.lightbox-overlay.is-active {
    opacity: 1;
    visibility: visible;
    transition: opacity .3s ease, visibility 0s;
}

.lightbox-stage {
    position: relative;
    max-width: 96vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    transform: scale(.96);
    transition: opacity .3s ease, transform .3s ease;
}
.lightbox-overlay.is-active .lightbox-stage {
    opacity: 1;
    transform: scale(1);
}

/* Clipping frame for the zoomable image: the picture may be scaled and
   dragged inside it, but never spills over the stage or the controls. */
.lightbox-viewport {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    line-height: 0;
    cursor: zoom-in;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .55);
    touch-action: none;
}
.lightbox-viewport.is-zoomed {
    cursor: grab;
}
.lightbox-viewport.is-zoomed:active {
    cursor: grabbing;
}
.lightbox-viewport img {
    border-radius: 0;
    box-shadow: none;
    transform-origin: center center;
    will-change: transform;
    -webkit-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
}

.lightbox-stage img,
.lightbox-stage video {
    max-width: 96vw;
    max-height: 82vh;
    width: auto;
    height: auto;
    display: block;
    border-radius: 4px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .55);
    background: #111;
}

/* Video teaser card (e.g. the index page video-under-button) */
.video-card {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 5px;
    cursor: pointer;
}
.video-card img {
    display: block;
    width: 100%;
    transition: transform .35s ease;
}
.video-card:hover img {
    transform: scale(1.035);
}
/* Gallery tiles that open a video carry the same play badge as a video card. */
.project-gallery-link .lightbox-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 56px;
    height: 56px;
    margin: -28px 0 0 -28px;
    border-radius: 50%;
    background: rgba(53, 72, 121, .78);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    padding-left: 4px;
    transition: background .25s ease, transform .25s ease;
    pointer-events: none;
    z-index: 2;
}
.project-gallery-link:hover .lightbox-play-icon {
    background: rgba(53, 72, 121, .95);
    transform: scale(1.08);
}

.video-card .lightbox-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 64px;
    height: 64px;
    margin: -32px 0 0 -32px;
    border-radius: 50%;
    background: rgba(53, 72, 121, .78);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    padding-left: 4px; /* optical centering of the play glyph */
    transition: background .25s ease, transform .25s ease;
    pointer-events: none;
}
.video-card:hover .lightbox-play-icon {
    background: rgba(53, 72, 121, .95);
    transform: scale(1.08);
}

.lightbox-caption {
    margin-top: 18px;
    text-align: center;
    color: #fff;
    max-width: 720px;
}
.lightbox-caption-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 4px;
    letter-spacing: .02em;
}
.lightbox-caption-text {
    font-size: 14px;
    margin: 0;
    color: rgba(255, 255, 255, .68);
}

.lightbox-counter {
    position: absolute;
    top: -34px;
    left: 0;
    font-size: 13px;
    color: rgba(255, 255, 255, .55);
    letter-spacing: .05em;
}

/* Controls */
.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .18);
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    transition: background .2s ease, transform .2s ease;
    -webkit-tap-highlight-color: transparent;
}
.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, .18);
}
.lightbox-close:active,
.lightbox-prev:active,
.lightbox-next:active {
    transform: scale(.92);
}

.lightbox-close {
    top: 24px;
    right: 24px;
    width: 46px;
    height: 46px;
    font-size: 18px;
}
.lightbox-prev,
.lightbox-next {
    top: 50%;
    width: 54px;
    height: 54px;
    font-size: 20px;
    transform: translateY(-50%);
}
.lightbox-prev { left: 24px; }
.lightbox-next { right: 24px; }
.lightbox-prev:active,
.lightbox-next:active { transform: translateY(-50%) scale(.92); }

@media (max-width: 767px) {
    .lightbox-overlay { padding: 16px; }
    .lightbox-prev, .lightbox-next {
        width: 42px;
        height: 42px;
        font-size: 16px;
    }
    .lightbox-prev { left: 8px; }
    .lightbox-next { right: 8px; }
    .lightbox-close {
        top: 12px;
        right: 12px;
        width: 40px;
        height: 40px;
    }
    .lightbox-caption-title { font-size: 16px; }
}

/* ---------------------------------------------------------------------------
   Loading indicator
   Full-size images and the ~2 MB video can take a moment; without this the
   overlay opens empty and the click looks like it did nothing.
   ------------------------------------------------------------------------ */
.lightbox-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    display: none;
    transform: translate(-50%, -50%);
    text-align: center;
    color: rgba(255, 255, 255, .85);
    pointer-events: none;
    z-index: 2;
}

.lightbox-overlay.is-loading .lightbox-spinner {
    display: block;
}

.lightbox-spinner-ring {
    display: block;
    width: 42px;
    height: 42px;
    margin: 0 auto 14px;
    border: 2px solid rgba(255, 255, 255, .25);
    border-top-color: rgba(255, 255, 255, .9);
    border-radius: 50%;
    animation: lightbox-spin .9s linear infinite;
}

.lightbox-spinner-label {
    font-size: 13px;
    letter-spacing: .04em;
}

@keyframes lightbox-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .lightbox-spinner-ring {
        animation-duration: 2.4s;
    }
}
