/* ============================================================
   Infokacheln DCE – Styles v3
   + 2-Spalten Bildzeilen + Lightbox
   ============================================================ */

.infokacheln {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 1.5rem auto;
}

/* Kachel die 2 Spalten breit ist */
.kachel--wide {
    grid-column: span 2;
}

/* ---- Einzelne Kachel ---- */
.kachel {
    border-radius: 10px;
    overflow: hidden;
    line-height: 0;
}

/* ---- Bild füllt Kachel komplett ---- */
.kachel__bild {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 10px;
}

/* ---- Lightbox-Wrapper innerhalb Kachel ---- */
.kachel__lb-wrap {
    position: relative;
    cursor: zoom-in;
    line-height: 0;
    display: block;
    width: 100%;
    height: 100%;
}

.kachel__lb-wrap:focus-visible {
    outline: 3px solid #FF6B00;
    outline-offset: 2px;
    border-radius: 10px;
}

/* Zoom-Icon beim Hover */
.kachel__zoom-hint {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    background: rgba(0,0,0,0.5);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.kachel__lb-wrap:hover .kachel__zoom-hint {
    opacity: 1;
}

/* ============================================================
   2-Spalten Bildzeilen
   ============================================================ */

/* Bildzeilen spannen über alle 3 Grid-Spalten */
.infokacheln__bildzeilen {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Eine Zeile = 2 gleich breite Spalten */
.bildzeile {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.bildzeile__col {
    border-radius: 10px;
    overflow: hidden;
    line-height: 0;
}

/* Bild nimmt 100% der Spaltenbreite ein */
.bildzeile__bild {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
    object-fit: cover;
}

/* Lightbox-Wrap in Bildzeile */
.bildzeile__col .kachel__lb-wrap {
    border-radius: 10px;
}

.bildzeile__col .kachel__lb-wrap .bildzeile__bild {
    border-radius: 10px;
}

/* ============================================================
   Lightbox
   ============================================================ */

.ik-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,0.82);
    align-items: center;
    justify-content: center;
    padding: 20px;
    cursor: zoom-out;
}

.ik-lightbox.is-active {
    display: flex;
    animation: ikLbFadeIn 0.2s ease forwards;
}

@keyframes ikLbFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.ik-lightbox__bild {
    max-width: 100vw;
    max-height: 100vh;
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
    object-fit: contain;
    animation: ikLbScaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    cursor: default;
}

@keyframes ikLbScaleIn {
    from { transform: scale(0.92); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

.ik-lightbox__close {
    /*position: fixed;*/
    position: absolute;
    top: 10px;
    right: 10px;
    width: 38px;
    height: 38px;
    background: rgba(0,0,0,0.6);
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, transform 0.15s;
    z-index: 2;
}

.ik-lightbox__close:hover {
    background: rgba(0,0,0,0.9);
    transform: scale(1.1);
}

.ik-lightbox__close:focus-visible {
    outline: 3px solid #FF6B00;
    outline-offset: 2px;
}

/* ============================================================
   Responsive
   ============================================================ */

/* 2 Spalten unter 900px */
@media (max-width: 900px) {
    .infokacheln {
        grid-template-columns: repeat(2, 1fr);
    }
    .kachel--wide {
        grid-column: span 2;
    }
}

/* 1 Spalte unter 540px */
@media (max-width: 540px) {
    .infokacheln {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .kachel--wide {
        grid-column: span 1;
    }
    .infokacheln__bildzeilen {
        gap: 8px;
    }
}

/* Bildzeilen: unter 600px übereinander */
@media (max-width: 600px) {
    .bildzeile {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   Vollbreite Bild
   ============================================================ */

.infokacheln__vollbild {
    grid-column: 1 / -1; /* über alle Spalten */
    line-height: 0;
    border-radius: 10px;
    overflow: hidden;
}

.infokacheln__vollbild .kachel__lb-wrap {
    border-radius: 10px;
    width: 100%;
}

.infokacheln__vollbild-bild {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
    object-fit: cover;
}
