/* ============================================
   EMR Events — Modern Glassmorphism Theme
   ============================================ */

:root {
    --emr-primary: #0073aa;
    --emr-primary-hover: #005f8d;
    --emr-success: #28a745;
    --emr-bg-glass: rgba(255, 255, 255, 0.7);
    --emr-blur: blur(12px);
    --emr-border-glass: rgba(255, 255, 255, 0.3);
    --emr-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    --emr-radius: 16px;
}

/* --- Search Bar --- */

.emr-events-search-bar {
    background: var(--emr-bg-glass);
    backdrop-filter: var(--emr-blur);
    -webkit-backdrop-filter: var(--emr-blur);
    padding: 30px;
    border: 1px solid var(--emr-border-glass);
    border-radius: var(--emr-radius);
    margin-bottom: 40px;
    box-shadow: var(--emr-shadow);
}

.emr-events-date-search {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 20px;
}

.emr-search-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

@media (min-width: 768px) {
    .emr-search-field {
        flex: 0 0 calc(33.333% - 14px);
    }
}

.emr-search-field label {
    font-size: 0.8em;
    font-weight: 600;
    color: #444;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.emr-search-field input[type="text"],
.emr-search-field input[type="date"],
.emr-modal-trigger {
    padding: 12px 16px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.95em;
    color: #222;
    width: 100%;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
    box-sizing: border-box;
}

/* --- Date Inputs + Flatpickr alt inputs --- */

/* Style the visible Flatpickr alt input (type=text) the same as date fields */
.emr-search-field .flatpickr-alt-input {
    padding-left: 42px !important;
    cursor: pointer !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='17' height='17' viewBox='0 0 24 24' fill='none' stroke='%230073aa' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: 13px center !important;
    background-size: 17px !important;
}

.emr-search-field .flatpickr-alt-input:focus {
    border-color: var(--emr-primary);
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.15);
    outline: none;
}

.emr-search-field .flatpickr-alt-input:hover {
    border-color: rgba(0, 115, 170, 0.35);
    background-color: #fff;
}

/* --- Flatpickr Calendar Theme --- */

.flatpickr-calendar {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.14), 0 4px 16px rgba(0, 0, 0, 0.07);
    overflow: hidden;
    font-family: inherit;
    /* No padding here — day grid must use Flatpickr's own sizing */
    padding-bottom: 8px;
}

/* Strip any horizontal padding/margin the theme might inject into Flatpickr's
   internal grid elements — these break the JS width calculation */
.flatpickr-calendar,
.flatpickr-calendar *,
.flatpickr-calendar *::before,
.flatpickr-calendar *::after {
    box-sizing: border-box;
}

