/* BIA-258: the /calendar month view (plan section 5.3), from docs/design/events-calendar-prototype.html.
   Each BIA's own stylesheet (e.g. mountpleasant.css) styles every button and .btn, so every control here sets
   its own padding, min-height, letter-spacing and font, and the overlay buttons use .cal-btn, not .btn.
   Versioned by file name, so a change ships as a new file (the query-string kind is not reliable on CloudFront).
   Per-site colours can be overridden in /css/{SiteDomainKey}.css through the --c-* tokens. */
:root {
	--bg: #F3F4F7;
	--surface: #FFFFFF;
	--sunk: #EBEDF2;
	--fg: #171A22;
	--muted: #5F6676;
	--line: #DADDE5;
	--today: #E0457B;
	--c-featured: #6C5CE7;
	--c-bia: #0E9F74;
	--c-member: #EE8424;
	--display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
	--body: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
	--mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
	--shadow: 0 1px 2px rgba(20,24,34,.06), 0 8px 24px rgba(20,24,34,.06);
}
@media (prefers-color-scheme: dark) {
	:root {
		--bg: #0F1116; --surface: #171A22; --sunk: #1F232D; --fg: #EEF0F5; --muted: #9AA1B2;
		--line: #2A2F3B; --today: #FF6B9C; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.3);
		color-scheme: dark;
	}
}
* { box-sizing: border-box; }
body.bia-cal-body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--body); font-size: 15px; line-height: 1.45; }
.bia-cal { max-width: 1240px; margin: 0 auto; padding-inline: 16px; padding-block: 24px 56px; display: grid; gap: 18px; }
.bia-cal h1, .bia-cal h2, .bia-cal h3 { font-family: var(--display); text-wrap: balance; margin: 0; }
.bia-cal a { color: inherit; }
.bia-cal button:focus-visible, .bia-cal a:focus-visible, .bia-cal select:focus-visible { outline: 2px solid var(--today); outline-offset: 2px; }

.kind-featured { --c: var(--c-featured); }
.kind-bia { --c: var(--c-bia); }
.kind-member { --c: var(--c-member); }

.cal-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.cal-site { margin: 0; font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.cal-top h1 { font-size: clamp(28px, 4vw, 42px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.05; }
.seg { display: inline-flex; background: var(--sunk); border-radius: 999px; padding: 3px; gap: 2px; }
.seg a { text-decoration: none; color: var(--muted); font: 500 13px var(--body); padding: 6px 14px; border-radius: 999px; }
.seg a[aria-current="page"] { background: var(--surface); color: var(--fg); box-shadow: var(--shadow); }

.cal { background: var(--surface); border-radius: 20px; box-shadow: var(--shadow); overflow: hidden; container-type: inline-size; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 10px; flex-wrap: wrap; }
.cal-head h2 { font-size: clamp(22px, 3vw, 32px); font-weight: 800; letter-spacing: -0.02em; }
.cal-head h2 span { color: var(--muted); font-weight: 500; }
.cal-nav { display: flex; gap: 6px; align-items: center; }
.icon-btn, .today-btn { height: 34px; min-width: 34px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); display: inline-grid; place-items: center; text-decoration: none; font-size: 16px; }
.today-btn { padding: 0 12px; font: 600 13px var(--body); }
.cal-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 0 20px 14px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-filter { min-height: 0; letter-spacing: normal; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); border-radius: 999px; padding: 4px 10px 4px 8px; font: 500 12.5px var(--body); cursor: pointer; }
.chip-filter i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); display: block; }
.chip-filter[aria-pressed="false"] { opacity: .45; text-decoration: line-through; }
.cal-filter select { font: 500 13px var(--body); color: var(--fg); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; }
/* The legend chips carry the kind class for their colour; they stay visible so a hidden kind can be shown again. */
.bia-cal.hide-featured .kind-featured:not(.chip-filter), .bia-cal.hide-bia .kind-bia:not(.chip-filter), .bia-cal.hide-member .kind-member:not(.chip-filter) { display: none !important; }

