/*
 * UID Event Range — continuous multi-day event bars for evo-calendar.
 * Renders Google-Calendar-style blocks spanning the event's date range.
 *
 * Responsiveness note:
 * evo-calendar lays the month out as a <table> with `table-layout: auto`.
 * Any in-flow, non-wrapping content inside a day cell would inflate the
 * table's intrinsic width and break the grid on desktop, tablet and mobile.
 * The range bars are therefore absolutely positioned inside each day cell
 * (see uid-event-range.js); the day cell reserves vertical room via padding.
 * Nothing here changes the table's horizontal sizing.
 *
 * Additive layer only; does not modify the vendor evo-calendar library.
 */

.evo-calendar tr.calendar-body > td.calendar-day {
    position: relative;
    /* Never let a bar's label widen the table. */
    overflow: hidden;
}

.evo-calendar .uid-ev-range {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 3px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    text-align: left;
    pointer-events: none; /* clicks pass through to the day cell */
    z-index: 2;
}

.evo-calendar .uid-ev-bar {
    display: block;
    width: 100%;
    height: 18px;
    line-height: 18px;
    padding: 0 5px;
    font-size: 11px;
    font-weight: 600;
    color: #fff !important;
    text-decoration: none !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-radius: 0;
    box-sizing: border-box;
    cursor: pointer;
    pointer-events: auto; /* re-enable clicks on the bar itself */
    transition: filter .15s ease;
}

.evo-calendar .uid-ev-bar:hover {
    filter: brightness(1.12);
    color: #fff !important;
    text-decoration: none !important;
}

.evo-calendar .uid-ev-bar.is-start {
    border-top-left-radius: 9px;
    border-bottom-left-radius: 9px;
}

.evo-calendar .uid-ev-bar.is-end {
    border-top-right-radius: 9px;
    border-bottom-right-radius: 9px;
}

.evo-calendar .uid-ev-bar.is-continuation {
    padding: 0;
}

.evo-calendar .uid-ev-slot {
    display: block;
    width: 100%;
    height: 18px;
}

/* Tablet / small desktop */
@media screen and (max-width: 1024px) {
    .evo-calendar .uid-ev-range {
        gap: 2px;
        bottom: 2px;
    }

    .evo-calendar .uid-ev-bar,
    .evo-calendar .uid-ev-slot {
        height: 15px;
        line-height: 15px;
    }

    .evo-calendar .uid-ev-bar {
        font-size: 10px;
        padding: 0 4px;
    }
}

/* Mobile */
@media screen and (max-width: 767px) {
    .evo-calendar .uid-ev-range {
        gap: 2px;
        bottom: 2px;
    }

    .evo-calendar .uid-ev-bar,
    .evo-calendar .uid-ev-slot {
        height: 12px;
        line-height: 12px;
    }

    .evo-calendar .uid-ev-bar {
        font-size: 9px;
        padding: 0 3px;
    }
}

/* Very small phones: keep bars slim; only label the real start/end. */
@media screen and (max-width: 425px) {
    .evo-calendar .uid-ev-bar {
        font-size: 0;
        padding: 0;
    }

    .evo-calendar .uid-ev-bar.is-start,
    .evo-calendar .uid-ev-bar.is-end {
        font-size: 8px;
        padding: 0 2px;
    }
}