.flatpickr-months,
.flatpickr-weekdays,
.flatpickr-innerContainer,
.flatpickr-rContainer,
.flatpickr-days,
.dayContainer,
.flatpickr-day {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.flatpickr-calendar.open {
    animation: emr-fp-in 0.18s ease;
}

@keyframes emr-fp-in {
    from { opacity: 0; transform: translateY(-6px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0)   scale(1); }
}

/* Month header bar */
.flatpickr-months {
    background: var(--emr-primary);
    border-radius: 14px 14px 0 0;
    padding: 4px 0;
    align-items: center;
}

.flatpickr-month {
    color: #fff !important;
    fill: #fff !important;
}

/* Force white on the month <select> and year <input> — theme rules override without !important */
.flatpickr-current-month {
    font-size: 1em;
    font-weight: 700;
    padding-top: 4px;
}

.flatpickr-current-month,
.flatpickr-current-month span,
.flatpickr-current-month input,
.flatpickr-current-month select,
.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year {
    color: #fff !important;
    fill: #fff !important;
    font-weight: 700 !important;
    background: transparent !important;
    border: none !important;
}

/* Prevent theme global input/select width & padding rules from inflating the header */
.flatpickr-current-month select.flatpickr-monthDropdown-months {
    width: auto !important;
    padding: 0 2px 0 0 !important;
    box-sizing: content-box !important;
    min-width: unset !important;
    max-width: unset !important;
}

.flatpickr-current-month .numInputWrapper {
    width: auto !important;
    min-width: unset !important;
    display: inline-block !important;
}

.flatpickr-current-month input.cur-year {
    width: 4ch !important;
    min-width: unset !important;
    max-width: unset !important;
    padding: 0 0 0 2px !important;
    box-sizing: content-box !important;
}

/* Options appear in a native OS dropdown (white background) — must be dark */
.flatpickr-current-month .flatpickr-monthDropdown-months option {
    color: #333 !important;
    background: #fff !important;
    font-weight: 400 !important;
}

/* Year spinner arrows */
.flatpickr-current-month .numInputWrapper span.arrowUp::after {
    border-bottom-color: rgba(255, 255, 255, 0.8) !important;
}

.flatpickr-current-month .numInputWrapper span.arrowDown::after {
    border-top-color: rgba(255, 255, 255, 0.8) !important;
}

.flatpickr-prev-month,
.flatpickr-next-month {
    fill: #fff;
    color: #fff;
    padding: 8px 10px;
    border-radius: 8px;
    top: 4px;
}

.flatpickr-prev-month:hover,
.flatpickr-next-month:hover {
    background: rgba(255, 255, 255, 0.2) !important;
}

.flatpickr-prev-month svg,
.flatpickr-next-month svg {
    fill: #fff !important;
}

/* Day-of-week header */
.flatpickr-weekdays {
    background: rgba(0, 115, 170, 0.06);
    padding: 6px 0 2px;
}

span.flatpickr-weekday {
    color: var(--emr-primary);
    font-weight: 700;
    font-size: 0.72em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: transparent;
}

/* Day cells — only visual styles, no dimension overrides so Flatpickr's
   internal width calculation stays intact */
.flatpickr-day {
    border-radius: 8px;
    color: #333;
    font-weight: 500;
    border: none;
    transition: background 0.15s, color 0.15s;
}

.flatpickr-day:hover,
.flatpickr-day.prevMonthDay:hover,
.flatpickr-day.nextMonthDay:hover {
    background: rgba(0, 115, 170, 0.1);
    border-color: transparent;
    color: var(--emr-primary);
}

.flatpickr-day.today {
    border: 2px solid var(--emr-primary);
    color: var(--emr-primary);
    font-weight: 700;
}

.flatpickr-day.today:hover {
    background: var(--emr-primary);
    color: #fff;
    border-color: var(--emr-primary);
}

.flatpickr-day.selected,
.flatpickr-day.selected:hover {
    background: var(--emr-primary) !important;
    border-color: var(--emr-primary) !important;
    color: #fff !important;
    font-weight: 700;
}

.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
    color: #ccc;
}

.flatpickr-day.disabled {
    color: #ddd;
}

/* Mobile */
@media (max-width: 767px) {
    .flatpickr-calendar {
        border-radius: 20px;
    }

    .emr-search-field .flatpickr-alt-input {
        padding-left: 46px !important;
        background-size: 19px !important;
        background-position: 14px center !important;
    }
}

.emr-modal-trigger {
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.emr-modal-trigger:after {
    content: '▼';
    font-size: 0.7em;
    color: #777;
}

/* --- Action Buttons --- */

.emr-search-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    width: 100%;
    margin-top: 10px;
}

@media (min-width: 768px) {
    .emr-search-actions {
        flex: 0 0 calc(33.333% - 14px);
        margin-top: 0;
        justify-content: flex-end;
    }
}

.emr-search-submit {
    background: var(--emr-primary);
    color: #fff;
    border: none;
    padding: 14px 32px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.2);
}

.emr-search-submit:hover {
    background: var(--emr-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 115, 170, 0.3);
}

.emr-search-submit.emr-ready {
    background: var(--emr-success);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.2);
}

.emr-search-reset {
    font-size: 0.9em;
    color: #666;
    text-decoration: none;
    font-weight: 700;
}

.emr-search-reset:hover {
    color: #d9534f;
    text-decoration: underline;
}

/* --- Layout --- */

.emr-archive-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.emr-events-page-layout {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

@media (min-width: 1024px) {
    .emr-events-page-layout {
        flex-direction: row;
    }
    .emr-main-events-content {
        flex: 1;
    }
    .emr-events-sidebar {
        flex: 0 0 320px;
    }
}

/* --- Event Tag Pills --- */

.emr-event-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.emr-event-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.78em;
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.2s ease;
}

.emr-tag-category {
    background: rgba(0, 115, 170, 0.1);
    color: var(--emr-primary);
    border: 1px solid rgba(0, 115, 170, 0.25);
}

.emr-tag-category:hover {
    background: var(--emr-primary);
    color: #fff;
}

.emr-tag-area {
    background: rgba(40, 167, 69, 0.1);
    color: #1a7530;
    border: 1px solid rgba(40, 167, 69, 0.25);
}

.emr-tag-area:hover {
    background: #28a745;
    color: #fff;
}

/* --- Event Meta Row (date / time / location chips) --- */

.emr-event-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.emr-recurrence-badge {
    color: #7b4ea0 !important;
    background: rgba(123, 78, 160, 0.08) !important;
    border: 1px solid rgba(123, 78, 160, 0.22) !important;
    font-weight: 700 !important;
}