/* full month */
.cal-mini { display: none; }
.dow, .week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.dow { border-top: 1px solid var(--line); }
.dow div { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 8px 10px; }
.week { border-top: 1px solid var(--line); row-gap: 3px; padding-bottom: 6px; }
.day-bg { min-height: 0; letter-spacing: normal; border-radius: 0; grid-row: 1 / -1; border: 0; border-left: 1px solid var(--line); background: transparent; text-align: left; padding: 6px 8px; cursor: pointer; font: 600 13px var(--body); color: var(--fg); display: flex; align-items: flex-start; }
.day-bg:first-child { border-left: 0; }
.day-bg.out { color: var(--muted); background: color-mix(in srgb, var(--sunk) 55%, transparent); }
.day-bg .num { flex: none; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; font-variant-numeric: tabular-nums; }
.day-bg.today .num { background: var(--today); color: #fff; }
/* Hover: a lighter tint than the selected day (7%), laid over the cell's own background so out-of-month days show it too. */
@media (hover: hover) {
	.day-bg:hover { background-image: linear-gradient(color-mix(in srgb, var(--today) 4%, transparent), color-mix(in srgb, var(--today) 4%, transparent)); }
}
.bia-cal.day-open .day-bg.sel { background: color-mix(in srgb, var(--today) 7%, transparent); }
.singles { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 3px; padding: 0 5px; min-width: 0; }
/* 2026-10-09: the whole day square opens the day. The list of events sits on top of the day's button, so its blank
   space lets clicks through to the button; the events and "+N more" inside it stay clickable as before. */
.singles { pointer-events: none; }
.singles > * { pointer-events: auto; }
.ev { display: flex; align-items: center; gap: 6px; min-width: 0; text-decoration: none; font: 500 12.5px var(--body); color: var(--fg); background: color-mix(in srgb, var(--c) 14%, var(--surface)); border-radius: 8px; padding: 3px 6px 3px 3px; }
.ev:hover { background: color-mix(in srgb, var(--c) 24%, var(--surface)); }
.ev .thumb { width: 26px; height: 26px; border-radius: 6px; flex: none; background-size: cover; background-position: center; }
.ev .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; margin: 0 4px 0 6px; }
.ev .t { font-family: var(--mono); font-size: 10.5px; color: var(--muted); flex: none; }
.ev .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.more { min-height: 0; letter-spacing: normal; border-radius: 6px; border: 0; background: transparent; color: var(--muted); font: 600 12px var(--body); text-align: left; padding: 2px 6px; cursor: pointer; }

