/* Common Time — frontend styles. Mobile-first. Sleek, restrained.
 *
 * The palette is brand-driven: CommonTime_Brand emits the active Fraternity or
 * Foundation skin as inline `--ct-*` custom properties on `.ct-event`
 * (see class-commontime-brand.php → palette_css()). The values below are the
 * Foundation defaults — they apply when no inline palette is present and
 * are overridden per-event by the inline style.
 *   --ct-crimson: primary action / selected state
 *   --ct-black:   text + headers       --ct-gold:  accent + dividers
 *   --ct-cream:   parchment background --ct-soft:  card surface
 *   --ct-border:  warm gray border
 *
 * Typography: Georgia/serif for display + headings (period feel),
 *             system sans-serif for body + form (modern, legible).
 */

.ct-event {
	--ct-crimson:  #7a1818;
	--ct-crimson2: #5e1212;
	--ct-black:    #211816;
	--ct-black2:   #2c2520;
	--ct-gold:     #d5a642;
	--ct-gold2:    #a87f2c;
	--ct-cream:    #fff9ec;
	--ct-soft:     #ffffff;
	--ct-border:   #e7d8b9;
	--ct-text:     #2a2520;
	--ct-muted:    #6b6358;
	--ct-on-accent:#fff9ec;   /* legible text on the accent (light on red/charcoal, dark on gold per theme) */
	--ct-shadow:   0 1px 2px rgba(28, 24, 22, 0.04), 0 4px 14px rgba(28, 24, 22, 0.06);
	--ct-shadow-h: 0 1px 2px rgba(28, 24, 22, 0.06), 0 8px 24px rgba(28, 24, 22, 0.10);

	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, system-ui, sans-serif;
	color: var(--ct-text);
	background: var(--ct-cream);
	border-radius: 18px;
	border: 1px solid rgba(28, 24, 22, 0.07);
	padding: 28px 24px 30px;
	box-shadow: 0 1px 2px rgba(28, 24, 22, 0.04), 0 18px 50px rgba(28, 24, 22, 0.09);
	position: relative;
	overflow: hidden;
	transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
	-webkit-font-smoothing: antialiased;
}
@media (min-width: 760px) {
	.ct-event { padding: 32px 34px 34px; }
}

/* Top accent — narrow gold band reminiscent of a fraternity ribbon */
.ct-event::before {
	content: "";
	position: absolute;
	left: 0; right: 0; top: 0;
	height: 4px;
	background: linear-gradient(90deg, var(--ct-crimson) 0%, var(--ct-gold) 50%, var(--ct-black) 100%);
}

/* ------- Per-brand treatment -------
 * Foundation = refined/serif (the defaults). Fraternity = bolder, flatter,
 * more collegiate "Red & Black": heavier frame + accent, tighter title. */
.ct-event[data-ct-brand="fraternity"] {
	border-width: 2px;
	border-radius: 7px;
}
.ct-event[data-ct-brand="fraternity"]::before { height: 6px; }
.ct-event[data-ct-brand="fraternity"] .ct-event__title { letter-spacing: -0.01em; }
.ct-event[data-ct-brand="fraternity"] .ct-event__header { border-bottom-width: 2px; }

/* ------- Header ------- */
.ct-event__header { margin: 4px 0 22px 0; padding-bottom: 18px; border-bottom: 1px solid var(--ct-border); }
.ct-event__brand {
	display: flex; align-items: center; gap: 14px;
	font-family: Georgia, "Times New Roman", serif;
	font-size: 0.78em;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--ct-gold2);
	margin-bottom: 16px;
}
/* Scale the brand mark to anchor the larger wordmark (square logo + SEF sail). */
.ct-event__brand .ct-logo { height: 52px; width: auto; }
.ct-event__brand .ct-logo--sail { height: 56px; }
.ct-event__brand .ct-lyre {
	display: inline-block; width: 18px; height: 18px;
	background: var(--ct-gold);
	-webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 2c-2 0-3 1-3 3v3l-4 1c-1 1-1 3 0 4l4 1v6l-2 3h10l-2-3v-6l4-1c1-1 1-3 0-4l-4-1V5c0-2-1-3-3-3z' fill='black'/></svg>") center/contain no-repeat;
	mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 2c-2 0-3 1-3 3v3l-4 1c-1 1-1 3 0 4l4 1v6l-2 3h10l-2-3v-6l4-1c1-1 1-3 0-4l-4-1V5c0-2-1-3-3-3z' fill='black'/></svg>") center/contain no-repeat;
}
.ct-event__title {
	font-family: Georgia, "Times New Roman", serif;
	font-weight: 700;
	font-size: 2em;
	line-height: 1.15;
	color: var(--ct-black);
	margin: 0 0 10px 0;
}
.ct-event__message {
	color: var(--ct-text);
	margin: 0 0 14px 0;
	font-size: 1em;
	line-height: 1.55;
}
.ct-event__message p { margin: 0 0 0.7em; }
.ct-event__meta {
	color: var(--ct-muted);
	font-size: 0.86em;
	margin: 0;
	letter-spacing: 0.01em;
}
.ct-event__meta strong { color: var(--ct-text); font-weight: 600; }

/* ------- Banners ------- */
.ct-banner {
	padding: 14px 18px;
	border-radius: 6px;
	margin: 18px 0;
	font-size: 0.95em;
	border-left: 4px solid;
}
.ct-banner--closed {
	background: #fff3f3;
	border-color: var(--ct-crimson);
	color: var(--ct-crimson2);
}
.ct-error { color: var(--ct-crimson); }

.ct-grid-help {
	font-size: 0.88em;
	color: var(--ct-muted);
	margin: 6px 0 10px;
	line-height: 1.5;
}

