/* ==========================================================================
   BILDERSCHAU (Fotos in den Projekten) – gehört zu js/bilderschau.js
   Ohne JavaScript erscheinen die Fotos als untereinander stehende Liste mit Beschriftung.
   ========================================================================== */

.bs {
    --bs-green: #2d6a4f;
    --bs-ink: #1f2420;
    --bs-line: #d9ddd6;
    --bs-soft: #e6e9e2;
    margin: 1.4rem 0;
    font-family: 'Inter', Arial, sans-serif;
    color: var(--bs-ink);
    break-inside: avoid;
}

.bs .bs-slides { margin: 0; padding: 0; list-style: none; }
.bs .bs-figure { margin: 0; }
.bs .bs-figure img { display: block; max-width: 100%; height: auto; }
.bs figcaption {
    margin-top: 6px;
    font-size: 0.95rem;
    font-style: italic;
    line-height: 1.45;
    color: #333;
}

/* ----- ohne JavaScript: Liste ----- */
.bs:not(.is-live) .bs-slide { margin: 0 0 18px; }
.bs:not(.is-live) .bs-figure img { width: 100%; border-radius: 8px; }

/* ----- mit JavaScript: Bilderschau ----- */
.bs.is-live .bs-frame {
    position: relative;
    aspect-ratio: 16 / 10;
    max-height: 75vh;
    width: 100%;
    background: var(--bs-soft);
    border-radius: 10px;
    overflow: hidden;
    touch-action: pan-y;
}

.bs.is-live .bs-slides { position: absolute; inset: 0; }

.bs.is-live .bs-slide { display: none; position: absolute; inset: 0; }
.bs.is-live .bs-slide.is-active { display: block; animation: bs-in 0.35s ease; }

/* unscharfe Fassung des eigenen Fotos füllt die Flächen neben Hochformat-Bildern */
.bs.is-live .bs-slide::before {
    content: "";
    position: absolute;
    inset: -24px;
    background: var(--bg) center / cover no-repeat;
    filter: blur(22px) brightness(0.8);
}

.bs.is-live .bs-figure { position: absolute; inset: 0; }

.bs.is-live .bs-figure img {
    -webkit-user-drag: none;
    user-select: none;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 0;
    cursor: zoom-in;
}

.bs.is-live figcaption { display: none; }

@keyframes bs-in { from { opacity: 0; } to { opacity: 1; } }

.bs-arrow,
.bs-zoom {
    position: absolute;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: #fff;
    background: rgba(0, 0, 0, 0.5);
    border: 0;
    border-radius: 50%;
    cursor: pointer;
}

.bs-arrow:hover,
.bs-zoom:hover { background: rgba(0, 0, 0, 0.75); }

.bs-arrow { top: 50%; width: 44px; height: 44px; margin-top: -22px; font-size: 1.7rem; line-height: 1; padding-bottom: 3px; }
.bs-prev { left: 10px; }
.bs-next { right: 10px; }
.bs-zoom { top: 10px; right: 10px; width: 38px; height: 38px; }

.bs-count {
    position: absolute;
    left: 10px;
    bottom: 10px;
    z-index: 3;
    padding: 2px 10px;
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
    color: #fff;
    background: rgba(0, 0, 0, 0.55);
    border-radius: 999px;
}

.bs-caption {
    text-align: left;
    hyphens: manual;
    min-height: 2.9em;
    margin: 10px 2px 0;
    font-size: 0.98rem;
    font-style: italic;
    line-height: 1.45;
    color: #2a2f2b;
}

.bs-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 6px; }

.bs-play {
    padding: 5px 14px;
    font: inherit;
    font-size: 0.85rem;
    color: var(--bs-ink);
    background: #fff;
    border: 1px solid var(--bs-line);
    border-radius: 999px;
    cursor: pointer;
}

.bs-play:hover { border-color: var(--bs-green); color: var(--bs-green); }

.bs-dots { display: flex; flex-wrap: wrap; gap: 4px; }

.bs-dot {
    position: relative;
    width: 12px;
    height: 12px;
    padding: 0;
    background: #c3c9bf;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
}

.bs-dot::after { content: ""; position: absolute; inset: -8px; }  /* größere Fläche zum Antippen */
.bs-dot[aria-current="true"] { background: var(--bs-green); }

.bs-thumbs {
    position: relative;
    display: flex;
    gap: 8px;
    margin: 8px 0 0;
    padding: 0 0 6px;
    list-style: none;
    overflow-x: auto;
}

.bs-thumb {
    display: block;
    flex: none;
    width: 76px;
    height: 56px;
    padding: 0;
    overflow: hidden;
    background: var(--bs-soft);
    border: 2px solid transparent;
    border-radius: 6px;
    opacity: 0.7;
    cursor: pointer;
}

.bs-thumb:hover { opacity: 1; }
.bs-thumb[aria-current="true"] { border-color: var(--bs-green); opacity: 1; }
.bs-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }

.bs button:focus-visible,
.bs-frame:focus-visible,
.bs-lightbox button:focus-visible { outline: 3px solid #1b6ef3; outline-offset: 2px; }

/* ----- Großansicht ----- */
.bs-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px;
    background: rgba(0, 0, 0, 0.93);
    color: #fff;
}

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

.bs-lb-stage { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; flex: 1; min-height: 0; touch-action: pan-y; }

.bs-lb-stage img {
    -webkit-user-drag: none;
    user-select: none;
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
}

.bs-lb-caption { max-width: 900px; hyphens: manual; min-height: 1.4em; margin: 0; text-align: center; font-size: 1rem; font-style: italic; line-height: 1.45; }
.bs-lb-count { font-size: 0.85rem; opacity: 0.8; font-variant-numeric: tabular-nums; }

.bs-lightbox .bs-arrow { background: rgba(255, 255, 255, 0.18); }
.bs-lightbox .bs-arrow:hover { background: rgba(255, 255, 255, 0.35); }
.bs-lb-close { position: absolute; top: 12px; right: 12px; z-index: 4; width: 42px; height: 42px; font-size: 1.6rem; line-height: 1; color: #fff; background: rgba(255, 255, 255, 0.18); border: 0; border-radius: 50%; cursor: pointer; }
.bs-lb-close:hover { background: rgba(255, 255, 255, 0.35); }

body.bs-noscroll { overflow: hidden !important; }

@media (max-width: 700px) {
    .bs.is-live .bs-frame { aspect-ratio: 4 / 3; }
    .bs-arrow { width: 38px; height: 38px; margin-top: -19px; font-size: 1.5rem; }
    .bs-prev { left: 6px; }
    .bs-next { right: 6px; }
    .bs-thumb { width: 64px; height: 48px; }
}

@media (prefers-reduced-motion: reduce) {
    .bs.is-live .bs-slide.is-active { animation: none; }
}
