/* =====================================================
   GridMarshal – Public Styles
   ===================================================== */

.em-events-wrapper {
    text-align: left !important;
    font-family: inherit;
    margin: 24px 0;
}

/* Filter bar */
.em-filter-bar {
    text-align: left !important;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    padding: 8px 14px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
}
.em-filter-bar label {
    display: inline;
    font-weight: 400;
    font-size: 13px;
    color: #555;
    white-space: nowrap;
    width: auto;
    margin: 0;
    padding: 0;
    float: none;
}
.em-filter-bar select {
    padding: 5px 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 13px;
}

/* Table */
.em-table-wrap {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.em-events-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.em-events-table tbody tr {
    background: #fff;
}
.em-events-table thead {
    background: var(--gm-header-bg, #2c3e50);
    color: var(--gm-header-text, #fff);
}
.em-events-table thead th {
    padding: 12px 14px;
    text-align: left !important;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: .4px;
    text-transform: uppercase;
}
.em-events-table tbody tr {
    border-bottom: 1px solid #e9ecef;
    transition: background .15s;
}
.em-events-table tbody tr:last-child { border-bottom: none; }
.em-events-table tbody tr:hover { background: #f0f4f8; }
.em-events-table td {
    padding: 12px 14px;
    vertical-align: middle;
    text-align: left !important;
}

/* Past/cancelled rows */
.em-events-table tr.em-past td { color: #6c757d; }
.em-events-table tr.em-cancelled td { color: #999; text-decoration: line-through; }

/* Badges */
.em-badge {
    display: inline-block;
    margin-top: 4px;
    padding: 2px 7px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .3px;
}
.em-badge-upcoming  { background: #d4edda; color: #155724; }
.em-badge-past      { background: #e2e3e5; color: #383d41; }
.em-badge-cancelled { background: #f8d7da; color: #721c24; }

/* Event name cell */
.em-name strong { font-size: 16px; line-height: 1.4; vertical-align: middle; }
.em-type-tag {
    display: inline-block;
    padding: 1px 8px;
    background: #e8f0fe;
    color: #3c5a99;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 4px;
}
.em-notes {
    margin: 4px 0 0;
    color: #555;
    font-size: 13px;
    line-height: 1.5;
}
.em-pricing {
    margin: 4px 0 0;
    font-size: 12px;
    color: #444;
}

/* Location */
.em-location a { color: inherit; text-decoration: underline; }
.em-title-link { color: inherit !important; text-decoration: none !important; }
.em-title-link:hover { text-decoration: none !important; }

/* Carousel title link — dotted underline hint on hover */
.gm-slide-title-link {
    color: inherit !important;
    text-decoration: none !important;
    cursor: pointer;
}
.gm-slide-title-link:hover,
.gm-slide-title-link:focus {
    text-decoration: underline !important;
    text-decoration-style: dotted !important;
    text-underline-offset: 2px !important;
    color: inherit !important;
}
.em-location-sub {
    display: block;
    font-size: 12px;
    color: #6c757d;
    margin-top: 2px;
}

/* Link buttons — use CSS variables set by theme or settings page */
.em-links { min-width: 140px; }
.em-btn {
    display: inline-block;
    margin: 3px 4px 3px 0;
    padding: 5px 11px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: opacity .15s;
    background: var(--gm-secondary-bg, #6c757d);
    color: var(--gm-secondary-text, #fff);
}
.em-btn:hover { opacity: .85; text-decoration: none; }

/* Primary — registration only */
.em-btn-register {
    background: var(--gm-primary-bg, #28a745);
    color: var(--gm-primary-text, #fff);
}

/* Secondary — all others inherit base .em-btn vars */
.em-btn-map,
.em-btn-supps,
.em-btn-results,
.em-btn-photos {
    background: var(--gm-secondary-bg, #6c757d);
    color: var(--gm-secondary-text, #fff);
}

.em-no-results { font-size: 12px; color: #aaa; font-style: italic; }

/* Date column */
.em-date { min-width: 110px; white-space: nowrap; }
.em-time {
    display: inline-block;
    font-size: 11px;
    color: #888;
    margin-top: 2px;
    font-weight: 400;
    line-height: 1.4;
}

/* Results links — inline flow on all devices */
.em-results-stack {
    display: inline-block;
}
.em-results-stack .em-btn {
    display: inline-block;
}

.em-cancelled-label {
    font-size: 12px;
    color: #999;
    font-style: italic;
}
.em-no-link { color: #ccc; }

/* Responsive */
@media (max-width: 768px) {
    .em-events-table, .em-events-table thead, .em-events-table tbody,
    .em-events-table th, .em-events-table td, .em-events-table tr {
        display: block;
    }
    .em-events-table thead tr { display: none; }
    .em-events-table tbody tr {
        margin-bottom: 8px;
        border: 1px solid #dee2e6 !important;
        border-radius: 6px;
        overflow: hidden;
    }
    .em-events-table td {
        border: none !important;
        padding: 2px 10px;
    }
    .em-events-table td:first-child { padding-top: 7px; }
    .em-events-table td:last-child { padding-bottom: 7px; }

    /* Hide all data-label pseudo headers by default */
    .em-events-table td::before {
        display: none;
    }



    /* Date row: inline-block so date, time and icon sit inline */
    .em-date-row {
        display: inline-block !important;
    }
    .em-date-text { white-space: nowrap; }
    .em-time {
        display: inline-block !important;
        margin-top: 0 !important;
        white-space: nowrap;
    }

    /* City/state inline after location name */
    .em-location-sub {
        display: inline !important;
        margin-top: 0 !important;
        margin-left: 4px;
    }
    .em-location-sub::before { content: ' — '; }

    /* Hide location cell on cancelled events */
    table.em-events-table td.em-cancelled-location {
        display: none !important;
    }

    /* Results buttons inline on mobile */
    .em-results-stack {
        display: inline-block !important;
    }
    .em-results-stack .em-btn {
        display: inline-block !important;
    }

    /* Hide empty registration/results cell */
    table.em-events-table td.em-links-empty {
        display: none !important;
    }

    /* Remove table wrap border and shadow on mobile */
    .em-table-wrap {
        border: none !important;
        box-shadow: none !important;
    }

    /* Tighten notes, pricing, badges on mobile */
    .em-notes { font-size: 12px; margin: 2px 0 0; }
    .em-pricing { font-size: 12px; margin: 2px 0 0; }
    .em-badge { font-size: 10px; padding: 1px 6px; margin-left: 4px; }
    .em-type-tag { font-size: 9px; padding: 0 6px; }
    .em-btn { font-size: 13px; padding: 4px 9px; margin: 2px 3px 2px 0; }
    .em-subscribe-bar {
    text-align: left !important; margin-top: 8px; gap: 8px; }
    .em-subscribe-link { font-size: 12px; padding: 5px 12px; }
    .em-subscribe-desc { font-size: 11px; }
}

/* ── Event Modal Banner ─────────────────────────────── */
.em-modal-banner {
    width: calc(100% + 64px);
    margin: -28px -32px 20px;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
}
.em-modal-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.em-modal-date {
    font-size: 14px;
    color: #555;
    margin: 4px 0 12px;
}
.em-modal-location {
    font-size: 14px;
    color: #444;
    margin: 0 0 12px;
    font-weight: 600;
}
.em-modal-loc-sub {
    font-weight: 400;
    color: #666;
}
.em-modal-long-desc {
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    margin-bottom: 20px;
}
.em-modal-long-desc p { margin: 0 0 12px; }
.em-modal-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid #eee;
}

/* ── Shared Modal ───────────────────────────────────── */
.em-modal-overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(0,0,0,.55);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}
.em-modal-overlay.em-modal-open {
    display: flex !important;
}

.em-modal-box {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0,0,0,.25);
    max-width: 480px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 28px 32px 24px;
    position: relative;
}

.em-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #fff;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 20px;
    line-height: 32px;
    text-align: center;
    cursor: pointer;
    color: #444;
    padding: 0;
    box-shadow: 0 1px 4px rgba(0,0,0,.2);
    z-index: 2;
}
.em-modal-close:hover { color: #000; box-shadow: 0 2px 8px rgba(0,0,0,.3); }

.em-modal-content h2 {
    margin: 0 0 14px;
    font-size: 20px;
    padding-right: 24px;
}

/* Modal trigger links — subtle underline style */
a.em-location-modal-trigger,
a.em-event-modal-trigger {
    color: inherit;
    text-decoration: underline;
    text-decoration-style: dotted;
    cursor: pointer;
}
a.em-location-modal-trigger:hover,
a.em-event-modal-trigger:hover {
    text-decoration-style: solid;
}

/* ── Calendar icon + subscribe bar ─────────────────────────────────── */
.em-date-row {
    display: block;
}
.em-cal-icon {
    font-size: 13px;
    text-decoration: none;
    opacity: .55;
    line-height: 1;
    transition: opacity .15s;
    flex-shrink: 0;
}
.em-cal-icon:hover { opacity: 1; }

.em-subscribe-bar {
    text-align: left !important;
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.em-subscribe-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1px solid #ccc;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    background: #fff;
    transition: border-color .15s, background .15s;
    white-space: nowrap;
}
.em-subscribe-link:hover {
    border-color: var(--gm-primary-bg, #28a745);
    background: #f8fff9;
    text-decoration: none;
    color: #333;
}
.em-subscribe-desc {
    font-size: 12px;
    color: #888;
}

/* Next event badge */
.em-badge-next {
    background: var(--gm-primary-bg, #c0392b);
    color: var(--gm-primary-text, #fff);
    border-radius: 2px;
    transform: skewX(-10deg);
    display: inline-block;
    padding: 2px 8px;
}
.em-badge-next > * { display: inline-block; transform: skewX(10deg); }

/* ═══════════════════════════════════════════════════════════
   Events Carousel  [events_carousel]
   ═══════════════════════════════════════════════════════════ */

.gm-carousel-wrap {
    padding-bottom: 8px;
    text-align: left !important;
}

/* Force-hide Splide arrows and pagination — we rely on swipe/click only */
.gm-splide .splide__arrows,
.gm-splide .splide__arrow,
.gm-splide .splide__pagination {
    display: none !important;
}

/* ── Slide shell ─────────────────────────────────────────── */
.gm-splide .splide__slide {
    width: 352px;
}
.gm-splide .splide__slide.gm-slide--past {
    opacity: .45;
    transition: opacity .25s;
}

/* ── Banner image (16:9) ─────────────────────────────────── */
.gm-slide-banner {
    width: 352px;
    height: 198px;
    border-radius: 6px 6px 0 0;
    overflow: hidden;
    background: linear-gradient(to right, #c0c0c0, #e8e8e8, #c0c0c0);
    box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.gm-slide-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.gm-slide-banner-placeholder {
    width: 100%;
    height: 100%;
}

/* ── Card body ───────────────────────────────────────────── */
.gm-slide-card {
    width: 352px;
    min-height: 240px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-top: none;
    overflow: hidden;
}

/* ── Top section: date + info ────────────────────────────── */
.gm-slide-top {
    display: grid;
    grid-template-columns: 26% 1px 1fr;
    align-items: stretch;
}

.gm-slide-date {
    padding: 28px 0 12px 16px;
    font-family: inherit;
    color: var(--gm-primary-bg, #c0392b);
    line-height: 1;
}
.gm-slide-date--dim {
    opacity: .4;
}
.gm-slide-day {
    font-size: 46px;
    font-weight: 800;
    line-height: .85;
    letter-spacing: -.02em;
}
.gm-slide-day--multi {
    font-size: 28px;
    margin-top: 2px;
}
.gm-slide-day-amp {
    font-size: 16px;
    font-weight: 600;
}
.gm-slide-month {
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    margin-top: 4px;
}

.gm-slide-divider {
    width: 1px;
    background: #ccc;
    align-self: stretch;
    margin: 8% 0;
}

.gm-slide-info {
    padding: 10px 12px 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

/* ── Badge ───────────────────────────────────────────────── */
.gm-slide-badge-row {
    height: 22px;
    margin-left: -2px;
    margin-bottom: 2px;
}
.gm-slide-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
    transform: skewX(-10deg);
    border-radius: 2px;
    line-height: 1.5;
}
.gm-slide-badge--next {
    background: var(--gm-primary-bg, #c0392b);
    color: var(--gm-primary-text, #fff);
}
.gm-slide-badge--cancelled {
    background: var(--gm-secondary-bg, #6c757d);
    color: var(--gm-secondary-text, #fff);
}

/* ── Event type, title, location ─────────────────────────── */
.gm-slide-type {
    font-size: 12px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.gm-slide-title {
    font-size: 17px;
    font-weight: 700;
    color: #222;
    line-height: 1.25;
    padding-right: 6px;
}
.gm-slide-location {
    margin-top: 6px;
}
.gm-slide-loc-name {
    font-size: 13px;
    font-weight: 600;
    color: #555;
}
.gm-slide-loc-sub {
    font-size: 11px;
    font-weight: 500;
    color: #888;
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* ── Action buttons ──────────────────────────────────────── */
.gm-slide-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px 12px;
    border-top: 1px solid #ececec;
}
.gm-slide-btn {
    flex: 1 1 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none !important;
    cursor: pointer;
    transition: background .15s, opacity .15s;
    letter-spacing: .02em;
    white-space: nowrap;
}
.gm-slide-btn--info {
    background: var(--gm-secondary-bg, #6c757d) !important;
    color: var(--gm-secondary-text, #fff) !important;
}
.gm-slide-btn--info:hover {
    background: var(--gm-secondary-bg, #6c757d) !important;
    opacity: .85;
    color: var(--gm-secondary-text, #fff) !important;
    text-decoration: none !important;
}
.gm-slide-btn--register {
    background: var(--gm-primary-bg, #c0392b) !important;
    color: var(--gm-primary-text, #fff) !important;
}
.gm-slide-btn--register:hover {
    background: var(--gm-primary-bg, #c0392b) !important;
    opacity: .85;
    color: var(--gm-primary-text, #fff) !important;
    text-decoration: none !important;
}
.gm-slide-btn--results {
    background: var(--gm-secondary-bg, #6c757d) !important;
    color: var(--gm-secondary-text, #fff) !important;
}
.gm-slide-btn--results:hover {
    opacity: .85;
    color: var(--gm-secondary-text, #fff) !important;
    text-decoration: none !important;
}



/* ── Cancelled / past dimming ────────────────────────────── */
.gm-slide--past    .gm-slide-banner,
.gm-slide--cancelled .gm-slide-banner {
    filter: grayscale(40%);
}
.gm-slide--past    .gm-slide-card,
.gm-slide--cancelled .gm-slide-card {
    background: #f0f0f0;
}

/* ── Mobile ──────────────────────────────────────────────── */
@media (max-width: 400px) {
    .gm-splide .splide__slide,
    .gm-slide-banner,
    .gm-slide-card {
        width: 300px;
    }
    .gm-slide-banner {
        height: 169px; /* maintain 16:9 */
    }
    .gm-slide-day { font-size: 38px; }
}
