/* Merriest Mile Show Calendar
 * Base colors are set in Show Calendar > Colors (printed inline after this file).
 * Everything else is derived from them, so one change recolors the whole design.
 */

.mmc {
	/* Base colors (admin editable) */
	--mmc-green: #245b4e;
	--mmc-gold: #e7b95f;
	--mmc-night: #133836;
	--mmc-cream: #fdf6e6;
	--mmc-cell: #ffffff;
	--mmc-ink: #33403e;
	--mmc-open: #3a9e78;
	--mmc-event: #d4495d;
	--mmc-closed: #8d9897;
	--mmc-soon: #f3e4c2;

	/* Text on colored surfaces (picked automatically for contrast) */
	--mmc-gold-ink: #2b2410;
	--mmc-heading: #fdf3dc;
	--mmc-light: #f6eedb;

	/* Derived shades */
	--mmc-green-deep: color-mix(in srgb, var(--mmc-green) 76%, #000);
	--mmc-gold-soft: color-mix(in srgb, var(--mmc-gold) 60%, #fff);
	--mmc-night-depth: 62%; /* 93% when the home row color is light */
	--mmc-night-deep: color-mix(in srgb, var(--mmc-night) var(--mmc-night-depth), #000);
	--mmc-night-glow: color-mix(in srgb, var(--mmc-night) 75%, var(--mmc-green));
	--mmc-cream-deep: color-mix(in srgb, var(--mmc-cream) 88%, var(--mmc-gold));
	--mmc-line: color-mix(in srgb, var(--mmc-cream) 70%, var(--mmc-gold));
	--mmc-ink-soft: color-mix(in srgb, var(--mmc-ink) 82%, #fff);
	--mmc-label: color-mix(in srgb, color-mix(in srgb, var(--mmc-green), var(--mmc-ink)) 80%, #fff);
	--mmc-muted: color-mix(in srgb, var(--mmc-ink) 35%, var(--mmc-line));
	--mmc-foot-ink: color-mix(in srgb, var(--mmc-ink) 70%, var(--mmc-gold));
	--mmc-ring: color-mix(in srgb, var(--mmc-gold) 30%, transparent);
	--mmc-open-ink: color-mix(in srgb, var(--mmc-open) 80%, #000);
	--mmc-event-ink: color-mix(in srgb, var(--mmc-event) 88%, #000);
	--mmc-closed-ink: color-mix(in srgb, var(--mmc-closed) 75%, #000);
	--mmc-soon-ink: color-mix(in srgb, var(--mmc-soon) 35%, var(--mmc-ink));

	/* Type */
	--mmc-serif: Georgia, "Times New Roman", Times, serif;
	--mmc-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Helvetica, Arial, sans-serif;
	--mmc-radius: 18px;

	container-name: mmc;
	container-type: inline-size;
	box-sizing: border-box;
	font-family: var(--mmc-sans);
	color: var(--mmc-ink);
	line-height: 1.4;
	text-align: left;
}

.mmc *,
.mmc *::before,
.mmc *::after {
	box-sizing: inherit;
}

.mmc[hidden],
.mmc [hidden] {
	display: none !important;
}

.mmc p,
.mmc h2,
.mmc h3 {
	margin: 0;
	padding: 0;
	text-transform: none;
	letter-spacing: normal;
}

/* ---------- Legend ---------- */

.mmc .mmc-legend {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px 22px;
	width: fit-content;
	max-width: 100%;
	margin: 0 auto 24px;
	padding: 10px 22px;
	list-style: none;
	background: color-mix(in srgb, var(--mmc-night) 82%, transparent);
	border: 1px solid color-mix(in srgb, var(--mmc-gold) 28%, transparent);
	border-radius: 999px;
}

.mmc .mmc-legend li {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
	color: var(--mmc-light);
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
}

.mmc .mmc-legend li::before {
	content: "";
	flex: none;
	width: 11px;
	height: 11px;
	border-radius: 50%;
	background: var(--dot, var(--mmc-soon));
	box-shadow: 0 0 0 2px color-mix(in srgb, var(--mmc-light) 14%, transparent);
}

.mmc .is-open { --dot: var(--mmc-open); }
.mmc .is-event { --dot: var(--mmc-event); }
.mmc .is-closed { --dot: var(--mmc-closed); }
.mmc .is-soon { --dot: var(--mmc-soon); }

/* ---------- Months ---------- */

.mmc .mmc-months {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 24px;
	align-items: start;
}

@container mmc (min-width: 860px) {
	.mmc .mmc-months {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.mmc .mmc-month {
	container-name: mmc-month;
	container-type: inline-size;
	display: flex;
	flex-direction: column;
	margin: 0;
	background: var(--mmc-cream);
	border: 3px solid var(--mmc-gold);
	border-radius: var(--mmc-radius);
	overflow: hidden;
	box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.55);
}

.mmc .mmc-month__head {
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	gap: 12px;
	margin: 0;
	padding: 22px 26px 18px;
	background: linear-gradient(180deg, var(--mmc-green) 0%, var(--mmc-green-deep) 100%);
	text-align: center;
}

.mmc .mmc-spark {
	color: var(--mmc-gold);
	font-size: 18px;
	line-height: 1;
}

.mmc .mmc-month__name {
	font-family: var(--mmc-serif);
	font-size: 34px;
	font-weight: 400;
	line-height: 1.1;
	color: var(--mmc-heading);
}

.mmc .mmc-month__year {
	margin-top: 6px;
	padding-left: 0.32em;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.32em;
	color: var(--mmc-gold-soft);
}

.mmc .mmc-month__body {
	flex: 1;
	padding: 18px 12px 12px;
}

.mmc .mmc-dow,
.mmc .mmc-grid {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	gap: 6px;
}

.mmc .mmc-dow {
	margin-bottom: 10px;
}

.mmc .mmc-dow span {
	text-align: center;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--mmc-label);
}

/* ---------- Cells ---------- */

.mmc .mmc-cell {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	align-items: stretch;
	width: 100%;
	max-width: none;
	min-width: 0;
	min-height: 88px;
	height: auto;
	margin: 0;
	padding: 8px 7px 7px;
	background: var(--mmc-cell);
	border: 1px solid var(--mmc-line);
	border-radius: 8px;
	box-shadow: none;
	color: var(--mmc-ink);
	font: inherit;
	font-weight: 400;
	line-height: 1.25;
	letter-spacing: normal;
	text-align: left;
	text-transform: none;
	text-shadow: none;
	vertical-align: top;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.mmc button.mmc-cell:hover {
	transform: translateY(-1px);
	border-color: var(--mmc-gold);
	box-shadow: 0 6px 14px -8px rgba(60, 40, 0, 0.45);
	background: var(--mmc-cell);
	color: var(--mmc-ink);
}

.mmc button.mmc-cell:focus {
	outline: none;
}

.mmc button.mmc-cell:focus-visible {
	outline: 2px solid var(--mmc-green);
	outline-offset: 2px;
}

/* Status dot, top right */
.mmc .mmc-cell::after {
	content: "";
	position: absolute;
	top: 9px;
	right: 8px;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--dot);
}

.mmc .mmc-cell.is-soon::after,
.mmc .mmc-cell--blank::after,
.mmc .mmc-cell.is-off::after,
.mmc .mmc-cell.is-today::after {
	display: none;
}

.mmc .mmc-cell--blank {
	visibility: hidden;
	border: 0;
	background: none;
	cursor: default;
}

.mmc .mmc-cell__num {
	font-family: var(--mmc-serif);
	font-size: 20px;
	line-height: 1;
	color: var(--mmc-ink);
}

.mmc .mmc-cell__text {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin-top: 8px;
	font-size: 10px;
	line-height: 1.25;
	color: var(--mmc-muted);
	overflow-wrap: anywhere;
}

.mmc .mmc-cell__title {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	font-weight: 700;
	color: var(--mmc-green-deep);
}

.mmc .mmc-cell__flag {
	display: none;
	position: absolute;
	top: 6px;
	right: 6px;
	padding: 2px 6px;
	border-radius: 999px;
	background: var(--mmc-gold);
	color: var(--mmc-gold-ink);
	font-size: 8px;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	line-height: 1.3;
}

/* Status variants */
.mmc .mmc-cell.is-open .mmc-cell__line {
	font-weight: 600;
	color: var(--mmc-open-ink);
}

.mmc .mmc-cell.is-event,
.mmc button.mmc-cell.is-event:hover {
	background: linear-gradient(180deg, var(--mmc-cell) 0%, color-mix(in srgb, var(--mmc-event) 7%, var(--mmc-cell)) 100%);
	box-shadow: inset 0 3px 0 var(--mmc-event);
}

.mmc .mmc-cell.is-event .mmc-cell__title {
	color: var(--mmc-event-ink);
}

.mmc .mmc-cell.is-event .mmc-cell__line {
	color: var(--mmc-ink-soft);
}

.mmc .mmc-cell.is-closed,
.mmc button.mmc-cell.is-closed:hover {
	background: color-mix(in srgb, var(--mmc-closed) 10%, var(--mmc-cell));
}

.mmc .mmc-cell.is-closed .mmc-cell__num {
	color: color-mix(in srgb, var(--mmc-closed) 85%, var(--mmc-cell));
}

.mmc .mmc-cell.is-closed .mmc-cell__line {
	color: var(--mmc-closed-ink);
}

.mmc .mmc-cell.is-off {
	background: transparent;
	border: 1px dashed color-mix(in srgb, var(--mmc-ink) 8%, transparent);
	cursor: default;
}

.mmc .mmc-cell.is-off .mmc-cell__num {
	color: color-mix(in srgb, var(--mmc-muted) 60%, var(--mmc-cream));
}

.mmc .mmc-cell.is-past {
	opacity: 0.5;
}

.mmc .mmc-cell.is-today {
	border: 2px solid var(--mmc-gold);
	box-shadow: 0 0 0 3px var(--mmc-ring);
}

.mmc .mmc-cell.is-today.is-event {
	box-shadow: inset 0 3px 0 var(--mmc-event), 0 0 0 3px var(--mmc-ring);
}

.mmc .mmc-cell.is-today .mmc-cell__flag {
	display: block;
}

.mmc .mmc-cell.is-selected,
.mmc button.mmc-cell.is-selected:hover {
	outline: 2px solid var(--mmc-green);
	outline-offset: 1px;
}

/* Arrived from a home page day link */
@keyframes mmc-arrive {
	0% { outline-offset: 1px; outline-color: var(--mmc-gold); }
	50% { outline-offset: 6px; outline-color: var(--mmc-gold); }
	100% { outline-offset: 1px; outline-color: var(--mmc-green); }
}

.mmc .mmc-cell.is-arrived {
	outline-width: 3px;
	animation: mmc-arrive 0.9s ease-in-out 2;
}

.mmc .mmc-month__foot.is-arrived {
	background: color-mix(in srgb, var(--mmc-gold) 22%, var(--mmc-cream-deep));
	transition: background-color 0.6s ease;
}

/* ---------- Footer / details ---------- */

.mmc .mmc-month__foot {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 4px 10px;
	min-height: 48px;
	margin: 0;
	padding: 12px 18px;
	background: var(--mmc-cream-deep);
	border-top: 1px solid var(--mmc-line);
	text-align: center;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.04em;
	line-height: 1.4;
	color: var(--mmc-foot-ink);
}

.mmc .mmc-month__foot strong {
	font-weight: 800;
	color: var(--mmc-green-deep);
}

.mmc .mmc-month__foot.has-detail {
	letter-spacing: 0.01em;
	font-size: 13px;
}

/* Compact cells when a month is narrow (phones, narrow columns) */
@container mmc-month (max-width: 480px) {
	.mmc .mmc-month__head {
		padding: 16px 16px 14px;
	}

	.mmc .mmc-month__name {
		font-size: 28px;
	}

	.mmc .mmc-month__body {
		padding: 14px 8px 8px;
	}

	.mmc .mmc-dow,
	.mmc .mmc-grid {
		gap: 4px;
	}

	.mmc .mmc-dow span {
		font-size: 10px;
		letter-spacing: 0.02em;
	}

	.mmc .mmc-cell {
		align-items: center;
		justify-content: flex-start;
		min-height: 52px;
		padding: 7px 4px 14px;
		border-radius: 7px;
	}

	.mmc .mmc-cell__num {
		font-size: 16px;
	}

	.mmc .mmc-cell__text,
	.mmc .mmc-cell__flag {
		display: none !important;
	}

	.mmc .mmc-cell::after {
		top: auto;
		right: auto;
		bottom: 7px;
		left: 50%;
		transform: translateX(-50%);
	}
}

/* ---------- Home page row: [mm_this_week] ---------- */

.mmc.mmc-week {
	position: relative;
	margin: 0;
	padding: 34px 28px 28px;
	background: radial-gradient(120% 140% at 50% 0%, var(--mmc-night-glow) 0%, var(--mmc-night) 45%, var(--mmc-night-deep) 100%);
	border: 2px solid var(--mmc-gold);
	border-radius: 22px;
	color: var(--mmc-light);
	overflow: hidden;
	box-shadow: 0 24px 50px -24px rgba(0, 0, 0, 0.6);
}

/* String of bulbs along the top edge, tinted from the theme colors */
.mmc.mmc-week::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 16px;
	background:
		radial-gradient(circle at 50% 55%, var(--mmc-gold) 0 3.5px, transparent 4.5px) 0 0 / 112px 16px repeat-x,
		radial-gradient(circle at 50% 55%, color-mix(in srgb, var(--mmc-open) 70%, #fff) 0 3.5px, transparent 4.5px) 28px 0 / 112px 16px repeat-x,
		radial-gradient(circle at 50% 55%, color-mix(in srgb, var(--mmc-event) 75%, #fff) 0 3.5px, transparent 4.5px) 56px 0 / 112px 16px repeat-x,
		radial-gradient(circle at 50% 55%, #cfe6f5 0 3.5px, transparent 4.5px) 84px 0 / 112px 16px repeat-x;
	opacity: 0.9;
	pointer-events: none;
}

.mmc .mmc-week__head {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px 24px;
	margin-bottom: 18px;
}

.mmc.mmc-week.is-ended .mmc-week__head {
	margin-bottom: 0;
}

.mmc .mmc-week__eyebrow {
	margin-bottom: 8px;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.3em;
	text-transform: uppercase;
	color: var(--mmc-gold);
}

.mmc .mmc-week__title {
	font-family: var(--mmc-serif);
	font-size: 34px;
	font-weight: 400;
	line-height: 1.1;
	color: var(--mmc-light);
}

.mmc .mmc-week__link,
.mmc .mmc-week__link:visited {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 11px 18px;
	border-radius: 10px;
	background: var(--mmc-gold);
	color: var(--mmc-gold-ink);
	font-size: 14px;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	box-shadow: 0 8px 18px -10px color-mix(in srgb, var(--mmc-gold) 90%, transparent);
	transition: transform 0.15s ease, background-color 0.15s ease;
}

.mmc .mmc-week__link:hover,
.mmc .mmc-week__link:focus-visible {
	background: var(--mmc-gold-soft);
	color: var(--mmc-gold-ink);
	transform: translateY(-1px);
}

.mmc .mmc-week__cards {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: minmax(136px, 1fr);
	gap: 12px;
	margin: 0 -4px;
	padding: 14px 4px 8px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: thin;
	scrollbar-color: color-mix(in srgb, var(--mmc-gold) 50%, transparent) transparent;
}

.mmc.mmc-week.is-ended .mmc-week__cards {
	display: none;
}

.mmc .mmc-day {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	margin: 0;
	padding: 16px 10px 14px;
	background: var(--mmc-cream);
	border: 1px solid var(--mmc-line);
	border-radius: 14px;
	color: var(--mmc-ink);
	text-align: center;
	scroll-snap-align: start;
}

.mmc .mmc-day:not(.is-shown) {
	display: none;
}

/* Day cards that link to the full calendar */
.mmc a.mmc-day,
.mmc a.mmc-day:visited {
	color: var(--mmc-ink);
	text-decoration: none;
	cursor: pointer;
	transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.mmc a.mmc-day:hover {
	color: var(--mmc-ink);
	transform: translateY(-3px);
	border-color: var(--mmc-gold);
	box-shadow: 0 14px 24px -16px rgba(0, 0, 0, 0.75);
}

.mmc a.mmc-day.is-event:hover {
	box-shadow: inset 0 3px 0 var(--mmc-event), 0 14px 24px -16px rgba(0, 0, 0, 0.75);
}

.mmc a.mmc-day.is-today:hover {
	box-shadow: 0 0 0 4px var(--mmc-ring), 0 14px 24px -16px rgba(0, 0, 0, 0.75);
}

.mmc a.mmc-day:focus {
	outline: none;
}

.mmc a.mmc-day:focus-visible {
	outline: 2px solid var(--mmc-gold);
	outline-offset: 3px;
}

.mmc .mmc-day__dow {
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--mmc-label);
}

.mmc .mmc-day__num {
	margin-top: 2px;
	font-family: var(--mmc-serif);
	font-size: 38px;
	line-height: 1.05;
	color: var(--mmc-ink);
}

.mmc .mmc-day__mon {
	margin-bottom: 10px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--mmc-muted);
}

.mmc .mmc-day__badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 10px;
	border-radius: 999px;
	background: color-mix(in srgb, var(--mmc-soon) 50%, var(--mmc-cream));
	color: var(--mmc-soon-ink);
	font-size: 11px;
	font-weight: 700;
	line-height: 1.3;
	white-space: nowrap;
}

.mmc .mmc-day__badge::before {
	content: "";
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--dot);
}

.mmc .mmc-day.is-soon .mmc-day__badge::before {
	background: color-mix(in srgb, var(--mmc-soon) 70%, var(--mmc-ink));
}

.mmc .mmc-day.is-open .mmc-day__badge {
	background: color-mix(in srgb, var(--mmc-open) 14%, #fff);
	color: var(--mmc-open-ink);
}

.mmc .mmc-day.is-event .mmc-day__badge {
	background: color-mix(in srgb, var(--mmc-event) 13%, #fff);
	color: var(--mmc-event-ink);
}

.mmc .mmc-day.is-closed .mmc-day__badge {
	background: color-mix(in srgb, var(--mmc-closed) 22%, #fff);
	color: var(--mmc-closed-ink);
}

.mmc .mmc-day__hours {
	margin-top: 10px;
	font-size: 13px;
	font-weight: 600;
	color: var(--mmc-ink-soft);
}

.mmc .mmc-day__title {
	margin-top: 4px;
	font-family: var(--mmc-serif);
	font-size: 15px;
	line-height: 1.2;
	color: var(--mmc-event-ink);
}

.mmc .mmc-day.is-open .mmc-day__title {
	color: var(--mmc-green-deep);
}

.mmc .mmc-day__note {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin-top: 6px;
	font-size: 11px;
	line-height: 1.35;
	color: var(--mmc-ink-soft);
}

.mmc .mmc-day.is-event {
	box-shadow: inset 0 3px 0 var(--mmc-event);
}

.mmc .mmc-day.is-closed {
	background: color-mix(in srgb, var(--mmc-closed) 14%, var(--mmc-cream));
}

.mmc .mmc-day.is-closed .mmc-day__num {
	color: color-mix(in srgb, var(--mmc-closed) 85%, var(--mmc-cream));
}

.mmc .mmc-day.is-today {
	border: 2px solid var(--mmc-gold);
	box-shadow: 0 0 0 4px var(--mmc-ring);
}

.mmc .mmc-day.is-today.is-event {
	box-shadow: inset 0 3px 0 var(--mmc-event), 0 0 0 4px var(--mmc-ring);
}

.mmc .mmc-day__flag {
	display: none;
	position: absolute;
	top: -11px;
	left: 50%;
	transform: translateX(-50%);
	padding: 3px 10px;
	border-radius: 999px;
	background: var(--mmc-gold);
	color: var(--mmc-gold-ink);
	font-size: 10px;
	font-weight: 800;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	line-height: 1.3;
	white-space: nowrap;
}

.mmc .mmc-day.is-today .mmc-day__flag {
	display: block;
}

@container mmc (max-width: 560px) {
	.mmc .mmc-week__title {
		font-size: 28px;
	}

	.mmc .mmc-week__head > div {
		flex: 1 1 100%;
	}
}

@media (max-width: 600px) {
	.mmc.mmc-week {
		padding: 30px 16px 20px;
		border-radius: 18px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.mmc *,
	.mmc *::before,
	.mmc *::after {
		transition: none !important;
		animation: none !important;
	}
}
