/* ═══════════════ Schedule / Calendar page ═══════════════ */
/* Self-contained module — uses the design tokens from styles.css (:root).
   Kept separate so it ports cleanly into the future Astro component. */

.calendar-page {
    padding-top: 48px;
    padding-bottom: 72px;
    text-align: left;
}

/* ── Header + subscribe ── */
.schedule-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.schedule-head h1 {
    font-size: 2rem;
    color: var(--navy);
    margin-bottom: 6px;
}
.schedule-sub {
    color: var(--text-muted);
    font-size: 0.95rem;
    max-width: 46ch;
}
.subscribe-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}
.btn-outline-dark {
    background: transparent;
    color: var(--burgundy);
    border: 1.5px solid var(--border);
}
.btn-outline-dark:hover {
    border-color: var(--gold-soft);
    background: var(--cream-warm);
}

/* ── Help / how-to ── */
.cal-help {
    background: var(--cream-warm);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    margin-bottom: 24px;
}
.cal-help-lead {
    font-size: 0.95rem;
    color: var(--text);
    margin-bottom: 16px;
}
.cal-help-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 18px;
}
.cal-help-grid h4 {
    font-size: 1rem;
    color: var(--burgundy);
    margin-bottom: 4px;
}
.cal-help-grid p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.55;
}
.cal-help-copy {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.cal-help-copy input {
    flex: 1;
    min-width: 220px;
    font-size: 0.82rem;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--text-muted);
    font-family: inherit;
}

/* ── Toolbar ── */
.cal-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.cal-nav {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.cal-nav button {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--navy);
    font-size: 1rem;
    font-weight: 600;
    padding: 7px 13px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    line-height: 1;
}
.cal-nav button:hover {
    border-color: var(--gold-soft);
    background: var(--cream-warm);
}
#cal-today {
    font-size: 0.85rem;
}
.cal-title {
    font-family: "EB Garamond", serif;
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--burgundy);
    flex: 1;
    text-align: center;
    min-width: 160px;
}
.cal-views {
    display: inline-flex;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--white);
}
.cal-views button {
    background: transparent;
    border: none;
    padding: 8px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    font-family: inherit;
    border-left: 1px solid var(--border);
}
.cal-views button:first-child {
    border-left: none;
}
.cal-views button.active {
    background: var(--burgundy);
    color: var(--white);
}

/* ── Legend ── */
.cal-legend {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: 14px;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.cal-legend .dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    margin-right: 5px;
    vertical-align: middle;
}
.dot-service {
    background: var(--burgundy);
}
.dot-special {
    background: var(--gold);
}
.dot-feast {
    background: var(--blue-accent);
}

/* ── Month grid ── */
.cal-month {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--white);
}
.cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--cream-warm);
    border-bottom: 1px solid var(--border);
}
.cal-weekdays span {
    padding: 8px 6px;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}
.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}
.cal-cell {
    min-height: 104px;
    min-width: 0; /* let the 1fr track shrink so nowrap chips truncate
                     instead of forcing the column (and grid) to overflow */
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 6px 6px 8px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    cursor: pointer;
    transition: background 0.12s;
    text-align: left;
    background: var(--white);
    font: inherit;
    overflow: hidden;
}
.cal-cell:nth-child(7n) {
    border-right: none;
}
.cal-cell:hover {
    background: var(--cream);
}
.cal-cell.dim {
    background: #fbfaf6;
    color: var(--text-light);
}
.cal-cell.dim .cal-daynum {
    color: var(--text-light);
}
.cal-cell.today {
    background: rgba(201, 168, 76, 0.12);
}
.cal-cell.selected {
    box-shadow: inset 0 0 0 2px var(--gold);
}
.cal-daynum {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--navy);
}
.cal-cell.today .cal-daynum {
    background: var(--burgundy);
    color: var(--white);
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.cal-chip {
    font-size: 0.72rem;
    line-height: 1.25;
    padding: 2px 5px;
    border-radius: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: rgba(107, 29, 42, 0.09);
    color: var(--burgundy);
    border-left: 2px solid var(--burgundy);
}
.cal-chip.special {
    background: rgba(201, 168, 76, 0.16);
    color: #8a6d1f;
    border-left-color: var(--gold);
}
.cal-chip.feast {
    background: transparent;
    color: var(--blue-accent);
    border-left-color: transparent;
    padding-left: 0;
    font-style: italic;
}
.cal-chip .t {
    font-weight: 700;
}
.cal-more {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* ── Day-detail panel (month view) ── */
.cal-detail {
    margin-top: 18px;
}

/* ── Agenda (week / 3-day / day detail) ── */
.cal-agenda {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.cal-day {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.cal-day.today {
    border-left: 3px solid var(--gold);
}
.cal-day-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 10px 16px;
    background: var(--cream-warm);
    border-bottom: 1px solid var(--border);
}
.cal-day-head .wd {
    font-family: "EB Garamond", serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--navy);
}
.cal-day-head .dt {
    font-size: 0.82rem;
    color: var(--text-muted);
}
.cal-day-head .feast {
    margin-left: auto;
    font-size: 0.82rem;
    color: var(--blue-accent);
    font-style: italic;
    text-align: right;
}
.cal-day-body {
    padding: 6px 16px 12px;
}
.cal-event {
    display: flex;
    gap: 14px;
    padding: 7px 0;
    border-bottom: 1px dashed var(--border);
    font-size: 0.9rem;
}
.cal-event:last-child {
    border-bottom: none;
}
.cal-event .time {
    min-width: 74px;
    font-weight: 700;
    color: var(--burgundy);
}
.cal-event .ev-title {
    color: var(--text);
}
.cal-event .ev-note {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.cal-event.special .time {
    color: #8a6d1f;
}
.cal-event.special .ev-title::before {
    content: "Parish event · ";
    color: var(--text-light);
    font-size: 0.78rem;
}
.cal-empty {
    padding: 10px 0;
    color: var(--text-light);
    font-size: 0.88rem;
    font-style: italic;
}

.cal-status {
    padding: 40px 0;
    text-align: center;
    color: var(--text-muted);
}

/* ═══════════════ Responsive ═══════════════ */
@media (max-width: 760px) {
    .cal-help-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .cal-toolbar {
        justify-content: center;
    }
    .cal-title {
        order: -1;
        flex-basis: 100%;
        font-size: 1.2rem;
    }
    .cal-views {
        flex: 1;
    }
    .cal-views button {
        flex: 1;
    }
    .cal-nav {
        flex: 1;
        justify-content: space-between;
    }
}

/* Compact month grid on small screens: dots instead of text chips. */
@media (max-width: 560px) {
    .cal-cell {
        min-height: 58px;
        padding: 4px;
        align-items: center;
    }
    .cal-daynum {
        font-size: 0.78rem;
    }
    .cal-chip,
    .cal-more {
        display: none;
    }
    .cal-dots {
        display: flex;
        gap: 3px;
        margin-top: 2px;
        flex-wrap: wrap;
        justify-content: center;
    }
    .cal-dots i {
        width: 6px;
        height: 6px;
        border-radius: 50%;
    }
}
/* Dots are only rendered/visible in the compact grid. */
.cal-dots {
    display: none;
}
