/* =========================================
   VARIABLES & RESET
   ========================================= */
:root {
    --card-radius: 32px;
    --card-bg: #ffffff;
    --text-main: #111111;
    --text-muted: #666666;
    --text-light: #999999;
    --border-color: #E5E5E5;
    
    /* Accent Color (Dynamic) */
    --accent-color: #6c9040; 
}

* {
    box-sizing: border-box;
}

/* body {
    font-family: 'Inter', sans-serif;
    background-color: #f4f4f4;
    display: flex;
    justify-content: center;
    padding: 40px;
} */

/* =========================================
   CARD CONTAINER
   ========================================= */
.event-card {
    width: 100%;
    max-width: 380px;
    background: var(--card-bg);
    border-radius: var(--card-radius);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.event-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.12);
}

/* =========================================
   HEADER (IMAGE) SECTION
   ========================================= */
.event-card__header {
    position: relative;
    width: 100%;
    height: 240px; 
    overflow: hidden;
}

.event-card__poster-wrapper {
    width: 100%;
    height: 100%;
    border-radius: 0 0 32px 0; /* Bottom-right corner curve */
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.event-card__poster {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease;
}

.event-card:hover .event-card__poster {
    transform: scale(1.05);
}

/* -----------------------------------------
   UPDATED: Horizontal Badge (Type)
   -----------------------------------------
*/
.event-card__type-badge {
    bottom: 70px;
    height: auto;
    border-radius: 0 12px 12px 0;
    display: flex;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: absolute;
    left: 0;
    width: fit-content;
    padding: 8px 16px 8px 16px;
    background: linear-gradient(to right, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.2) 100%);
    backdrop-filter: blur(1px);
    font-size: 0.85rem;
    font-weight: 700;
    color: #444;
    z-index: 4;
    padding-right: 40px;
}

.event-card__type-badge span {
    text-transform: uppercase;
    font-weight: 800;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    color: #333;
}

/* -----------------------------------------
   Horizontal Strip (Thematic Axis)
   -----------------------------------------
*/
.event-card__thematic-axis {
    bottom: 20px;
    height: auto;
    border-radius: 0 12px 12px 0;
    display: flex;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: absolute;
    left: 0;
    width: fit-content;
    padding: 8px 16px 8px 16px;
    background: linear-gradient(to right, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.2) 100%);
    backdrop-filter: blur(1px);
    font-size: 0.85rem;
    font-weight: 100;
    color: #444;
    z-index: 4;
    padding-right: 40px;
}

/* Shadow overlay for depth */
.event-card__header-shadow {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30%;
    background: linear-gradient(to top, rgba(0,0,0,0.1) 0%, transparent 100%);
    z-index: 2;
    pointer-events: none;
}

/* =========================================
   BODY SECTION
   ========================================= */
.event-card__body {
    display: flex;
    flex-direction: row;
    padding: 24px 0 32px 0;
}

/* --- Left Column (Date & Logo) --- */
.event-card__col-left {
    width: 80px; 
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    padding-top: 5px;
}

.event-card__date-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
}

.event-card__date-badge .month {
    font-size: 1.1rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--accent-color);
}

.event-card__date-badge .day {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--accent-color);
}

.event-card__logo-wrapper {
    margin-top: auto; 
    width: 60px;
    opacity: 1; 
    padding-bottom: 10px;
}

.event-card__logo {
    width: 100%;
    height: auto;
    display: block;
}

/* --- Divider --- */
.event-card__divider {
    width: 1px;
    background-color: var(--border-color);
    margin: 0 5px;
}

/* --- Right Column (Content) --- */
.event-card__col-right {
    flex-grow: 1;
    padding: 0 20px 0 15px;
    display: flex;
    flex-direction: column;
}

.event-card__location {
    display: flex;
    align-items: flex-start; /* Key change: aligns icon to top, not center */
    gap: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 4px;
}

.icon-pin {
    color: #444;
}

