/* ---------------------------------------------------------
   KATEGORIEN (linke Karte)
--------------------------------------------------------- */

/* Wrapper für die gesamte Kategorie-Liste */
.gallery-category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Erste Ebene */
.gallery-category-list-level {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Kategorie-Links */
.gallery-category-list a {
    display: block;
    padding: 8px 12px;
    border-radius: 6px;
    background: #eee;
    margin-bottom: 6px;
    text-decoration: none;
    color: #333;
    transition: background 0.2s;
}

/* Hover */
.gallery-category-list a:hover {
    background: #ddd;
}

/* Aktive Kategorie */
.gallery-category-list .cat-item.active > a {
    background: #ffcc00;
    font-weight: bold;
}

/* Unterkategorien standardmäßig verstecken */
.gallery-category-list li ul {
    display: none;
    padding-left: 15px; /* leichte Einrückung */
}

/* Geöffnete Unterkategorien */
.gallery-category-list li.cat-item.open > ul {
    display: block;
}

/* Linke Karte sticky machen – NUR in der Galerie */
.grid-gallery > article:first-child {
    position: sticky;
    top: 20px;
    align-self: start;
}

/* ---------------------------------------------------------
   GALERIE-GRID (rechte Karte)
--------------------------------------------------------- */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
}

/* Thumbnail-Container */
.gallery-thumb {
    background: #fff;
    padding: 6px;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

/* Hover-Effekt */
.gallery-thumb:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

/* Thumbnail-Bild */
.gallery-thumb img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
}

/* Bildname unter dem Thumbnail */
.gallery-thumb-title {
    margin-top: 6px;
    font-size: 0.75rem;
    color: #666;
    text-align: center;
    line-height: 1.2;
    word-break: break-word;
    opacity: 0.85;
}

/* ---------------------------------------------------------
   LIGHTBOX
--------------------------------------------------------- */

.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    inset: 0;
    background: rgba(0,0,0,0.9);
    justify-content: center;
    align-items: center;
}

/* Weißer Rahmen wie bei den Thumbs – nur groß */
/* Weißer Rahmen */
.lightbox-frame {
    background: #fff;
    padding: 16px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.45);
    max-width: 90%;
    max-height: 85%;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative; /* wichtig */
    overflow: visible;  /* verhindert Abschneiden */
}

/* ESC oben rechts IM Rahmen */
.lightbox-frame .close {
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 34px;
    font-weight: bold;
    color: #000;
    opacity: 0.9;
    cursor: pointer;
    text-shadow: 0 0 6px rgba(255,255,255,0.8);
    z-index: 9999; /* >>> WICHTIG: über dem Bild */
}

.lightbox-frame .close:hover {
    opacity: 1;
}

/* Bild */
.lightbox-img {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 6px;
    z-index: 1; /* Bild bleibt unter ESC */
    position: relative;
}

.lightbox-img.fade-in {
    animation: fadeIn 0.25s ease;
}

/* Controls unter dem Bild – IM Rahmen */
.lightbox-controls {
    margin-top: 14px;
    display: flex;
    align-items: center;
    gap: 30px;
    color: #333;
}

/* Pfeile */
.lightbox-prev,
.lightbox-next {
    font-size: 42px;
    cursor: pointer;
    user-select: none;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    opacity: 1;
}

/* Bildname */
.lightbox-caption {
    font-size: 1rem;
    color: #444;
    max-width: 300px;
    text-align: center;
    opacity: 0.9;
}

/* Fade-In Animation */
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to   { opacity: 1; transform: scale(1); }
}

/* Slide-Animationen */
@keyframes slideLeft {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideRight {
    from { opacity: 0; transform: translateX(-40px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* Wird dynamisch per JS gesetzt */
.lightbox-img.slide-left {
    animation: slideLeft 0.25s ease;
}

.lightbox-img.slide-right {
    animation: slideRight 0.25s ease;
}

/* ---------------------------------------------------------
   LAYOUT: Galerie – linke Karte schmal, rechte groß
--------------------------------------------------------- */

.grid-gallery {
    display: grid;
    grid-template-columns: 260px 1fr; /* Links fix, rechts flexibel */
    gap: 24px;
    margin-bottom: 32px;
    align-items: start;
}

/* Mobile Ansicht */
@media (max-width: 800px) {
    .grid-gallery {
        grid-template-columns: 1fr;
    }
}

/* Rechte Karte leicht blau einfärben */
.grid-gallery > article:last-child .card-content {
    background: #f4f8ff; /* sehr leichtes Blau */
	border: 1px solid #d7e4ff;
    border-radius: 6px;
    padding: 12px;
}