.ccd-shell {
    padding-top: 0;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--line)
}

#ccd-calendar, .ccd-agenda-item {
    scroll-margin-top: 7rem
}

.ccd-legend {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .55rem;
    margin-bottom: 1rem
}

    .ccd-legend > span:last-child {
        font-size: .75rem;
        color: #596577;
        margin-left: auto
    }

.ccd-kind {
    display: inline-block;
    font-size: .7rem;
    line-height: 1.5;
    font-weight: 700;
    padding: .3rem .65rem;
    border: 1px solid;
    border-radius: 4px;
    white-space: nowrap
}

    .ccd-kind.ccd-class {
        color: #36584b;
        background: #eaf3ed;
        border-color: #9bbaa7
    }

    .ccd-kind.ccd-no-class {
        color: #8e3040;
        background: #fcf0f1;
        border-color: #d6a5ad
    }

    .ccd-kind.ccd-observance {
        color: #715820;
        background: #fbf4e3;
        border-color: #d1bd88
    }

.ccd-grid .cell-events a.ccd-class {
    background: #eaf3ed;
    border-left-color: #557e69
}

.ccd-grid .cell-events a.ccd-no-class {
    background: #fcf0f1;
    border-left-color: #ae5364
}

.ccd-grid .cell-events a.ccd-observance {
    background: #fbf4e3;
    border-left-color: #a08444
}

/* Shared with the admin calendar's read-only notes. */
.ccd-notes {
    white-space: pre-line;
    font-size: .9rem;
    line-height: 1.7;
    color: #4c5666;
    margin: 0
}

/* Date-led agenda: independent of the parish event cards and their time column. */
.ccd-agenda {
    margin-top: 0;

    border-top: 1px solid var(--line);
    background: var(--paper)
}

.ccd-agenda-heading {
    margin-bottom: 1.7rem
}

    .ccd-agenda-heading h3 {
        margin: 0;
        color: var(--navy);
        font-size: var(--section-heading-size);
        line-height: 1.3
    }


.ccd-agenda-day {
    position: relative;
    margin-bottom: 1.15rem;
    scroll-margin-top: 7rem
}

    .ccd-agenda-day:last-child {
        margin-bottom: 0
    }

    .ccd-agenda-day:not(:last-child):before {
        content: "";
        position: absolute;
        left: 38px;
        top: 0;
        bottom: -1.15rem;
        width: 1px;
        background: #cbd5e2
    }

.ccd-date-tile {
    margin: 0;
    position: relative;
    text-align: center;
    border: 1px solid #d8dfe9;
    background: #fff;
    overflow: hidden;
    color: var(--navy);
    box-shadow: var(--ccd-calendar-shadow)
}

    .ccd-date-tile time {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding-bottom: .6rem
    }

.ccd-date-month {
    align-self: stretch;
    background: var(--navy);
    color: #fff;
    font-size: .6rem;
    font-weight: 700;
    letter-spacing: .14em;
    line-height: 1.4;
    padding: .45rem .3rem;
    text-transform: uppercase
}

.ccd-date-number {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.1;
    padding-top: .45rem;
    font-variant-numeric: tabular-nums
}

.ccd-date-weekday {
    font-size: .65rem;
    color: #617086;
    line-height: 1.5;
    font-weight: 400;
    margin-top: .15rem
}

.ccd-day-entries {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: .75rem;
    min-width: 0
}

/* The shared date tile and the first entry take their height from the same row. */
.ccd-day-entries > li {
    display: grid;
    grid-template-columns: 78px minmax(0,1fr);
    column-gap: 1.4rem;
}

.ccd-agenda-item {
    grid-column: 2;
    --ccd-accent: #638570;
    display: block;
    position: relative;
    min-height: 96px;
    background: #fff;
    border: 1px solid #dce3ec;
    border-left: 4px solid var(--ccd-accent);
    box-shadow: var(--public-card-shadow, var(--ccd-calendar-shadow));
    scroll-margin-top: 7rem
}

    .ccd-agenda-item.ccd-entry-no-class {
        --ccd-accent: #b16c79
    }

    .ccd-agenda-item.ccd-entry-observance {
        --ccd-accent: #b29861
    }

