/* ==========================================================================
   Events — shared by the homepage "Upcoming Events" carousel (incl/events.php)
   and the events index at /events/ (events.php).
   Card styles are shared; the carousel and grid layouts are separate.
   ========================================================================== */

/* ===== Events section wrapper (homepage carousel) ===== */
.our-events {
    padding: 100px 0;
    overflow: hidden;
}

/* ===== Carousel layout ===== */
.events-carousel-wrapper {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
}

.events-carousel {
    flex: 1 1 auto;
    overflow: hidden;
}

.events-track {
    display: flex;
}

/* ===== Events index page (/events/) ===== */
.events-index {
    padding: 80px 0 90px;
    background: #f7f6fc;
}

/* ===== Grid layout (events index) ===== */
.events-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 26px;
    margin-top: 26px;
}

/* Cards are laid out by the grid, so cancel the carousel's column sizing. */
.events-grid .event-card {
    flex: none;
    margin-right: 0;
}

.events-empty {
    text-align: center;
    color: #6b6b6b;
    font-size: 16px;
    padding: 60px 20px;
}

/* ===== Event card (shared) ===== */
.event-card {
    flex: 0 0 calc(33.333% - 20px);
    margin-right: 20px;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.event-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 36px rgba(115, 75, 223, 0.25);
}

.event-card-image {
    position: relative;
    overflow: hidden;
    height: 220px;
}

.event-card-image figure {
    margin: 0;
    height: 100%;
}

.event-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.event-card:hover .event-card-image img {
    transform: scale(1.08);
}

.event-date-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    background: #734BDF;
    color: #fff;
    border-radius: 10px;
    padding: 8px 12px;
    text-align: center;
    line-height: 1.1;
    box-shadow: 0 6px 14px rgba(115, 75, 223, 0.4);
}

.event-date-day {
    display: block;
    font-size: 20px;
    font-weight: 700;
}

.event-date-month {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.event-card-body {
    padding: 24px 26px 28px;
}

.event-meta {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 13px;
    color: #734BDF;
}

.event-meta li {
    display: flex;
    align-items: center;
    gap: 6px;
}

.event-card-body h3 {
    font-size: 20px;
    margin: 0 0 10px;
    line-height: 1.3;
}

/* The card title links to the event page — keep it looking like a heading
   rather than a default-styled link, with a hover cue. */
.event-card-body h3 a,
.event-card-body h3 a:hover,
.event-card-body h3 a:focus {
    color: inherit;
    text-decoration: none;
}

.event-card-body h3 a:hover,
.event-card-body h3 a:focus-visible {
    color: #734BDF;
}

.event-card-body p {
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 16px;
    color: #6b6b6b;
}

/* Past events are dimmed slightly so the toggle state is obvious at a glance. */
.event-card.is-past .event-card-image img {
    filter: grayscale(25%);
}

.event-card.is-past .event-date-badge {
    background: #6b6b6b;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
}

/* ===== Carousel nav arrows ===== */
.events-nav {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: transparent;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
}

.events-nav:hover {
    background: #734BDF;
    border-color: #734BDF;
    transform: scale(1.05);
}

.events-nav:active {
    transform: scale(0.95);
}

/* ===== Upcoming / Past toggle (events index) ===== */
.events-view-toggle {
    display: flex;
    justify-content: center;
    margin: 0 0 8px;
}

.ev-toggle-group {
    display: inline-flex;
    gap: 6px;
    padding: 6px;
    background: #efecfb;
    border-radius: 999px;
}

.ev-toggle-option {
    position: relative;
    margin: 0;
    cursor: pointer;
}

/* Keep the radio focusable and keyboard-operable — visually hidden, not removed. */
.ev-toggle-option input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: 0;
}

.ev-toggle-option span {
    display: block;
    padding: 11px 26px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
    color: #4c3a8f;
    transition: background 0.25s ease, color 0.25s ease;
    white-space: nowrap;
}

.ev-toggle-option:hover span {
    background: #e2ddf7;
}

.ev-toggle-option input:checked + span {
    background: #734BDF;
    color: #fff;
}

.ev-toggle-option input:focus-visible + span {
    outline: 2px solid #734BDF;
    outline-offset: 2px;
}

/* ===== Responsive: 3 / 2 / 1 columns ===== */
@media (max-width: 991px) {
    .event-card {
        flex: 0 0 calc(50% - 20px);
    }

    .events-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .events-nav {
        flex: 0 0 40px;
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 575px) {
    .our-events {
        padding: 60px 0;
    }

    .event-card {
        flex: 0 0 calc(100% - 20px);
    }

    .events-grid {
        grid-template-columns: 1fr;
    }

    .events-carousel-wrapper {
        gap: 8px;
    }

    .ev-toggle-option span {
        padding: 10px 18px;
        font-size: 14px;
    }
}
