/* ==========================================================================
   MSA Events
   ========================================================================== */

.msa-events-section,
.msa-events-row,
.msa-events-grid,
.msa-calendar,
.msa-calendar-list,
.msa-eventviews {
	--msa-crimson: #C42031;
	--msa-black: #000000;
	--msa-white: #FFFFFF;
	--msa-ink: #1A1A1A;
	--msa-body-text: #4A4A4A;
	/* #8A8A85 failed WCAG AA as type on every surface; see msa-site.css. */
	--msa-muted: #616161;

	--msa-teal: #00B1BA;
	--msa-blue: #264398;
	--msa-yellow: #FFD508;
	--msa-purple: #A73C96;

	/* Text-safe variants. The brand colours fail WCAG AA as text on white,
	   so anything set as type uses these instead. */
	--msa-teal-text: #00767C;
	--msa-blue-text: #264398;
	--msa-yellow-text: #6B5800;
	--msa-purple-text: #8A2F7C;
	--msa-crimson-text: #A81A29;

	--msa-hairline: rgba(0, 0, 0, 0.09);
	--msa-card-bg: #FFFFFF;

	--msa-display: "Bebas Neue", Impact, sans-serif;
	--msa-body: "Roboto", Arial, sans-serif;

	--msa-radius: 10px;

	font-family: var(--msa-body);
	color: var(--msa-body-text);
}

.msa-events-section *,
.msa-events-section *::before,
.msa-events-section *::after,
.msa-events-grid *,
.msa-calendar * {
	box-sizing: border-box;
}

/* Elementor puts widgets in flex containers; without an explicit basis the
   grids shrink-wrap to their content width. */
.elementor-widget-msa_events_featured,
.elementor-widget-msa_events_list,
.elementor-widget-msa_events_calendar {
	flex: 1 1 100%;
	width: 100%;
}

.msa-visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* Accent modifiers, shared vocabulary across MSA plugins. */
.msa-accent--crimson { --msa-accent: var(--msa-crimson); --msa-accent-text: var(--msa-crimson-text); }
.msa-accent--teal    { --msa-accent: var(--msa-teal);    --msa-accent-text: var(--msa-teal-text); }
.msa-accent--blue    { --msa-accent: var(--msa-blue);    --msa-accent-text: var(--msa-blue-text); }
.msa-accent--yellow  { --msa-accent: var(--msa-yellow);  --msa-accent-text: var(--msa-yellow-text); }
.msa-accent--purple  { --msa-accent: var(--msa-purple);  --msa-accent-text: var(--msa-purple-text); }

/* ------------------------------------------------------- Section furniture */

.msa-eyebrow {
	margin: 0 0 10px;
	font-family: var(--msa-body);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.17em;
	text-transform: uppercase;
	color: var(--msa-accent-text, var(--msa-purple-text));
}

.msa-section-heading {
	margin: 0;
	font-family: var(--msa-display);
	font-size: 48px;
	font-weight: 400;
	line-height: 1;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--msa-ink);
}

.msa-section-heading--sm {
	font-size: 34px;
	margin-bottom: 22px;
}

.msa-events-section__head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 20px 32px;
	margin-bottom: 34px;
}

.msa-events-section__note {
	margin: 22px 0 0;
	max-width: 480px;
	font-size: 12px;
	line-height: 1.6;
	color: var(--msa-muted);
}

.msa-events-empty {
	margin: 0;
	font-size: 15px;
	color: var(--msa-muted);
}

.msa-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 48px;
	padding: 0 28px;
	border-radius: 999px;
	font-family: var(--msa-display);
	font-size: 18px;
	letter-spacing: 0.07em;
	text-transform: uppercase;
	text-decoration: none;
	line-height: 1;
	white-space: nowrap;
	transition: background-color 0.2s ease;
}

.msa-btn--black {
	background: var(--msa-black);
	color: var(--msa-white);
}

.msa-btn--black:hover {
	background: var(--msa-crimson);
	color: var(--msa-white);
}

/* -------------------------------------------------------------- Event card */

.msa-event {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid var(--msa-hairline);
	border-radius: var(--msa-radius);
	background: var(--msa-card-bg);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.msa-event:hover {
	transform: translateY(-2px);
	box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}

.msa-event__media {
	position: relative;
	display: block;
	overflow: hidden;
	background: #EDEDEA;
	text-decoration: none;
}

.msa-event__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.msa-event--featured .msa-event__media {
	aspect-ratio: 16 / 10;
}

.msa-event--list .msa-event__media {
	aspect-ratio: 16 / 10;
}

.msa-event--no-image .msa-event__media {
	min-height: 96px;
}

.msa-event__badge {
	position: absolute;
	top: 14px;
	left: 14px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-width: 56px;
	padding: 7px 8px 8px;
	border-radius: 8px;
	background: var(--msa-white);
	line-height: 1;
	box-shadow: 0 3px 10px rgba(0, 0, 0, 0.16);
}

.msa-event__badge-month {
	font-family: var(--msa-body);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--msa-accent-text, var(--msa-crimson-text));
}

