/**
 * File: gallery.css
 *
 * GALLERY PAGE - SLIDER & LIGHTBOX STYLES.
 * Styles for photo galleries and the lightbox feature.
 *
 * @package     KuK Bendorf Theme
 * @author      Oliver Ferber <admin@kuk-bendorf.de>
 * @copyright   2024-2026 KuK Bendorf e.V.
 * @license     Proprietär – © 2026 KuK Bendorf e.V., alle Rechte vorbehalten (siehe LICENSE.txt)
 * @version     1.0.0
 */

.gallery-section {
    background: transparent;
}

/* Page Header – inherits global .page-header from main.css */

/* ==========================================
   GALLERY CATEGORY SECTIONS
   ========================================== */

.gallery-category-section {
    margin-bottom: 60px;
}

.category-title {
    color: var(--primary);
    font-size: 1.8rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--primary);
}

.category-title i {
    color: #FFD700;
}

.category-description {
    color: #666;
    font-size: 1.05rem;
    margin-bottom: 20px;
    font-style: italic;
}

/* ==========================================
   SWIPER SLIDER - SINGLE ROW
   ========================================== */

.gallery-slider-wrapper {
    position: relative;
    padding: 10px 50px;
}

.gallery-swiper {
    overflow: hidden;
}

.gallery-slide-item {
    /* Keine feste Höhe mehr — richtet sich nach dem Bild-Seitenverhältnis
       plus der Titel-Zeile, falls vorhanden. Vorher: fixe 280px-Karte mit
       230px-Bild ließ bei fehlendem Titel (die Titel-Zeile wird ja nur
       gerendert, wenn es einen echten Titel gibt) ~50px sichtbaren
       Leerraum am unteren Kartenrand. */
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    background: white;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    border: 1px solid #eee;
}

.gallery-slide-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(242, 15, 15, 0.12);
    border-color: var(--kuk-red);
}

.gallery-slide-item img {
    width: 100%;
    aspect-ratio: 4 / 3;
    height: auto;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.gallery-slide-item:hover img {
    transform: scale(1.05);
}

/* Placeholder when no image is available */
.gallery-slide-placeholder {
    width: 100%;
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
    color: #aaa;
    font-size: 3rem;
    transition: transform 0.4s ease;
}
.gallery-slide-item:hover .gallery-slide-placeholder {
    transform: scale(1.05);
}

.gallery-slide-title {
    padding: 12px 15px;
    font-weight: 600;
    color: #333;
    text-align: center;
    font-size: 0.9rem;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Swiper Navigation
   Swiper 12 rendert den Pfeil als injiziertes <svg class="swiper-navigation-icon">
   (stroke="currentColor"), nicht mehr als CSS-Icon-Font über ::after wie in
   älteren Swiper-Versionen. Die frühere ::after-Regel griff seit dem
   Swiper-12-Update ins Leere — der Pfeil blieb dadurch in Swipers eigener
   Standardfarbe (Blau) statt im KuK-Rot, was neben dem weißen Kreis
   deplatziert/"hässlich" aussah. Fix: color direkt auf den Button setzen,
   davon erbt das SVG über currentColor.
*/
.swiper-button-prev,
.swiper-button-next {
    width: 44px;
    height: 44px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
    transition: all 0.3s ease;
    color: var(--primary);
}

.swiper-navigation-icon {
    /* War 40% — bei der schmalen Swiper-12-Pfeil-SVG (viewBox 11x20) blieb
       davon nur ein sehr kleines, dünnes Häkchen mit viel Leerraum im
       44px-Kreis übrig. Kräftiger, besser lesbarer Pfeil bei 55%. */
    width: 55%;
    height: 55%;
}

.swiper-button-prev:hover,
.swiper-button-next:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
}

.swiper-button-prev.swiper-button-disabled,
.swiper-button-next.swiper-button-disabled {
    opacity: 0.35;
}

/* ==========================================
   LIGHTBOX MODAL
   ========================================== */

.gallery-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.94);
    cursor: pointer;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: galleryZoomIn 0.3s ease;
}