/* ------- Grid quick-action toolbar (Select all / Clear) — capsule pills ------- */
.ct-grid-toolbar { display: flex; gap: 8px; margin: 2px 0 0; }
.ct-grid-toolbar__btn {
	font: inherit;
	font-size: 0.84em;
	font-weight: 600;
	letter-spacing: 0.01em;
	padding: 8px 17px;
	border-radius: 980px;
	cursor: pointer;
	border: 1px solid rgba(28, 24, 22, 0.12);
	background: var(--ct-soft);
	color: var(--ct-crimson2);
	transition: background 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
}
.ct-grid-toolbar__btn:hover { background: var(--ct-cream); border-color: rgba(28, 24, 22, 0.2); }
.ct-grid-toolbar__btn:active { transform: scale(0.97); }
.ct-grid-toolbar__btn--ghost { color: var(--ct-muted); }
.ct-grid-toolbar__btn--ghost:hover { color: var(--ct-text); }

/* ------- Days-only picker: toggleable day buttons instead of the time grid ------- */
.ct-grid.ct-daysonly {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	min-width: 0;
	padding: 14px;
}
.ct-dayonly {
	position: relative;
	display: flex; flex-direction: column; align-items: center; gap: 2px;
	min-width: 88px;
	padding: 14px 16px;
	border: 1px solid var(--ct-border);
	border-radius: 12px;
	background: var(--ct-soft);
	color: var(--ct-black);
	font: inherit;
	cursor: pointer;
	transition: background 130ms ease, border-color 130ms ease, color 130ms ease, box-shadow 130ms ease, transform 80ms ease;
}
/* A checkbox affordance in the corner — a clear on/off cue that does NOT
   depend on color, so "checked vs. unchecked" reads on any brand skin or
   site theme where the crimson fill alone is hard to tell apart. */
.ct-dayonly::after {
	content: "";
	position: absolute;
	top: 7px; right: 7px;
	width: 17px; height: 17px;
	box-sizing: border-box;
	border: 2px solid rgba(28, 24, 22, 0.30);
	border-radius: 5px;
	background: transparent center / 12px 12px no-repeat;
	transition: background-color 130ms ease, border-color 130ms ease;
}
.ct-dayonly:hover { background: var(--ct-cream); border-color: rgba(28,24,22,0.2); }
.ct-dayonly:hover::after { border-color: rgba(28, 24, 22, 0.5); }
.ct-dayonly:active { transform: scale(0.97); }
.ct-dayonly:focus-visible { outline: 2px solid var(--ct-crimson); outline-offset: 2px; }
.ct-dayonly__wd { font-size: 0.64em; font-weight: 600; opacity: 0.5; letter-spacing: 0.16em; text-transform: uppercase; }
.ct-dayonly__dy { font-family: Georgia, "Times New Roman", serif; font-size: 1.05em; font-weight: 600; white-space: nowrap; }
/* Selected: crimson fill PLUS an inset ring and a checked box with a dark
   tick. The ring + tick survive low-contrast themes where the fill alone
   was the only signal (the reported "can't tell what's checked" problem). */
.ct-dayonly.ct-cell--selected {
	background: var(--ct-crimson);
	border-color: var(--ct-crimson);
	color: var(--ct-on-accent);
	box-shadow: inset 0 0 0 2px var(--ct-on-accent), var(--ct-shadow-h);
}
.ct-dayonly.ct-cell--selected:hover { background: var(--ct-crimson2); border-color: var(--ct-crimson2); }
.ct-dayonly.ct-cell--selected .ct-dayonly__wd { opacity: 0.85; }
.ct-dayonly.ct-cell--selected::after {
	background-color: #fff;
	border-color: #fff;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23211816' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round' d='M5 12.5l4.2 4.2L19 6.5'/%3E%3C/svg%3E");
}

/* ------- Day-window pager: page through long date ranges ------- */
.ct-grid-pager {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 2px 0 10px;
	flex-wrap: wrap;
}
.ct-grid-pager__nav {
	display: inline-flex; align-items: center; justify-content: center;
	width: 30px; height: 30px; padding: 0;
	border: 1px solid rgba(28, 24, 22, 0.14);
	border-radius: 8px;
	background: var(--ct-soft);
	color: var(--ct-crimson2);
	font-size: 12px; line-height: 1;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}
.ct-grid-pager__nav:hover:not(:disabled) { background: var(--ct-cream); border-color: rgba(28, 24, 22, 0.24); }
.ct-grid-pager__nav:disabled { opacity: 0.32; cursor: default; }
.ct-grid-pager__range {
	font-family: Georgia, "Times New Roman", serif;
	font-weight: 600; color: var(--ct-black);
	min-width: 9.5em; text-align: center; font-size: 0.92em;
	font-variant-numeric: tabular-nums;
}
.ct-grid-pager__size {
	display: inline-flex; align-items: center; gap: 6px;
	margin-left: auto;
	font-size: 0.78em; color: var(--ct-muted);
	text-transform: uppercase; letter-spacing: 0.04em;
}
.ct-grid-pager__size-sel {
	font-size: 1.05em; padding: 3px 6px;
	border-radius: 6px;
	border: 1px solid rgba(28, 24, 22, 0.14);
	background: var(--ct-soft); color: var(--ct-text);
	cursor: pointer;
}
.ct-grid-pager--all .ct-grid-pager__nav { display: none; }

