/* Eventblock Frontend Styles */

.eventblock-container {
    margin: 1rem 0;
}

.eventblock-placeholder {
    text-align: center;
    padding: 2rem;
    font-style: italic;
    color: #666;
    border: 1px dashed #ddd;
    border-radius: 4px;
}

/* Mobile-First: Liste für kleine Bildschirme */
.eventblock-events {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.eventblock-event {
    display: flex;
    flex-direction: column;
    border: 2px solid white !important;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
    background: transparent;
}

.eventblock-event:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.eventblock-image {
    width: 100%;
    height: 0;
    padding-bottom: 133.33%; /* 4:3 Hochformat (3/4 * 100%) */
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.eventblock-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: filter 0.3s ease, transform 0.2s ease;
}

.eventblock-image img:hover {
    transform: scale(1.02);
}

.eventblock-image img:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.eventblock-image.eventblock-grayscale img {
    filter: grayscale(100%);
}

.eventblock-content {
    padding: 1rem;
    flex: 1;
    background: transparent;
}

.eventblock-title {
    margin: 0 0 0.75rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.3;
    color: inherit;
}

.eventblock-date,
.eventblock-location,
.eventblock-price {
    margin: 0.5rem 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

.eventblock-date strong,
.eventblock-location strong,
.eventblock-price strong {
    color: #333;
    font-weight: 600;
}

/* Tablet und Desktop: Karussell für größere Bildschirme */
@media (min-width: 768px) {
    .eventblock-events {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        scroll-behavior: smooth;
        gap: 1rem;
        padding: 0.5rem 0;
        -webkit-overflow-scrolling: touch;
    }
    
    .eventblock-event {
        flex: 0 0 300px;
        min-width: 300px;
        max-width: 300px;
    }
    
    .eventblock-image {
        height: 0;
        padding-bottom: 133.33%; /* 4:3 Hochformat beibehalten */
    }
    
    /* Scroll-Indikator für Karussell */
    .eventblock-container {
        position: relative;
    }
    
    .eventblock-events::-webkit-scrollbar {
        height: 8px;
    }
    
    .eventblock-events::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 4px;
    }
    
    .eventblock-events::-webkit-scrollbar-thumb {
        background: #c1c1c1;
        border-radius: 4px;
    }
    
    .eventblock-events::-webkit-scrollbar-thumb:hover {
        background: #a1a1a1;
    }
}

@media (min-width: 1024px) {
    .eventblock-event {
        flex: 0 0 320px;
        min-width: 320px;
        max-width: 320px;
    }
    
    .eventblock-image {
        height: 0;
        padding-bottom: 133.33%; /* 4:3 Hochformat beibehalten */
    }
}

/* Fokus-Styles für Accessibility */
.eventblock-event:focus-within {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .eventblock-events {
        flex-direction: column;
    }
    
    .eventblock-event {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    
    .eventblock-image.eventblock-grayscale img {
        filter: grayscale(100%) contrast(120%);
    }
}

/* Hochkontrastmodus */
@media (prefers-contrast: high) {
    .eventblock-event {
        border: 2px solid #000;
    }
    
    .eventblock-event:hover {
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    }
}

/* Reduzierte Bewegung */
@media (prefers-reduced-motion: reduce) {
    .eventblock-event,
    .eventblock-image img {
        transition: none;
    }
    
    .eventblock-events {
        scroll-behavior: auto;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .eventblock-event {
        border-color: #444;
        /* background-color: #2a2a2a; */
        color: #e1e1e1;
    }
    
    .eventblock-placeholder {
        color: #999;
        border-color: #444;
    }
    
    .eventblock-date strong,
    .eventblock-location strong,
    .eventblock-price strong {
        color: #fff;
    }
}

/* Lightbox für Bildvergrößerung */
.eventblock-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    cursor: pointer;
    padding: 20px;
    box-sizing: border-box;
}

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

.eventblock-lightbox-content {
    position: relative;
    max-width: calc(100% - 40px);
    max-height: calc(100% - 40px);
    cursor: default;
    display: flex;
    align-items: center;
    justify-content: center;
}

.eventblock-lightbox img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.eventblock-lightbox-close {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    z-index: 10000;
}

.eventblock-lightbox-close:hover {
    background: rgba(255, 255, 255, 1);
}

.eventblock-lightbox-close:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Mobile Optimierungen für Lightbox */
@media (max-width: 768px) {
    .eventblock-lightbox {
        padding: 10px;
    }
    
    .eventblock-lightbox-content {
        max-width: calc(100% - 20px);
        max-height: calc(100% - 20px);
    }
    
    .eventblock-lightbox-close {
        width: 35px;
        height: 35px;
        font-size: 18px;
        top: -15px;
        right: -15px;
    }
}

/* Animation für Lightbox */
@media (prefers-reduced-motion: reduce) {
    .eventblock-lightbox {
        transition: none;
    }
    
    .eventblock-image img {
        transition: filter 0.3s ease;
    }
    
    .eventblock-image img:hover {
        transform: none;
    }
}
