/*
 * Stylesheet for XL Events Plugin - V1.3 (BULLETPROOF LAYOUT FIX)
 *
 * This version uses a Flexbox layout, which is more robust for centering
 * a variable number of items. This fixes the "single item stretching" bug.
 */

/* The main container for the event cards */
.xl-events-grid {
    /* --- THE CORE FIX --- */
    display: flex;          /* Use Flexbox for robust alignment */
    flex-wrap: wrap;        /* Allow cards to wrap to the next line on smaller screens */
    justify-content: center;/* Center the cards horizontally. This is key for 1, 2, or 3 cards. */
    gap: 35px;              /* The space between cards */
    
    /* --- General Container Styling --- */
    padding: 60px 25px;
    max-width: 1300px;
    margin: 0 auto;
}

/* Individual Event Card - FIXED WIDTH */
.xl-event-card {
    /* --- THE SECOND PART OF THE FIX --- */
    width: 350px;           /* A fixed width prevents the card from ever stretching */
    flex-shrink: 0;         /* Prevents the card from shrinking if space is tight */

    /* --- Visual & Hover Effects --- */
    background: linear-gradient(180deg, rgba(45, 45, 50, 0.75), rgba(30, 30, 35, 0.75));
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    
    /* --- Internal Layout --- */
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Enhanced Hover Effect */
.xl-event-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: rgba(255, 255, 255, 0.35);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4), 0 0 30px rgba(160, 120, 255, 0.25);
}

/* Card Image */
.xl-event-image-wrapper {
    width: 100%;
    aspect-ratio: 1 / 1.2; /* Slightly taller image ratio */
}

.xl-event-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Card Details Section */
.xl-event-details {
    padding: 25px;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Pushes buttons to the bottom */
}

.xl-event-details h3 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 18px 0;
    color: #ffffff;
    font-family: 'EB Garamond', serif; /* Ensure font consistency */
}

.xl-event-details ul {
    list-style: none;
    padding: 0;
    margin: 0 0 25px 0;
    flex-grow: 1; /* Takes up available space */
}

.xl-event-details li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    margin-bottom: 12px;
    opacity: 0.9;
    font-family: sans-serif; /* Using a clean sans-serif for details */
}

.xl-event-details li:last-child {
    margin-bottom: 0;
}

.xl-event-details li svg {
    flex-shrink: 0;
    opacity: 0.8;
    width: 16px;
    height: 16px;
}

/* Ticket Buttons */
.xl-event-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.xl-ticket-btn,
.xl-sold-out-btn {
    text-align: center;
    background-color: #ffffff;
    color: #000000 !important;
    border: none;
    border-radius: 8px;
    padding: 12px 18px;
    font-size: 15px;
    font-family: sans-serif;
    font-weight: bold;
    text-decoration: none !important;
    transition: background-color 0.3s ease, transform 0.2s ease;
    flex-grow: 1;
    min-width: 130px;
}

.xl-ticket-btn:hover {
    background-color: #cccccc;
    transform: scale(1.03);
}

.xl-sold-out-btn {
    background-color: #252525;
    color: #888888 !important;
    cursor: not-allowed;
}