/* multi-day: start marker, thin line, end marker */
.span-line { position: relative; z-index: 1; height: 30px; display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 0 4px; min-width: 0; color: var(--fg); text-decoration: none; }
.span-line::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 3px; transform: translateY(-50%); background: var(--c); opacity: .9; }
.span-line.real-start::before { left: 14px; }
.span-line.real-end::before { right: 14px; }
.cap { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 30px; border-radius: 999px; background: var(--c); color: #fff; font: 700 12.5px var(--body); padding: 0 10px 0 3px; min-width: 0; max-width: 100%; box-shadow: 0 0 0 3px var(--surface); }
.cap:not(:has(.thumb)) { padding-left: 10px; }
.cap .thumb { width: 24px; height: 24px; border-radius: 50%; background-size: cover; background-position: center; flex: none; box-shadow: 0 0 0 1.5px rgba(255,255,255,.8); }
.cap .n { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; min-width: 0; }
.cap.end { padding: 0 10px; font: 600 11px var(--mono); letter-spacing: .02em; flex: none; }
.cap.end.named { flex: 0 1 auto; gap: 5px; font: 700 12px var(--body); letter-spacing: normal; padding: 0 10px; }
.cap.end.named .e { font: 600 10.5px var(--mono); opacity: .85; flex: none; }
.span-line.ends-only::before { left: 0; right: auto; width: 10px; }
.cont { position: relative; font: 600 11.5px var(--body); color: var(--fg); background: var(--surface); padding: 1px 8px 1px 6px; border-radius: 999px; box-shadow: 0 0 0 1.5px var(--c); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; max-width: 70%; }

/* mini month (phones) */
.mini-dow, .mweek { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.mini-dow div { text-align: center; font-family: var(--mono); font-size: 10.5px; color: var(--muted); padding: 6px 0; }
.mweek { row-gap: 3px; padding-bottom: 6px; }
.mday { min-height: 0; letter-spacing: normal; border-radius: 0; padding: 2px 0 0; grid-row: 1 / -1; border: 0; background: transparent; cursor: pointer; display: flex; justify-content: center; color: var(--fg); font: 600 14px var(--body); }
.mday.out { color: var(--muted); opacity: .6; }
.mday .num { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.mday.today .num { color: var(--today); box-shadow: inset 0 0 0 2px var(--today); }
.mday.sel .num { background: var(--fg); color: var(--surface); box-shadow: none; }
.mline { position: relative; z-index: 1; height: 5px; pointer-events: none; }
.mline::before { content: ""; position: absolute; left: 0; right: 0; top: 1px; height: 3px; background: var(--c); }
.mline.real-start::before { left: calc(50% - 3px); border-radius: 3px 0 0 3px; }
.mline.real-end::before { right: calc(50% - 3px); border-radius: 0 3px 3px 0; }
.mdots { position: relative; z-index: 1; display: flex; justify-content: center; gap: 3px; height: 8px; pointer-events: none; }
.mdots i { width: 6px; height: 6px; border-radius: 50%; background: var(--c); display: block; }

@container (max-width: 700px) {
	.cal-full { display: none; }
	.cal-mini { display: block; }
}

/* day agenda */
.agenda { border-top: 1px solid var(--line); padding: 16px 20px 20px; display: grid; gap: 14px; }
.agenda h3 { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; }
.agenda .sub { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.card { display: flex; gap: 12px; align-items: center; text-decoration: none; color: var(--fg); }
.card .thumb { width: 64px; height: 64px; border-radius: 14px; background-size: cover; background-position: center; flex: none; }
.card .ph { width: 64px; height: 64px; border-radius: 14px; flex: none; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 16%, var(--surface)); color: var(--c); font: 800 22px var(--display); }
.card .meta { min-width: 0; display: grid; gap: 2px; }
.card .n { font: 700 15.5px var(--display); letter-spacing: -0.01em; }
.card .w { font-size: 13px; color: var(--muted); }
.tag { display: inline-flex; align-items: center; gap: 5px; font: 600 11px var(--body); }
.tag i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); display: block; }
.ongoing, .list-col { display: grid; gap: 10px; }
.ongoing .card { background: color-mix(in srgb, var(--c) 10%, var(--surface)); border-radius: 18px; padding: 10px; }
.progress { display: block; height: 4px; border-radius: 4px; background: color-mix(in srgb, var(--c) 22%, transparent); overflow: hidden; margin-top: 4px; }
.progress b { display: block; height: 100%; background: var(--c); }
.empty, .cal-noscript { color: var(--muted); font-size: 14px; margin: 0; }
.cal-noscript { padding: 0 20px 18px; }

/* event overlay */
.cal-scrim { position: fixed; inset: 0; background: rgba(10,12,18,.5); display: grid; place-items: center; padding: 16px; z-index: 20; }
.cal-sheet { background: var(--surface); color: var(--fg); width: min(520px, 100%); max-height: calc(100% - 32px); overflow: auto; border-radius: 22px; box-shadow: var(--shadow); }
/* Event images are mostly flyers and logos: show the whole image, never crop it. */
.cal-sheet .hero { aspect-ratio: 16 / 9; max-width: 100%; background-color: var(--sunk); background-size: contain; background-repeat: no-repeat; background-position: center; }
.cal-sheet .hero.none { aspect-ratio: auto; height: 10px; background: var(--c); }
.cal-sheet .body { padding: 18px 20px 20px; display: grid; gap: 10px; }
.cal-sheet h3 { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.badge { display: inline-flex; align-items: center; gap: 6px; font: 600 12px var(--body); background: color-mix(in srgb, var(--c) 15%, var(--surface)); border-radius: 999px; padding: 4px 10px; justify-self: start; }
.badge i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); display: block; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 14px; margin: 0; }
.facts dt { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding-top: 2px; }
.facts dd { margin: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
/* 2026-10-09: "a.cal-btn" too, so .bia-cal a { color: inherit } cannot turn a button link's text the colour of its background. */
.cal-btn, .bia-cal a.cal-btn { min-height: 0; letter-spacing: normal; border: 0; border-radius: 999px; padding: 9px 16px; font: 600 14px var(--body); cursor: pointer; background: var(--fg); color: var(--surface); text-decoration: none; display: inline-block; }
.cal-btn.ghost, .bia-cal a.cal-btn.ghost { background: var(--sunk); color: var(--fg); }
.cal-btn:hover { opacity: .9; }
@media (prefers-reduced-motion: no-preference) {
	.cal-sheet { animation: cal-rise .18s ease-out; }
	@keyframes cal-rise { from { transform: translateY(10px); opacity: .6; } to { transform: none; opacity: 1; } }
}

/* ── /events list view (BIA-258), shares this file with /calendar ── */
.list-search { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 20px 16px; }
.list-search input[type="search"] { flex: 1 1 220px; min-width: 0; min-height: 0; font: 500 14px var(--body); color: var(--fg); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; }
.list-search select { min-height: 0; font: 500 13px var(--body); color: var(--fg); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; }
.listv { border-top: 1px solid var(--line); padding: 4px 20px 22px; display: grid; gap: 4px; }
.lday { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 14px; border-top: 1px solid var(--line); padding-top: 14px; padding-bottom: 10px; }
.lday:first-child { border-top: 0; }
.lday .d { font-family: var(--display); }
.lday .d b { display: block; font-size: 30px; font-weight: 800; line-height: 1; }
.lday .d span { font-family: var(--mono); font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.lday .sub { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.listv .empty { padding: 18px 0; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; padding: 0 20px 22px; color: var(--muted); font-size: 14px; }

/* ── one event page (BIA-258) ── */
.event-page { max-width: 820px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font: 500 14px var(--body); color: var(--muted); margin-top: 6px; }
.crumbs a { color: var(--fg); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.event-sheet .hero-img { display: block; width: 100%; max-width: 100%; max-height: 560px; object-fit: contain; background: var(--sunk); }
.event-sheet .hero.none { height: 10px; background: var(--c); }
.event-sheet .body { padding: 22px 24px 26px; display: grid; gap: 12px; }
.event-sheet h1 { font-size: clamp(26px, 4vw, 38px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.event-description { font-size: 15.5px; line-height: 1.6; max-width: 68ch; }
.event-description img { max-width: 100%; height: auto; border-radius: 10px; }
.event-description a { color: var(--fg); }
@media (max-width: 520px) {
	.lday { grid-template-columns: 52px minmax(0, 1fr); gap: 10px; }
	.lday .d b { font-size: 24px; }
	.event-sheet .body { padding: 18px 16px 20px; }
}
