.public-calendar-page {
    background: #f7f7fb;
    min-height: 65vh;
}

html,
body {
    overflow-x: hidden;
}

.public-calendar-heading {
    background: #212121;
    border-bottom: 5px solid var(--color-accent);
    color: #fff;
    padding: 2.25rem 0 2rem;
}

.public-calendar-eyebrow {
    color: #ffd66b;
    font-family: 'Montserrat', sans-serif;
    font-size: .78rem;
    font-weight: 700;
    margin: 0 0 .35rem;
    text-transform: uppercase;
}

.public-calendar-heading h1 {
    font-size: clamp(2rem, 4vw, 3.2rem);
    letter-spacing: 0;
    margin: 0;
}

.public-calendar-cycle {
    color: rgba(255,255,255,.75);
    font-weight: 700;
    margin: .35rem 0 0;
}

.public-calendar-content {
    padding-block: 1.5rem 3rem;
}

.public-calendar-state {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    min-height: 280px;
    padding: 5rem 1.5rem;
    text-align: center;
}


.public-calendar-notes {
    color: #5f4615;
    margin: 0;
    max-width: 65ch;
}

.public-calendar-advisory {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-left: 4px solid var(--color-accent);
    border-radius: 8px;
    color: #374151;
    font-size: .9rem;
    font-weight: 800;
    margin: 0 0 1rem;
    padding: .85rem 1rem;
}

.public-calendar-levels {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
    margin-bottom: 1rem;
}

.public-calendar-levels__button {
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    color: #374151;
    cursor: pointer;
    font-size: .84rem;
    font-weight: 800;
    min-height: 38px;
    padding: 0 .95rem;
}

.public-calendar-levels__button.is-active {
    background: #212121;
    border-color: #212121;
    color: #fff;
}

.public-calendar-legend {
    align-items: center;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: .9rem 1rem;
}

.public-calendar-legend h2 {
    flex: 0 0 auto;
    font-size: .76rem;
    margin: 0;
    text-transform: uppercase;
}

.public-calendar-legend__items {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: .55rem 1rem;
}

.public-calendar-legend__item {
    align-items: center;
    display: inline-flex;
    font-size: .84rem;
    font-weight: 700;
    gap: .4rem;
}

.public-calendar-legend__dot {
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.12);
    height: .7rem;
    width: .7rem;
}

.public-calendar-legend__hint {
    color: #6b7280;
    font-size: .8rem;
}

.public-calendar-shell {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 16px 40px rgba(15,23,42,.08);
    padding: 1rem;
}

.public-calendar-shell .fc {
    --fc-border-color: #e5e7eb;
    --fc-button-active-bg-color: #212121;
    --fc-button-active-border-color: #212121;
    --fc-button-bg-color: #fff;
    --fc-button-border-color: #d1d5db;
    --fc-button-hover-bg-color: #f3f4f6;
    --fc-button-hover-border-color: var(--color-primary);
    --fc-button-text-color: #212121;
    --fc-today-bg-color: rgba(249,168,37,.12);
    font-size: .88rem;
}

.public-calendar-shell .fc .fc-toolbar-title {
    font-size: 1.45rem;
    font-weight: 800;
}

.public-calendar-shell .fc .fc-toolbar-title::first-letter {
    text-transform: uppercase;
}

.public-calendar-shell .fc .fc-button {
    border-radius: 6px;
    font-size: .78rem;
    font-weight: 700;
    text-transform: capitalize;
}

.public-calendar-shell .fc .fc-button-primary:not(:disabled).fc-button-active {
    color: #fff;
}

.public-calendar-shell .fc .fc-col-header-cell {
    background: #212121;
    color: #fff;
    padding: .45rem .2rem;
}

.public-calendar-shell .fc .fc-col-header-cell-cushion {
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;
}

.public-calendar-shell .fc .fc-daygrid-day-frame {
    min-height: 112px;
}

.public-calendar-shell .fc .fc-event {
    background: transparent !important;
    border: 0 !important;
    margin: 2px 3px;
    overflow: hidden;
    padding: 0;
    white-space: normal;
}

.public-calendar-shell .fc .fc-daygrid-event-harness {
    overflow: hidden;
    white-space: normal;
}

.public-calendar-shell .fc .fc-event-main {
    color: inherit !important;
}

