/* Listings — cards. Loaded FIRST: later sheets position against this grid.
   Cascade order is fixed in ListingsModule::STYLES; read colours from --mf-* tokens only. */

.mf-event-grid,
.mf-archive,
.mf-single,
.mf-session-modal {
	font-family: var(--mf-font);
}

/* Scroll lock for the filter drawer AND the contact, session and favourites popups (here: single pages skip archive.css).
   Lock html too: once the root has its own overflow (single event's overflow-x: clip), body's no longer stops the page. */
html:has(body.mf-filters-locked),
body.mf-filters-locked {
	overflow: hidden;
}

.mf-event-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 28px;
	width: 100%;
}

.mf-archive .mf-event-grid {
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 24px;
}

@media (max-width: 1200px) {
	.mf-archive .mf-event-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 900px) {
	.mf-archive .mf-event-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	.mf-event-grid,
	.mf-archive .mf-event-grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 18px;
	}
}

/* card */

.mf-event-card {
	background: var(--mf-card-bg);
	border: 1px solid var(--mf-line);
	border-radius: var(--mf-radius);
	box-shadow: var(--mf-shadow);
	overflow: hidden;
	transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
	height: 100%;
}

.mf-event-card:hover {
	transform: translateY(-3px);
	box-shadow: var(--mf-shadow-hover);
	border-color: var(--mf-blue);
}

.mf-event-card__link {
	display: flex;
	flex-direction: column;
	height: 100%;
	text-decoration: none;
	color: inherit;
}

/* The whole card is one <a>, and text-decoration can't be cancelled by a descendant —
   beat the theme underline here, on the anchor itself. */
.mf-event-card a.mf-event-card__link,
.mf-event-card a.mf-event-card__link:hover,
.mf-event-card a.mf-event-card__link:focus,
.mf-event-card a.mf-event-card__link:visited {
	text-decoration: none;
}

/* media */

.mf-event-card__media {
	position: relative;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: var(--mf-light-blue);
}

.mf-event-card__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.4s ease;
}

.mf-event-card:hover .mf-event-card__img {
	transform: scale(1.04);
}

.mf-event-card__img--placeholder {
	background: linear-gradient(135deg, var(--mf-light-blue), var(--mf-mid-blue));
}

/* body */

.mf-event-card__body {
	padding: 20px 22px 8px;
	flex: 1 1 auto;
	text-align: center;
}

.mf-event-card__title {
	margin: 0 0 10px;
	font-size: 1.18rem;
	line-height: 1.3;
	font-weight: 700;
	color: var(--mf-navy);
}

.mf-event-card__desc {
	margin: 0;
	font-size: 0.95rem;
	line-height: 1.55;
	color: var(--mf-ink);
}

/* meta footer */

.mf-event-card__meta {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	border-top: 1px solid var(--mf-line);
	margin-top: 16px;
}

