.events-container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    font-family: 'Source Sans Pro', sans-serif;
    color: white;
    padding-bottom: 80px; /* Increased from 60px for more gap */
    padding-top: 20px;
}

.events-header {
    text-align: center;
    margin-bottom: 30px;
}

.events-header h1 {
    font-size: 28px;
    font-family: 'InterTight', sans-serif;
    font-weight: bold;
    margin-bottom: 20px;
    color: #333;
}

.event-filters {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-button {
    background-color: #117fa7;
    color: white;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
    font-family: 'InterTight', sans-serif; 
    border-radius: 0px !important;
    white-space: nowrap;
}

.filter-button.active,
.filter-button:hover {
    background-color: #0c2340 !important;
}

.events-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Start with the original grid */
    gap: 20px;
}

.event-card {
    display: none; /* Hidden by default until JS applies filter */
    text-decoration: none;
    color: black;
    background: #99e1f5;
    height: 250px; /* Original height, unchanged */
    display: flex; /* Ensure flexbox */
    flex-direction: row; /* Horizontal layout */
    box-sizing: border-box;
    overflow: hidden;
}

.event-image-container {
    position: relative;
    width: 224px; /* Updated to correct width */
    height: 100%; /* Full height of the card (250px) */
    flex-shrink: 0;
}

.event-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.event-banner {
    position: absolute;
    color: white;
    top: 0;
    left: 0;
    background-color: #117fa7;
    padding: 5px 10px;
    font-weight: bold;
    font-size: 14px;
    text-transform: uppercase;
}

.event-info {
    padding: 15px; /* Adjusted padding to ensure consistent spacing */
    width: 114px; /* Remaining width (calculated as 338px - 224px, but using flex-grow for now) */
    height: 250px; /* Match card height */
    flex-grow: 1;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Align content from the top */
    box-sizing: border-box;
    overflow: hidden;
}

.event-date {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 0px; /* No extra space */
    line-height: 2; /* Reduce line height to bring it closer */
}

.event-time {
    font-size: 16px;
    opacity: 0.8;
    margin-top: -2px; /* Pull time closer to date */
    margin-bottom: 2px; /* Further reduce spacing */
    line-height: 2; /* Reduce space around text */
}


.event-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 12px; /* Increased margin to separate from location */
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-height: 40px; /* Ensure it doesn't overflow */
    line-height: 1.2;
    padding-right: 5px; /* Small right padding to prevent text cutoff */
}

.event-location {
    font-size: 14px;
    opacity: 0.8;
    margin-top: 45px !important; /* Increase this value to push it further */
}



.event-location strong {
    font-weight: bold;
}

.event-card:hover {
    cursor: pointer;
    transform: none;
}

.event-card,
.event-card h2,
.event-card p,
.event-card h3,
.event-card .event-location {
    text-decoration: none !important;
}

/* Small Mobile Devices (up to 576px) */
@media (max-width: 576px) {
    .events-container {
        width: 100%;
        padding: 10px;
    }
    .events-header h1 {
        font-size: 20px;
        margin-bottom: 15px;
    }
    .event-filters {
        gap: 5px;
        padding: 0 10px;
    }
    .filter-button {
        padding: 8px 10px;
        font-size: 12px;
    }
    .events-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    .event-card {
        display: none;
        flex-direction: row;
        height: 200px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden;
        flex-wrap: nowrap;
    }
    .event-image-container {
        width: 35%;
        max-width: 150px;
        height: 100%;
        flex-shrink: 0;
        box-sizing: border-box;
    }
    .event-info {
        padding: 10px;
        width: 65%;
        max-width: calc(100% - 150px);
        height: 200px;
        flex-grow: 0;
        flex-shrink: 1;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        box-sizing: border-box;
        overflow: hidden;
    }
    .event-date {
        font-size: 16px;
        margin-bottom: 0px;
    }
    .event-time {
        font-size: 12px;
        margin-bottom: 3px; /* Minimal space on mobile */
    }
    .event-title {
        font-size: 14px;
        margin-bottom: 6px; /* Adjusted for mobile */
        max-height: 28px; /* Adjusted for mobile */
    }
    .event-location {
        font-size: 10px;
        margin-top: 50px !important; /* Adjust spacing for small screens */
    }
    .events-container {
        padding-bottom: 60px !important; /* Add extra space before footer */
    }

}

/* Large Mobile Devices (577px to 768px) */
@media (min-width: 577px) and (max-width: 768px) {
    .events-container {
        width: 95%;
        padding: 15px;
    }
    .events-header h1 {
        font-size: 24px;
    }
    .event-filters {
        gap: 8px;
        padding: 0 15px;
    }
    .filter-button {
        padding: 9px 12px;
        font-size: 13px;
    }
    .events-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }
    .event-card {
        display: none;
        flex-direction: row;
        height: 220px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden;
        flex-wrap: nowrap;
    }
    .event-image-container {
        width: 35%;
        max-width: 190px;
        height: 100%;
        flex-shrink: 0;
        box-sizing: border-box;
    }
    .event-info {
        padding: 12px;
        width: 65%;
        max-width: calc(100% - 190px);
        height: 220px;
        flex-grow: 0;
        flex-shrink: 1;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        box-sizing: border-box;
        overflow: hidden;
    }
    .event-date {
        font-size: 18px;
        margin-bottom: 0px;
    }
    .event-time {
        font-size: 14px;
        margin-bottom: 4px; /* Minimal space on larger mobile */
    }
    .event-title {
        font-size: 16px;
        margin-bottom: 7px; /* Adjusted for this range */
        max-height: 32px; /* Adjusted for this range */
    }
    .event-location {
        font-size: 13px;
    }
    .events-container {
        padding-bottom: 70px !important; /* Ensure padding before footer */
    }
}

/* Ensure cards are visible when JS sets display: flex */
.event-card[style*="display: flex"] {
    display: flex !important;
}

/* Small Mobile Devices (up to 576px) */
@media (max-width: 576px) {
    .events-container {
        width: 100%;
        padding: 0 12px; /* Ensures padding from both sides */
        box-sizing: border-box; /* Prevents overflow */
    }
}

/* Large Mobile Devices (577px to 768px) */
@media (min-width: 577px) and (max-width: 768px) {
    .events-container {
        width: 95%;
        padding: 0 15px; /* Adds padding from both sides */
        box-sizing: border-box;
    }
}