.msa-event__badge-day {
	margin-top: 3px;
	font-family: var(--msa-display);
	font-size: 27px;
	color: var(--msa-ink);
}

.msa-event__flag {
	position: absolute;
	top: 16px;
	right: 16px;
	padding: 6px 14px 5px;
	border-radius: 999px;
	background: var(--msa-accent, var(--msa-purple));
	font-family: var(--msa-body);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.13em;
	text-transform: uppercase;
	color: var(--msa-white);
}

.msa-event__body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	padding: 20px 22px 22px;
}

.msa-event__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 18px;
	margin: 0 0 10px;
	font-size: 13px;
	color: var(--msa-body-text);
}

.msa-event__meta-item {
	display: inline-flex;
	align-items: center;
	gap: 7px;
}

.msa-event__meta svg {
	width: 14px;
	height: 14px;
	flex: 0 0 auto;
	fill: none;
	stroke: var(--msa-accent-text, var(--msa-crimson-text));
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.msa-event__sep {
	padding: 0 1px;
}

.msa-event__title {
	margin: 0 0 10px;
	font-family: var(--msa-display);
	font-size: 27px;
	font-weight: 400;
	line-height: 1.08;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

.msa-event__title a {
	color: var(--msa-ink);
	text-decoration: none;
}

.msa-event__title a:hover {
	color: var(--msa-crimson-text);
}

.msa-event__excerpt {
	margin: 0 0 16px;
	font-size: 14px;
	line-height: 1.62;
	color: var(--msa-body-text);
}

.msa-event__link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-top: auto;
	padding-bottom: 3px;
	border-bottom: 2px solid var(--msa-accent, var(--msa-crimson));
	align-self: flex-start;
	font-size: 14px;
	font-weight: 700;
	color: var(--msa-ink);
	text-decoration: none;
	transition: color 0.18s ease, gap 0.18s ease;
}

.msa-event__link:hover {
	color: var(--msa-crimson-text);
	gap: 12px;
}

/* Featured card runs larger. */
.msa-event--featured .msa-event__title {
	font-size: 34px;
}

.msa-event--featured .msa-event__body {
	padding: 24px 26px 26px;
}

/* Compact card is horizontal: image left, content right. */
.msa-event--compact {
	flex-direction: row;
}

.msa-event--compact .msa-event__media {
	flex: 0 0 36%;
	min-height: 100%;
}

.msa-event--compact .msa-event__badge {
	top: 10px;
	left: 10px;
	min-width: 48px;
	padding: 5px 6px 6px;
}

.msa-event--compact .msa-event__badge-day {
	font-size: 22px;
}

.msa-event--compact .msa-event__body {
	padding: 18px 20px 18px;
}

.msa-event--compact .msa-event__title {
	font-size: 23px;
}

.msa-event--compact .msa-event__excerpt {
	font-size: 13px;
	margin-bottom: 12px;
}

.msa-event--compact.msa-event--no-image .msa-event__media {
	display: none;
}

/* ------------------------------------------------------- Homepage row */

.msa-events-row {
	display: grid;
	grid-template-columns: 1.12fr 1fr;
	gap: 22px;
	align-items: stretch;
}

.msa-events-row--solo {
	grid-template-columns: 1fr;
	max-width: 640px;
}

.msa-events-row__stack {
	display: grid;
	grid-template-rows: repeat(auto-fit, minmax(0, 1fr));
	gap: 22px;
}

/* ------------------------------------------------------------- Grid */

.msa-events-grid {
	display: grid;
	gap: 24px;
}

.msa-events-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.msa-events-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.msa-events-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ----------------------------------------------------- View switcher */

/* Both panels render server-side, so with JavaScript off the visitor gets the
   month grid and the list rather than one empty tab. */
.msa-eventviews__tabs {
	display: none;
}

.msa-eventviews.is-enhanced .msa-eventviews__tabs {
	display: inline-flex;
	gap: 4px;
	margin-bottom: 26px;
	padding: 4px;
	border: 1px solid var(--msa-hairline);
	border-radius: 999px;
	background: var(--msa-white);
}

.msa-eventviews__tab {
	padding: 9px 22px;
	border: 0;
	border-radius: 999px;
	background: transparent;
	font-family: var(--msa-body);
	font-size: 14px;
	font-weight: 500;
	color: var(--msa-body-text);
	cursor: pointer;
	transition: background-color 0.18s ease, color 0.18s ease;
}

.msa-eventviews__tab:hover {
	color: var(--msa-ink);
}

.msa-eventviews__tab.is-active {
	background: var(--msa-ink);
	color: var(--msa-white);
}

.msa-eventviews.is-enhanced .msa-eventviews__panel {
	display: none;
}

.msa-eventviews.is-enhanced .msa-eventviews__panel.is-active {
	display: block;
}

.msa-eventviews__panel + .msa-eventviews__panel {
	margin-top: 40px;
}

.msa-eventviews.is-enhanced .msa-eventviews__panel + .msa-eventviews__panel {
	margin-top: 0;
}

.msa-eventviews .msa-calendar {
	margin-bottom: 0;
}

.msa-eventviews a:focus-visible,
.msa-eventviews button:focus-visible {
	outline: 2px solid var(--msa-crimson);
	outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
	.msa-eventviews__tab {
		transition: none;
	}
}

/* --------------------------------------------------------- Calendar */

.msa-calendar {
	margin: 0 0 48px;
}

.msa-calendar__head {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 20px;
	margin-bottom: 20px;
}

.msa-calendar__title {
	margin: 0;
	min-width: 240px;
	text-align: center;
	font-family: var(--msa-display);
	font-size: 36px;
	font-weight: 400;
	line-height: 1;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--msa-ink);
}

