/* ==================== BILDERGALERIE MODUL ==================== */

/*Den muss ich später anpassen. Der Container ist doch etws heftig und passt nicht ganz zum Styling */
.gallery-container {
    margin: 40px 0;
    /*background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border: 2px solid rgba(143, 182, 255, 0.2);*/
}

.gallery-title {
    color: var(--c64-blue-darker);
    font-size: 1.6em;
    font-weight: 700;
    margin: 0 0 24px 0;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--c64-accent);
    position: relative;
}

.gallery-title::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--c64-orange);
}

/* Galerie-Grid: 3 Kacheln nebeneinander */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 24px;
    position: relative;
}

/* Einzelne Bildkachel */
.gallery-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 10px;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 2px solid rgba(143, 182, 255, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
}

.gallery-item:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    border-color: var(--c64-accent);
}

.gallery-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--c64-accent), var(--c64-orange));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
    z-index: 2;
}

.gallery-item:hover::before {
    transform: scaleX(1);
}

/* Bild innerhalb der Kachel */
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

/* Bildunterschrift */
.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.6) 80%, transparent 100%);
    color: white;
    padding: 16px 12px 12px 12px;
    font-size: 0.9em;
    font-weight: 500;
    text-align: center;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    font-family: 'VT323', 'Consolas', 'Courier New', monospace;
    letter-spacing: 0.5px;
}

.gallery-item:hover .gallery-caption {
    transform: translateY(0);
}

/* ==================== NAVIGATIONS-BUTTONS ==================== */

.gallery-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
}

.gallery-btn {
    background: linear-gradient(135deg, var(--c64-accent) 0%, var(--c64-accent-hover) 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 4px 8px rgba(2, 136, 209, 0.3);
    font-family: 'VT323', 'Consolas', 'Courier New', monospace;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.gallery-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(2, 136, 209, 0.4);
    background: linear-gradient(135deg, var(--c64-orange) 0%, #cc6600 100%);
}

.gallery-btn:active:not(:disabled) {
    transform: translateY(0);
}

.gallery-btn:disabled {
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
    cursor: not-allowed;
    opacity: 0.5;
}

/* Seitenzahl-Anzeige */
.gallery-counter {
    font-weight: 600;
    color: var(--c64-blue-darker);
    font-size: 1.1em;
    min-width: 100px;
    text-align: center;
    font-family: 'VT323', 'Consolas', 'Courier New', monospace;
    letter-spacing: 1px;
}

/* C64-Pixel-Icons für Buttons */
.gallery-btn::before,
.gallery-btn::after {
    display: inline-block;
    font-weight: bold;
    font-size: 1.2em;
}

.gallery-btn-prev::before {
    content: '◄ ';
    margin-right: 4px;
}

.gallery-btn-next::after {
    content: ' ►';
    margin-left: 4px;
}

/* ==================== LIGHTBOX FÜR VOLLBILD ==================== */

.gallery-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    padding: 40px;
}

.gallery-lightbox.active {
    display: flex;
}

.gallery-lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: default;
}

.gallery-lightbox-content img {
    max-width: 100%;
    max-height: calc(90vh - 80px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6);
    border: 3px solid rgba(143, 182, 255, 0.3);
}

.gallery-lightbox-caption {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 16px 24px;
    text-align: center;
    font-size: 1.1em;
    max-width: 100%;
    border-radius: 6px;
    font-family: 'VT323', 'Consolas', 'Courier New', monospace;
    letter-spacing: 0.5px;
}

.gallery-lightbox-close {
    position: fixed;
    top: 20px;
    right: 20px;
    font-size: 2.5em;
    color: var(--c64-orange);
    background: rgba(0,0,0,0.7);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10001;
    font-family: 'VT323', 'Consolas', 'Courier New', monospace;
    transition: all 0.2s ease;
    border: 2px solid var(--c64-orange);
}

.gallery-lightbox-close:hover {
    background: rgba(0,0,0,0.95);
    color: #fff;
    transform: rotate(90deg);
}

/* ==================== RESPONSIVE DESIGN ==================== */

/* Tablets */
@media (max-width: 1024px) {
    .gallery-grid {
        gap: 16px;
    }
    
    .gallery-container {
        padding: 24px;
    }
}

/* Mobile: 2 Spalten bei kleineren Bildschirmen */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .gallery-container {
        padding: 20px;
        margin: 24px 0;
    }
    
    .gallery-title {
        font-size: 1.4em;
    }
    
    .gallery-btn {
        padding: 10px 18px;
        font-size: 0.9em;
    }
    
    .gallery-counter {
        font-size: 1em;
        min-width: 80px;
    }
}

/* Sehr kleine Displays: 1 Spalte */
@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .gallery-container {
        padding: 16px;
        margin: 16px 0;
    }
    
    .gallery-nav {
        flex-direction: column;
        gap: 8px;
    }
    
    .gallery-btn {
        width: 100%;
    }
    
    .gallery-lightbox {
        padding: 20px;
    }
    
    .gallery-lightbox-close {
        top: 10px;
        right: 10px;
        width: 44px;
        height: 44px;
        font-size: 2em;
    }
}

/* ==================== ANIMATIONEN ==================== */

@keyframes galleryFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gallery-item {
    animation: galleryFadeIn 0.4s ease-out backwards;
}

.gallery-item:nth-child(1) { animation-delay: 0.1s; }
.gallery-item:nth-child(2) { animation-delay: 0.2s; }
.gallery-item:nth-child(3) { animation-delay: 0.3s; }

/* Ladeindikator (optional) */
.gallery-loading {
    text-align: center;
    padding: 40px;
    color: var(--c64-text-soft);
    font-size: 1.2em;
    font-family: 'VT323', 'Consolas', 'Courier New', monospace;
}

.gallery-loading::after {
    content: '...';
    animation: loadingDots 1.5s infinite;
}

@keyframes loadingDots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* ==================== BILD-EINSTELLUNGEN (Custom Styles) ==================== */

/* Hover-Effekte */
.gallery-item.hover-zoom img {
    transition: transform 0.4s ease;
}

.gallery-item.hover-zoom:hover img {
    transform: scale(1.1);
}

.gallery-item.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.15);
}

.gallery-item.hover-brightness img {
    transition: filter 0.3s ease;
}

.gallery-item.hover-brightness:hover img {
    filter: brightness(1.15);
}

.gallery-item.hover-grayscale img {
    filter: grayscale(100%);
    transition: filter 0.4s ease;
}

.gallery-item.hover-grayscale:hover img {
    filter: grayscale(0%);
}

/* Bild-Einstellungen dynamisch anwenden */
.gallery-item img {
    /* Default object-fit wird per inline-style überschrieben */
    object-fit: cover;
    object-position: center;
}

/* Custom Border Radius */
.gallery-item.custom-radius {
    /* wird per inline-style gesetzt */
}

/* Lazy Loading Placeholder */
.gallery-item img[loading="lazy"] {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
}