/* ------- Meeting-type badge (event header) ------- */
/* Event location: address + embedded map + info links. */
.ct-location { margin: 16px 0 0; padding: 14px 16px; border-radius: 14px; background: var(--ct-soft); border: 1px solid rgba(28,24,22,0.08); box-shadow: 0 1px 2px rgba(28,24,22,0.04), 0 8px 22px rgba(28,24,22,0.06); }
.ct-location__hdr { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
.ct-location__pin { font-size: 1.05em; line-height: 1; }
.ct-location__kicker { font-size: 0.7em; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ct-crimson2); }
.ct-location__address { margin: 0 0 4px; font-weight: 600; color: var(--ct-black); }
.ct-location__info { font-size: 0.92em; color: var(--ct-text); }
.ct-location__info p { margin: 0 0 6px; }
.ct-location__links { margin: 8px 0 0; display: flex; gap: 18px; flex-wrap: wrap; }
.ct-location__link { font-size: 0.85em; font-weight: 600; color: var(--ct-crimson2); text-decoration: none; }
.ct-location__link:hover { text-decoration: underline; }
.ct-location__map { margin-top: 10px; border-radius: 10px; overflow: hidden; border: 1px solid rgba(28,24,22,0.1); }
.ct-location__map iframe { display: block; width: 100%; height: 240px; border: 0; }

.ct-event__type { margin: 8px 0 0; }
.ct-event__type-badge {
	display: inline-block;
	padding: 3px 12px;
	border-radius: 999px;
	background: color-mix(in srgb, var(--ct-crimson) 12%, var(--ct-soft));
	color: var(--ct-crimson2);
	border: 1px solid color-mix(in srgb, var(--ct-crimson) 24%, transparent);
	font-size: 0.74em; font-weight: 700;
	letter-spacing: 0.08em; text-transform: uppercase;
}

/* ------- Grid — a seamless, hairline-fine time matrix in a soft card ------- */
.ct-grid-wrapper {
	overflow-x: auto;
	margin: 16px 0 18px;
	-webkit-overflow-scrolling: touch;
	border-radius: 16px;
	background: var(--ct-soft);
	border: 1px solid rgba(28, 24, 22, 0.08);
	box-shadow: 0 1px 2px rgba(28, 24, 22, 0.04), 0 12px 34px rgba(28, 24, 22, 0.07);
}

.ct-grid {
	display: grid;
	grid-template-columns: 58px repeat(calc(var(--ct-cols) - 1), minmax(56px, 1fr));
	grid-auto-rows: 30px;
	gap: 0;
	user-select: none;
	-webkit-user-select: none;
	min-width: 100%;
}

@media (min-width: 800px) {
	.ct-grid {
		grid-template-columns: 70px repeat(calc(var(--ct-cols) - 1), minmax(64px, 1fr));
		grid-auto-rows: 23px;
	}
}

.ct-cell {
	border: 0;
	border-radius: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0.76em;
	color: var(--ct-text);
	padding: 0 4px;
	box-shadow: inset -1px 0 0 rgba(28, 24, 22, 0.06), inset 0 -1px 0 rgba(28, 24, 22, 0.06);
	transition: background 130ms cubic-bezier(.2,.7,.4,1), box-shadow 130ms ease;
}
.ct-cell--corner {
	background: var(--ct-soft);
	box-shadow: inset 0 -1px 0 rgba(28, 24, 22, 0.10);
	position: sticky; top: 0; left: 0; z-index: 4;
}

.ct-cell--dayhdr {
	flex-direction: column;
	gap: 1px;
	background: var(--ct-soft);
	color: var(--ct-black);
	border: 0;
	position: sticky; top: 0; z-index: 2;
	padding: 8px 4px;
	min-height: 50px;
	min-width: 0;        /* allow the header to shrink to its grid track */
	overflow: hidden;    /* a long label can never bleed into the next day's column */
	box-shadow: inset 0 -1px 0 rgba(28, 24, 22, 0.12), inset -1px 0 0 rgba(28, 24, 22, 0.06);
	cursor: pointer;
}
.ct-cell--dayhdr:hover { background: var(--ct-cream); }
.ct-cell--dayhdr:focus-visible { outline: 2px solid var(--ct-crimson); outline-offset: -2px; }
.ct-day-weekday { font-size: 0.64em; font-weight: 600; opacity: 0.5; letter-spacing: 0.16em; text-transform: uppercase; }
.ct-day-label   { font-family: Georgia, "Times New Roman", serif; font-size: 0.98em; font-weight: 600; letter-spacing: 0.01em; color: var(--ct-black); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

/* Time gutter: clickable (toggles a row) + sticky-left while scrolling. */
.ct-cell--timehdr {
	background: var(--ct-soft);
	border: 0;
	color: var(--ct-muted);
	font-size: 0.7em;
	font-variant-numeric: tabular-nums;
	justify-content: flex-end;
	padding-right: 10px;
	letter-spacing: 0.01em;
	white-space: nowrap;   /* the label must never wrap inside the narrow gutter */
	position: sticky; left: 0; z-index: 1;
	cursor: pointer;
	box-shadow: inset -1px 0 0 rgba(28, 24, 22, 0.08);
}
.ct-cell--timehdr:hover { color: var(--ct-crimson2); }
.ct-cell--timehdr:focus-visible { outline: 2px solid var(--ct-crimson); outline-offset: -2px; }
.ct-cell--timehdr-half { color: transparent; }
.ct-cell--timehdr-half:hover { color: transparent; }

/* Hover crosshair: the day-column + time-row headers for the cell under the
 * cursor light up, so you can read your position at a glance. The two-class
 * specificity (0,2,0) also reveals the normally-transparent half-hour label. */
.ct-cell--dayhdr.ct-cell--hl,
.ct-cell--timehdr.ct-cell--hl {
	background: color-mix(in srgb, var(--ct-crimson) 15%, var(--ct-soft));
	color: var(--ct-crimson2);
}
.ct-cell--dayhdr.ct-cell--hl .ct-day-label,
.ct-cell--dayhdr.ct-cell--hl .ct-day-weekday { color: var(--ct-crimson2); opacity: 1; }

.ct-cell--slot {
	cursor: pointer;
	background: var(--ct-soft);
	touch-action: none;
}
.ct-cell--slot:hover {
	background: color-mix(in srgb, var(--ct-crimson) 9%, var(--ct-soft));
}
.ct-cell--slot:focus-visible { outline: 2px solid var(--ct-crimson); outline-offset: -2px; z-index: 3; }

.ct-grid--painting { cursor: crosshair; }
.ct-grid--painting .ct-cell--slot { transition: background 60ms linear; }

/* Selected slots read as a soft-cornered "availability bar", but the grid
 * intersections stay lightly visible through the fill — faint white hairlines
 * over the accent — so the half-hour rows and day columns remain legible
 * inside a selection. The JS rounds only a region's outer corners (inline
 * border-radius), and inset shadows follow that radius. */
.ct-cell--selected {
	background: var(--ct-crimson);
	color: var(--ct-on-accent);
	box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.16), inset 0 -1px 0 rgba(255, 255, 255, 0.16) !important;
	position: relative;
	z-index: 1;
}
.ct-cell--selected:hover { background: var(--ct-crimson2); }