.msa-calendar__nav {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	border: 1px solid var(--msa-hairline);
	border-radius: 50%;
	color: var(--msa-ink);
	font-size: 17px;
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.msa-calendar__nav:hover {
	background: var(--msa-crimson);
	border-color: var(--msa-crimson);
	color: var(--msa-white);
}

.msa-calendar__grid {
	width: 100%;
	border-collapse: collapse;
	table-layout: fixed;
}

.msa-calendar__grid th {
	padding: 10px 6px;
	border-bottom: 2px solid var(--msa-hairline);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--msa-muted);
}

.msa-calendar__grid th abbr {
	text-decoration: none;
	border: 0;
}

.msa-calendar__cell {
	height: 118px;
	padding: 8px;
	border: 1px solid var(--msa-hairline);
	vertical-align: top;
}

.msa-calendar__cell--empty {
	background: #FAFAF8;
}

.msa-calendar__cell.is-today .msa-calendar__day {
	background: var(--msa-crimson);
	color: var(--msa-white);
}

.msa-calendar__day {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 26px;
	height: 26px;
	border-radius: 50%;
	font-size: 13px;
	font-weight: 700;
	color: var(--msa-ink);
}

.msa-calendar__events {
	margin: 6px 0 0;
	padding: 0;
	list-style: none;
}

.msa-calendar__events li {
	margin-bottom: 4px;
	padding-left: 8px;
	border-left: 3px solid var(--msa-accent, var(--msa-purple));
}

.msa-calendar__events a {
	display: block;
	font-size: 12px;
	line-height: 1.35;
	color: var(--msa-ink);
	text-decoration: none;
}

.msa-calendar__events a:hover {
	color: var(--msa-crimson-text);
	text-decoration: underline;
}

.msa-calendar-list {
	margin-top: 40px;
}

/* ------------------------------------------------------------ Focus */

.msa-events-section a:focus-visible,
.msa-events-grid a:focus-visible,
.msa-calendar a:focus-visible {
	outline: 2px solid var(--msa-crimson);
	outline-offset: 3px;
}

/* ------------------------------------------------------- Responsive */

@media (max-width: 1024px) {
	.msa-section-heading {
		font-size: 40px;
	}

	.msa-events-row {
		grid-template-columns: 1fr;
	}

	.msa-events-row__stack {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		grid-template-rows: none;
	}

	.msa-events-grid--4 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 860px) {
	.msa-events-grid--3 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.msa-calendar__cell {
		height: auto;
		min-height: 84px;
	}
}

@media (max-width: 700px) {
	.msa-calendar__grid,
	.msa-calendar__grid thead,
	.msa-calendar__grid tbody,
	.msa-calendar__grid tr,
	.msa-calendar__grid td {
		display: block;
		width: 100%;
	}

	.msa-calendar__grid thead {
		display: none;
	}

	.msa-calendar__cell--empty {
		display: none;
	}

	.msa-calendar__cell {
		min-height: 0;
		margin-bottom: 8px;
		border-radius: 8px;
	}

	.msa-calendar__cell:not(.has-events) {
		display: none;
	}
}

@media (max-width: 600px) {
	.msa-section-heading {
		font-size: 34px;
	}

	.msa-events-row__stack,
	.msa-events-grid--2,
	.msa-events-grid--3,
	.msa-events-grid--4 {
		grid-template-columns: 1fr;
	}

	.msa-event--compact {
		flex-direction: column;
	}

	.msa-event--compact .msa-event__media {
		flex: 0 0 auto;
		aspect-ratio: 16 / 9;

		/*
		 * The row layout above gives the image min-height:100% so it fills the
		 * card beside the text. Stacked, that same rule makes the image as tall
		 * as the whole card, pushing the title and excerpt past the bottom edge
		 * where the card's overflow:hidden clips them -- the card reads as a bare
		 * image with a date on it. Resetting it is what puts the words back.
		 */
		min-height: 0;
	}

	.msa-event--featured .msa-event__title {
		font-size: 27px;
	}

	.msa-events-section__head {
		align-items: flex-start;
	}
}

@media (prefers-reduced-motion: reduce) {
	.msa-event,
	.msa-event__link,
	.msa-btn,
	.msa-calendar__nav {
		transition: none;
	}

	.msa-event:hover {
		transform: none;
	}
}