.ccd-entry-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    min-height: 96px;
    padding: 1.25rem 1.6rem;
}
.ccd-entry-heading { min-width: 0; }

    .ccd-entry-heading h5 {
        font-size: 1.12rem;
        font-weight: 700;
        line-height: 1.5;
        color: var(--navy);
        margin: 0;
        overflow-wrap: anywhere;
        min-width: 0
    }

.ccd-entry-badges {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .4rem;
    margin-top: .45rem;
}

    .ccd-entry-badges .ccd-kind {
        font-size: .65rem;
        padding: .25rem .65rem;
        border-radius: 20px
    }

.ccd-tentative {
    font-size: .65rem;
    border: 1px dashed #a18351;
    color: #715820;
    background: #fffaf0;
    padding: .25rem .65rem;
    border-radius: 20px;
    line-height: 1.5
}

.ccd-entry-notes {
    border-top: 1px solid #edf0f4;
    margin: 0 1.6rem 1.25rem;
    padding-top: .9rem;
    color: #526077;
    font-size: .88rem;
    line-height: 1.8
}

.ccd-note-text {
    white-space: pre-line;
    overflow-wrap: anywhere;
    margin: 0
}

.ccd-note-list {
    display: grid;
    gap: .65rem;
    list-style: disc;
    margin: 0;
    padding-left: 1.15rem
}

    .ccd-note-list li {
        padding-left: .3rem
    }

        .ccd-note-list li::marker {
            color: var(--ccd-accent);
            font-size: .8em
        }

.ccd-note-text + .ccd-note-list {
    margin-top: .65rem
}

.ccd-agenda-item:target {
    outline: 2px solid #a88e55;
    outline-offset: 3px
}

.ccd-agenda-item:focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 3px
}

@media (max-width: 767.98px) {
    .ccd-agenda-heading { margin-bottom: 1rem; }
    .ccd-agenda-day { margin-bottom: 1rem; }
    .ccd-day-entries > li { grid-template-columns: 58px minmax(0, 1fr); column-gap: .75rem; }
    .ccd-agenda-day:not(:last-child)::before { left: 28px; bottom: -1rem; }
    .ccd-date-tile time { padding-bottom: .375rem; }
    .ccd-date-number { font-size: 1.5rem; padding-top: .25rem; }
    .ccd-date-month { font-size: .55rem; padding-block: .3rem; }
    .ccd-date-weekday { font-size: .6rem; }
    .ccd-agenda-item { min-height: 86px; border-left-width: 3px; }
    .ccd-entry-top { min-height: 86px; padding: .85rem 1rem; }
    .ccd-entry-heading h5 { font-size: 1rem; }
    .ccd-entry-notes { margin: 0 1rem 1rem; padding-top: .75rem; font-size: .82rem; }
    .ccd-note-list { padding-left: .9rem; }
}