.public-calendar-shell .fc .academic-calendar-non-working-bg {
    opacity: .18;
}

.public-calendar-shell .fc .fc-list-event:hover td {
    background: #f8fafc;
}

.public-calendar-event,
.public-calendar-payment {
    align-items: flex-start;
    background: #fff;
    background: color-mix(in srgb, var(--event-color) 12%, #fff);
    border: 1px solid color-mix(in srgb, var(--event-color) 34%, #e5e7eb);
    border-left: 4px solid var(--event-color);
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(15,23,42,.06);
    display: flex;
    gap: .35rem;
    justify-content: flex-start;
    line-height: 1.2;
    min-height: 25px;
    padding: .28rem .42rem;
    text-align: left;
    transition: box-shadow .18s ease, transform .18s ease;
    width: 100%;
}

.public-calendar-event:hover,
.public-calendar-payment:hover {
    box-shadow: 0 4px 10px rgba(15,23,42,.12);
    transform: translateY(-1px);
}

.public-calendar-event__dot {
    background: var(--event-color);
    border-radius: 50%;
    flex: 0 0 auto;
    height: .45rem;
    width: .45rem;
}

.public-calendar-event__content {
    align-items: baseline;
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    gap: .12rem .3rem;
    min-width: 0;
}

.public-calendar-event__time {
    color: #64748b;
    flex: 0 0 auto;
    font-size: .64rem;
    font-weight: 800;
}

.public-calendar-event__title {
    color: #1f2937;
    font-size: .7rem;
    font-weight: 800;
    line-height: 1.22;
    display: -webkit-box;
    max-height: 2.55em;
    overflow: hidden;
    overflow-wrap: anywhere;
    text-overflow: ellipsis;
    white-space: normal;
    word-break: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.public-calendar-payment__icon {
    align-items: center;
    background: var(--event-color);
    border: 1px solid var(--event-color);
    border-radius: 50%;
    color: #fff;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: .65rem;
    font-weight: 800;
    height: 1.15rem;
    justify-content: center;
    width: 1.15rem;
}

.public-calendar-shell .fc-list-event .public-calendar-event,
.public-calendar-shell .fc-list-event .public-calendar-payment {
    max-width: 620px;
    padding: .45rem .55rem;
}

.public-calendar-shell .fc .fc-list-day-cushion {
    background: #f1f5f9;
    padding: .65rem .8rem;
}

.public-calendar-shell .fc .fc-list-day-text,
.public-calendar-shell .fc .fc-list-day-side-text {
    color: #334155;
    font-size: .78rem;
    font-weight: 800;
    text-decoration: none;
}

.public-calendar-shell .fc .fc-list-day-text::first-letter,
.public-calendar-shell .fc .fc-list-day-side-text::first-letter {
    text-transform: uppercase;
}

.public-calendar-shell .fc .fc-list-event td {
    border-color: #e5e7eb;
    padding-block: .55rem;
}


@media (max-width: 820px) {
    .public-calendar-heading {
        padding: 1.5rem 0 1.35rem;
    }

    .public-calendar-heading h1 {
        font-size: 2rem;
    }

    .public-calendar-content {
        padding-block: 1rem 2rem;
        width: min(100% - 1rem, 100%);
    }
    .public-calendar-legend {
        align-items: flex-start;
        flex-direction: column;
    }

    .public-calendar-levels {
        display: grid;
        grid-template-columns: 1fr;
    }

    .public-calendar-legend {
        gap: .7rem;
        padding: .8rem;
    }

    .public-calendar-legend__items {
        gap: .65rem .8rem;
    }

    .public-calendar-shell {
        padding: .65rem;
    }

    .public-calendar-shell .fc .fc-toolbar {
        align-items: stretch;
        flex-direction: column;
        gap: .75rem;
        margin-bottom: 1rem;
    }

    .public-calendar-shell .fc .fc-toolbar-chunk {
        display: flex;
        justify-content: center;
    }

    .public-calendar-shell .fc .fc-toolbar-title {
        font-size: 1.35rem;
        text-align: center;
    }

    .public-calendar-shell .fc .fc-button {
        min-height: 38px;
        padding-inline: .8rem;
    }

    .public-calendar-shell .fc .fc-list {
        border: 0;
    }

    .public-calendar-shell .fc .fc-list-table {
        border-collapse: separate;
        border-spacing: 0;
    }

    .public-calendar-shell .fc .fc-list-event-time {
        color: #64748b;
        font-size: .72rem;
        padding-left: .45rem;
        padding-right: .35rem;
        white-space: nowrap;
        width: 1%;
    }

    .public-calendar-shell .fc .fc-list-event-graphic {
        display: none;
    }

    .public-calendar-shell .fc .fc-list-event-title {
        padding-left: .25rem;
        padding-right: .35rem;
    }

    .public-calendar-shell .fc-list-event .public-calendar-event,
    .public-calendar-shell .fc-list-event .public-calendar-payment {
        min-height: 42px;
        padding: .55rem .65rem;
    }

    .public-calendar-shell .fc-list-event .public-calendar-event__title {
        font-size: .82rem;
    }

    .public-calendar-shell .fc-list-event .public-calendar-event__time {
        display: none;
    }

    .public-calendar-shell .fc .fc-col-header-cell-cushion {
        font-size: .62rem;
    }

    .public-calendar-shell .fc .fc-daygrid-day-frame {
        min-height: 132px;
    }

    .public-calendar-shell .fc .fc-daygrid-day-number {
        font-size: .75rem;
        padding: .25rem;
    }

    .public-calendar-event--compact {
        align-items: flex-start;
        background: #fff;
        background: color-mix(in srgb, var(--event-color) 13%, #fff);
        border: 1px solid color-mix(in srgb, var(--event-color) 32%, #e5e7eb);
        border-left: 3px solid var(--event-color);
        border-radius: 5px;
        box-shadow: none;
        gap: .18rem;
        min-height: 20px;
        overflow: hidden;
        padding: .18rem .22rem;
    }

    .public-calendar-event--compact:hover {
        box-shadow: none;
        transform: none;
    }

    .public-calendar-event--compact .public-calendar-event__content {
        display: flex;
        flex-wrap: wrap;
        min-width: 0;
    }

    .public-calendar-event--compact .public-calendar-event__dot {
        height: .38rem;
        width: .38rem;
    }

    .public-calendar-event--compact .public-calendar-payment__icon {
        font-size: .5rem;
        height: .9rem;
        width: .9rem;
    }

    .public-calendar-event--compact .public-calendar-event__time {
        display: none;
    }

    .public-calendar-event--compact .public-calendar-event__title {
        display: -webkit-box;
        font-size: .62rem;
        line-height: 1.18;
        max-height: 2.45em;
        max-width: 100%;
        overflow: hidden;
        overflow-wrap: anywhere;
        text-overflow: ellipsis;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

}


.public-calendar-shell .fc .fc-list-event-time,
.public-calendar-event__time {
    display: none;
}


.public-calendar-dialog {
    border: 0;
    border-radius: 14px;
    box-shadow: 0 24px 80px rgba(15,23,42,.28);
    color: #1f2937;
    max-width: min(92vw, 440px);
    padding: 1.35rem;
}

.public-calendar-dialog::backdrop {
    background: rgba(15,23,42,.45);
}

.public-calendar-dialog__close {
    align-items: center;
    background: #f3f4f6;
    border: 0;
    border-radius: 999px;
    color: #374151;
    cursor: pointer;
    display: inline-flex;
    font-size: 1.35rem;
    height: 2rem;
    justify-content: center;
    position: absolute;
    right: .75rem;
    top: .75rem;
    width: 2rem;
}

.public-calendar-dialog__color {
    border-radius: 999px;
    height: .45rem;
    margin-bottom: .9rem;
    width: 3.5rem;
}

.public-calendar-dialog__area {
    color: #6b7280;
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .08em;
    margin: 0 2.25rem .35rem 0;
    text-transform: uppercase;
}

.public-calendar-dialog h2 {
    font-size: 1.2rem;
    line-height: 1.3;
    margin: 0 2.25rem .95rem 0;
}

.public-calendar-dialog__details {
    border-top: 1px solid #e5e7eb;
    display: grid;
    gap: .25rem;
    margin: 0;
    padding-top: .85rem;
}

.public-calendar-dialog__details dt {
    color: #6b7280;
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.public-calendar-dialog__details dd {
    font-weight: 700;
    margin: 0;
}