.event-card__partner {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.event-card__title {
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--text-main);
    margin: 0 0 4px 0;
    display: -webkit-box;
    -webkit-line-clamp: 9;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.event-card__subtitle {
    font-size: 1em;
    color: #666;
    margin: 0 0 4px 0;
}

/* Schedule List */
.event-card__schedule {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.schedule-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 6px;
}

.schedule-row svg {
    width: 14px;
    height: 14px;
    color: #999;
}

.schedule-row.is-past {
    text-decoration: line-through;
    opacity: 0.5;
}

.schedule-row.is-highlighted svg {
    color: var(--accent-color);
}

.schedule-row.is-highlighted {
    color: var(--accent-color);
    font-weight: 600;
}

.schedule-tbc {
    font-size: 0.8rem;
    font-style: italic;
    color: var(--text-light);
    margin-top: 4px;
}

.event-card__excerpt {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-muted);
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Footer Tags */
.event-card__footer {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-color);
}

/* Responsive Grid Logic */
.cp2026-events-grid {
    display: grid;
    gap: 40px;
    /* This allows the browser to fit as many cards as possible.
       It will create 3 columns if space permits, or drop to 2 or 1.
       Minimum card width is set to 320px.
    */
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    justify-content: center;
}

/* Ensure images and containers don't overflow on small screens */
.event-card {
    width: 100%;
    max-width: 100%; 
}

/* --- Fix for Map Pin Icon Consistency --- */
.event-card__location svg.icon-pin {
    width: 16px;
    height: 16px;
    min-width: 16px;
    flex-shrink: 0;
    margin-top: 3px; /* Pushes icon down to align with the text baseline */
}


/* Card Setup */
.event-card__poster-wrapper {
    position: relative;
    overflow: hidden;
}

/* Lottie "Live" Indicator */
.live-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    pointer-events: none;
    filter: drop-shadow(0px 2px 4px rgba(0,0,0,0.3));
}

/* Optional: Make the date badge turn green when live */
.event-card__date-badge.is-live-badge {
    color: #4CAF50; 
    border-color: #4CAF50;
}

/* --- Filter Bar Container --- */
.cp2026-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 40px;
    align-items: center;
}

/* --- Filter Groups (Wrappers) --- */
.cp2026-filter-bar .filter-group {
    flex: 1;
    min-width: 200px; /* Ensures they don't get too squashed on mobile */
    position: relative;
}

/* --- The Select Dropdowns (Stronger Selectors) --- */
.cp2026-filter-bar select.cp2026-select {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background-color: #ffffff;
    color: #333333;
    cursor: pointer;
    appearance: none; /* Removes default ugly browser arrow */
    -webkit-appearance: none;
    -moz-appearance: none;
    
    /* Custom Arrow Icon */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
}

/* Hover & Focus States */
.cp2026-filter-bar select.cp2026-select:hover {
    border-color: #cbd5e1;
}
.cp2026-filter-bar select.cp2026-select:focus {
    border-color: #6c9040; /* Your brand color */
    outline: none;
    box-shadow: 0 0 0 3px rgba(108, 144, 64, 0.1);
}

/* --- Mobile Stack --- */
@media (max-width: 768px) {
    .cp2026-filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
}

/* --- VIEW SWITCHER (Inside Filter Bar) --- */
.cp2026-filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}
.cp2026-filter-inputs {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    flex-grow: 1;
}
.cp2026-view-switcher {
    display: flex;
    gap: 5px;
}
.view-btn {
    background: transparent;
    border: 1px solid #ddd;
    color: #999;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s;
}
.view-btn:hover {
    border-color: #666;
    color: #333;
}
.view-btn.is-active {
    background: #333;
    border-color: #333;
    color: #fff;
}

/* --- MODAL POPUP --- */
.cp2026-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
    padding: 20px;
}
.cp2026-modal-overlay.is-open {
    opacity: 1;
    visibility: visible;
}
.cp2026-modal-content {
    background: transparent;
    max-width: 400px; /* Same as your card width */
    width: 100%;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s;
}
.cp2026-modal-overlay.is-open .cp2026-modal-content {
    transform: translateY(0);
}
/* Close Button */
.cp2026-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
}

