/* v3.6 calendar (draft) */
.calendar{padding:var(--section) 0;background:linear-gradient(180deg,var(--ink),var(--navy) 60%,var(--ink));border-top:1px solid var(--line-soft)}
.calendar .wrap{max-width:68rem}
.calendar .kicker{text-align:center;margin-left:auto;margin-right:auto;max-width:none}
.calendar h2{text-align:center;font-size:clamp(2.2rem,6vw,3.4rem);margin-top:.4rem}
.calendar .cal-sub{text-align:center;color:var(--stone);margin:1rem auto 2.5rem;max-width:36rem}
.cal-layout{display:grid;gap:1.5rem}
@media (min-width:900px){.cal-layout{grid-template-columns:1.6fr 1fr;align-items:start}}
.cal-card{border:1px solid var(--line);border-radius:14px;background:rgba(16,32,64,.55);padding:1.25rem}
.cal-today{margin-bottom:1.5rem;border-color:var(--gold);box-shadow:0 0 0 1px var(--line-soft),0 10px 40px rgba(212,175,55,.08)}
.cal-today h3,.cal-side h3{font-size:1.6rem;margin-bottom:.4rem}
.cal-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:.8rem}
.cal-head h3{font-size:1.7rem}
.cal-nav{width:2.6rem;height:2.6rem;border-radius:50%;border:1px solid var(--line);background:transparent;color:var(--gold-lt);font-size:1.3rem;cursor:pointer}
.cal-nav:hover,.cal-nav:focus-visible{background:rgba(212,175,55,.12);outline:2px solid var(--gold);outline-offset:2px}
.cal-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:4px}
.cal-dow{font-size:.75rem;font-weight:600;letter-spacing:.04em;font-size:.8rem;color:var(--gold-lt);text-align:center;padding:.3rem 0}
.cal-cell button{width:100%;aspect-ratio:1/1;min-height:2.4rem;border:1px solid transparent;border-radius:10px;background:rgba(244,241,234,.04);color:var(--cream);font:inherit;font-size:1rem;cursor:pointer;position:relative}
.cal-cell.out button{color:rgba(183,192,208,.45)}
.cal-cell button.has{background:linear-gradient(160deg,rgba(212,175,55,.28),rgba(107,31,51,.45));border-color:var(--line)}
.cal-cell button.has::after{content:"";position:absolute;left:50%;bottom:16%;width:5px;height:5px;margin-left:-2.5px;border-radius:50%;background:var(--gold)}
.cal-cell button.today{outline:2px solid var(--gold-hi);outline-offset:-2px}
.cal-cell button[aria-selected="true"]{background:var(--gold);color:var(--ink)}
.cal-cell button[aria-selected="true"]::after{background:var(--ink)}
.cal-cell button:focus-visible{outline:3px solid var(--gold-hi);outline-offset:1px}
.cal-day{margin-top:1rem;border-top:1px solid var(--line-soft);padding-top:1rem}
.cal-day h4{font-family:var(--serif);font-weight:500;font-size:1.35rem;color:var(--cream)}
.ev{display:flex;gap:.8rem;padding:.6rem 0;border-bottom:1px solid var(--line-soft)}
.ev:last-child{border-bottom:0}
.ev .d{flex:none;width:3.2rem;text-align:center;font-family:var(--serif);color:var(--gold-lt);line-height:1.05}
.ev .d b{display:block;font-size:1.6rem;font-weight:500;color:var(--cream)}
.ev strong{color:var(--cream);font-weight:600}
.cal-small{font-size:.95rem;color:var(--stone)}
.cal-note{margin-top:1rem;font-size:.9rem;color:var(--stone);font-style:italic}
@media (prefers-reduced-motion:no-preference){.cal-cell button{transition:background .2s,color .2s}}
@media (prefers-reduced-motion:reduce){.cal-cell button,.cal-nav{transition:none!important}}
/* v3.7: keep the sticky scene layer inside the scroll stage so it can't spill over the calendar/footer; trim the seat chapter's trailing empty scroll */
html.cin3 .stage{overflow:clip}
.calendar,.site-footer{position:relative;z-index:1}
html.cin3 .chapter-seat{height:100svh}
#calendar{scroll-margin-top:calc(var(--hh) + 1rem)}
/* v3.10: themed Sundays */
.cal-cell button.has.themed{background:linear-gradient(160deg,rgba(212,175,55,.55),rgba(107,31,51,.6));border-color:var(--gold)}
.cal-cell button.has.themed::after{width:7px;height:7px;margin-left:-3.5px;background:var(--gold-hi)}
.cal-cell button.has.themed[aria-selected="true"]{background:var(--gold);color:var(--ink)}
/* v3.11 daily theme */
.cal-daily{margin:.35rem 0 .9rem;padding-left:.8rem;border-left:2px solid var(--gold,#c9a54a)}
.cal-daily p{margin:0}
.cal-dl{font-size:.72rem;letter-spacing:.04em;font-size:.8rem;color:var(--gold,#c9a54a);margin-bottom:.3rem!important;text-wrap:balance}
.cal-sm{font-family:var(--serif);font-size:1.3rem;line-height:1.2;color:var(--cream);text-wrap:balance}
.cal-en{font-size:.92rem;opacity:.82;margin-top:.15rem!important;text-wrap:balance}
.cal-rd{font-size:.8rem;letter-spacing:.06em;opacity:.7;margin-top:.35rem!important}
/* v3.11 layout: On today full width, calendar + Upcoming side by side, tops aligned */
.cal-layout .cal-today{margin-bottom:0}
@media (min-width:900px){.cal-layout .cal-today{grid-column:1/-1}}
/* v3.11 wide ON TODAY: date left, theme/events right (desktop only) */
@media (min-width:900px){
.cal-layout .cal-today{display:grid;grid-template-columns:minmax(16rem,22rem) 1fr;column-gap:2.5rem;align-items:center;padding:1rem 1.5rem}
.cal-today>*{grid-column:1;margin:0}
.cal-today>.label{grid-row:1;align-self:end}
.cal-today>h3{grid-row:2;align-self:start;margin:0}
.cal-today>.cal-daily,.cal-today>.ev{grid-column:2;grid-row:1/span 2;margin:0}
.cal-today>.cal-daily~.cal-small{grid-column:2;grid-row:3;margin-top:.5rem;padding-left:.8rem}
.cal-today>.ev~.ev{grid-row:auto}
.cal-today>h3+.cal-small{grid-column:2;grid-row:1/span 2;align-self:center}
}
/* v3.13: Upcoming stretches to the calendar box's bottom (desktop) */
@media (min-width:900px){.cal-layout>.cal-side{align-self:stretch;display:flex;flex-direction:column}.cal-side>.cal-note{margin-top:auto;padding-top:1rem}}
#cal-up .ev[hidden]{display:none}
#cal-up .ev:not(:has(~ .ev:not([hidden]))){border-bottom:0}
/* v3.14: date preview in the On today box */
#cal-ontoday{transition:opacity .16s ease}
#cal-ontoday.fade{opacity:.25}
#cal-ontoday.previewing{border-color:var(--gold-lt)}
#cal-ontoday.previewing .label{color:var(--gold-lt)}
.cal-cell button.peek{box-shadow:0 0 0 2px var(--gold-hi) inset}
@media (prefers-reduced-motion:reduce){#cal-ontoday{transition:none}}
#cal-day{transition:opacity .16s ease}
.cal-day h4{font-size:1.15rem;margin-bottom:.3rem}
.cal-day .cal-daily{margin-bottom:.2rem}
@media (prefers-reduced-motion:reduce){#cal-day{transition:none}}
/* v3.15: event rows - date column and title column share a first-line baseline; tight wrapped titles */
.ev{align-items:flex-start}
.ev .d{width:3.2rem;line-height:1.3;padding-top:.05rem}
.ev .d b{line-height:1;margin-top:.1rem}
.ev .d+div{flex:1;min-width:0;line-height:1.3}
.ev .d+div strong{display:block;line-height:1.3}
.ev .d+div br{display:none}
.ev .d+div .cal-small{display:block;margin-top:.2rem;line-height:1.3}
/* v3.16: date block is a compact unit, vertically centred against title + time; same column width and gap on every row */
.ev{align-items:center;gap:.9rem;padding:.65rem 0}
.ev .d{flex:0 0 3.2rem;width:3.2rem;padding:0;line-height:1.1;display:flex;flex-direction:column;align-items:center}
.ev .d b{line-height:1;margin-top:.15rem}
/* Sunday theme under the service row */
.ev+.cal-daily{margin-top:.5rem}
@media (min-width:900px){
.cal-today>.ev:has(+.cal-daily){grid-row:1;align-self:end}
.cal-today>.ev+.cal-daily{grid-column:2;grid-row:2/span 2;align-self:start}
}
/* v3.17: details views (On today + calendar bottom) drop the duplicate date block; service text lines up with the theme block's text */
#cal-ontoday .ev .d,#cal-day .ev .d{display:none}
#cal-ontoday .ev,#cal-day .ev{padding-left:calc(.8rem + 2px)}
/* v3.17b: Sunday details - one continuous gold line from service title to reading; shared left padding */
#cal-ontoday .ev,#cal-day .ev{padding:0 0 .45rem .8rem;border-left:2px solid var(--gold,#c9a54a);border-bottom:0;margin:0}
#cal-ontoday .ev+.cal-daily,#cal-day .ev+.cal-daily{margin-top:0;padding-top:.1rem}
/* v3.26: Upcoming date column = weekday over ordinal day + short month ("18th Oct"), one line, level with title */
#cal-up .ev .d{flex:0 0 4.6rem;width:4.6rem}
#cal-up .ev .d b{font-size:1.12rem;white-space:nowrap;letter-spacing:.01em;margin-top:.2rem}
/* v3.39: longer calendar intro line wraps evenly (no lone last word) */
.cal-sub{text-wrap:balance}

/* v3.41: one-off event place + dress note lines */
.ev .cal-where,.ev .cal-evnote{display:block;margin-top:.15rem;line-height:1.35}
.ev .cal-evnote{font-style:italic}
#cal-up .ev .cal-evnote{display:none}
/* v3.41: weekday with a one-off event: daily block on top, event below (no overlap) */
.cal-today>.cal-daily:has(+.ev){grid-row:1;align-self:end}
.cal-today>.cal-daily+.ev{grid-column:2;grid-row:2/span 2;align-self:start;margin-top:.5rem}
/* v3.41b: same-date items stacked under one date in Upcoming */
#cal-up .ev-its{flex:1;min-width:0}
#cal-up .ev-it+.ev-it{margin-top:.55rem;padding-top:.5rem;border-top:1px dashed rgba(201,165,74,.35)}
#cal-up .ev-grp:has(.ev-it+.ev-it) .d{align-self:flex-start;padding-top:.1rem}
/* v3.43 past tint warmer light red. v3.42: one-off special event days - light green while upcoming, light red once past; selected/today keep a gold outline on top */
.cal-cell button.evt.evt-soon,.cal-cell button.evt.evt-soon[aria-selected="true"]{background:#bfe8c4;color:#0b1a33;border-color:#7fc98a}
.cal-cell button.evt.evt-past,.cal-cell button.evt.evt-past[aria-selected="true"]{background:#f28b82;color:#0b1a33;border-color:#d93025}
.cal-cell button.evt::after{background:#0b1a33}
.cal-cell.out button.evt{opacity:.7}
.cal-cell button.evt[aria-selected="true"]{outline:3px solid var(--gold-hi);outline-offset:-3px;box-shadow:0 0 0 2px var(--ink) inset}
.cal-cell button.evt.today:not([aria-selected="true"]){outline:2px solid var(--gold-hi);outline-offset:-2px}
/* v3.44: date panels stack theme then events in one column (no grid overlap) */
.cal-stack{display:flex;flex-direction:column;gap:.55rem;min-width:0}
.cal-stack>.cal-daily{margin:0}
#cal-ontoday .cal-stack>.ev,#cal-day .cal-stack>.ev{margin:0;padding-bottom:0}
@media (min-width:900px){.cal-today>.cal-stack{grid-column:2;grid-row:1/span 2;margin:0;align-self:center}}
