.uspace-event-carousel-container {
    width: 100%;
    margin: 2rem auto;
    box-sizing: border-box;
}

.uspace-event-carousel-container button,
.uspace-event-carousel-container button:hover,
.uspace-event-carousel-container button:focus,
.uspace-event-carousel-container button:focus-visible,
.uspace-event-carousel-container button:active {
    appearance: none;
    background-image: none !important;
    text-shadow: none !important;
    border-image: none !important;
}

.uspace-event-carousel-viewport {
    width: 100%;
}

.uspace-event-carousel-track {
    display: grid;
    grid-template-columns: repeat(var(--uspace-event-grid-columns, 3), minmax(0, 1fr));
    /* Default when not driven by Elementor --uspace-carousel-gap */
    --uspace-carousel-gap: 30px;
    row-gap: var(--uspace-carousel-gap);
    column-gap: var(--uspace-carousel-gap);
}

.uspace-event-carousel-slide {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.uspace-event-carousel-slide.is-revealing {
    animation: uspaceEventCardReveal 0.42s ease both;
}

.uspace-event-carousel-slide.is-hidden {
    display: none !important;
}

.uspace-evt-slide-image {
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    margin-bottom: 15px;
    border-radius: 4px;
}

.uspace-evt-slide-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.uspace-evt-slide-image:hover img {
    transform: scale(1.05);
}

.uspace-evt-slide-content {
    display: flex;
    flex-direction: column;
    padding: 0;
    gap: 8px;
}

.uspace-evt-slide-date {
    font-size: 0.9rem;
    color: #666;
    margin: 0;
}

.uspace-evt-slide-title {
    margin: 0;
    font-size: 1.25rem;
    line-height: 1.4;
    font-weight: 500;
}

.uspace-evt-slide-title a {
    color: #0a4f66;
    text-decoration: none;
    transition: color 0.2s ease;
}

.uspace-evt-slide-title a:hover {
    color: #0d3b4a;
}

.uspace-event-carousel-actions {
    display: flex;
    justify-content: center;
    margin-top: 36px;
}

.uspace-event-carousel-load-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 12px 28px;
    border: 1px solid currentColor;
    border-radius: 0;
    background: transparent;
    color: #0a4f66;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.2;
    text-align: center;
    transition: color 0.2s ease, background-color 0.2s ease, opacity 0.2s ease;
}

.uspace-event-carousel-load-more:hover,
.uspace-event-carousel-load-more:focus {
    background-color: #0a4f66;
    color: #fff;
}

.uspace-event-carousel-load-more:focus,
.uspace-event-carousel-load-more:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}

@media (max-width: 1024px) {
    .uspace-event-carousel-track {
        grid-template-columns: repeat(var(--uspace-event-grid-columns, 2), minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .uspace-event-carousel-track {
        grid-template-columns: repeat(var(--uspace-event-grid-columns, 1), minmax(0, 1fr));
    }

    /*
     * Elementor previously emitted gap: 0 !important on mobile, which could not be overridden.
     * Longhand + max() floor preserves larger user values from --uspace-carousel-gap.
     */
    html body .elementor-widget-uspace_event_carousel .elementor-widget-container .uspace-event-carousel-viewport .uspace-event-carousel-track {
        row-gap: max(24px, var(--uspace-carousel-gap, 30px)) !important;
        column-gap: max(16px, var(--uspace-carousel-gap, 30px)) !important;
    }

    .uspace-event-carousel-container {
        margin: 1.5rem auto;
    }

    .uspace-event-carousel-actions {
        margin-top: 28px;
    }

    .uspace-event-carousel-load-more {
        width: 100%;
        max-width: 320px;
    }
}

@keyframes uspaceEventCardReveal {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .uspace-event-carousel-slide.is-revealing {
        animation: none;
    }

    .uspace-evt-slide-image img,
    .uspace-event-carousel-load-more {
        transition: none;
    }
}