/* Native disclosures and custom grids keep the public calendar usable without Bootstrap or JavaScript. */
.ccd-shell {
    --ccd-calendar-shadow: 0 2px 8px rgb(0 0 0 / .08);
    --ccd-grid-line: #d3d9e3;
    --ccd-control-size: 56px;
}
#ccd-calendar-filters .events-toolbar { flex-wrap: wrap; margin-bottom: .5rem; }
@media (min-width:768px) {
    #ccd-calendar-filters .events-toolbar { gap: .75rem; }
}
#content .ccd-shell .events-month-nav {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: .9rem;
    max-width: 100%;
    position: relative;
}
.ccd-month-controls { display: flex; align-items: center; gap: .375rem; }
.ccd-month-controls > :is(a,span) {
    --ui-corner-radius: 50%;
    --ui-control-radius: 50%;
    display: grid;
    place-items: center;
    width: var(--ccd-control-size);
    height: var(--ccd-control-size);
    border: 1px solid var(--line);
    background: #fff;
    color: #536078;
}
.ccd-month-controls .icon { width: 1.25rem; height: 1.25rem; }
.ccd-prev-month .icon { transform: rotate(180deg); }
.ccd-month-controls .is-disabled { opacity: .3; }
#content .ccd-shell .ccd-month-controls a:is(:hover,:focus-visible) {
    background: #f3e8d4;
    color: var(--navy);
    text-decoration: none;
}
.ccd-shell .events-today .icon { width: 1rem; height: 1rem; }
.ccd-month-picker { min-width: 0; }
.ccd-shell summary { list-style: none; cursor: pointer; }
.ccd-shell summary::-webkit-details-marker { display: none; }
.ccd-month-picker > summary { display: flex; align-items: center; min-height: 44px; }
.ccd-shell #calendar-month {
    display: flex;
    align-items: center;
    gap: .35rem;
    margin: 0;
    color: var(--navy);
    font-size: 1.75rem;
    line-height: 1.3;
}
.ccd-month-picker > summary:hover h3 { text-decoration: underline dotted; text-underline-offset: .2em; }
.ccd-month-picker h3 .icon { width: .9rem; height: .9rem; transform: rotate(90deg); }
.ccd-month-panel {
    position: absolute;
    z-index: 5;
    display: grid;
    align-items: end;
    gap: .65rem;
    padding: .85rem;
    border: 1px solid var(--line);
    background: #fff;
    box-shadow: 0 8px 28px #17223926;
    inset: calc(100% + .35rem) auto auto 0;
    width: min(260px, 100%);
}
.ccd-shell .ccd-month-panel label {
    display: block;
    margin-bottom: .25rem;
    color: var(--navy);
    font-size: .8rem;
    font-weight: 700;
}
.ccd-shell .ccd-month-panel input {
    min-width: 0;
    width: 100%;
    min-height: 44px;
    padding: .4rem .5rem;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--navy);
    font: inherit;
    font-size: .9rem;
}
.ccd-shell .ccd-month-panel button { min-height: 44px; }
.ccd-shell .events-result-line { min-height: 44px; gap: 0 .75rem; }
.ccd-shell .events-result-line a { display: inline-flex; align-items: center; min-height: 44px; margin-left: 0; }

