/* ===== Desktop ===== */

.ec-day-events {
    display: none;
}

/* Desktop: hide mobile summary */
.ec-day-events-mobile {
    display: none;
}

.ec-event {
    display: block;
    font-size: 0.75rem;
    margin-top: 4px;
    background: #f1f5ff;
    padding: 4px;
    border-radius: 4px;
    cursor: pointer;
}

.ec-more {
    margin-top: 4px;
    font-size: 0.75rem;
    background: none;
    border: none;
    color: #2b7cff;
    cursor: pointer;
}

/* Highlight today */
.ec-today {
    background: #fffae6;
    border: 2px solid #f0c040;
}

/* ===== Mobile ===== */

@media (max-width: 768px) {

    .ec-event,
    .ec-more {
        display: none !important;
    }

    .ec-day-events {
        display: flex !important;
        align-items: center;
        justify-content: center;
        background: #2b7cff;
        color: #fff;
        border-radius: 6px;
        font-size: 0.85rem;
        font-weight: 600;
        margin-top: 6px;
        padding: 6px 0;
        cursor: pointer;
    }

    .ec-day-events-mobile {
        display: block;
        background-color: #f0f0f0;
        text-align: center;
        padding: 4px;
        border-radius: 4px;
        cursor: pointer;
    }

    /* Add a colored circle behind the day number */
    .ec-today .ec-day-num {
        background: #f0c040;
        color: #000;
        border-radius: 50%;
        width: 24px;
        height: 24px;
        line-height: 24px;
        display: inline-block;
        text-align: center;
        font-weight: bold;
    }
}

/* Modal container - hidden by default */
.ec-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none; /* Hidden initially */
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 10px; /* small padding for mobile */
    box-sizing: border-box;
}

/* Show modal when open */
.ec-modal.open {
    display: flex;
}

/* Modal content box */
.ec-modal-content {
    background: #fff;
    max-width: 500px;
    width: 100%;
    max-height: 90vh; /* 90% of viewport height */
    overflow-y: auto;  /* Scroll if content too tall */
    border-radius: 8px;
    padding: 20px;
    box-sizing: border-box;
    position: relative;
}

/* Close button */
.ec-modal-close {
    position: sticky;
    top: 0;
    right: 0;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    margin: 10px;
}

/* Individual event blocks inside modal */
.ec-modal-event {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

/* Event heading */
.ec-modal-event h3 {
    font-size: 1rem; /* smaller than before */
    margin: 0 0 5px 0;
}

/* Event link */
.ec-event-link {
    color: #0073aa;
    text-decoration: underline;
    display: inline-block;
    margin-top: 3px;
}

/* Optional hover effect */
.ec-event-link:hover {
    color: #005177;
}

/* Ensure body scroll doesn't break layout when modal open */
body.modal-open {
    overflow: hidden;
}




.ec-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.ec-month-wrap {
    flex: 1;
    text-align: center;
}

.ec-prev,
.ec-next {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

.ec-month-picker {
    margin-top: 8px;
    display: flex;
    gap: 6px;
    justify-content: center;
}

/* Keep calendar columns equal width */
.ec-calendar {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

/* Prevent event content stretching cells */
.ec-calendar td {
    overflow: hidden;
}

/* Ensure event text doesn’t expand column */
.ec-event,
.ec-day-events-mobile {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Make sure mobile summary fills cell but doesn't stretch */
.ec-day-events-mobile {
    width: 100%;
    text-align: center;
    font-size: 0.8em;
}

/* Equal column widths */
.ec-calendar {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

/* Lock row height */
.ec-calendar td {
    height: 110px;          /* adjust to taste */
    vertical-align: top;
    overflow: hidden;
    position: relative;
}

/* Ensure event container doesn't stretch cell */
.ec-event,
.ec-day-events-mobile {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Hide mobile summary on desktop */
.ec-day-events-mobile {
    display: none;
}

/* Mobile behaviour */
@media (max-width: 767px) {

    /* Hide desktop event list */
    .ec-event,
    .ec-more {
        display: none !important;
    }

    /* Show mobile summary */
    .ec-day-events-mobile {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 100%;
        font-weight: 600;
        cursor: pointer;
    }

    /* Optional: fill day cell with colour if events exist */
    .ec-calendar td:has(.ec-day-events-mobile) {
        background: #f2f7ff;
    }
}

