/* Seitenweites Hintergrundbild */
.page-bg {
    background: url('bilder/20241017_182401.jpg')
                no-repeat center center;
    background-color: #000; /* Fallback, falls Bild noch lädt / fehlt */
    background-size: cover;
}

/* Pinned Hintergrund nur auf Desktop-Geräten: background-attachment: fixed
   verursacht auf Mobilgeräten Repaint-Jank beim Scrollen und wird von
   iOS Safari nicht unterstützt (stiller Fallback auf scroll). */
@media (hover: hover) and (pointer: fine) {
    .page-bg {
        background-attachment: fixed;
    }
}

/* Carousel-Container feste Höhe */
.carousel-inner {
    height: 520px;
}

/* Inaktive Slides verbergen */
.carousel-item {
    display: none;
}

/* Aktiven Slide zentrieren */
.carousel-item.active {
    height: 520px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Medien-Previews feste Höhe, keine Verzerrung */
.carousel-item img,
.carousel-item video {
    height: 480px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

/* Hover-Effekt für Carousel-Medien */
.carousel-item img:hover,
.carousel-item video:hover {
    opacity:0.85;
    transform: scale(1.02);
    box-shadow:0 4px 20px rgba(0,0,0,0.4);
}

/* Mobile: feste Medien-Höhe (480px) übersteigt auf schmalen Viewports den
   Container bei hochformatigen Medien → Horizontal-Overflow. Daher Breite an
   den Container anpassen und Höhe dynamisch begrenzen. Steht nach den
   Basisregeln und überschreibt diese (gleiche Spezifität, spätere Reihenfolge). */
@media (max-width:575.98px) {
    .carousel-inner {
        height: auto;
    }
    .carousel-item.active {
        height: auto;
    }
    .carousel-item img,
    .carousel-item video {
        width:100%;
        height: auto;
        max-height:400px;
    }
}

/* ── Lightbox Modal ───────────────────────────── */

/* Modal overlay */
#lightboxModal .modal-content {
    background: rgba(0,0,0,0.95);
}

#lightboxModal .modal-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
 background: #1a1a1a;
}

#lightboxModal .modal-footer {
    background: #1a1a1a;
    border-top: none;
    padding: 1rem;
}

#lightboxModal .btn-close {
    filter: invert(1);
}

/* Lightbox button hover */
#lightboxClose:hover,
#lightboxDownload:hover,
#lightboxPrev:hover,
#lightboxNext:hover {
    background-color: rgba(255, 255, 255, 0.3) !important;
}

/* Lightbox navigation buttons */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 10;
    color: white;
    text-decoration: none;
}

.lightbox-nav:hover {
    background: rgba(0, 0, 0, 0.8);
    color: white;
}

.lightbox-prev {
    left: 1rem;
}

.lightbox-next {
    right: 1rem;
}

.lightbox-nav svg {
    width:32px;
    height:32px;
}

/* Lightbox download button */
.lightbox-download-btn {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 0.375rem;
    padding: 0.375rem 1rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.lightbox-download-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Lightbox media container (modal-body) */
.lightbox-body {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding:0;
    overflow: hidden;
    flex:1;
    min-height:0;
}

.lightbox-counter {
    color: #fff;
    font-size: 0.9rem;
    opacity: 0.7;
    margin-top: 0.5rem;
}

/* Responsive adjustments */
@media (max-width: 767.98px) {
    #lightboxModal .modal-body {
        min-height: 70vh;
    }
}

/* ── „In Lightbox öffnen"-Button für Video-Slides ─────────
   Pro Video-Slide per JS injiziert (siehe Lightbox-Script in
   index.html). Separate Buttons sind nötig, weil Klicks auf das
   <video>-Element selbst von den nativen Video-Controls
   (Shadow-DOM) verbraucht werden und kein zuverlässiges
   JS-Click-Event auslösen. .carousel-item ist bereits
   position: relative (Bootstrap); z-index 2 liegt über den
   Carousel-Steuerungspfeilen (z-index 1). */
.carousel-item .video-lightbox-btn {
    position: absolute;
    top:0.75rem;
    right:0.75rem;
    z-index:2;
    width:48px;
    height:48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius:50%;
    background: rgba(0,0,0,0.55);
    color: #fff;
    cursor: pointer;
    transition: background 0.2s ease;
}

.carousel-item .video-lightbox-btn:hover,
.carousel-item .video-lightbox-btn:focus-visible {
    background: rgba(0,0,0,0.8);
}

.carousel-item .video-lightbox-btn svg {
    width:24px;
    height:24px;
}