.emr-upcoming-recurrence {
    color: #7b4ea0;
    font-style: normal;
}

/* --- Event Card --- */

.emr-events-grid {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.emr-event-card {
    display: flex;
    flex-direction: row;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: var(--emr-blur);
    -webkit-backdrop-filter: var(--emr-blur);
    border: 1px solid var(--emr-border-glass);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    min-height: 260px; /* Enforced minimum height */
}

.emr-event-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.8);
}

.emr-event-image {
    flex: 0 0 320px;
    width: 320px;
    overflow: hidden;
    background: #f8f9fa;
    align-self: stretch;
    min-height: 260px;
    display: flex;
    flex-direction: column;
}

.emr-event-image > a {
    flex: 1;
    display: flex;
    overflow: hidden;
    height: 100%;
}

.emr-event-image img {
    flex: 1;
    min-width: 0;
    min-height: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

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

.emr-event-content {
    padding: 30px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.emr-event-content h2 {
    margin: 0 0 15px 0;
    font-size: 1.8em;
    font-weight: 700;
}

.emr-event-content h2 a {
    color: #222;
    text-decoration: none;
}

.emr-event-content h2 a:hover {
    color: var(--emr-primary);
    text-decoration: underline;
}

.emr-event-meta {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.88em;
    color: #555;
    background: rgba(0, 0, 0, 0.04);
    padding: 4px 10px;
    border-radius: 20px;
}

.emr-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.emr-event-excerpt {
    margin-bottom: 25px;
    line-height: 1.7;
    color: #444;
    flex-grow: 1;
}

.emr-event-actions {
    display: flex;
    gap: 15px;
}

.emr-details-btn,
.emr-ticket-btn,
.emr-website-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 22px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9em;
    transition: all 0.2s;
}

.emr-ticket-btn {
    background: var(--emr-primary);
    color: #fff !important;
}

.emr-ticket-btn:hover {
    background: var(--emr-primary-hover);
    color: #fff !important;
}

/* Website full button — single event page */
.emr-website-btn {
    background: #fff;
    color: var(--emr-primary) !important;
    border: 2px solid var(--emr-primary);
    text-decoration: none;
}

.emr-website-btn:hover {
    background: var(--emr-primary);
    color: #fff !important;
}

/* Website globe icon — card listings (matches height of sibling buttons via same vertical padding) */
.emr-website-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(0, 115, 170, 0.08);
    border: 1px solid rgba(0, 115, 170, 0.25);
    font-size: 1.1em;
    line-height: 1.4;
    text-decoration: none;
    transition: all 0.2s;
    flex-shrink: 0;
}

.emr-website-icon-btn:hover {
    background: var(--emr-primary);
    border-color: var(--emr-primary);
    transform: scale(1.08);
}

.emr-details-btn {
    background: rgba(0, 0, 0, 0.05);
    color: #333 !important;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.emr-details-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333 !important;
}

/* --- Sidebar --- */

.emr-sidebar-widget {
    background: var(--emr-bg-glass);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 25px;
    border: 1px solid var(--emr-border-glass);
    border-radius: var(--emr-radius);
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.emr-sidebar-widget h3 {
    margin: 0 0 20px 0;
    font-size: 1.1em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-bottom: 3px solid var(--emr-primary);
    display: inline-block;
    padding-bottom: 6px;
}

.emr-term-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.emr-term-list li a {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(0, 115, 170, 0.05);
    border: 1px solid rgba(0, 115, 170, 0.1);
    border-radius: 30px;
    color: var(--emr-primary);
    text-decoration: none;
    font-size: 0.85em;
    font-weight: 600;
    transition: all 0.3s ease;
}

.emr-term-list li a:hover {
    background: var(--emr-primary);
    color: #fff;
    transform: translateY(-2px);
}

/* --- Filter Notice --- */

.emr-filter-notice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: rgba(0, 115, 170, 0.08);
    border-left: 4px solid var(--emr-primary);
    padding: 16px 20px 16px 25px;
    border-radius: 0 10px 10px 0;
    margin-bottom: 30px;
    color: #2c3e50;
    font-size: 1.1em;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

.emr-filter-notice-clear {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    white-space: nowrap;
    padding: 6px 16px;
    border-radius: 6px;
    background: rgba(0, 115, 170, 0.12);
    border: 1px solid rgba(0, 115, 170, 0.3);
    color: var(--emr-primary) !important;
    font-size: 0.82em;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.emr-filter-notice-clear:hover {
    background: var(--emr-primary);
    color: #fff !important;
    border-color: var(--emr-primary);
}

/* --- Pagination --- */

.emr-pagination {
    margin-top: 50px;
    display: flex;
    justify-content: center;
    gap: 12px;
}

.emr-pagination .page-numbers {
    padding: 12px 20px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    color: #333;
    transition: all 0.2s;
}

.emr-pagination .page-numbers:hover {
    background: #f8f9fa;
}

.emr-pagination .page-numbers.current {
    background: var(--emr-primary);
    color: #fff;
    border-color: var(--emr-primary);
}

/* --- Modals Dialogs --- */

.emr-filter-modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 99999;
    align-items: center;
    justify-content: center;
}

.emr-filter-modal.emr-modal-open {
    display: flex;
}

.emr-modal-backdrop {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
}

.emr-modal-dialog {
    position: relative;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    width: 90%;
    max-width: 500px;
    border-radius: 24px;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    max-height: 80vh;
    border: 1px solid var(--emr-border-glass);
}

.emr-modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.emr-modal-body {
    padding: 25px;
    overflow-y: auto;
}

.emr-modal-footer {
    padding: 15px 25px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    text-align: right;
}

.emr-checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 8px;
    transition: background 0.2s;
    cursor: pointer;
}