/* Hour boundary — a marginally firmer top hairline so hours read at a glance. */
.ct-cell[data-iso$=":00"] {
	box-shadow: inset -1px 0 0 rgba(28, 24, 22, 0.06), inset 0 1px 0 rgba(28, 24, 22, 0.09), inset 0 -1px 0 rgba(28, 24, 22, 0.06);
}

/* ------- Slot count ------- */
/* Editorial eyebrow label above the selector. */
.ct-eyebrow {
	color: var(--ct-crimson);
	font-size: 0.72em;
	font-weight: 700;
	letter-spacing: 0.15em;
	text-transform: uppercase;
	margin: 2px 0 7px;
}

/* Live count as a refined capsule (number emphasised in JS). */
.ct-slot-count {
	display: inline-flex;
	align-items: baseline;
	gap: 6px;
	font-size: 0.86em;
	color: var(--ct-muted);
	margin: 14px 0 16px;
	padding: 8px 15px;
	border-radius: 999px;
	border: 1px solid var(--ct-border);
	background: var(--ct-soft);
	box-shadow: var(--ct-shadow);
}
.ct-slot-count:empty { display: none; }
.ct-slot-count strong { color: var(--ct-crimson); font-size: 1.3em; font-weight: 700; letter-spacing: -0.02em; }

/* ------- Form ------- */
.ct-form {
	background: var(--ct-soft);
	border: 1px solid var(--ct-border);
	border-top: 3px solid var(--ct-gold);
	border-radius: 8px;
	padding: 22px 24px 20px;
	max-width: 560px;
	box-shadow: var(--ct-shadow);
}
.ct-field { margin-bottom: 14px; }
.ct-field label {
	display: block;
	font-size: 0.86em;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--ct-black);
	margin-bottom: 5px;
}
.ct-field input, .ct-field textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--ct-border);
	border-radius: 4px;
	font: inherit;
	background: var(--ct-cream);
	color: var(--ct-text);
	box-sizing: border-box;
	transition: border-color 120ms ease, background 120ms ease, box-shadow 120ms ease;
}
.ct-field input:focus, .ct-field textarea:focus {
	outline: none;
	border-color: var(--ct-crimson);
	background: var(--ct-soft);
	box-shadow: 0 0 0 3px rgba(139, 26, 43, 0.15);
}
.ct-req { color: var(--ct-crimson); }

.ct-form__actions { margin-top: 14px; }
.ct-submit {
	background: var(--ct-crimson);
	color: var(--ct-on-accent);
	border: none;
	border-radius: 4px;
	padding: 12px 24px;
	font: inherit;
	font-weight: 600;
	letter-spacing: 0.04em;
	cursor: pointer;
	width: 100%;
	min-height: 44px;
	transition: background 150ms ease, transform 100ms ease, box-shadow 150ms ease;
	box-shadow: 0 1px 0 var(--ct-crimson2), 0 4px 14px rgba(139, 26, 43, 0.20);
}
.ct-submit:hover {
	background: var(--ct-crimson2);
	box-shadow: 0 1px 0 var(--ct-crimson2), 0 6px 18px rgba(139, 26, 43, 0.30);
}
.ct-submit:active  { transform: translateY(1px); box-shadow: 0 1px 0 var(--ct-crimson2); }
.ct-submit:disabled { background: #b89aa0; cursor: default; box-shadow: none; }

@media (min-width: 600px) {
	.ct-submit { width: auto; min-width: 220px; }
}

.ct-form__feedback {
	margin-top: 14px;
	padding: 11px 14px;
	border-radius: 4px;
	font-size: 0.95em;
	display: none;
	border-left: 4px solid;
}
.ct-form__feedback:not(:empty) { display: block; }
.ct-form__feedback--ok  { background: #f0f5ec; color: #335829; border-color: #6c8a5c; }
.ct-form__feedback--err { background: #fbeeee; color: var(--ct-crimson2); border-color: var(--ct-crimson); }

/* ------- Quote footer (subtle, rotating) ------- */
.ct-quote {
	margin: 28px auto 4px;
	max-width: 620px;
	text-align: center;
	color: var(--ct-muted);
	font-family: Georgia, serif;
	font-style: italic;
	font-size: 0.96em;
	line-height: 1.5;
	padding: 18px 16px 14px;
	border-top: 1px solid var(--ct-border);
	border-bottom: 1px solid var(--ct-border);
	background: linear-gradient(180deg, transparent 0%, rgba(184, 146, 74, 0.04) 50%, transparent 100%);
	opacity: 1;
	transition: opacity 700ms ease;
}
.ct-quote--fading { opacity: 0; }
.ct-quote__mark {
	display: block;
	font-size: 2.2em;
	line-height: 0.5;
	color: var(--ct-gold);
	margin-bottom: 6px;
}
.ct-quote__text { display: block; }
.ct-quote__cite {
	display: block;
	margin-top: 10px;
	font-style: normal;
	font-size: 0.82em;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--ct-gold2);
}

.ct-foundation-mark {
	margin-top: 16px;
	text-align: center;
	font-family: Georgia, serif;
	font-size: 0.78em;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--ct-muted);
}
.ct-foundation-mark::before, .ct-foundation-mark::after {
	content: "·";
	margin: 0 8px;
	color: var(--ct-gold);
}

/* ------- Brand row (logo + foundation line) ------- */
.ct-event__brandtext { display: inline-flex; flex-direction: column; line-height: 1.1; }
.ct-event__brandorg {
	font-size: 0.7em;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--ct-gold2);
	margin-bottom: 4px;
}
/* The product name (e.g. "Common Time") is the brand wordmark — give it real
 * presence so it holds its own against the event title below it. */
