/**
 * Community Events CSS - Theme-Aware
 * Responsive styles for event calendar, lists, and displays
 */

/* ========================================
   Calendar Views
   ======================================== */

.community-events-calendar {
    margin: 20px 0;
    font-family: var(--comm-font-body, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif);
    color: var(--wp--preset--color--foreground, #333);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--wp--preset--color--tertiary, #f5f5f5);
    border-radius: 8px;
}

.calendar-header h2 {
    margin: 0;
    font-size: 1.15em;
    font-weight: 600;
    color: var(--wp--preset--color--foreground, #333);
}

.calendar-header button {
    padding: 8px 16px;
    background: var(--wp--preset--color--primary, #0073aa);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.3s ease;
}

.calendar-header button:hover {
    background: var(--wp--preset--color--secondary, #005a87);
}

.calendar-header .nav-week-prev,
.calendar-header .nav-week-next {
    padding: 8px 16px;
    background: var(--wp--preset--color--primary, #0073aa);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    text-decoration: none;
    transition: background 0.3s ease;
}

.calendar-header .nav-week-prev:hover,
.calendar-header .nav-week-next:hover {
    background: var(--wp--preset--color--secondary, #005a87);
    color: white;
}

/* Month View Grid */
.calendar-grid {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--wp--preset--color--primary, #0073aa);
    color: white;
}

.weekday {
    padding: 12px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9em;
}

.calendar-days {
    display: flex;
    flex-direction: column;
}

/* Each week row wraps the optional multi-day bar row + the day cells */
.calendar-week {
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid #ddd;
}

.calendar-week:last-child {
    border-bottom: none;
}

/* Grid row that holds spanning multi-day event bars */
.multi-day-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: 22px;
    background: var(--wp--preset--color--background, white);
    padding: 2px 0 1px;
    border-bottom: 1px solid #eee;
}

/* Individual spanning bar */
.multi-day-event-bar {
    height: 20px;
    margin: 1px 2px;
    border-radius: 3px;
    background: var(--wp--preset--color--primary, #0073aa);
    color: #fff;
    font-size: 0.68em;
    font-weight: 500;
    line-height: 20px;
    overflow: hidden;
    white-space: nowrap;
}

.multi-day-event-bar a {
    display: block;
    color: #fff;
    text-decoration: none;
    padding: 0 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    height: 100%;
}

.multi-day-event-bar a:hover {
    text-decoration: underline;
}

/* Bar continues from previous week row: square left edge, no left margin */
.multi-day-event-bar.continues-left {
    border-radius: 0 3px 3px 0;
    margin-left: 0;
}

/* Bar continues into next week row: square right edge, no right margin */
.multi-day-event-bar.continues-right {
    border-radius: 3px 0 0 3px;
    margin-right: 0;
}

.multi-day-event-bar.continues-left.continues-right {
    border-radius: 0;
    margin-left: 0;
    margin-right: 0;
}

.multi-day-event-bar.is-cancelled {
    background: #d63638;
    opacity: 0.88;
}

/* The 7 day cells inside each week */
.week-cells {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #ddd;
}

.calendar-day {
    background: var(--wp--preset--color--background, white);
    aspect-ratio: 1 / 1;
    padding: 6px 5px 4px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.calendar-day.empty {
    background: #f9f9f9;
}

.calendar-day.today {
    background: #fffbf0;
    box-shadow: inset 0 0 0 2px var(--wp--preset--color--primary, #f0a000);
}

/* Has-events: tint cell background */
.calendar-day.has-events {
    background-color: #e8f4fb;
    cursor: pointer;
}

/* Day number and events stay above everything */
.calendar-day.has-events .day-number,
.calendar-day.has-events .day-events {
    position: relative;
    z-index: 1;
}

.day-number {
    font-weight: 600;
    font-size: 0.85em;
    margin-bottom: 4px;
    color: var(--wp--preset--color--foreground, #333);
}

.day-events {
    margin-top: 2px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    overflow: hidden;
}

/* Event title rows inside calendar cells */
.day-event-title {
    display: block;
    font-size: 0.68em;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--wp--preset--color--primary, #0073aa);
    text-decoration: none;
    background: rgba(0, 115, 170, 0.08);
    border-radius: 2px;
    padding: 1px 3px;
}

.day-event-title:hover {
    background: rgba(0, 115, 170, 0.18);
    color: var(--wp--preset--color--secondary, #005a87);
    text-decoration: underline;
}

.day-event-title.is-cancelled {
    background: rgba(214, 54, 56, 0.16);
    color: #8a1c1d;
}

.day-event-title.is-cancelled:hover {
    background: rgba(214, 54, 56, 0.25);
    color: #6f1718;
}

.day-event-more {
    font-size: 0.62em;
    color: #888;
    line-height: 1.2;
    padding: 1px 3px;
}

/* ----------------------------------------
   Calendar Day Hover Popup
   ---------------------------------------- */
.cal-day-popup {
    position: fixed;
    z-index: 9999;
    width: 280px;
    max-height: min(80vh, 400px);
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
    padding: 10px 12px;
    pointer-events: none;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.cal-day-popup.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.cal-day-popup .popup-date {
    font-size: 0.78em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--wp--preset--color--primary, #0073aa);
    margin-bottom: 7px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
}

.cal-day-popup .popup-events {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.cal-day-popup .popup-event-item {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 8px;
}

/* Small thumbnail in popup */
.cal-day-popup .popup-event-thumb {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}

.cal-day-popup .popup-event-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.cal-day-popup .popup-event-item a {
    font-size: 0.82em;
    font-weight: 600;
    color: #1a1a1a;
    text-decoration: none;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.cal-day-popup .popup-event-item a:hover {
    color: var(--wp--preset--color--primary, #0073aa);
    text-decoration: underline;
}

.cal-day-popup .popup-event-meta {
    font-size: 0.72em;
    color: #666;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Keep non-calendar event-item unchanged (list/week views) */
.event-item {
    display: block;
    padding: 4px 6px;
    margin: 2px 0;
    background: #0073aa;
    color: white;
    text-decoration: none;
    border-radius: 3px;
    font-size: 0.85em;
    transition: background 0.2s ease;
}

.event-item:hover {
    background: #005a87;
}

.event-time {
    font-weight: 600;
    margin-right: 4px;
}

.event-title {
    display: inline;
}

.event-item.event-cancelled {
    background: #c73335;
}

.event-item.event-cancelled:hover {
    background: #a42a2c;
}

.event-status-badge {
    display: inline-block;
    margin: 4px 0 8px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.75em;
    font-weight: 600;
    background: rgba(0, 115, 170, 0.12);
    color: #005a87;
}

.event-status-badge.event-status-cancelled {
    background: rgba(214, 54, 56, 0.14);
    color: #8a1c1d;
}

/* Week View */
.week-view .week-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
}

.week-day {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    background: white;
}

.week-day h3 {
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #0073aa;
    font-size: 1.1em;
    color: #333;
}

.week-day .event-item {
    margin: 10px 0;
    padding: 10px;
    background: #f5f5f5;
    border-left: 4px solid #0073aa;
}

.week-day .event-item a {
    text-decoration: none;
    color: #333;
}

.week-day .event-time {
    display: block;
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

.week-day .event-title {
    display: block;
    font-weight: 600;
}

/* Day View */
.day-view .day-events-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ========================================
   Event List Views
   ======================================== */

.community-events-list {
    margin: 20px 0;
}

.event-style-list {
    display: flex;
    gap: 20px;
    padding: 20px;
    margin: 15px 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    transition: box-shadow 0.3s ease;
}

.event-style-list:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.event-thumbnail {
    flex-shrink: 0;
    width: 200px;
}

.event-thumbnail img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.event-details {
    flex-grow: 1;
}

.event-details h3 {
    margin: 0 0 10px 0;
    font-size: 1.5em;
}

.event-details h3 a {
    color: #0073aa;
    text-decoration: none;
}

.event-details h3 a:hover {
    color: #005a87;
}

.event-date-time {
    display: flex;
    gap: 15px;
    margin: 10px 0;
    font-size: 1em;
    color: #666;
}

.event-date::before {
    content: '📅 ';
}

.event-time::before {
    content: '🕐 ';
}

.event-location {
    margin: 10px 0;
    color: #666;
}

.event-excerpt {
    margin: 15px 0;
    line-height: 1.6;
    color: #333;
}

.event-link {
    display: inline-block;
    padding: 8px 20px;
    background: #0073aa;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.event-link:hover {
    background: #005a87;
}

/* ========================================
   Upcoming Events Widget
   ======================================== */

.community-events-upcoming {
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.community-events-upcoming h3,
.upcoming-events-heading {
    margin: 0 0 15px 0;
    font-size: 1.3em;
    color: #333;
}

/* ── List layout ── */
.upcoming-events-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.upcoming-events-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 10px 0;
    padding: 10px;
    background: white;
    border-left: 4px solid #0073aa;
    border-radius: 4px;
}

.upcoming-events-list .upcoming-event-thumb-link {
    flex-shrink: 0;
    display: block;
    line-height: 0;
}

.upcoming-events-list .upcoming-event-thumb {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}

.upcoming-events-list .upcoming-event-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.upcoming-events-list .upcoming-event-info a {
    display: flex;
    gap: 10px;
    align-items: baseline;
    text-decoration: none;
    color: #333;
}

.upcoming-events-list .event-date {
    flex-shrink: 0;
    font-weight: 600;
    color: #0073aa;
    font-size: 0.9em;
}

.upcoming-events-list .event-title {
    flex-grow: 1;
}

.upcoming-events-list .event-time,
.upcoming-events-list .event-location {
    font-size: 0.82em;
    color: #666;
}

.upcoming-events-list .event-excerpt {
    font-size: 0.85em;
    color: #555;
    margin: 4px 0 0;
}

/* ── Card layout ── */
.upcoming-events-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.upcoming-event-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-top: 4px solid #0073aa;
    display: flex;
    flex-direction: row;
    align-items: stretch;
}

.upcoming-event-card-thumb {
    display: block;
    flex-shrink: 0;
    width: 140px;
    overflow: hidden;
    line-height: 0;
}

.upcoming-event-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.upcoming-event-card-thumb--placeholder {
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upcoming-event-thumb-placeholder-icon {
    font-size: 2.5em;
    line-height: 1;
}

.upcoming-event-card-body {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.upcoming-event-card-date {
    font-size: 0.82em;
    font-weight: 600;
    color: #0073aa;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.upcoming-event-card-time {
    font-weight: 400;
    color: #555;
}

.upcoming-event-card-title {
    margin: 0;
    font-size: 1em;
    line-height: 1.35;
}

.upcoming-event-card-title a {
    color: #222;
    text-decoration: none;
}

.upcoming-event-card-title a:hover {
    color: #0073aa;
}

.upcoming-event-card-location {
    font-size: 0.82em;
    color: #666;
}

.upcoming-event-card-excerpt {
    font-size: 0.85em;
    color: #555;
    margin: 0;
    line-height: 1.5;
}

.upcoming-event-card-link {
    display: inline-block;
    margin-top: 4px;
    padding: 5px 12px;
    background: #0073aa;
    color: #fff !important;
    border-radius: 4px;
    font-size: 0.82em;
    font-weight: 600;
    text-decoration: none;
    align-self: flex-start;
}

.upcoming-event-card-link:hover {
    opacity: 0.88;
}

/* ── Grid layout ── */
.upcoming-events-grid {
    display: grid;
    grid-template-columns: repeat(var(--upcoming-grid-columns, 3), 1fr);
    gap: 20px;
}

.upcoming-event-grid-item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-top: 4px solid #0073aa;
    display: flex;
    flex-direction: column;
}

.upcoming-event-grid-thumb {
    display: flex;
    line-height: 0;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: #e9ecef;
    align-items: center;
    justify-content: center;
}

.upcoming-event-grid-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.upcoming-event-grid-body {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.upcoming-event-grid-date {
    font-size: 0.82em;
    font-weight: 600;
    color: #0073aa;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.upcoming-event-grid-title {
    margin: 0;
    font-size: 1em;
    line-height: 1.35;
}

.upcoming-event-grid-title a {
    color: #222;
    text-decoration: none;
}

.upcoming-event-grid-title a:hover {
    color: #0073aa;
}

.upcoming-event-grid-location {
    font-size: 0.82em;
    color: #666;
}

.upcoming-event-grid-excerpt {
    font-size: 0.85em;
    color: #555;
    margin: 0;
    line-height: 1.5;
}

/* Responsive: stack grid to 2 col on tablet, 1 col on mobile */
@media (max-width: 900px) {
    .upcoming-events-grid {
        grid-template-columns: repeat(min(var(--upcoming-grid-columns, 3), 2), 1fr);
    }

    .upcoming-event-card {
        flex-direction: column;
    }

    .upcoming-event-card-thumb {
        width: 100%;
        height: 180px;
    }
}

@media (max-width: 600px) {
    .upcoming-events-grid {
        grid-template-columns: 1fr;
    }

    /* List layout: stack thumbnail above event info on mobile */
    .upcoming-events-list li {
        flex-direction: column;
        gap: 8px;
    }

    .upcoming-events-list .upcoming-event-thumb-link {
        width: 100%;
    }

    .upcoming-events-list .upcoming-event-thumb {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
        border-radius: 4px 4px 0 0;
    }

    /* Stack date and title vertically in the info block */
    .upcoming-events-list .upcoming-event-info a {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    /* Card layout: reduce thumbnail height on small phones */
    .upcoming-event-card-thumb {
        height: 140px;
    }
}

/* ========================================
   Event Countdown
   ======================================== */

.community-event-countdown {
    text-align: center;
    padding: 30px;
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: white;
    border-radius: 8px;
    margin: 20px 0;
}

.community-event-countdown h3 {
    margin: 0 0 20px 0;
    font-size: 1.8em;
}

.countdown-timer {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.countdown-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.countdown-value {
    font-size: 2.5em;
    font-weight: 700;
    line-height: 1;
}

.countdown-label {
    font-size: 0.9em;
    margin-top: 5px;
    opacity: 0.9;
}

/* ========================================
   Event Slider
   ======================================== */

.community-events-slider {
    position: relative;
    margin: 20px 0;
    overflow: hidden;
    border-radius: 8px;
}

.slider-container {
    position: relative;
    min-height: 400px;
}

.slider-item {
    display: none;
    position: relative;
}

.slider-item.active {
    display: block;
}

.slider-image img {
    width: 100%;
    height: 400px;
    object-fit: cover;
}

.slider-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: white;
}

.slider-content h3 {
    margin: 0 0 10px 0;
    font-size: 2em;
}

.slider-date {
    margin: 10px 0;
    font-size: 1.1em;
}

.slider-link {
    display: inline-block;
    padding: 10px 25px;
    margin-top: 10px;
    background: #0073aa;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.slider-link:hover {
    background: #005a87;
}

.slider-prev,
.slider-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1.5em;
    transition: background 0.3s ease;
    z-index: 10;
}

.slider-prev {
    left: 10px;
}

.slider-next {
    right: 10px;
}

.slider-prev:hover,
.slider-next:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* ========================================
   Event Map
   ======================================== */

.community-events-map-wrapper {
    margin: 20px 0;
}

.community-events-map {
    border: 1px solid #ddd;
    border-radius: 8px 8px 0 0;
    margin: 20px 0 0;
}

/* ── Custom map pins ──────────────────────────────────────────────── */
.cem-pin {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 3px 8px rgba(0,0,0,0.4);
    border: 2px solid rgba(255,255,255,0.85);
    transition: transform 0.15s ease;
    cursor: pointer;
}
.cem-pin:hover { transform: scale(1.1); }

.cem-pin-single {
    width: 36px;
    height: 36px;
    font-size: 1.1em;
}
.cem-pin-multi {
    width: 44px;
    height: 44px;
    font-size: 0.75em;
    flex-direction: column;
    gap: 0;
}
.cem-pin-count {
    font-size: 1.15em;
    font-weight: 800;
    line-height: 1;
}
.cem-pin-emoji {
    font-size: 0.85em;
    line-height: 1;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", sans-serif;
}

/* ── Mobile: two-finger gesture hint ────────────────────────────── */
.cem-gesture-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.9em;
    font-family: var(--comm-font-body, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
    white-space: nowrap;
    z-index: 1001;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
.cem-gesture-hint--active {
    opacity: 1;
}

/* ── Geographic cluster icon ─────────────────────────────────────── */
.cem-cluster {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #6c3483;
    color: #fff;
    font-size: 1em;
    font-weight: 800;
    box-shadow: 0 3px 10px rgba(0,0,0,0.35);
    border: 2px solid rgba(255,255,255,0.85);
    cursor: pointer;
}

/* ── Map popup ──────────────────────────────────────────────────────── */
.cem-map-popup .leaflet-popup-content-wrapper {
    border-radius: 10px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.cem-map-popup .leaflet-popup-content {
    margin: 0;
    min-width: 220px;
    max-width: 320px;
}
.cem-popup-wrap {
    font-family: var(--comm-font-body, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
    font-size: 13px;
    color: #333;
}
.cem-popup-header {
    padding: 8px 12px;
    font-size: 0.75em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #fff;
}
.cem-popup-type-events   { background: #c0392b; }
.cem-popup-type-venue    { background: #d35400; }
.cem-popup-type-org      { background: #2471a3; }
.cem-popup-type-business { background: #1e8449; }

/* ── Map legend ──────────────────────────────────────────────────── */
.community-events-map-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    padding: 8px 12px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    font-size: 0.85em;
    color: #444;
}
.cem-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}
.cem-legend-item::before {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}
.cem-legend-event::before   { background: #c0392b; }
.cem-legend-venue::before   { background: #d35400; }
.cem-legend-org::before     { background: #2471a3; }
.cem-legend-business::before { background: #1e8449; }

.cem-popup-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.cem-popup-item {
    display: flex;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    align-items: flex-start;
}
.cem-popup-item:last-child { border-bottom: none; }

.cem-popup-thumb-link { flex-shrink: 0; }
.cem-popup-thumb {
    width: 54px;
    height: 54px;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}
.cem-popup-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}
.cem-popup-title {
    font-weight: 600;
    color: #1a1a1a;
    text-decoration: none;
    font-size: 0.95em;
    line-height: 1.3;
    word-break: break-word;
}
.cem-popup-title:hover { color: var(--wp--preset--color--primary, #0073aa); }
.cem-popup-meta {
    font-size: 0.8em;
    color: var(--wp--preset--color--primary, #0073aa);
    font-weight: 500;
}
.cem-popup-loc {
    font-size: 0.78em;
    color: #666;
}
.cem-popup-more {
    padding: 7px 12px;
    font-size: 0.78em;
    color: #888;
    font-style: italic;
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
}

/* ========================================
   Responsive Design
   ======================================== */

/* Weekday name visibility helpers (controlled by mobile media queries) */
.wday-short { display: none; }
.wday-long  { display: inline; }

/* Mobile agenda panel – hidden until JS activates it on mobile */
.cal-mobile-agenda {
    display: none;
}

@media screen and (max-width: 768px) {
    /* Mobile map – slightly larger pins for easier finger tapping */
    .cem-pin-single {
        width: 40px;
        height: 40px;
    }
    .cem-pin-multi {
        width: 48px;
        height: 48px;
    }
    .cem-pin-emoji {
        font-size: 1em;
    }

    /* Popup is narrower on mobile */
    .cal-day-popup {
        width: 200px;
    }
    
    /* Week view stacks on mobile */
    .week-view .week-grid {
        grid-template-columns: 1fr;
    }
    
    /* List view adjustments */
    .event-style-list {
        flex-direction: column;
    }
    
    .event-thumbnail {
        width: 100%;
    }
    
    /* Countdown adjustments */
    .countdown-timer {
        gap: 10px;
    }
    
    .countdown-unit {
        min-width: 60px;
        padding: 10px;
    }
    
    .countdown-value {
        font-size: 1.8em;
    }
}

/* ========================================
   Mobile Calendar – Modern Compact Design
   Mini-grid with dot indicators + agenda panel
   ======================================== */

@media screen and (max-width: 600px) {
    /* ----- Calendar header: keep nav + title in one row ----- */
    .community-events-calendar.month-view .calendar-header {
        flex-direction: row;
        flex-wrap: nowrap;
        padding: 8px 10px;
        gap: 4px;
        margin-bottom: 0;
        border-radius: 8px 8px 0 0;
        justify-content: space-between;
        align-items: center;
    }

    .community-events-calendar.month-view .calendar-header h2 {
        font-size: 0.9em;
        text-align: center;
        flex: 1;
        margin: 0 4px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .community-events-calendar.month-view .calendar-header button {
        padding: 5px 8px;
        font-size: 0.75em;
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* Merge header bottom edge with grid */
    .community-events-calendar.month-view .calendar-grid {
        border-radius: 0;
        border-top: none;
    }

    /* Single-letter weekday labels */
    .wday-long  { display: none; }
    .wday-short { display: inline; }

    .weekday {
        padding: 6px 2px;
        font-size: 0.8em;
    }

    /* Uniform compact cells – aspect-ratio keeps them square */
    .calendar-day {
        aspect-ratio: 1 / 1;
        height: auto;
        max-height: none;
        min-height: 0;
        padding: 4px 2px 2px;
        align-items: center;
        justify-content: flex-start;
        cursor: default;
    }

    .calendar-day.has-events {
        cursor: pointer;
    }

    /* Circular day-number badge */
    .day-number {
        width: 26px;
        height: 26px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        font-size: 0.82em;
        font-weight: 600;
        margin: 0 auto 2px;
    }

    /* Today: filled circle instead of box-shadow ring */
    .calendar-day.today {
        background: var(--wp--preset--color--background, #fff);
        box-shadow: none;
    }

    .calendar-day.today .day-number {
        background: var(--wp--preset--color--primary, #0073aa);
        color: #fff;
    }

    /* Selected day highlight */
    .community-events-calendar.month-view .calendar-day.mob-selected {
        background: rgba(0, 115, 170, 0.08);
        box-shadow: none;
    }

    .community-events-calendar.month-view .calendar-day.mob-selected .day-number {
        background: var(--wp--preset--color--primary, #0073aa);
        color: #fff;
    }

    /* Hide event text inside cells; show dots instead */
    .day-event-title,
    .day-event-more {
        display: none !important;
    }

    /* Hide multi-day bars on mobile; dots on covered day cells handle indication */
    .multi-day-row {
        display: none;
    }

    /* Dot row below day number */
    .calendar-day.has-events .day-events {
        flex-direction: row;
        justify-content: center;
        gap: 3px;
        margin-top: 1px;
    }

    /* Render up to 3 dots via generated content on the container */
    .calendar-day.has-events .day-events::before {
        content: '';
        display: block;
        width: 5px;
        height: 5px;
        border-radius: 50%;
        background: var(--wp--preset--color--primary, #0073aa);
    }

    /* Dot turns white when day is selected */
    .community-events-calendar.month-view .calendar-day.mob-selected .day-events::before {
        background: var(--wp--preset--color--primary, #0073aa);
        opacity: 0.6;
    }

    /* ----- Mobile agenda panel ----- */
    .cal-mobile-agenda {
        display: none; /* shown via .active class added by JS */
        border: 1px solid #ddd;
        border-top: none;
        border-radius: 0 0 8px 8px;
        background: #fff;
        max-height: 340px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .cal-mobile-agenda.active {
        display: block;
    }

    .cal-mob-agenda-date {
        position: sticky;
        top: 0;
        background: var(--wp--preset--color--tertiary, #f5f5f5);
        font-size: 0.78em;
        font-weight: 700;
        color: var(--wp--preset--color--primary, #0073aa);
        padding: 8px 14px;
        border-bottom: 1px solid #e0e0e0;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        z-index: 1;
    }

    .cal-mob-agenda-list {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .cal-mob-agenda-item {
        display: flex;
        align-items: flex-start;
        gap: 10px;
        padding: 10px 14px;
        border-bottom: 1px solid #f0f0f0;
        text-decoration: none;
        color: inherit;
        transition: background 0.15s;
    }

    .cal-mob-agenda-item:last-child {
        border-bottom: none;
    }

    .cal-mob-agenda-item:active {
        background: #f5f5f5;
    }

    .cal-mob-agenda-thumb {
        width: 52px;
        height: 52px;
        border-radius: 6px;
        object-fit: cover;
        flex-shrink: 0;
    }

    .cal-mob-agenda-info {
        flex: 1;
        min-width: 0;
    }

    .cal-mob-agenda-title {
        display: block;
        font-size: 0.92em;
        font-weight: 600;
        color: var(--wp--preset--color--foreground, #222);
        line-height: 1.3;
        margin-bottom: 4px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .cal-mob-agenda-meta {
        font-size: 0.76em;
        color: #666;
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .cal-mob-agenda-empty {
        padding: 16px 14px;
        color: #888;
        font-size: 0.85em;
        text-align: center;
    }
}

/* ========================================
   3D EVENT SLIDER
   Modern flyer-based slider with GSAP effects
   ======================================== */

.community-events-slider-3d {
    position: relative;
    max-width: 1200px;
    margin: 40px auto;
    perspective: 2000px;
}

.slider-wrapper-3d {
    position: relative;
    min-height: 600px;
    overflow: hidden;
}

.event-slide-3d {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    opacity: 0;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    overflow: hidden;
}

.event-slide-3d.active {
    display: flex;
    opacity: 1;
}

/* Left: Flyer Container (8.5x11 aspect ratio) */
.event-flyer-container {
    flex: 0 0 45%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
}

.flyer-3d-wrapper {
    width: 100%;
    max-width: 100%;
    /* Fallback for browsers without aspect-ratio support */
    position: relative;
    padding-bottom: 129.41%; /* 11/8.5 * 100 = 129.41% for 8.5x11 ratio */
    aspect-ratio: 8.5 / 11;
    transform-style: preserve-3d;
    cursor: pointer;
    transition: transform 0.3s ease;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    border-radius: 12px;
    overflow: hidden;
}

/* Reset padding when aspect-ratio is supported */
@supports (aspect-ratio: 1) {
    .flyer-3d-wrapper {
        padding-bottom: 0;
    }
}

.flyer-image {
    width: 100%;
    height: 100%;
    background: white;
    position: absolute;
    top: 0;
    left: 0;
}

.flyer-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.flyer-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    text-align: center;
    color: white;
}

.flyer-placeholder .event-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.flyer-placeholder h3 {
    font-size: 28px;
    margin: 0;
    line-height: 1.3;
}

/* Right: Event Info */
.event-info-container {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 40px 50px;
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(248,248,248,0.95) 100%);
    backdrop-filter: blur(10px);
}

.event-info-content {
    width: 100%;
}

.event-title {
    font-size: 42px;
    font-weight: 800;
    margin: 0 0 25px 0;
    color: var(--wp--preset--color--primary, #c1440e);
    line-height: 1.2;
}

.event-meta {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    color: #555;
}

.meta-item .dashicons {
    width: 24px;
    height: 24px;
    font-size: 24px;
    color: var(--wp--preset--color--primary, #c1440e);
}

.event-excerpt {
    margin-bottom: 30px;
}

.event-excerpt p {
    font-size: 17px;
    line-height: 1.7;
    color: #666;
    margin: 0;
}

.event-actions {
    margin-top: 35px;
}

.btn-learn-more {
    display: inline-block;
    padding: 16px 40px;
    background: linear-gradient(135deg, var(--wp--preset--color--primary, #c1440e) 0%, var(--wp--preset--color--secondary, #8b2f0a) 100%);
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 18px;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(193, 68, 14, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-learn-more:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(193, 68, 14, 0.4);
    color: white;
}

/* Navigation */
.slider-navigation-3d {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
}

.slider-btn-3d {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--wp--preset--color--primary, #c1440e);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(193, 68, 14, 0.3);
}

.slider-btn-3d:hover {
    background: var(--wp--preset--color--secondary, #8b2f0a);
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(193, 68, 14, 0.4);
}

.slider-btn-3d .dashicons {
    width: 24px;
    height: 24px;
    font-size: 24px;
}

.slider-dots-3d {
    display: flex;
    gap: 12px;
}

.slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ccc;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.slider-dot:hover {
    background: #999;
    transform: scale(1.2);
}

.slider-dot.active {
    background: var(--wp--preset--color--primary, #c1440e);
    width: 40px;
    border-radius: 6px;
}

/* No events message */
.no-events-slider {
    padding: 60px 30px;
    text-align: center;
    background: var(--wp--preset--color--tertiary, #f5f5f5);
    border-radius: 16px;
}

.no-events-slider p {
    font-size: 18px;
    color: #666;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 992px) {
    .event-slide-3d {
        flex-direction: column;
        min-height: auto;
    }
    
    .event-flyer-container {
        flex: 0 0 auto;
        padding: 30px;
    }
    
    .flyer-3d-wrapper {
        max-width: 350px;
    }
    
    .event-info-container {
        padding: 30px;
    }
    
    .event-title {
        font-size: 32px;
    }
    
    .meta-item {
        font-size: 16px;
    }
    
    .event-excerpt p {
        font-size: 15px;
    }
    
    .btn-learn-more {
        padding: 14px 32px;
        font-size: 16px;
    }
}

@media (max-width: 640px) {
    .event-flyer-container {
        padding: 20px;
    }
    
    .flyer-3d-wrapper {
        max-width: 280px;
    }
    
    .event-info-container {
        padding: 20px;
    }
    
    .event-title {
        font-size: 26px;
        margin-bottom: 20px;
    }
    
    .meta-item {
        font-size: 15px;
    }
    
    .event-excerpt p {
        font-size: 14px;
    }
    
    .btn-learn-more {
        display: block;
        text-align: center;
        padding: 12px 24px;
        font-size: 15px;
    }
    
    .slider-btn-3d {
        width: 40px;
        height: 40px;
    }
    
    .slider-btn-3d .dashicons {
        width: 20px;
        height: 20px;
        font-size: 20px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .flyer-3d-wrapper,
    .slider-btn-3d,
    .slider-dot,
    .btn-learn-more {
        transition: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .event-slide-3d {
        border: 3px solid currentColor;
    }
    
    .slider-btn-3d,
    .btn-learn-more {
        border: 2px solid white;
    }
}

/* ========================================
   Single Event Page (single-comm_event)
   ======================================== */

.comm-single-event {
    margin: 0;
    padding: 0;
}

/* Banner */
.cev-banner {
    position: relative;
    width: 100%;
    min-height: 300px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--wp--preset--color--primary, #c1440e) 0%, #2d3748 100%);
}

.cev-banner-image img {
    width: 100%;
    max-height: 480px;
    object-fit: contain;
    display: block;
}

.cev-banner-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    background: linear-gradient(135deg, var(--wp--preset--color--primary, #c1440e) 0%, #2d3748 100%);
}

.cev-banner-icon {
    font-size: 5rem;
    opacity: 0.5;
}

.cev-banner-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px 40px;
    background: linear-gradient(transparent, rgba(0,0,0,0.75));
    color: #fff;
}

.cev-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.cev-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cev-badge-status { background: rgba(255,255,255,0.25); color: #fff; }
.cev-badge-format { background: rgba(255,200,0,0.35); color: #fff; }
.cev-status-cancelled { background: rgba(200,0,0,0.5); }
.cev-status-postponed { background: rgba(200,130,0,0.5); }
.cev-status-completed { background: rgba(0,130,0,0.4); }

.cev-title {
    margin: 0 0 10px;
    font-size: 2.2em;
    color: #fff;
    text-shadow: 0 2px 6px rgba(0,0,0,0.5);
    line-height: 1.2;
}

.cev-banner-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.95em;
    color: rgba(255,255,255,0.9);
}

.cev-banner-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Layout */
.cev-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 30px;
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

/* Main column */
.cev-main {
    display: flex;
    flex-direction: column;
    gap: 30px;
    min-width: 0;
}

/* Sections */
.cev-section {
    background: #fff;
    border-radius: 8px;
    padding: 28px 30px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.cev-section-title {
    margin: 0 0 18px;
    font-size: 1.3em;
    color: #333;
    border-bottom: 3px solid var(--wp--preset--color--primary, #c1440e);
    padding-bottom: 10px;
}

.cev-content { line-height: 1.7; color: #444; }
.cev-no-description { color: #888; font-style: italic; }

/* Map */
.cev-map { border-radius: 8px; overflow: hidden; margin-top: 12px; }
.cev-map-address { margin: 0 0 10px; color: #444; }
.cev-directions-link { margin-top: 10px; font-size: 0.9em; }
.cev-directions-link a { color: var(--wp--preset--color--primary, #c1440e); text-decoration: none; }
.cev-directions-link a:hover { text-decoration: underline; }

/* Virtual links */
.cev-virtual-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.cev-virtual-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95em;
    transition: opacity 0.2s;
    color: #fff;
}

.cev-virtual-btn:hover { opacity: 0.85; color: #fff; }
.cev-virtual-zoom  { background: #2d8cff; }
.cev-virtual-teams { background: #464EB8; }
.cev-virtual-meet  { background: #00897b; }
.cev-virtual-webex { background: #007ab8; }

.cev-video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 8px;
}

.cev-video-wrapper iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
}

/* Sidebar */
.cev-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cev-sidebar-card {
    background: #fff;
    border-radius: 8px;
    padding: 22px 24px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.cev-sidebar-card-title {
    margin: 0 0 16px;
    font-size: 1.1em;
    color: #333;
    border-bottom: 2px solid var(--wp--preset--color--primary, #c1440e);
    padding-bottom: 8px;
}

/* Countdown */
.cev-countdown-card .countdown-timer {
    display: flex;
    justify-content: space-around;
    gap: 8px;
    margin-top: 10px;
}

.cev-countdown-card .countdown-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    background: var(--wp--preset--color--primary, #c1440e);
    color: #fff;
    border-radius: 6px;
    padding: 10px 4px;
}

.cev-countdown-card .countdown-value {
    font-size: 1.8em;
    font-weight: 700;
    line-height: 1;
}

.cev-countdown-card .countdown-label {
    font-size: 0.65em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
    opacity: 0.85;
}

/* Details list */
.cev-details-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cev-detail-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.cev-detail-icon {
    color: var(--wp--preset--color--primary, #c1440e);
    font-size: 1.1em;
    margin-top: 2px;
    flex-shrink: 0;
}

.cev-detail-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.9em;
}

.cev-detail-content strong {
    color: #555;
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cev-detail-content span,
.cev-detail-content a {
    color: #333;
}

.cev-detail-content a {
    color: var(--wp--preset--color--primary, #c1440e);
    text-decoration: none;
}

.cev-detail-content a:hover { text-decoration: underline; }

/* iCal */
.cev-ical-btn {
    display: inline-block;
    width: 100%;
    padding: 10px 16px;
    background: var(--wp--preset--color--primary, #c1440e);
    color: #fff;
    text-align: center;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95em;
    box-sizing: border-box;
    transition: background 0.2s;
}

.cev-ical-btn:hover {
    background: #a0360b;
    color: #fff;
}

.cev-ical-note {
    margin: 8px 0 0;
    font-size: 0.78em;
    color: #777;
    line-height: 1.4;
}

/* Responsive */
@media (max-width: 900px) {
    .cev-layout {
        grid-template-columns: 1fr;
    }

    .cev-sidebar {
        order: -1;
    }

    .cev-sidebar-card {
        /* On mobile show countdown and details inline */
    }

    .cev-countdown-card .countdown-timer {
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .cev-banner-overlay {
        padding: 20px;
    }

    .cev-title {
        font-size: 1.5em;
    }

    .cev-section {
        padding: 20px;
    }

    .cev-layout {
        padding: 0 12px;
        margin: 16px auto;
    }
}


/* ========================================
   Single Event Page v2 (cev2-*)
   Modern 2-col + 1-col layout with GSAP
   ======================================== */

/* ── Custom properties ── */
.cev2-event {
    --cev2-accent:      var(--wp--preset--color--primary, #c1440e);
    --cev2-accent-dark: #a0360b;
    --cev2-surface:     #ffffff;
    --cev2-surface-2:   #f8f9fb;
    --cev2-border:      #e8eaf0;
    --cev2-text:        #1a202c;
    --cev2-text-muted:  #64748b;
    --cev2-hero-title:  #ffffff;
    --cev2-hero-meta:   rgba(255,255,255,0.88);
    --cev2-radius:      14px;
    --cev2-shadow:      0 4px 24px rgba(0,0,0,0.08);
    --cev2-shadow-lg:   0 12px 40px rgba(0,0,0,0.14);
    --cev2-gap:         28px;
    --cev2-font-body:   var(--comm-font-body, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif);
    --cev2-font-heading: var(--comm-font-heading, var(--cev2-font-body));
    --cev2-font-size-base: var(--comm-font-size-base, 16px);
    --cev2-font-weight-body: var(--comm-font-weight-body, 400);
    --cev2-font-weight-heading: var(--comm-font-weight-heading, 700);
    --cev2-line-height-body: var(--comm-font-line-height-body, 1.65);
    --cev2-line-height-heading: var(--comm-font-line-height-heading, 1.24);
    --cev2-letter-spacing-body: var(--comm-font-letter-spacing-body, 0em);
    --cev2-letter-spacing-heading: var(--comm-font-letter-spacing-heading, 0em);
    --cev2-paragraph-margin-bottom: var(--comm-font-paragraph-margin-bottom, 1em);
    --cev2-heading-margin-bottom: var(--comm-font-heading-margin-bottom, 0.75em);
    --cev2-paragraph-padding-inline: var(--comm-font-paragraph-padding-inline, 0px);
    --cev2-paragraph-padding-block: var(--comm-font-paragraph-padding-block, 0px);
    font-family: var(--cev2-font-body);
    font-size: var(--cev2-font-size-base);
    font-weight: var(--cev2-font-weight-body);
    line-height: var(--cev2-line-height-body);
    letter-spacing: var(--cev2-letter-spacing-body);
    color: var(--cev2-text);
    background: var(--cev2-surface-2);
    /* Break out of the theme's max-width container to fill the full viewport */
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding: 0;
}

.cev2-event h1,
.cev2-event h2,
.cev2-event h3,
.cev2-event h4,
.cev2-event h5,
.cev2-event h6 {
    font-family: var(--cev2-font-heading);
    font-weight: var(--cev2-font-weight-heading);
    line-height: var(--cev2-line-height-heading);
    letter-spacing: var(--cev2-letter-spacing-heading);
    margin-bottom: var(--cev2-heading-margin-bottom);
}

.cev2-event p,
.cev2-event li,
.cev2-event dd,
.cev2-event dt,
.cev2-event figcaption,
.cev2-event label,
.cev2-event input,
.cev2-event textarea,
.cev2-event select,
.cev2-event button {
    font-family: var(--cev2-font-body);
    font-size: inherit;
}

.cev2-event p {
    margin-bottom: var(--cev2-paragraph-margin-bottom);
    padding-inline: var(--cev2-paragraph-padding-inline);
    padding-block: var(--cev2-paragraph-padding-block);
}

/* Prevent horizontal scrollbar caused by the viewport-width breakout */
.comm-single-event-page {
    overflow-x: hidden;
}

/* ── Icons ── */
.cev2-icon,
.cev2-detail__icon svg,
.cev2-section-title svg,
.cev2-map-address-bar svg,
.cev2-ical-btn svg {
    width: 1em;
    height: 1em;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    vertical-align: middle;
    flex-shrink: 0;
}

/* ── HERO ── */
.cev2-hero {
    position: relative;
    min-height: 60vh;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

.cev2-hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transform: scale(1.05);
    transition: transform 8s ease;
    will-change: transform;
    filter: blur(1px);
}

.cev2-hero:hover .cev2-hero-bg {
    transform: scale(1.0);
}

.cev2-hero-scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(10,10,30,0.2) 0%,
        rgba(10,10,30,0.55) 40%,
        rgba(10,10,30,0.88) 100%
    );
}

/* Transparent-header: reinforce top overlay for nav readability */
body.has-transparent-header .cev2-hero-scrim {
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,.50) 0%,
        rgba(10,10,30,0.30) 25%,
        rgba(10,10,30,0.55) 40%,
        rgba(10,10,30,0.88) 100%
    );
}

.cev2-hero-body {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px 44px;
}

/* Badges */
.cev2-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.cev2-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 14px;
    border-radius: 40px;
    font-size: 0.72em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    backdrop-filter: blur(6px);
}

.cev2-badge--status   { background: rgba(255,255,255,0.22); color: #fff; border: 1px solid rgba(255,255,255,0.3); }
.cev2-badge--format   { background: rgba(255,200,20,0.28); color: #ffe066; border: 1px solid rgba(255,200,20,0.4); }
.cev2-badge--virtual  { background: rgba(100,180,255,0.25); color: #a8d8ff; border: 1px solid rgba(100,180,255,0.4); }
.cev2-status-cancelled  { background: rgba(220,38,38,0.45) !important; }

/* Cancelled date treatment */
.cev2-date-cancelled-wrap { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cev2-date-del { text-decoration: line-through; opacity: 0.55; }
.cev2-cancelled-label {
    display: inline-block;
    background: rgba(220,38,38,0.85);
    color: #fff;
    font-size: 0.72em;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 1px 7px;
    border-radius: 3px;
    vertical-align: middle;
    white-space: nowrap;
}
.cev2-status-postponed  { background: rgba(217,119,6,0.45) !important; }
.cev2-status-completed  { background: rgba(22,163,74,0.4) !important; }

/* Title */
.cev2-title {
    margin: 0 0 14px;
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 800;
    color: var(--cev2-hero-title, #ffffff) !important;
    line-height: 1.15;
    text-shadow: 0 2px 12px rgba(0,0,0,0.45);
    letter-spacing: -0.01em;
}

/* Hero meta strip */
.cev2-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    font-size: 0.9em;
    color: var(--cev2-hero-meta, rgba(255,255,255,0.88));
}

.cev2-hero-meta__item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cev2-hero-meta__item .cev2-icon {
    width: 0.95em;
    height: 0.95em;
    opacity: 0.8;
}

/* ── WRAPPER ── */
.cev2-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 20px 60px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* ── GRID (two-column) ── */
.cev2-grid {
    display: grid;
    gap: var(--cev2-gap);
}

.cev2-grid--top {
    grid-template-columns: 1fr 1fr;
}

.cev2-grid--mid {
    grid-template-columns: 1fr 380px;
}

/* ── FEATURED IMAGE ── */
.cev2-col-image {
    display: flex;
    flex-direction: column;
    gap: 18px;
    position: sticky;
    top: 32px;
    align-self: start;
    min-width: 0;
}

.cev2-feat-image {
    margin: 0;
    border-radius: var(--cev2-radius);
    overflow: hidden;
    box-shadow: var(--cev2-shadow-lg);
    line-height: 0;
    position: relative;
}

.cev2-feat-image::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--cev2-radius);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12);
    z-index: 1;
    pointer-events: none;
}

.cev2-feat-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--cev2-radius);
}

.cev2-feat-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 16/10;
    background: linear-gradient(135deg, #1a1a2e 0%, #0f3460 100%);
    border-radius: var(--cev2-radius);
    box-shadow: var(--cev2-shadow-lg);
}

.cev2-feat-placeholder span {
    font-size: 5rem;
    opacity: 0.35;
}

/* ── CARD ── */
.cev2-card {
    background: var(--cev2-surface);
    border-radius: var(--cev2-radius);
    padding: 26px 28px;
    box-shadow: var(--cev2-shadow);
    border: 1px solid var(--cev2-border);
    transition: box-shadow 0.25s ease;
}

.cev2-card:hover {
    box-shadow: var(--cev2-shadow-lg);
}

.cev2-card__title {
    margin: 0 0 18px;
    font-size: 1.05em;
    font-weight: 700;
    color: var(--cev2-text);
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--cev2-accent);
}

/* ── COUNTDOWN ── */
.cev2-countdown-card {
    background: linear-gradient(135deg, var(--cev2-accent) 0%, #8b1a0a 100%);
    border: none;
    color: #fff;
}

.cev2-countdown-card .cev2-card__title {
    color: rgba(255,255,255,0.9);
    border-bottom-color: rgba(255,255,255,0.3);
}

.cev2-countdown__inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding-top: 8px;
}

.cev2-countdown__unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    background: rgba(255,255,255,0.12);
    border-radius: 10px;
    padding: 12px 6px 10px;
    backdrop-filter: blur(4px);
}

.cev2-countdown__val {
    font-size: 2.2em;
    font-weight: 800;
    line-height: 1;
    color: #fff;
    letter-spacing: -0.02em;
    display: inline-block;
}

.cev2-countdown__lbl {
    font-size: 0.62em;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: rgba(255,255,255,0.75);
    margin-top: 5px;
}

.cev2-countdown__sep {
    font-size: 2em;
    font-weight: 800;
    color: rgba(255,255,255,0.5);
    margin-bottom: 14px;
    user-select: none;
}

/* ── DETAILS LIST ── */
.cev2-col-details {
    display: flex;
    flex-direction: column;
    gap: 18px;
    align-self: start;
    position: sticky;
    top: 20px;
}

.cev2-details-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cev2-detail {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.cev2-detail__icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(193, 68, 14, 0.10); /* fallback for older Safari */
    background: color-mix(in srgb, var(--cev2-accent) 10%, transparent);
    color: var(--cev2-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cev2-detail__icon svg {
    width: 1.1em;
    height: 1.1em;
}

.cev2-detail__body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.9em;
    padding-top: 2px;
}

.cev2-detail__body strong {
    display: block;
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--cev2-text-muted);
    font-weight: 600;
    margin-bottom: 1px;
}

.cev2-detail__body span,
.cev2-detail__body a {
    color: var(--cev2-text);
    line-height: 1.5;
}

.cev2-detail__body a {
    color: var(--cev2-accent);
    text-decoration: none;
}

.cev2-detail__body a:hover { text-decoration: underline; }

.cev2-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 2px;
}

.cev2-tag {
    display: inline-block;
    padding: 2px 10px;
    background: rgba(193, 68, 14, 0.12); /* fallback for older Safari */
    background: color-mix(in srgb, var(--cev2-accent) 12%, transparent);
    color: var(--cev2-accent);
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 500;
}

.cev2-price { font-weight: 700; font-size: 1.05em; color: var(--cev2-text); }
.cev2-price--free { color: #16a34a; }

/* ── ABOUT / DESCRIPTION ── */
.cev2-about-card { box-sizing: border-box; }

.cev2-prose {
    line-height: 1.8;
    color: #374151;
    font-size: 0.97em;
}

.cev2-prose p { margin-bottom: 1.1em; }
.cev2-prose h2, .cev2-prose h3 { color: var(--cev2-text); margin: 1.4em 0 0.5em; }
.cev2-prose a { color: var(--cev2-accent); }
.cev2-prose img { max-width: 100%; border-radius: 8px; }

.cev2-no-content { color: var(--cev2-text-muted); font-style: italic; }

/* ── iCAL ── */
.cev2-ical-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 18px;
    background: linear-gradient(135deg, var(--cev2-accent) 0%, var(--cev2-accent-dark) 100%);
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95em;
    box-sizing: border-box;
    transition: filter 0.2s ease, transform 0.15s ease;
    box-shadow: 0 4px 14px rgba(193,68,14,0.35);
}

.cev2-ical-btn svg { width: 1.1em; height: 1.1em; }

.cev2-ical-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    color: #fff;
}

.cev2-ical-note {
    margin: 10px 0 0;
    font-size: 0.78em;
    color: var(--cev2-text-muted);
    line-height: 1.4;
    text-align: center;
}

.cev2-col-actions {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* ── FULL-WIDTH SECTIONS ── */
.cev2-full-section {
    background: var(--cev2-surface);
    border-radius: var(--cev2-radius);
    padding: 32px 34px;
    box-shadow: var(--cev2-shadow);
    border: 1px solid var(--cev2-border);
}

.cev2-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 22px;
    font-size: 1.25em;
    font-weight: 700;
    color: var(--cev2-text);
    padding-bottom: 14px;
    border-bottom: 2px solid var(--cev2-accent);
}

.cev2-section-title svg { color: var(--cev2-accent); }

/* ── VIRTUAL LINKS ── */
.cev2-virtual-links {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 20px;
}

.cev2-virtual-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95em;
    color: #fff;
    transition: opacity 0.2s, transform 0.15s;
    box-shadow: 0 3px 12px rgba(0,0,0,0.18);
}

.cev2-virtual-btn:hover { opacity: 0.9; transform: translateY(-2px); color: #fff; }
.cev2-virtual-btn--zoom  { background: #2d8cff; }
.cev2-virtual-btn--teams { background: #464eb8; }
.cev2-virtual-btn--meet  { background: #00897b; }
.cev2-virtual-btn--webex { background: #007ab8; }

.cev2-video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: var(--cev2-shadow-lg);
}

.cev2-video-wrapper iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
}

/* ── TICKETS SECTION ── */
.cev2-tickets-section {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #e2e8f0;
    border: none;
}

.cev2-tickets-section .cev2-section-title {
    color: #f1f5f9;
    border-bottom-color: var(--cev2-accent);
}

.cev2-tickets-section .cev2-section-title svg { color: #ffd700; }

/* ── MAP SECTION ── */
.cev2-map-section {
    padding-bottom: 0;
    overflow: hidden;
}

.cev2-map-address-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin-bottom: 18px;
    font-size: 0.92em;
    color: var(--cev2-text);
}

.cev2-map-address-bar strong {
    font-size: 1em;
    font-weight: 700;
}

.cev2-map-address-text { color: var(--cev2-text-muted); }

.cev2-directions-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    background: var(--cev2-accent);
    color: #fff !important;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.88em;
    transition: background 0.2s, transform 0.15s;
    margin-left: auto;
}

.cev2-directions-btn:hover {
    background: var(--cev2-accent-dark);
    transform: translateY(-1px);
    color: #fff;
}

.cev2-directions-btn svg { width: 0.9em; height: 0.9em; }

.cev2-map {
    --cev2-section-pad: 34px;
    border-radius: 0 0 var(--cev2-radius) var(--cev2-radius);
    margin: 0 calc(-1 * var(--cev2-section-pad));
    width: calc(100% + 2 * var(--cev2-section-pad));
}

/* ── EVENT REPORT ── */
.cev2-report-card {
    max-width: 1200px;
    margin: 0 auto 32px;
    padding: 22px 28px 24px;
    background: var(--cev2-surface);
    border: 1px solid var(--cev2-border);
    border-radius: var(--cev2-radius);
    box-shadow: var(--cev2-shadow);
}

.cev2-report-card h2 {
    margin: 0 0 6px;
    color: var(--cev2-text);
    font-size: 1.05em;
}

.cev2-report-card p {
    margin: 0 0 16px;
    color: var(--cev2-text-muted);
    font-size: 0.88em;
    line-height: 1.5;
}

.cev2-report-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 14px;
    align-items: end;
}

.cev2-report-form label {
    grid-column: 1 / -1;
    margin: 0;
    color: var(--cev2-text);
    font-size: 0.82em;
    font-weight: 700;
}

.cev2-report-form textarea {
    width: 100%;
    min-height: 76px;
    max-height: 180px;
    padding: 10px 12px;
    resize: vertical;
    color: var(--cev2-text);
    background: var(--cev2-surface-2);
    border: 1px solid var(--cev2-border);
    border-radius: 8px;
    font-size: 0.88em;
    line-height: 1.5;
}

.cev2-report-form textarea:focus {
    outline: 2px solid var(--cev2-accent);
    outline-offset: 1px;
    border-color: var(--cev2-accent);
}

.cev2-report-form button {
    min-height: 42px;
    padding: 9px 18px;
    color: #fff;
    background: var(--cev2-accent);
    border: 0;
    border-radius: 7px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
}

.cev2-report-form button:hover:not(:disabled) {
    background: var(--cev2-accent-dark);
    transform: translateY(-1px);
}

.cev2-report-form button:disabled {
    cursor: wait;
    opacity: 0.65;
}

.cev2-report-message {
    grid-column: 1 / -1;
    color: var(--cev2-text-muted);
    font-size: 0.82em;
}

/* Override Leaflet popup styling */
.leaflet-popup-content-wrapper {
    border-radius: 10px !important;
    box-shadow: 0 8px 30px rgba(0,0,0,0.18) !important;
}

.leaflet-popup-content h4 {
    margin: 0 0 6px;
    font-size: 0.95em;
    font-weight: 700;
}

.leaflet-popup-content a {
    color: var(--wp--preset--color--primary, #c1440e);
    text-decoration: none;
}

.leaflet-popup-content p {
    margin: 0;
    font-size: 0.85em;
    color: #555;
}

/* ── RESPONSIVE ── */
@media (max-width: 960px) {
    .cev2-grid--top,
    .cev2-grid--mid {
        grid-template-columns: 1fr;
    }

    .cev2-col-details {
        position: static;
    }

    .cev2-col-image {
        position: static;
    }

    .cev2-hero {
        min-height: 280px;
    }

    .cev2-title {
        font-size: clamp(1.5rem, 6vw, 2.2rem);
    }

    .cev2-map {
        --cev2-section-pad: 20px;
        border-radius: 0 0 var(--cev2-radius) var(--cev2-radius);
    }
}

@media (max-width: 640px) {
    .cev2-wrap {
        padding: 18px 12px 40px;
        gap: 18px;
    }

    .cev2-hero-body {
        padding: 24px 16px 30px;
    }

    .cev2-card,
    .cev2-full-section {
        padding: 18px 16px;
    }

    .cev2-countdown__val {
        font-size: 1.7em;
    }

    .cev2-map {
        --cev2-section-pad: 16px;
    }

    .cev2-map-address-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .cev2-directions-btn {
        margin-left: 0;
    }

    .cev2-report-card {
        margin: 0 12px 24px;
        padding: 18px 16px 20px;
    }

    .cev2-report-form {
        grid-template-columns: 1fr;
    }

    .cev2-report-form button {
        width: 100%;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .cev2-hero-bg { transition: none; }
}

/* GSAP animation hook classes — visible by default, GSAP overrides on init */
.cev2-anim-left,
.cev2-anim-right,
.cev2-anim-up,
.cev2-anim-up--delay {
    will-change: transform, opacity;
}

/* ── Upcoming occurrences card (single event page) ─────────────────────── */
.cev2-upcoming-occ-card {
    margin-top: 16px;
}

.cev2-upcoming-occ-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cev2-upcoming-occ-item {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: var(--cev2-radius, 6px);
    background: var(--cev2-bg, #f9f9f9);
    font-size: 0.92em;
    color: var(--cev2-text, #333);
}

.cev2-upcoming-occ-item--next {
    border-left: 3px solid var(--cev2-accent, #0073aa);
    font-weight: 600;
}

.cev2-upcoming-occ-badge {
    margin-left: auto;
    background: var(--cev2-accent, #0073aa);
    color: #fff;
    font-size: 0.75em;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}


/* ═══════════════════════════════════════════════════════════════════════════
   PREV / NEXT EVENT NAVIGATION  (cev2-event-nav)
═══════════════════════════════════════════════════════════════════════════ */

.cev2-event-nav {
    background: var(--cev2-surface, #fff);
    border-bottom: 1px solid var(--cev2-border, #e8eaf0);
    position: sticky;
    top: var(--comm-sticky-offset, 0px);
    z-index: 20;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

.cev2-event-nav__inner {
    display: flex;
    align-items: stretch;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    min-height: 64px;
    gap: 0;
}

.cev2-event-nav__item {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--cev2-text, #1a202c);
    transition: background 0.18s, color 0.18s;
    border-radius: 0;
    overflow: hidden;
}

.cev2-event-nav__item:hover {
    background: var(--cev2-surface-2, #f8f9fb);
    color: var(--cev2-accent, #c1440e);
}

.cev2-event-nav__item--empty {
    flex: 1;
    pointer-events: none;
}

.cev2-event-nav__item--next {
    justify-content: flex-end;
    text-align: right;
}

.cev2-event-nav__arrow {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    color: var(--cev2-accent, #c1440e);
}

.cev2-event-nav__arrow svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.cev2-event-nav__content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.cev2-event-nav__label {
    font-size: 0.72em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--cev2-text-muted, #64748b);
    line-height: 1.2;
}

.cev2-event-nav__title {
    font-size: 0.92em;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
    line-height: 1.3;
    margin-top: 2px;
}

.cev2-event-nav__date {
    font-size: 0.78em;
    color: var(--cev2-text-muted, #64748b);
    line-height: 1.2;
    margin-top: 2px;
}

.cev2-event-nav__all {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
    padding: 0 20px;
    font-size: 0.85em;
    font-weight: 700;
    color: var(--cev2-accent, #c1440e);
    text-decoration: none;
    border-left: 1px solid var(--cev2-border, #e8eaf0);
    border-right: 1px solid var(--cev2-border, #e8eaf0);
    transition: background 0.18s;
    white-space: nowrap;
}

.cev2-event-nav__all:hover {
    background: var(--cev2-surface-2, #f8f9fb);
}

.cev2-event-nav__all svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .cev2-event-nav__inner {
        padding: 0 8px;
        min-height: 48px;
    }
    .cev2-event-nav__item {
        padding: 8px 6px;
        gap: 6px;
    }
    .cev2-event-nav__title {
        max-width: 100px;
        font-size: 0.82em;
    }
    .cev2-event-nav__label {
        font-size: 0.66em;
    }
    .cev2-event-nav__arrow svg {
        width: 20px;
        height: 20px;
    }
    .cev2-event-nav__all {
        padding: 0 10px;
        font-size: 0.75em;
    }
    .cev2-event-nav__all svg {
        display: none;
    }
}

@media (max-width: 480px) {
    .cev2-event-nav__inner {
        padding: 0 4px;
        min-height: 44px;
    }
    .cev2-event-nav__item {
        padding: 6px 4px;
        gap: 4px;
    }
    .cev2-event-nav__title,
    .cev2-event-nav__date {
        display: none;
    }
    .cev2-event-nav__label {
        font-size: 0.65em;
    }
    .cev2-event-nav__arrow svg {
        width: 18px;
        height: 18px;
    }
    .cev2-event-nav__all {
        padding: 0 8px;
        font-size: 0.72em;
    }
}


/* ═══════════════════════════════════════════════════════════════════════════
   RELATED EVENTS SECTIONS  (cev2-related-*)
═══════════════════════════════════════════════════════════════════════════ */

.cev2-related-section {
    background: var(--cev2-surface, #fff);
}

.cev2-related-header {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--cev2-border, #e8eaf0);
    flex-wrap: wrap;
}

.cev2-related-entity-thumb {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid var(--cev2-border, #e8eaf0);
}

.cev2-related-entity-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cev2-related-entity-info {
    flex: 1;
    min-width: 0;
}

.cev2-related-section-title {
    font-size: 1.15em;
    font-weight: 700;
    color: var(--cev2-text, #1a202c);
    margin: 0 0 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.cev2-related-section-title svg {
    width: 1.1em;
    height: 1.1em;
    stroke: var(--cev2-accent, #c1440e);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

.cev2-related-section-title a {
    color: var(--cev2-accent, #c1440e);
    text-decoration: none;
}

.cev2-related-section-title a:hover {
    text-decoration: underline;
}

.cev2-related-entity-meta {
    font-size: 0.9em;
    color: var(--cev2-text-muted, #64748b);
    margin: 0 0 6px;
}

.cev2-related-entity-contact {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 16px;
    font-size: 0.87em;
    color: var(--cev2-text-muted, #64748b);
    margin-top: 4px;
}

.cev2-related-entity-contact a {
    color: var(--cev2-accent, #c1440e);
    text-decoration: none;
}

.cev2-related-entity-contact a:hover {
    text-decoration: underline;
}

/* ── Related event cards grid ── */

.cev2-rel-events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 18px;
}

.cev2-rel-card {
    display: flex;
    flex-direction: column;
    border-radius: var(--cev2-radius, 14px);
    overflow: hidden;
    background: var(--cev2-surface-2, #f8f9fb);
    border: 1px solid var(--cev2-border, #e8eaf0);
    text-decoration: none;
    color: var(--cev2-text, #1a202c);
    transition: box-shadow 0.2s, transform 0.18s, border-color 0.18s;
}

.cev2-rel-card:hover {
    box-shadow: var(--cev2-shadow-lg, 0 12px 40px rgba(0,0,0,0.14));
    transform: translateY(-3px);
    border-color: var(--cev2-accent, #c1440e);
    color: var(--cev2-text, #1a202c);
}

.cev2-rel-card__img {
    width: 100%;
    aspect-ratio: 1/1;
    overflow: hidden;
    background: var(--cev2-border, #e8eaf0);
}

.cev2-rel-card__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.cev2-rel-card:hover .cev2-rel-card__img img {
    transform: scale(1.05);
}

.cev2-rel-card__img--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
    background: linear-gradient(135deg, var(--cev2-accent, #c1440e) 0%, #8b2f0a 100%);
}

.cev2-rel-card__body {
    padding: 14px 16px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cev2-rel-card__title {
    font-size: 0.93em;
    font-weight: 700;
    margin: 0;
    line-height: 1.35;
    color: var(--cev2-text, #1a202c);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cev2-rel-card__date,
.cev2-rel-card__location {
    font-size: 0.8em;
    color: var(--cev2-text-muted, #64748b);
    margin: 0;
    line-height: 1.4;
}

.cev2-rel-card__location {
    margin-top: auto;
    padding-top: 6px;
}

@media (max-width: 640px) {
    .cev2-rel-events-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }
    .cev2-related-entity-thumb {
        width: 60px;
        height: 60px;
    }
}