/* No min price → price cell omitted, footer collapses to two columns. */
.mf-event-card__meta--no-price {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mf-event-card__meta-cell {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2px;
	padding: 14px 8px;
	text-align: center;
	min-height: 64px;
}

.mf-event-card__meta-cell + .mf-event-card__meta-cell {
	border-left: 1px solid var(--mf-line);
}

.mf-event-card__meta-label {
	font-size: 0.72rem;
	line-height: 1.2;
	color: var(--mf-muted);
	text-transform: none;
}

.mf-event-card__meta-value {
	font-size: 0.92rem;
	line-height: 1.25;
	font-weight: 600;
	color: var(--mf-navy);
}

.mf-event-card__meta-value--sub {
	font-weight: 500;
	color: var(--mf-ink);
}

.mf-event-card__meta-cell--price .mf-event-card__meta-value {
	white-space: nowrap;
}

/* empty */

.mf-event-grid__empty {
	grid-column: 1 / -1;
	text-align: center;
	color: var(--mf-muted);
	padding: 40px 0;
}

/* Coach card — reuses .mf-event-grid; only the internals differ. */

.mf-coach-card {
	background: var(--mf-card-bg);
	border: 1px solid var(--mf-line);
	border-radius: var(--mf-radius);
	box-shadow: var(--mf-shadow);
	overflow: hidden;
	transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
	height: 100%;
}

.mf-coach-card:hover {
	transform: translateY(-3px);
	box-shadow: var(--mf-shadow-hover);
	border-color: var(--mf-blue);
}

.mf-coach-card__link {
	display: flex;
	flex-direction: column;
	height: 100%;
	text-decoration: none;
	color: inherit;
}

/* Same inherited-underline problem as .mf-event-card__link — see the note there. */
.mf-coach-card a.mf-coach-card__link,
.mf-coach-card a.mf-coach-card__link:hover,
.mf-coach-card a.mf-coach-card__link:focus,
.mf-coach-card a.mf-coach-card__link:visited {
	text-decoration: none;
}

.mf-coach-card__media {
	position: relative;
	overflow: hidden;
	background: var(--mf-light-blue);
	/* Don't let the column flex layout shrink the banner. */
	flex: 0 0 auto;
	width: 100%;
	aspect-ratio: 16 / 12;
}

/* Fallback for engines that drop aspect-ratio on a flex item: padding-top ratio. */
@supports not (aspect-ratio: 1 / 1) {
	.mf-coach-card__media::before {
		content: "";
		display: block;
		padding-top: 75%; /* 12 / 16 */
	}
}

.mf-coach-card__img {
	/* Inset 0, not width/height 100%: in a flex child the intrinsic height can win. */
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	display: block;

	/* ONE variable drives base crop AND hover zoom, so two transforms never fight. */
	--mf-coach-zoom: 1;
	transform: scale(var(--mf-coach-zoom));
	transition: transform 0.4s ease;

	/* Portraits in a 4:3 box: anchor near the TOP so the crop never cuts the head. */
	--mf-coach-anchor: 15%;
	object-fit: cover;
	object-position: center var(--mf-coach-anchor);
	transform-origin: center var(--mf-coach-anchor);
}

/* Zoom past cover: headshots arrive shot wide. */
.mf-coach-card__media--cover .mf-coach-card__img {
	--mf-coach-zoom: 1.16;
}

.mf-coach-card__media--contain {
	background: var(--mf-light-blue);
}

.mf-coach-card__media--contain .mf-coach-card__img {
	object-fit: contain;
	object-position: center center;
	padding: 14px;
}

/* Scoped to --cover: a contained logo never zooms. */
.mf-coach-card:hover .mf-coach-card__media--cover .mf-coach-card__img {
	--mf-coach-zoom: 1.22;
}

/* Phones: a full-width card doesn't need the extra zoom. */
@media (max-width: 640px) {
	.mf-coach-card__media--cover .mf-coach-card__img,
	.mf-coach-card:hover .mf-coach-card__media--cover .mf-coach-card__img {
		--mf-coach-zoom: 1.08;
	}
}

.mf-coach-card__img--placeholder {
	background: linear-gradient(135deg, var(--mf-light-blue), var(--mf-mid-blue));
}

.mf-coach-card__body {
	padding: 16px 18px 20px;
	display: flex;
	flex-direction: column;
	gap: 9px;
	flex: 1 1 auto;
}

.mf-coach-card__name {
	margin: 0;
	font-size: 1.12rem;
	font-weight: 700;
	color: var(--mf-navy);
	line-height: 1.25;
}

.mf-coach-card__where {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: -3px 0 0;
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--mf-blue-deep);
}

.mf-coach-card__pin {
	width: 14px;
	height: 14px;
	flex: 0 0 auto;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
}

.mf-coach-card__desc {
	margin: 0;
	font-size: 0.9rem;
	line-height: 1.55;
	color: var(--mf-ink);
}

/* margin-top:auto pins tags to the bottom so they line up across a row. */
.mf-coach-card__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: auto;
	padding-top: 4px;
}

.mf-coach-card__tag {
	display: inline-block;
	padding: 4px 10px;
	border-radius: 999px;
	background: var(--mf-sky-1);
	color: var(--mf-navy);
	border: 1px solid var(--mf-sky-2);
	font-size: 0.72rem;
	font-weight: 600;
	line-height: 1.3;
}