.ct-event__brandline {
	font-family: Georgia, "Times New Roman", serif;
	font-weight: 700;
	font-size: 2em;
	line-height: 1.02;
	letter-spacing: 0.005em;
	text-transform: none;
	color: var(--ct-black);
}
.ct-event__brandsub {
	font-size: 0.74em;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--ct-gold2);
	margin-top: 6px;
}
.ct-logo-wrap { display: inline-flex; flex: 0 0 auto; }
.ct-logo { display: block; filter: drop-shadow(0 2px 4px rgba(28,24,22,0.10)); }
/* Real SEF sail (assets/img/sail.svg) — fills with currentColor = the active
 * program accent, so it recolors live with the theme switcher. */
.ct-logo--sail { display: block; }
.ct-logo-wrap--sail { color: var(--ct-crimson); transition: color 0.3s ease; filter: drop-shadow(0 1px 2px rgba(28,24,22,0.12)); }

/* ======================================================================
 * Foundation program themes — photo-forward hero + live theme switcher
 * ====================================================================== */

/* Foundation events lead with the hero photo (no pennant, no top ribbon). */
.ct-event[data-ct-brand="foundation"] { padding-top: 0; }
.ct-event[data-ct-brand="foundation"]::before { display: none; }

.ct-hero {
	position: relative;
	margin: 0 -24px 0;
	height: 158px;
	overflow: hidden;
	background: var(--ct-black);
	border-radius: 10px 10px 0 0;
}
.ct-hero__img {
	width: 100%; height: 100%;
	object-fit: cover;
	display: block;
	transition: opacity 0.35s ease;
}
.ct-hero__img--swapping { opacity: 0; }
.ct-hero__scrim {
	position: absolute; inset: 0;
	background:
		linear-gradient(180deg, rgba(20,16,14,0.10) 0%, rgba(20,16,14,0) 38%,
			color-mix(in srgb, var(--ct-crimson) 62%, transparent) 100%);
	pointer-events: none;
}
.ct-hero__label {
	position: absolute; left: 18px; bottom: 12px; right: 18px;
	margin: 0;
	color: #fff;
	font-family: Georgia, "Times New Roman", serif;
	font-weight: 700;
	font-size: 1.55em;
	letter-spacing: 0.01em;
	text-shadow: 0 1px 10px rgba(0,0,0,0.55);
}
@media (min-width: 600px) {
	.ct-hero { height: 248px; }
	.ct-hero__label { font-size: 1.9em; }
}

/* ======================================================================
 * Mobile day-first flow — swipeable day strip + paintable time column
 * (revealed by JS on small screens; the grid is the desktop baseline)
 * ====================================================================== */
.ct-dayflow { margin: 4px 0 2px; }

/* Day strip (Embla viewport + flex track) */
.ct-dayflow__strip { overflow: hidden; padding: 6px 2px; }
.ct-dayflow__strip-track { display: flex; gap: 8px; }
.ct-day-pill {
	flex: 0 0 auto;
	min-width: 80px;
	display: flex; flex-direction: column; align-items: center; gap: 1px;
	padding: 9px 14px;
	border: 1px solid var(--ct-border);
	border-radius: 13px;
	background: var(--ct-soft);
	color: var(--ct-muted);
	font: inherit; cursor: pointer;
	position: relative;
	transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}
