/* ============================================================
   Windimhaar Gallery v2 – Styles
   ============================================================ */

.wih-gallery-wrap {
    width: 100%;
    margin: 0 0 2em;
    user-select: none;
}

/* ── Stage ── */
.wih-stage {
    position: relative;
    width: 100%;
    height: 520px;
    background: #ffffff;
    overflow: hidden;
    border-radius: 4px 4px 0 0;
}

.wih-slides {
    width: 100%;
    height: 100%;
    position: relative;
}

/* ── Slides ── */
.wih-slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.45s ease;
    pointer-events: none;
}

.wih-slide.wih-active {
    opacity: 1;
    pointer-events: auto;
}

/* Querformat */
.wih-slide.wih-landscape img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Hochformat – weiße Streifen links/rechts */
.wih-slide.wih-portrait {
    background: #ffffff;
}

.wih-slide.wih-portrait img {
    width: auto;
    height: 100%;
    max-width: 100%;
    object-fit: contain;
    display: block;
}

.wih-lb-trigger {
    display: contents;
    cursor: zoom-in;
}

/* ── Pfeile ── */
.wih-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(255,255,255,0.18);
    border: none;
    color: #fff;
    font-size: 2.8rem;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    backdrop-filter: blur(4px);
    line-height: 1;
}

.wih-arrow:hover,
.wih-arrow:focus-visible { background: rgba(255,255,255,0.38); outline: none; }

.wih-prev { left: 14px; }
.wih-next { right: 14px; }

/* ── Thumbnails ── */
.wih-thumbs-wrap {
    background: #f4f4f4;
    padding: 10px 8px;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: #ccc #f4f4f4;
}

.wih-thumbs-wrap::-webkit-scrollbar { height: 4px; }
.wih-thumbs-wrap::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }

.wih-thumbs {
    display: flex;
    gap: 8px;
    min-width: min-content;
}

.wih-thumb {
    flex-shrink: 0;
    width: 82px;
    height: 60px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 3px;
    background: #ddd;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.2s, opacity 0.2s;
    opacity: 0.65;
}

.wih-thumb:hover,
.wih-thumb:focus-visible { opacity: 1; outline: none; }

.wih-thumb.wih-thumb-active {
    border-color: #2e6be6;
    opacity: 1;
}

.wih-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

/* ── Dots ── */
.wih-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 10px 0 4px;
}

.wih-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ccc;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s, transform 0.2s;
}

.wih-dot:hover { background: #999; }

.wih-dot.wih-dot-active {
    background: #2e6be6;
    transform: scale(1.25);
}

/* ── Lightbox ── */
.wih-lb-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.97);
    z-index: 99998;
    cursor: zoom-out;
}

.wih-lb-backdrop.wih-lb-open { display: block; }

.wih-lb {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.wih-lb.wih-lb-open { display: flex; }

.wih-lb-img-wrap {
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.wih-lb-img {
    max-width: 85vw;
    max-height: 82vh;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    border-radius: 3px;
    box-shadow: 0 4px 24px rgba(0,0,0,.18);
    transition: opacity 0.2s;
}

.wih-lb-caption {
    color: rgba(0,0,0,.55);
    font-size: .875rem;
    margin: 0;
    text-align: center;
    max-width: 60ch;
}

.wih-lb-close,
.wih-lb-prev,
.wih-lb-next {
    position: fixed;
    background: rgba(0,0,0,0.08);
    border: none;
    color: #333;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.wih-lb-close:hover, .wih-lb-prev:hover, .wih-lb-next:hover {
    background: rgba(0,0,0,0.16);
}

.wih-lb-close {
    top: 16px; right: 16px;
    width: 44px; height: 44px;
    font-size: 1.6rem;
}

.wih-lb-prev, .wih-lb-next {
    top: 50%; transform: translateY(-50%);
    width: 56px; height: 56px;
    font-size: 2.4rem;
}

.wih-lb-prev { left: 16px; }
.wih-lb-next { right: 16px; }

/* ── Responsive ── */
@media (max-width: 768px) {
    .wih-stage { height: 280px; }
    .wih-arrow { width: 40px; height: 40px; font-size: 2rem; }
    .wih-thumb { width: 64px; height: 46px; }
    .wih-lb-prev { left: 6px; }
    .wih-lb-next { right: 6px; }
    .wih-lb-img { max-width: 96vw; max-height: 75vh; }
}

@media (prefers-reduced-motion: reduce) {
    .wih-slide, .wih-lb-img { transition: none; }
}
