/**
 * Frontend-Styles für Einsatzverwaltung Gallery
 */

.evg-frontend-gallery {
    margin: 40px 0;
    padding: 40px 0;
    background: #3D3D3D;
    border-radius: 8px;
}

.evg-frontend-gallery h3 {
    font-size: 28px;
    margin-bottom: 30px;
    color: #ffffff;
    font-weight: 600;
    text-align: center;
    padding: 0 30px;
}

.evg-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin: 0;
    padding: 0 30px;
}

.evg-gallery-item {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 12px;
    transition: all 0.3s ease;
    aspect-ratio: 4/3;
    background: #1a1a1a;
    border: 3px solid #ffffff;
}

.evg-gallery-item:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
    transform: translateY(-8px);
    border-color: #666;
}

.evg-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

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

/* Lightbox-Overlay */
.evg-lightbox-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    cursor: pointer;
}

.evg-lightbox-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.evg-lightbox-content {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
    background: transparent;
    pointer-events: none;
}

.evg-lightbox-content img {
    max-width: 90%;
    max-height: 90%;
    display: block;
    border-radius: 0;
    object-fit: contain;
    pointer-events: auto;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    -ms-interpolation-mode: nearest-neighbor;
}

.evg-lightbox-close {
    position: fixed;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: white;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    padding: 10px 15px;
    line-height: 1;
    z-index: 10001;
    transition: all 0.2s;
    border-radius: 4px;
}

.evg-lightbox-close:hover {
    background: rgba(255, 0, 0, 0.8);
    transform: scale(1.1);
}

.evg-lightbox-prev,
.evg-lightbox-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    font-size: 50px;
    color: white;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    padding: 20px 15px;
    line-height: 1;
    transition: all 0.2s;
    border-radius: 4px;
    z-index: 10001;
}

.evg-lightbox-prev:hover,
.evg-lightbox-next:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translateY(-50%) scale(1.1);
}

.evg-lightbox-prev {
    left: 30px;
}

.evg-lightbox-next {
    right: 30px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .evg-gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 25px;
    }
}

@media (max-width: 768px) {
    .evg-gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 20px;
        padding: 0 20px;
    }

    .evg-frontend-gallery {
        padding: 30px 0;
    }

    .evg-frontend-gallery h3 {
        font-size: 24px;
        padding: 0 20px;
    }

    .evg-lightbox-prev,
    .evg-lightbox-next {
        padding: 10px;
        font-size: 30px;
    }

    .evg-lightbox-prev {
        left: 10px;
    }

    .evg-lightbox-next {
        right: 10px;
    }

    .evg-lightbox-close {
        top: 10px;
        right: 10px;
        font-size: 30px;
    }
}

@media (max-width: 480px) {
    .evg-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Foto-Icon im Titel - erscheint am Ende der Zeile */
.evg-title-icon {
    margin-left: 10px !important;
    font-size: 1.3em;
    color: #ffffff !important;
    transition: all 0.2s ease !important;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
    text-decoration: none !important;
}

/* Versuche das Icon nach rechts zu verschieben - universeller Ansatz */
table .evg-title-icon,
.evg-title-icon {
    position: absolute !important;
    right: 10px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    margin-left: 0 !important;
}

/* Stelle sicher dass Parent-Elemente relativ positioniert sind */
table td:has(.evg-title-icon),
table a:has(.evg-title-icon) {
    position: relative !important;
}

/* Fallback für Browser ohne :has() Support */
table td {
    position: relative;
}

table a {
    position: relative;
    display: block;
    width: 100%;
    padding-right: 35px;
}

a .evg-title-icon,
a:hover .evg-title-icon {
    text-decoration: none !important;
}

a:hover .evg-title-icon,
table a:hover .evg-title-icon {
    color: #ffffff !important;
    transform: translateY(-50%) scale(1.3) !important;
    text-decoration: none !important;
}