.ct-day-pill__wd { font-size: 0.7em; letter-spacing: 0.12em; text-transform: uppercase; }
.ct-day-pill__dy { font-family: Georgia, serif; font-weight: 700; font-size: 1.05em; color: var(--ct-black); white-space: nowrap; }
.ct-day-pill.is-active {
	border-color: var(--ct-crimson);
	background: var(--ct-cream);
	box-shadow: 0 3px 12px rgba(28,24,22,0.10), inset 0 0 0 1px var(--ct-crimson);
	transform: translateY(-1px);
}
.ct-day-pill.is-active .ct-day-pill__wd { color: var(--ct-crimson2); }
.ct-day-pill__badge {
	position: absolute; top: -7px; right: -5px;
	min-width: 19px; height: 19px; padding: 0 5px; box-sizing: border-box;
	border-radius: 10px;
	background: var(--ct-crimson); color: var(--ct-on-accent);
	font-size: 11px; font-weight: 700; line-height: 19px; text-align: center;
	box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.ct-day-pill__badge:empty { display: none; }

/* Controls bar: prev/next + Hours/30-min toggle */
.ct-dayflow__bar { display: flex; align-items: stretch; gap: 10px; margin: 6px 0; }
.ct-dayflow__nav {
	flex: 0 0 auto; width: 44px;
	border: 1px solid var(--ct-border); border-radius: 11px;
	background: var(--ct-soft); color: var(--ct-crimson2);
	font-size: 22px; line-height: 1; cursor: pointer;
	transition: transform 0.08s ease, background 0.15s ease;
}
.ct-dayflow__nav:active { transform: scale(0.95); background: var(--ct-cream); }
.ct-gran {
	flex: 1 1 auto; display: flex; gap: 3px; padding: 3px;
	background: var(--ct-soft); border: 1px solid var(--ct-border); border-radius: 11px;
}
.ct-gran__btn {
	flex: 1 1 0; min-height: 38px; border: none; border-radius: 8px;
	background: transparent; color: var(--ct-muted);
	font: inherit; font-weight: 600; cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.ct-gran__btn.is-active { background: var(--ct-cream); color: var(--ct-black); box-shadow: inset 0 0 0 1px var(--ct-border); }
.ct-dayflow__help { font-size: 0.85em; color: var(--ct-muted); font-style: italic; margin: 0 0 10px; }

/* Time column */
/* The time column is one grouped card; the rows are seamless with hairline
 * separators (iOS table feel). Selected rows fill with the program accent. */
.ct-dayflow__column {
	display: flex; flex-direction: column; gap: 0;
	border-radius: 16px;
	overflow: hidden;
	background: var(--ct-soft);
	border: 1px solid rgba(28, 24, 22, 0.08);
	box-shadow: 0 1px 2px rgba(28, 24, 22, 0.04), 0 10px 28px rgba(28, 24, 22, 0.07);
}
.ct-tblock {
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
	min-height: 56px; padding: 13px 18px;
	border: 0; border-radius: 0;
	background: var(--ct-soft);
	color: var(--ct-text);
	font: inherit; cursor: pointer; text-align: left;
	touch-action: none;
	-webkit-user-select: none; user-select: none;
	box-shadow: inset 0 -1px 0 rgba(28, 24, 22, 0.07);
	transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}
.ct-tblock:last-child { box-shadow: none; }
.ct-tblock:active { background: color-mix(in srgb, var(--ct-crimson) 7%, var(--ct-soft)); }
.ct-tblock__main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ct-tblock__time {
	font-weight: 600; font-size: 1.04em; letter-spacing: -0.01em;
	font-variant-numeric: tabular-nums;
}
/* Two marks for an hour's 30-min halves (Hours mode). */
.ct-tblock__halves { display: inline-flex; gap: 5px; }
.ct-tblock__half {
	width: 17px; height: 5px; border-radius: 999px;
	background: rgba(28, 24, 22, 0.16);
	transition: background 0.16s ease;
}
.ct-tblock__half.on { background: var(--ct-crimson); }
.ct-tblock--full .ct-tblock__half { background: rgba(255, 255, 255, 0.34); }
.ct-tblock--full .ct-tblock__half.on { background: var(--ct-on-accent); }
.ct-tblock__mark {
	position: relative;
	width: 22px; height: 22px; border-radius: 50%; flex: 0 0 auto;
	border: 1.5px solid rgba(28, 24, 22, 0.22);
	transition: border-color 0.16s ease, background 0.16s ease;
}
.ct-tblock--full {
	background: var(--ct-crimson); color: var(--ct-on-accent);
	box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.14);
}
.ct-tblock--full .ct-tblock__mark { border-color: var(--ct-on-accent); }
.ct-tblock--full .ct-tblock__mark::after {
	content: ""; position: absolute; left: 6.5px; top: 3px;
	width: 5px; height: 10px;
	border: solid var(--ct-on-accent); border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}
.ct-tblock--partial { background: color-mix(in srgb, var(--ct-crimson) 13%, var(--ct-soft)); color: var(--ct-text); }
.ct-tblock--partial .ct-tblock__mark { border-color: var(--ct-crimson); }
.ct-tblock--partial .ct-tblock__mark::after {
	content: ""; position: absolute; left: 4px; top: 8.5px;
	width: 10px; border-top: 2px solid var(--ct-crimson);
}

/* Day-change enter animation (staggered via inline animation-delay in JS) */
@keyframes ct-col-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
.ct-dayflow__column--enter > .ct-tblock { animation: ct-col-in 0.26s cubic-bezier(0.2,0.7,0.4,1) both; }

@media (prefers-reduced-motion: reduce) {
	.ct-dayflow__column--enter > .ct-tblock { animation: none; }
	.ct-day-pill, .ct-tblock, .ct-dayflow__nav { transition: none; }
}

@media (prefers-reduced-motion: reduce) {
	.ct-event, .ct-hero__img, .ct-logo-wrap--sail { transition: none; }
}

/* ------- Pennant decorative accent ------- */
.ct-pennant-wrap {
	position: absolute;
	top: 8px;
	right: 18px;
	width: 46px;
	height: 170px;
	pointer-events: none;
	display: none;
	opacity: 0.92;
}
.ct-pennant {
	width: 100%;
	height: 100%;
	filter: drop-shadow(0 4px 6px rgba(28,24,22,0.18));
	animation: ct-pennant-sway 6s ease-in-out infinite;
	transform-origin: 50% 0%;
}
@keyframes ct-pennant-sway {
	0%, 100% { transform: rotate(-1deg); }
	50%      { transform: rotate(1.5deg); }
}
@media (min-width: 880px) {
	.ct-pennant-wrap { display: block; }
	.ct-event { padding-right: 80px; }
	/* Foundation has a hero instead of the pennant — keep symmetric padding. */
	.ct-event[data-ct-brand="foundation"] { padding-right: 24px; }
}
@media (prefers-reduced-motion: reduce) {
	.ct-pennant { animation: none; }
}

/* ------- This day in fraternity history ------- */
.ct-history {
	margin: 16px 0 0;
	padding: 12px 14px 10px;
	background: linear-gradient(180deg, rgba(184,146,74,0.06) 0%, rgba(255,255,255,0) 100%);
	border-left: 2px solid var(--ct-gold);
	border-radius: 0 6px 6px 0;
}
.ct-history__hdr {
	display: flex; align-items: center; gap: 8px;
	margin-bottom: 6px;
}
.ct-history__dot {
	width: 6px; height: 6px; border-radius: 50%;
	background: var(--ct-gold);
	box-shadow: 0 0 0 3px rgba(184,146,74,0.18);
	flex: 0 0 auto;
}
.ct-history__kicker {
	font-family: Georgia, serif;
	font-size: 0.74em;
	font-weight: 600;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--ct-gold2);
}
.ct-history__list {
	margin: 0; padding: 0;
	list-style: none;
	display: flex; flex-direction: column; gap: 4px;
}
.ct-history__item {
	display: flex;
	align-items: baseline;
	gap: 10px;
	font-size: 0.88em;
	color: var(--ct-text);
	line-height: 1.45;
}
.ct-history__year {
	flex: 0 0 auto;
	font-family: Georgia, serif;
	font-weight: 700;
	font-size: 0.92em;
	color: var(--ct-crimson2);
	min-width: 3.2em;
	letter-spacing: 0.04em;
}
.ct-history__label { flex: 1 1 auto; color: var(--ct-muted); }