/* --- VIEW STATES --- */
/* Helper classes to toggle views */
.view-hidden {
    display: none !important;
}





/* --- CAROUSEL MODAL STYLES --- */
.cp2026-carousel-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.cp-carousel-track {
    display: flex;
    transition: transform 0.3s ease-in-out;
    width: 100%;
}

.cp-carousel-slide {
    min-width: 100%; /* Show one card at a time */
    box-sizing: border-box;
    display: flex;
    justify-content: center;
}

/* Navigation Buttons */
.cp-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #fff;
    border: 1px solid #eee;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.cp-carousel-btn:hover {
    background: #333;
    color: #fff;
}
.cp-carousel-btn.prev { left: -15px; }
.cp-carousel-btn.next { right: -15px; }

/* Indicators (Dots) */
.cp-carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 15px;
}
.cp-carousel-indicators .dot {
    width: 8px;
    height: 8px;
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
}
.cp-carousel-indicators .dot.active {
    background: #fff;
}

/* Adjust Modal Width for Carousel */
.cp2026-modal-content {
    max-width: 450px; /* Give slightly more room for arrows */
}






/* --- COLUMN OVERRIDES --- */

/* Force 4 Columns when shortcode has cols="4" */
.cp2026-events-container[data-cols="4"] .cp2026-events-grid {
    grid-template-columns: repeat(4, 1fr);
}

/* Force 2 Columns when shortcode has cols="2" */
.cp2026-events-container[data-cols="2"] .cp2026-events-grid {
    grid-template-columns: repeat(2, 1fr);
}

/* Force 1 Column (List view style) */
.cp2026-events-container[data-cols="1"] .cp2026-events-grid {
    grid-template-columns: 1fr;
}

/* --- RESPONSIVE SAFETY CHECK --- */
/* Ensure 4 columns doesn't break small laptops/tablets */
@media (max-width: 1024px) {
    .cp2026-events-container[data-cols="4"] .cp2026-events-grid {
        grid-template-columns: repeat(3, 1fr); /* Drop to 3 on tablet landscape */
    }
}

@media (max-width: 768px) {
    /* On mobile, always force 1 column regardless of settings */
    .cp2026-events-container[data-cols="4"] .cp2026-events-grid,
    .cp2026-events-container[data-cols="3"] .cp2026-events-grid,
    .cp2026-events-container[data-cols="2"] .cp2026-events-grid {
        grid-template-columns: 1fr;
    }
}





/* --- PAGINATION CONTAINER --- */
.cp2026-pagination {
    margin-top: 60px !important; /* Override inline style for consistency */
    width: 100%;
    display: flex;
    justify-content: center;
}

/* Remove default list styles */
.cp2026-pagination ul.page-numbers {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px; /* Space between buttons */
    padding: 0;
    margin: 0;
    list-style: none !important;
    border: none;
}

.cp2026-pagination li {
    margin: 0 !important;
    padding: 0 !important;
    display: inline-block;
}

/* --- THE BUTTONS (Numbers & Arrows) --- */
.cp2026-pagination .page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    
    /* Typography */
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
    
    /* Colors & Borders */
    color: #333;
    background: #fff;
    border: 1px solid #E5E5E5; /* Light grey border */
    transition: all 0.2s ease;
    border-radius: 0; /* Square look to match your filters */
}

/* Hover State */
.cp2026-pagination a.page-numbers:hover {
    background-color: #f9f9f9;
    border-color: #999;
    color: #000;
}

/* Active State (Current Page) */
.cp2026-pagination .page-numbers.current {
    background-color: #333; /* Dark Grey matches your Filter Buttons */
    color: #fff;
    border-color: #333;
    cursor: default;
}

/* Arrows adjustment */
.cp2026-pagination .prev, 
.cp2026-pagination .next {
    font-size: 18px;
    padding-bottom: 4px; /* Visual alignment fix for arrows */
}