.ccd-shell .ccd-grid { border-color: var(--ccd-grid-line); box-shadow: var(--ccd-calendar-shadow); }
.ccd-grid th { border: 1px solid var(--navy); }
.ccd-grid td { height: 92px; padding: .6rem .85rem; border-color: var(--ccd-grid-line); }
.ccd-grid td:not(.outside-month) { position: relative; isolation: isolate; background: var(--paper); }
.ccd-grid .day-number { min-height: 32px; padding: 0; color: var(--navy); font-size: 1.05rem; font-weight: 700; }
.ccd-grid a.day-number::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.ccd-grid a.day-number:focus-visible::after { outline: 2px solid var(--navy); outline-offset: -2px; }
.ccd-shell .ccd-grid a.day-number:is(:hover,:focus-visible) { background: transparent; color: var(--navy); text-decoration: none; outline: none; }
.ccd-grid .cell-events { margin-inline-start: -.35rem; }
.ccd-grid .cell-events a { position: relative; z-index: 2; color: var(--navy); font-size: .85rem; }
.ccd-grid .cell-events em { display: block; }
.ccd-shell .ccd-grid td:has(.has-events):focus-within { background: #fff; box-shadow: inset 0 2px var(--gold); }
@media (hover: hover) {
    .ccd-shell .ccd-grid td:has(.has-events):hover { background: #fff; box-shadow: inset 0 2px var(--gold); }
}
.ccd-shell .ccd-grid td.is-today { background: #fffaf0; outline: 1px solid var(--gold); outline-offset: -1px; }
.ccd-shell .ccd-grid .is-today .day-number { justify-content: space-between; }
.ccd-shell .ccd-grid .is-today time {
    --ui-corner-radius: 50%;
    display: grid;
    place-items: center;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    padding: 0;
    background: var(--navy);
    color: #fff;
    font-weight: 800;
    line-height: 1;
}
.ccd-grid .calendar-today-label {
    --ui-corner-radius: 999px;
    padding: .2rem .4rem;
    border: 1px solid #dfceb0;
    background: #f3e8d4;
    color: #705020;
    font-size: .6rem;
}

.ccd-entry-action {
    --ui-corner-radius: var(--ui-control-radius);
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    min-height: 48px;
    padding: .55rem .85rem;
    background: var(--navy);
    color: #fff;
    font-size: .8rem;
    font-weight: 700;
}
.ccd-entry-details[open] .ccd-entry-action .icon { transform: rotate(90deg); }
.ccd-entry-details > summary:focus-visible { outline: 2px solid var(--blue); outline-offset: -3px; }
@media (hover: hover) and (pointer: fine) {
    .ccd-agenda-item:has(> .ccd-entry-details):hover {
        background-color: #f3f9fd;
        border-left-color: var(--gold);
        box-shadow: 0 4px 14px rgb(27 39 61 / .16);
    }
    .ccd-entry-details > summary:hover h5 { text-decoration: underline dotted; text-underline-offset: .2em; }
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
    .ccd-agenda-item:has(> .ccd-entry-details) { transition: background-color 160ms ease-out, box-shadow 160ms ease-out, border-left-color 160ms ease-out; }
    .ccd-entry-action .icon { transition: transform 160ms ease-out; }
    .ccd-entry-details:not([open]) > summary:hover .ccd-entry-action .icon { transform: translateX(4px); }
}

@media (max-width: 900px) {
    .ccd-grid td { padding-inline: .35rem; }
    .ccd-grid .calendar-today-label { padding-inline: .2rem; }
}
@media (max-width: 767.98px) {
    .ccd-shell { --ccd-control-size: 44px; }
    .ccd-shell :is(.faith-section-heading .faith-text-link,.ccd-school-year,.ccd-legend) { display: none; }
    .ccd-shell .faith-section-heading { align-items: flex-start; margin-bottom: 1rem; }
    #content .ccd-shell .events-month-nav { grid-template-columns: auto minmax(0,1fr); width: auto; max-width: none; gap: .25rem; }
    .ccd-month-controls { gap: .25rem; }
    .ccd-month-picker h3 .icon { width: .75rem; height: .75rem; color: #805919; }
    .ccd-month-panel { inset: 100% .5rem auto; width: auto; }
    .ccd-month-controls .icon { width: 1.1rem; height: 1.1rem; }
    .ccd-shell #calendar-month { gap: .25rem; font-size: var(--section-heading-size); line-height: 1.25; }
    .ccd-shell .events-result-line { display: flex; margin-bottom: .25rem; }
    .ccd-shell .events-result-line:last-child { min-height: 0; margin-bottom: 0; }
    .ccd-grid td { height: 64px; padding: .25rem; }
    .ccd-grid .day-number { min-height: 44px; font-size: .9rem; }
    .ccd-grid .cell-events { display: none; }
    .ccd-grid .day-count { display: block; min-width: 17px; border-radius: 50%; background: var(--navy); color: #fff; font-size: .62rem; line-height: 17px; text-align: center; }
    .ccd-shell .ccd-grid .is-today .day-number { justify-content: flex-start; }
    .ccd-shell .ccd-grid .is-today time { flex-basis: 28px; width: 28px; height: 28px; }
    .ccd-grid .calendar-today-label { display: none; }
    .ccd-shell .events-mobile-tip { display: block; margin: 0 0 .5rem; color: #4c5666; font-size: .8rem; }
    .ccd-entry-action { width: 48px; padding: 0; }
    .ccd-entry-action > span { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

.ccd-shell .faith-section-heading { flex-wrap: wrap; }
.ccd-subscription-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; padding-block: 1rem; }
.ccd-subscription-actions a { display: inline-flex; align-items: center; min-height: 44px; }