.emr-checkbox-label:hover {
    background: rgba(0, 0, 0, 0.05);
}

.emr-checkbox-label input {
    width: 20px;
    height: 20px;
}

/* --- Upcoming Events List --- */

.emr-upcoming-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.emr-upcoming-list li {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.emr-upcoming-date {
    display: block;
    font-size: 0.75em;
    font-weight: 800;
    color: var(--emr-primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 4px;
}

.emr-upcoming-title {
    text-decoration: none;
    color: #222;
    font-weight: 700;
    font-size: 0.95em;
}

/* --- Modal Buttons (close & apply) --- */

.emr-modal-header h3 {
    margin: 0;
    font-size: 1.1em;
    font-weight: 700;
}

.emr-modal-close {
    background: none;
    border: none;
    font-size: 1.6em;
    line-height: 1;
    cursor: pointer;
    color: #888;
    padding: 4px 10px;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
}

.emr-modal-close:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #222;
}

.emr-modal-apply {
    background: var(--emr-primary);
    color: #fff;
    border: none;
    padding: 10px 28px;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.emr-modal-apply:hover {
    background: var(--emr-primary-hover);
    transform: translateY(-1px);
}

/* --- Single Event Page --- */

.emr-single-event-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.emr-back-link {
    margin: 0 0 30px;
}

.emr-back-link a {
    color: var(--emr-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: gap 0.2s ease;
}

.emr-back-link a:hover {
    gap: 10px;
    text-decoration: underline;
}

.emr-single-layout {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.emr-single-event {
    min-width: 0;
}

.emr-single-event-image {
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    max-height: 480px;
}

.emr-single-event-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.emr-single-event-header {
    background: var(--emr-bg-glass);
    backdrop-filter: var(--emr-blur);
    -webkit-backdrop-filter: var(--emr-blur);
    border: 1px solid var(--emr-border-glass);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: var(--emr-shadow);
}

.emr-single-event-title {
    margin: 15px 0 20px;
    font-size: 2em;
    font-weight: 800;
    line-height: 1.2;
    color: #1a1a2e;
}

.emr-single-event-meta {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 25px;
}

.emr-single-meta-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.emr-single-meta-icon {
    font-size: 1.3em;
    flex-shrink: 0;
    margin-top: 1px;
}

.emr-single-meta-item > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.emr-single-meta-item strong {
    font-size: 0.73em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #888;
    display: block;
}

.emr-single-meta-item span {
    color: #222;
    font-size: 1em;
    font-weight: 600;
}

.emr-single-event-actions {
    margin-top: 20px;
}

.emr-ticket-btn-large {
    padding: 14px 36px;
    font-size: 1em;
    border-radius: 12px;
}

.emr-single-event-body {
    background: var(--emr-bg-glass);
    backdrop-filter: var(--emr-blur);
    -webkit-backdrop-filter: var(--emr-blur);
    border: 1px solid var(--emr-border-glass);
    border-radius: 20px;
    padding: 35px;
    box-shadow: var(--emr-shadow);
    line-height: 1.8;
    color: #333;
    font-size: 1.05em;
}

.emr-single-event-body p:last-child {
    margin-bottom: 0;
}

.emr-single-sidebar {
    background: var(--emr-bg-glass);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--emr-border-glass);
    border-radius: var(--emr-radius);
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.emr-single-sidebar h3 {
    margin: 0 0 20px;
    font-size: 1.1em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-bottom: 3px solid var(--emr-primary);
    display: inline-block;
    padding-bottom: 6px;
}

@media (min-width: 1024px) {
    .emr-single-layout {
        flex-direction: row;
        align-items: flex-start;
    }

    .emr-single-event {
        flex: 1;
    }

    .emr-single-sidebar {
        flex: 0 0 300px;
        position: sticky;
        top: 30px;
    }
}

/* ── Rentals Integration ───────────────────────────────────────────────── */

/* Card — "Book a Rental Nearby" button */
.emr-rental-card-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    background: #1a6b3c !important;
    color: #fff !important;
    padding: 11px 16px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.92rem;
    text-decoration: none !important;
    margin-top: 10px;
    transition: background 0.2s, transform 0.15s;
    box-sizing: border-box;
}
.emr-rental-card-btn:hover {
    background: #145731 !important;
    transform: translateY(-1px);
    color: #fff !important;
}

/* Single event page — "Stay Nearby" block */
.emr-rental-cta-block {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    flex-wrap: wrap;
    background: linear-gradient(135deg, #1a6b3c 0%, #0f4f2c 100%);
    border-radius: 14px;
    padding: 28px 32px;
    margin: 36px 0 0;
    box-shadow: 0 6px 24px rgba(26, 107, 60, 0.25);
}
.emr-rental-cta-content {
    flex: 1;
    min-width: 0;
}
.emr-rental-cta-heading {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 10px !important;
    color: #fff !important;
    line-height: 1.4;
}
.emr-rental-cta-dates {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 !important;
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 0.97rem;
}
.emr-rental-cta-date-item {
    white-space: nowrap;
}
.emr-rental-cta-date-item strong {
    color: #fff !important;
    font-weight: 600;
    margin-right: 4px;
}
.emr-rental-cta-date-sep {
    color: rgba(255, 255, 255, 0.6) !important;
    font-size: 1.1rem;
}
.emr-rental-cta-subtext {
    color: rgba(255, 255, 255, 0.85) !important;
    margin: 0 !important;
    font-size: 0.97rem;
}
.emr-rental-cta-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    background: #fff;
    color: #1a6b3c !important;
    padding: 14px 28px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none !important;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.2s, transform 0.15s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}
.emr-rental-cta-btn:hover {
    background: #e5f5ec;
    transform: translateY(-2px);
    color: #0f4f2c !important;
}

/* Sidebar — "Book Your Stay" widget */
.emr-sidebar-rental {
    background: linear-gradient(160deg, #1a6b3c 0%, #0f4f2c 100%);
    border-radius: 12px;
    padding: 22px 20px;
    text-align: center;
    box-shadow: 0 4px 18px rgba(26, 107, 60, 0.2);
}
.emr-sidebar-rental h3 {
    color: #fff !important;
    font-size: 1.05rem;
    margin: 0 0 10px !important;
    border: none !important;
}
.emr-sidebar-rental p {
    color: rgba(255, 255, 255, 0.88) !important;
    font-size: 0.88rem;
    line-height: 1.5;
    margin: 0 0 16px !important;
}
.emr-rental-sidebar-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: #1a6b3c !important;
    padding: 11px 18px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.92rem;
    text-decoration: none !important;
    transition: background 0.2s, transform 0.15s;
}
.emr-rental-sidebar-btn:hover {
    background: #e5f5ec;
    transform: translateY(-1px);
    color: #0f4f2c !important;
}

/* --- Responsive --- */

@media (max-width: 767px) {
    .emr-event-card {
        flex-direction: column;
    }
    .emr-event-image {
        width: 100%;
        height: 240px;
        flex: none;
        flex-direction: row;
    }

    .emr-event-image > a {
        flex: 1;
    }

    /* Prevent iOS from zooming in on form inputs */
    .emr-search-field input[type="text"],
    .emr-search-field input[type="date"],
    .emr-modal-trigger {
        font-size: 16px;
        min-height: 48px;
    }


    .emr-search-submit {
        min-height: 48px;
        width: 100%;
    }

    .emr-single-event-title {
        font-size: 1.6em;
    }

    .emr-single-event-header {
        padding: 20px;
    }

    .emr-single-event-body {
        padding: 20px;
    }

    .emr-rental-cta-block {
        flex-direction: column;
        align-items: stretch;
        padding: 22px 20px;
        gap: 18px;
    }
    .emr-rental-cta-btn {
        text-align: center;
        justify-content: center;
    }
    .emr-rental-cta-dates {
        flex-direction: column;
        gap: 6px;
    }
}