@keyframes galleryZoomIn {
    from {
        transform: scale(0.85);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

#lightboxImage {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
    cursor: default;
}

/* Bottom bar under image */
.lightbox-bottom-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 800px;
    margin-top: 18px;
    padding: 0 10px;
    gap: 20px;
}

.lightbox-title {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    flex: 1;
    text-align: left;
}

.lightbox-counter {
    color: #888;
    font-size: 0.9rem;
    white-space: nowrap;
}

/* Download Button in Lightbox */
.lightbox-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s;
    white-space: nowrap;
}

.lightbox-download-btn:hover {
    background: var(--kuk-red);
    border-color: var(--kuk-red);
    color: #fff;
}

.lightbox-download-btn i {
    font-size: 1rem;
}

/* Lightbox navigation buttons */
.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: fixed;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border: none;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.3rem;
    z-index: 99999;
}

.lightbox-close {
    top: 24px;
    right: 24px;
}

.lightbox-prev {
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next {
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.3);
}

.lightbox-prev:hover {
    transform: translateY(-50%) scale(1.1);
}

.lightbox-next:hover {
    transform: translateY(-50%) scale(1.1);
}

/* ==========================================
   NO GALLERY MESSAGE
   ========================================== */

.no-gallery {
    text-align: center;
    padding: 80px 40px;
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.no-gallery p {
    color: #666;
    font-size: 1.2rem;
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    .gallery-category-section {
        margin-left: 15px;
        margin-right: 15px;
    }

    .gallery-slider-wrapper {
        padding: 10px 30px;
    }

    .category-title {
        font-size: 1.4rem;
    }

    .swiper-button-prev,
    .swiper-button-next {
        width: 36px;
        height: 36px;
    }

    .lightbox-close,
    .lightbox-prev,
    .lightbox-next {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }

    .lightbox-close {
        top: 14px;
        right: 14px;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .lightbox-bottom-bar {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .lightbox-title {
        text-align: center;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .gallery-slider-wrapper {
        /* War 10px bei unveränderter 36px-Button-Breite -> die Pfeile ragten
           über das Bild statt daneben zu sitzen. Etwas mehr Luft plus ein
           eigener, kleinerer Button für diese Breite (direkt unten). */
        padding: 10px 24px;
    }

    .swiper-button-prev,
    .swiper-button-next {
        width: 32px;
        height: 32px;
    }
}

/* ==========================================
   DARK MODE
   Datei stammt aus der Zeit vor dem Dark-Mode-System und war komplett
   unabgedeckt — Pfeil-Buttons, Karten und Texte blieben in ihrer festen
   hellen Farbe auf dunklem Seitenhintergrund stehen.
   ========================================== */
html[data-theme="dark"] .category-description {
    color: var(--color-text-2, #A0A8C0);
}

html[data-theme="dark"] .gallery-slide-item {
    background: var(--surface-2, #1A1A2C);
    border-color: var(--color-border, #2A2A42);
}

html[data-theme="dark"] .gallery-slide-title {
    color: var(--color-text, #F0F0F8);
}

html[data-theme="dark"] .swiper-button-prev,
html[data-theme="dark"] .swiper-button-next {
    background: var(--surface-2, #1A1A2C);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4), 0 0 0 1px var(--color-border, #2A2A42);
}

html[data-theme="dark"] .swiper-button-prev:hover,
html[data-theme="dark"] .swiper-button-next:hover {
    background: var(--primary);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

html[data-theme="dark"] .no-gallery {
    background: var(--surface-2, #1A1A2C);
    box-shadow: none;
    border: 1px solid var(--color-border, #2A2A42);
}

html[data-theme="dark"] .no-gallery p {
    color: var(--color-text-2, #A0A8C0);
}