/* ------- Editing banner ------- */
.ct-editing-banner {
	background: linear-gradient(180deg, #fdf6e0 0%, #f8ecc8 100%);
	border: 1px solid var(--ct-gold);
	border-left: 4px solid var(--ct-gold);
	color: #5a4317;
	padding: 11px 16px;
	border-radius: 6px;
	font-size: 0.92em;
	margin: 12px 0 16px;
	font-family: Georgia, serif;
	font-style: italic;
}

/* ------- Mainflow wrapper ------- */
.ct-mainflow { position: relative; }
.ct-mainflow[hidden] { display: none; }

/* ------- Confirmation panel ------- */
.ct-confirm {
	margin: 18px 0 8px;
	padding: 28px 24px 24px;
	background:
		radial-gradient(ellipse at top, rgba(184,146,74,0.10) 0%, rgba(184,146,74,0) 60%),
		var(--ct-soft);
	border: 1px solid var(--ct-border);
	border-top: 3px solid var(--ct-gold);
	border-radius: 8px;
	box-shadow: var(--ct-shadow-h);
	text-align: center;
	animation: ct-confirm-rise 600ms cubic-bezier(.2,.7,.4,1) both;
}
.ct-confirm[hidden] { display: none; animation: none; }

@keyframes ct-confirm-rise {
	from { opacity: 0; transform: translateY(8px); }
	to   { opacity: 1; transform: translateY(0); }
}

.ct-confirm__seal {
	width: 78px;
	height: 78px;
	margin: 0 auto 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: radial-gradient(circle at 30% 30%, #ffffff 0%, var(--ct-cream) 70%);
	border: 1px solid var(--ct-border);
	box-shadow:
		0 0 0 6px rgba(184,146,74,0.10),
		0 6px 18px rgba(28,24,22,0.10);
}
.ct-confirm__check { width: 56px; height: 56px; }
.ct-confirm__circle {
	fill: none;
	stroke: var(--ct-gold);
	stroke-width: 3;
	stroke-dasharray: 170;
	stroke-dashoffset: 170;
	animation: ct-check-circle 700ms cubic-bezier(.2,.7,.4,1) 100ms forwards;
}
.ct-confirm__tick {
	fill: none;
	stroke: var(--ct-crimson);
	stroke-width: 4.5;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-dasharray: 50;
	stroke-dashoffset: 50;
	animation: ct-check-tick 450ms cubic-bezier(.4,.9,.5,1) 700ms forwards;
}
@keyframes ct-check-circle { to { stroke-dashoffset: 0; } }
@keyframes ct-check-tick   { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
	.ct-confirm { animation: none; }
	.ct-confirm__circle, .ct-confirm__tick { animation: none; stroke-dashoffset: 0; }
}

.ct-confirm__heading {
	font-family: Georgia, serif;
	font-size: 1.6em;
	font-weight: 700;
	color: var(--ct-black);
	margin: 0 0 4px;
}
.ct-confirm__lead {
	color: var(--ct-muted);
	font-size: 1.02em;
	margin: 0 0 18px;
}

.ct-confirm__summary {
	text-align: left;
	background: var(--ct-cream);
	border: 1px solid var(--ct-border);
	border-radius: 6px;
	padding: 14px 16px;
	margin: 0 auto 18px;
	max-width: 520px;
}
.ct-confirm__summary-hdr {
	font-family: Georgia, serif;
	font-size: 0.78em;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--ct-gold2);
	margin: 0 0 8px;
}
.ct-confirm__summary-day {
	display: flex;
	gap: 10px;
	padding: 6px 0;
	border-top: 1px dashed var(--ct-border);
	align-items: baseline;
	font-size: 0.94em;
}
.ct-confirm__summary-day:first-of-type { border-top: none; }
.ct-confirm__summary-daylabel {
	flex: 0 0 7em;
	font-family: Georgia, serif;
	font-weight: 600;
	color: var(--ct-black);
}
.ct-confirm__summary-times {
	flex: 1 1 auto;
	color: var(--ct-text);
	line-height: 1.5;
}
.ct-confirm__summary-comment {
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px solid var(--ct-border);
	font-size: 0.92em;
	color: var(--ct-text);
	font-style: italic;
}
.ct-confirm__summary-comment-hdr {
	font-family: Georgia, serif;
	font-size: 0.74em;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--ct-gold2);
	font-style: normal;
	margin-bottom: 4px;
}

