/**
 * MRMVR Elements — Channel Showcase.
 *
 * A photograph with a frosted card of booking-channel logos floating over its
 * edge, beside a content panel. The card is held in the same grid cell as the
 * photograph and pushed out past its edge by a negative margin, so it always
 * straddles the seam however wide the widget is.
 *
 * Sizes itself against its own container rather than the viewport.
 *
 * @package MRMVR\Elements
 * @since   1.50.0
 */

.mrx-chan-wrap {
	container-type: inline-size;
	container-name: mrxc;
	min-height: 0;
}

.mrx-chan {
	/* Layout */
	--mrx-c-media-w: 64%;
	--mrx-c-min-h: 560px;
	--mrx-c-overlap: 46px;
	--mrx-c-cols: 2;
	--mrx-c-card-w: clamp(300px, 34cqi, 520px);
	--mrx-c-radius: 28px;

	/* Colour */
	--mrx-c-panel-bg: var(--mrmvr-blush-soft, #f9e9e0);
	--mrx-c-card-bg: rgba(253, 248, 245, .86);
	--mrx-c-tile-bg: rgba(255, 255, 255, .92);
	--mrx-c-tile-line: rgba(207, 161, 144, .3);
	--mrx-c-accent: var(--mrmvr-amber, #f57528);
	--mrx-c-title: var(--mrmvr-navy, #1a2142);
	--mrx-c-text: var(--mrmvr-navy, #1a2142);

	position: relative;
	display: grid;
	grid-template-columns: var(--mrx-c-media-w) minmax(0, 1fr);
	grid-template-areas: "stage panel";
	min-height: var(--mrx-c-min-h);
	background:
		radial-gradient(120% 90% at 100% 0%, rgba(255, 255, 255, .55), transparent 60%),
		var(--mrx-c-panel-bg);
	border: 1px solid rgba(207, 161, 144, .3);
	border-radius: var(--mrx-c-radius);
	overflow: hidden;
	isolation: isolate;
	font-family: var(--mrmvr-font-body, "Jost", sans-serif);
	box-shadow: 0 40px 80px -52px rgba(26, 33, 66, .45);
}

.mrx-chan-side-right .mrx-chan {
	grid-template-columns: minmax(0, 1fr) var(--mrx-c-media-w);
	grid-template-areas: "panel stage";
}

/* -------------------------------------------------------------------------
 * Stage — photograph and floating card
 * ---------------------------------------------------------------------- */

.mrx-chan__stage {
	position: relative;
	z-index: 2;
	grid-area: stage;
	display: grid;
	align-items: center;
	justify-items: end;
	padding: clamp(24px, 4cqi, 52px) 0;
	padding-inline-end: 0;
}

.mrx-chan-side-right .mrx-chan__stage {
	justify-items: start;
}

.mrx-chan__bg {
	position: absolute;
	inset: 0;
	z-index: 0;
	overflow: hidden;
	background: linear-gradient(135deg, #e9c9bb, #cfa190 55%, #b98674);
}

.mrx-chan__bg img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	transform: scale(1.001);
	transition: transform 1600ms var(--mrmvr-ease, cubic-bezier(.22, .61, .36, 1));
}

.mrx-chan:hover .mrx-chan__bg img {
	transform: scale(1.045);
}

/* A whisper of shade so the card keeps its edge on a bright photograph. */
.mrx-chan__bg::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(90deg, rgba(26, 33, 66, .1), rgba(26, 33, 66, 0) 55%);
	pointer-events: none;
}

.mrx-chan-side-right .mrx-chan__bg::after {
	background: linear-gradient(270deg, rgba(26, 33, 66, .1), rgba(26, 33, 66, 0) 55%);
}

/* -------------------------------------------------------------------------
 * Card
 * ---------------------------------------------------------------------- */

.mrx-chan__card {
	position: relative;
	z-index: 1;
	box-sizing: border-box;
	width: var(--mrx-c-card-w);
	max-width: calc(100% - 32px);
	margin-inline-end: calc(var(--mrx-c-overlap) * -1);
	padding: clamp(16px, 2cqi, 28px);
	background: var(--mrx-c-card-bg);
	-webkit-backdrop-filter: blur(22px) saturate(1.3);
	backdrop-filter: blur(22px) saturate(1.3);
	border: 1px solid rgba(255, 255, 255, .75);
	border-radius: 24px;
	box-shadow:
		0 1px 0 rgba(255, 255, 255, .9) inset,
		0 40px 70px -30px rgba(26, 33, 66, .5),
		0 12px 24px -14px rgba(26, 33, 66, .25);
}

.mrx-chan-side-right .mrx-chan__card {
	margin-inline-end: 0;
	margin-inline-start: calc(var(--mrx-c-overlap) * -1);
}

.mrx-chan__card-heading {
	margin: 0 0 14px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .22em;
	text-transform: uppercase;
	text-align: center;
	color: var(--mrmvr-clay-deep, #c08e82);
}

.mrx-chan__tiles {
	display: grid;
	grid-template-columns: repeat(var(--mrx-c-cols), minmax(0, 1fr));
	gap: clamp(8px, 1cqi, 12px);
	margin: 0;
	padding: 0;
	list-style: none;
}

.mrx-chan__tiles li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.mrx-chan__tile {
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 100%;
	min-height: clamp(66px, 7.4cqi, 112px);
	padding: 10px 14px;
	background: var(--mrx-c-tile-bg);
	border: 1px solid var(--mrx-c-tile-line);
	border-radius: 14px;
	text-decoration: none;
	transition:
		transform 400ms var(--mrmvr-ease, ease),
		box-shadow 400ms var(--mrmvr-ease, ease),
		border-color 400ms var(--mrmvr-ease, ease);
}

a.mrx-chan__tile:hover,
a.mrx-chan__tile:focus-visible,
.mrx-chan__tiles li:hover .mrx-chan__tile {
	transform: translateY(-3px);
	border-color: rgba(207, 161, 144, .7);
	box-shadow: 0 18px 28px -18px rgba(26, 33, 66, .45);
}

.mrx-chan__logo {
	display: block;
	width: auto;
	max-width: 88%;
	height: auto;
	max-height: clamp(32px, 4cqi, 52px);
	object-fit: contain;
}

/* Until a logo is uploaded the channel's name stands in as a wordmark. */
.mrx-chan__wordmark {
	font-size: clamp(14px, 1.7cqi, 19px);
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	color: var(--mrx-c-title);
}

.mrx-chan__card-foot {
	margin-top: 16px;
	padding-top: 14px;
	text-align: center;
	border-top: 1px solid rgba(207, 161, 144, .3);
}

.mrx-chan__note {
	margin: 0 0 8px;
	font-size: clamp(13px, 1.4cqi, 15px);
	line-height: 1.5;
	color: var(--mrx-c-text);
}

/* -------------------------------------------------------------------------
 * Links with a circled arrow
 * ---------------------------------------------------------------------- */

.mrx-chan__link,
.mrx-chan__button {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: var(--mrx-c-accent);
	font-weight: 500;
	text-decoration: none;
	transition: color 300ms ease;
}

.mrx-chan__link {
	font-size: clamp(13px, 1.4cqi, 15px);
}

.mrx-chan__link .mrx-chan__link-text {
	text-decoration: underline;
	text-underline-offset: 3px;
	text-decoration-thickness: 1px;
}

.mrx-chan__button {
	margin-top: clamp(20px, 2.6cqi, 34px);
	font-size: clamp(17px, 1.9cqi, 21px);
	font-weight: 600;
	letter-spacing: .01em;
}

.mrx-chan__arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 30px;
	height: 30px;
	border: 1.5px solid currentColor;
	border-radius: 50%;
	transition: transform 400ms var(--mrmvr-ease, ease), background-color 300ms ease, color 300ms ease;
}

.mrx-chan__button .mrx-chan__arrow {
	width: 38px;
	height: 38px;
}

.mrx-chan__link:hover .mrx-chan__arrow,
.mrx-chan__button:hover .mrx-chan__arrow,
.mrx-chan__link:focus-visible .mrx-chan__arrow,
.mrx-chan__button:focus-visible .mrx-chan__arrow {
	transform: translateX(5px);
	background-color: var(--mrx-c-accent);
	color: #fff;
}

.mrx-chan__link:focus-visible,
.mrx-chan__button:focus-visible,
.mrx-chan__tile:focus-visible {
	outline: 2px solid var(--mrx-c-accent);
	outline-offset: 4px;
}

/* -------------------------------------------------------------------------
 * Panel
 * ---------------------------------------------------------------------- */

.mrx-chan__panel {
	grid-area: panel;
	z-index: 1;
	align-self: center;
	box-sizing: border-box;
	padding: clamp(28px, 4.5cqi, 64px);
	padding-inline-start: calc(var(--mrx-c-overlap) + clamp(24px, 3.6cqi, 52px));
}

.mrx-chan-side-right .mrx-chan__panel {
	padding-inline-start: clamp(28px, 4.5cqi, 64px);
	padding-inline-end: calc(var(--mrx-c-overlap) + clamp(24px, 3.6cqi, 52px));
}

.mrx-chan__eyebrow {
	display: block;
	margin-bottom: 14px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .24em;
	text-transform: uppercase;
	color: var(--mrx-c-accent);
}

.mrx-chan__title {
	margin: 0;
	font-family: var(--mrmvr-font-display, "Cormorant Garamond", serif);
	font-size: clamp(32px, 4.2cqi, 56px);
	font-weight: 600;
	line-height: 1.05;
	letter-spacing: -.01em;
	color: var(--mrx-c-title);
}

.mrx-chan__title::after {
	content: "";
	display: block;
	width: 56px;
	height: 2px;
	margin-top: 18px;
	background: linear-gradient(90deg, var(--mrmvr-clay, #cfa190), transparent);
}

.mrx-chan__text {
	margin: clamp(16px, 2cqi, 26px) 0 0;
	max-width: 36ch;
	font-size: clamp(16px, 1.75cqi, 20px);
	line-height: 1.7;
	color: var(--mrx-c-text);
}

/* -------------------------------------------------------------------------
 * Narrow containers — photograph on top, card inside it, panel below
 * ---------------------------------------------------------------------- */

@container mrxc (max-width: 780px) {
	.mrx-chan,
	.mrx-chan-side-right .mrx-chan {
		grid-template-columns: minmax(0, 1fr);
		grid-template-areas:
			"stage"
			"panel";
		min-height: 0;
	}

	.mrx-chan__stage,
	.mrx-chan-side-right .mrx-chan__stage {
		justify-items: center;
		padding: 36px 18px;
	}

	.mrx-chan__card,
	.mrx-chan-side-right .mrx-chan__card {
		width: 100%;
		max-width: 520px;
		margin-inline: 0;
	}

	.mrx-chan__tile {
		min-height: 64px;
	}

	.mrx-chan__logo {
		max-height: 34px;
	}

	.mrx-chan__wordmark {
		font-size: 14px;
	}

	.mrx-chan__panel,
	.mrx-chan-side-right .mrx-chan__panel {
		padding: 30px 24px 36px;
	}

	.mrx-chan__title {
		font-size: 34px;
	}

	.mrx-chan__text {
		font-size: 17px;
		max-width: none;
	}

	.mrx-chan__button {
		font-size: 18px;
	}

	.mrx-chan__link {
		font-size: 14px;
	}

	.mrx-chan__note {
		font-size: 14px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.mrx-chan__bg img,
	.mrx-chan__tile,
	.mrx-chan__arrow {
		transition: none;
	}

	.mrx-chan:hover .mrx-chan__bg img {
		transform: none;
	}
}
