/* MemberPulse Events Shortcode Styles */

.memberpulse-events {
    margin: 2.5rem auto;
    width: 100%;
    max-width: 75rem;
    clear: both;
    padding: 0 1.25rem;
    font-family: inherit;
}

.memberpulse-no-events {
    text-align: center;
    padding: 1.25rem;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 0.25rem;
    color: #666;
}

/* Grid Layout */
.memberpulse-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    width: 100%;
    grid-auto-rows: auto;
    align-items: start;
}

/* Specific column grids */
.memberpulse-grid-1 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    width: 100%;
    grid-auto-rows: auto;
    align-items: start;
}

.memberpulse-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    width: 100%;
    grid-auto-rows: auto;
    align-items: start;
}

.memberpulse-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    width: 100%;
    grid-auto-rows: auto;
    align-items: start;
}

.memberpulse-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    width: 100%;
    grid-auto-rows: auto;
    align-items: start;
}

.memberpulse-grid-5 {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.25rem;
    width: 100%;
    grid-auto-rows: auto;
    align-items: start;
}

.memberpulse-grid-6 {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1.25rem;
    width: 100%;
    grid-auto-rows: auto;
    align-items: start;
}

/* Carousel Layout - Higher specificity to override theme conflicts */
.memberpulse-events.memberpulse-carousel-wrapper,
div.memberpulse-carousel-wrapper {
    position: relative !important;
    margin: 2.5rem auto !important; /* Center the carousel with more spacing */
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important; /* Reduced gap between nav buttons and carousel */
    width: 100% !important;
    max-width: 75rem !important; /* Limit width for better centering */
    justify-content: center !important;
    clear: both !important;
}

.memberpulse-carousel-wrapper .memberpulse-carousel-track {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: x mandatory !important;
    scrollbar-width: none !important; /* Firefox */
    -ms-overflow-style: none !important; /* IE/Edge */
    flex: 1 !important;
    min-width: 0 !important; /* Important for flex child */
}

.memberpulse-carousel-track::-webkit-scrollbar {
    display: none !important; /* Chrome/Safari */
}

.memberpulse-carousel-wrapper .memberpulse-carousel-row {
    display: flex !important;
    gap: 1.25rem !important; /* Reduced spacing between tiles */
    align-items: stretch !important;
    width: fit-content !important;
    min-width: 100% !important;
    padding: 0 1.25rem !important; /* Reduced padding for tighter layout */
    min-height: 21.875rem !important; /* Minimum height to ensure consistency */
}

.memberpulse-carousel-wrapper .memberpulse-carousel-slide {
    flex: 0 0 17.5rem !important; /* Default card width */
    scroll-snap-align: center !important; /* Center align for better positioning */
    display: flex !important;
    flex-direction: column !important;
}

/* Ensure tiles have equal height in carousel - Override theme conflicts */
.memberpulse-carousel-wrapper .memberpulse-carousel-slide .memberpulse-event-tile {
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
    align-self: stretch !important;
}

/* Force equal height with even more specificity - nuclear option against theme interference */
div.memberpulse-carousel-wrapper div.memberpulse-carousel-slide div.memberpulse-event-tile {
    height: 21.875rem !important;
    max-height: 21.875rem !important;
    min-height: 21.875rem !important;
}


/* Arrow Buttons */
.memberpulse-carousel-prev,
.memberpulse-carousel-next {
    position: relative;
    z-index: 10;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    flex-shrink: 0;
}

.memberpulse-carousel-prev:hover,
.memberpulse-carousel-next:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.05);
}

.memberpulse-carousel-prev:active,
.memberpulse-carousel-next:active {
    transform: scale(0.95);
}


/* Responsive */
@media (max-width: 768px) {
    .memberpulse-events {
        margin: 1.875rem auto;
        padding: 0 0.9375rem;
    }

    .memberpulse-grid {
        grid-template-columns: 1fr;
        gap: 0.9375rem;
    }

    /* Responsive behavior for specific column grids */
    .memberpulse-grid-2,
    .memberpulse-grid-3,
    .memberpulse-grid-4,
    .memberpulse-grid-5,
    .memberpulse-grid-6 {
        grid-template-columns: 1fr;
        gap: 0.9375rem;
    }

    .memberpulse-carousel-slide {
        flex: 0 0 calc(100% - 2rem);
    }

    .memberpulse-carousel-wrapper .memberpulse-carousel-row {
        gap: 0.75rem !important; /* Consistent with reduced spacing */
        padding: 0 0.75rem !important; /* Reduced mobile padding */
    }

    .memberpulse-carousel-prev,
    .memberpulse-carousel-next {
        width: 2.625rem;
        height: 2.625rem;
    }

    .memberpulse-carousel-wrapper {
        margin: 1.875rem auto !important;
    }
}

@media (max-width: 480px) {
    .memberpulse-events {
        margin: 1.5625rem auto;
        padding: 0 0.625rem;
    }

    .memberpulse-grid,
    .memberpulse-grid-1,
    .memberpulse-grid-2,
    .memberpulse-grid-3,
    .memberpulse-grid-4,
    .memberpulse-grid-5,
    .memberpulse-grid-6 {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .memberpulse-event-tile {
        padding: 0.75rem;
    }

    .memberpulse-carousel-wrapper {
        margin: 1.5625rem auto !important;
        gap: 0.75rem !important;
    }
}

@media (max-width: 640px) {
    .memberpulse-carousel-slide {
        flex: 0 0 calc(100% - 1.5rem);
    }

    .memberpulse-carousel-wrapper {
        gap: 0.375rem; /* Tighter spacing on small mobile */
    }

    .memberpulse-carousel-wrapper .memberpulse-carousel-row {
        gap: 0.5rem !important; /* Even tighter on smallest screens */
        padding: 0 0.5rem !important; /* Minimal padding on small mobile */
    }

    .memberpulse-carousel-prev,
    .memberpulse-carousel-next {
        width: 2.25rem;
        height: 2.25rem;
    }
}