/* --- 1. Carousel Wrapper --- */
.my-event-carousel-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden; 
    background-color: #e9dedc; 
    padding: 60px 0; 
}

.mec-carousel-inner {
    display: flex;
    transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
    align-items: stretch;
    width: calc(100% - 120px);  
    margin-left: 0;             
    margin-right: auto;
    overflow: visible;
}

/* --- 2. Event Card Styling --- */
.mec-event-card {
    margin: 25px 18px; 
    flex-shrink: 0;
    box-sizing: border-box;
    text-decoration: none;
    position: relative;
    z-index: 1; 
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, visibility 0s ease-out 0.6s;
    transition-delay: 0s; 
}

/* --- Placeholder Card Styling --- */
.mec-placeholder-card {
    pointer-events: none;
}
.mec-placeholder-card::after {
    display: none;
}
.mec-placeholder-card .mec-placeholder-content {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    height: 100%;
    flex-grow: 1; 
    padding: 30px 20px;
    background: transparent;
    border: 2px dashed #4b6482; 
    opacity: 0.7;
    border-radius: 0; 
}
.mec-placeholder-card h3 {
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    color: #4b6482; 
    font-size: clamp(1.15rem, 1rem + 1.2vw, 1.5rem);
    line-height: 1.3; 
    margin: 0;
    border: none;
    padding: 0;
}

/* --- 3. Hover Outline --- */
.mec-event-card::after {
    content: '';
    position: absolute;
    top: -9px;
    left: -9px;
    right: -9px;
    bottom: -9px;
    border: 2px solid #302e2d;
    opacity: 1; 
    pointer-events: none;
    z-index: 2;
    transition: top 0.3s ease-out, left 0.3s ease-out, right 0.3s ease-out, bottom 0.3s ease-out;
}
.mec-event-card:hover::after {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

/* --- 4. Card Sections (Image & Content) --- */
.mec-card-image {
    position: relative; 
    width: 100%;
    padding-bottom: 60%; 
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 0;
    margin-bottom: 10px;
    will-change: transform;
}

/* --- Past Event Yellow Bar --- */
.mec-past-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #F9C80E;
    color: #302E2D;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    text-align: center;
    padding: 8px 10px;
    font-size: 14px;
    box-sizing: border-box;
    z-index: 3;
}

.mec-card-content {
    padding: 30px 20px 20px 20px;
    background: #4b6482;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    flex-grow: 1;  
    will-change: transform;
}

/* --- 5. Card Typography --- */
h3.mec-card-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    color: #f4eeed;
    font-size: clamp(1.15rem, 1rem + 1.2vw, 1.5rem);
    line-height: 1.1;
    margin-bottom: 15px;
    border-bottom: none;
    padding-bottom: 0;
}
.mec-card-excerpt {
    font-family: sans-serif;
    color: #f4eeed;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
    opacity: 0.9;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    min-height: 3.2em; 
}
.mec-card-meta-wrapper {
    flex-grow: 1; 
    display: flex;
    flex-direction: column;
    justify-content: flex-end; 
    position: relative;
    padding-top: 30px;
}
.mec-card-meta-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    border-top: 1px solid #f4eeed;
}
h4.mec-card-meta {
    font-size: 16px; 
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    color: #f4eeed;
    line-height: 1.5;
    margin: 0;
    padding: 0;
    border: none;
}

/* --- 6. Scroll-Reveal Animation --- */
body .my-event-carousel-wrapper .mec-event-card.is-in-view {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    transition-delay: 0s !important; 
}
body .my-event-carousel-wrapper .mec-event-card.is-in-view .mec-card-content {
    transition-property: transform;
    transition-duration: 0.6s;
    transition-timing-function: ease-out;
    transition-delay: 0s !important; 
}
body .my-event-carousel-wrapper .mec-event-card.is-in-view .mec-card-image {
    transition-property: transform;
    transition-duration: 0.6s;
    transition-timing-function: ease-out;
    transition-delay: 0.25s !important;
}

/* --- 7. Navigation Arrows --- */
.mec-nav-arrow {
    position: absolute;
    top: 0;
    height: 100%;
    width: 60px; 
    transform: none; 
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10; 
    color: #ffffff; 
    font-family: 'Poppins', sans-serif;
    font-size: 80px; 
    font-weight: 300;
    user-select: none;
    opacity: 0.7;
    transition: opacity 0.3s ease, color 0.3s ease;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}
.mec-nav-arrow.mec-prev {
    left: 0; 
    padding-left: 10px;
}
.mec-nav-arrow.mec-next {
    right: 0; 
    padding-right: 10px;
}
.mec-nav-arrow:hover {
    color: #ffffff; 
    opacity: 1; 
}

/* --- 8. Responsive Media Queries --- */
@media (max-width: 980px) {
    .mec-carousel-inner {
        width: calc(100% - 80px); 
    }
    .mec-nav-arrow {
        width: 50px;
    }
}

@media (max-width: 767px) {
    /* Compress the outer wrapper */
    body .my-event-carousel-wrapper {
        padding: 30px 0 !important; 
    }

    body .mec-carousel-inner {
        width: calc(100% - 50px) !important; 
    }

    /* Shrink the margins around the cards */
    body .my-event-carousel-wrapper .mec-event-card {
        margin: 15px 10px !important;
    }

    /* Shrink the padding INSIDE the cards */
    body .my-event-carousel-wrapper .mec-card-content {
        padding: 15px !important;
    }

    /* Pull the text elements tighter together */
    body .my-event-carousel-wrapper h3.mec-card-title {
        font-size: 1.1rem !important; 
        line-height: 1.2 !important; 
        margin-bottom: 10px !important;
        overflow: hidden !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 3 !important; 
        -webkit-box-orient: vertical !important;
    }

    body .my-event-carousel-wrapper .mec-card-excerpt {
        margin-bottom: 12px !important;
    }

    body .my-event-carousel-wrapper .mec-card-meta-wrapper {
        padding-top: 15px !important; 
    }

    body .my-event-carousel-wrapper .mec-nav-arrow {
        width: 40px !important;
        font-size: 50px !important;
    }

    /* THE SLEDGEHAMMER: Forces the Yellow Bar to ignore Divi's global link styles */
    body #page-container .my-event-carousel-wrapper a.mec-event-card .mec-past-bar,
    body .my-event-carousel-wrapper a.mec-event-card .mec-past-bar {
        background-color: #F9C80E !important;
        color: #302E2D !important;
        position: absolute !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 100% !important;
        padding: 6px 10px !important;
        font-size: 12px !important;
        z-index: 5 !important;
        display: block !important;
    }
}