.ct-confirm__editblock {
	max-width: 520px;
	margin: 0 auto 16px;
	padding: 14px 16px;
	background: var(--ct-cream);
	border: 1px dashed var(--ct-gold);
	border-radius: 6px;
	text-align: left;
}
.ct-confirm__editlabel {
	font-family: Georgia, serif;
	font-weight: 700;
	color: var(--ct-black);
	margin-bottom: 2px;
}
.ct-confirm__edithint {
	color: var(--ct-muted);
	font-size: 0.88em;
	margin-bottom: 10px;
	line-height: 1.45;
}
.ct-confirm__linkrow {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
}
.ct-confirm__url {
	flex: 1 1 220px;
	min-width: 0;
	padding: 8px 10px;
	border: 1px solid var(--ct-border);
	border-radius: 4px;
	background: var(--ct-soft);
	font: inherit;
	font-size: 0.85em;
	color: var(--ct-text);
}
.ct-confirm__copy {
	flex: 0 0 auto;
	padding: 8px 14px;
	background: var(--ct-black);
	color: var(--ct-cream);
	border: none;
	border-radius: 4px;
	font: inherit;
	font-size: 0.88em;
	font-weight: 600;
	cursor: pointer;
	letter-spacing: 0.04em;
	transition: background 120ms ease;
}
.ct-confirm__copy:hover { background: var(--ct-crimson); }
.ct-confirm__copy--ok   { background: #335829; }

.ct-confirm__again {
	background: transparent;
	color: var(--ct-crimson2);
	border: 1px solid var(--ct-crimson);
	border-radius: 4px;
	padding: 9px 18px;
	font: inherit;
	font-size: 0.92em;
	font-weight: 600;
	cursor: pointer;
	transition: background 120ms ease, color 120ms ease;
}
.ct-confirm__again:hover { background: var(--ct-crimson); color: var(--ct-on-accent); }

/* ------- Upcoming family birthdays ------- */
.ct-family-birthdays {
	max-width: 520px;
	margin: 0 auto 18px;
	padding: 16px 18px 12px;
	text-align: left;
	background:
		linear-gradient(180deg, rgba(184,146,74,0.10) 0%, rgba(255,255,255,0) 75%),
		var(--ct-cream);
	border: 1px solid var(--ct-border);
	border-left: 3px solid var(--ct-gold);
	border-radius: 6px;
	box-shadow: 0 1px 3px rgba(28,24,22,0.04);
}
.ct-family-birthdays[hidden] { display: none; }
.ct-family-birthdays--edit {
	margin: 12px 0 16px;
	max-width: none;
}
.ct-family-birthdays__hdr {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 4px;
}
.ct-family-birthdays__icon {
	color: var(--ct-gold);
	font-size: 1.1em;
	line-height: 1;
}
.ct-family-birthdays__kicker {
	font-family: Georgia, serif;
	font-size: 0.78em;
	font-weight: 700;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--ct-gold2);
}
.ct-family-birthdays__lead {
	margin: 0 0 10px;
	color: var(--ct-muted);
	font-family: Georgia, serif;
	font-style: italic;
	font-size: 0.92em;
	line-height: 1.4;
}
.ct-family-birthdays__list {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.ct-family-birthdays__item {
	display: grid;
	grid-template-columns: 6.4em 1fr;
	column-gap: 12px;
	row-gap: 0;
	align-items: baseline;
	padding: 7px 0;
	border-top: 1px dashed var(--ct-border);
	font-size: 0.94em;
	line-height: 1.4;
}
.ct-family-birthdays__item:first-child { border-top: none; }
.ct-family-birthdays__when {
	grid-column: 1;
	font-family: Georgia, serif;
	font-weight: 600;
	font-size: 0.86em;
	letter-spacing: 0.04em;
	text-transform: lowercase;
	color: var(--ct-crimson2);
	white-space: nowrap;
}
.ct-family-birthdays__name {
	grid-column: 2;
	font-family: Georgia, serif;
	font-weight: 600;
	color: var(--ct-black);
}
.ct-family-birthdays__meta {
	grid-column: 2;
	font-size: 0.84em;
	color: var(--ct-muted);
}
.ct-family-birthdays__item--today .ct-family-birthdays__when {
	color: var(--ct-cream);
	background: var(--ct-crimson);
	border-radius: 3px;
	padding: 1px 8px;
	text-align: center;
	box-shadow: 0 1px 2px rgba(139,26,43,0.3);
}

/* Admin preview state — clear "this is staff-only" framing */
.ct-family-birthdays--preview {
	max-width: none;
	margin-bottom: 22px;
	border-left-color: #4a6da3;
	background:
		linear-gradient(180deg, rgba(74,109,163,0.08) 0%, rgba(255,255,255,0) 75%),
		var(--ct-cream);
}
.ct-family-birthdays__previewbadge {
	display: inline-block;
	margin-bottom: 10px;
	padding: 3px 10px;
	font-family: Georgia, serif;
	font-size: 0.72em;
	font-weight: 700;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: #ffffff;
	background: #4a6da3;
	border-radius: 3px;
	box-shadow: 0 1px 2px rgba(74,109,163,0.25);
}
.ct-family-birthdays--empty .ct-family-birthdays__hdr,
.ct-family-birthdays--empty .ct-family-birthdays__lead,
.ct-family-birthdays--empty .ct-family-birthdays__list { display: none; }
