/* Mago Reels. Reads the theme's tokens when present and works alone otherwise. */
.mhr {
	--mhr-ink: var(--night-ink, #F3F4F7);
	--mhr-muted: var(--night-muted, #AEB2C0);
	--mhr-ground: #0D0F15;
	--mhr-line: rgb(255 255 255 / .18);
	--mhr-display: var(--display, inherit);
	--mhr-radius: 18px;
	--mhr-gut: var(--gut, clamp(1.25rem, 5vw, 5rem));
	--mhr-h: min(66vh, max(680px, 29vw), 136vw);
	--mhr-w: calc(var(--mhr-h) * .5625);
	--mhr-unit: max(var(--mhr-w), 16.4vw); /* The spread widens with very wide screens, so the row always reaches both edges. */
	--mhr-ease: cubic-bezier(.2, .7, .2, 1);
	position: relative;
	isolation: isolate;
	overflow: hidden;
	padding-block: clamp(3.5rem, 7vw, 6rem) clamp(2.5rem, 4vw, 3.5rem);
	background: var(--mhr-ground);
	color: var(--mhr-ink);
}

.mhr *, .mhr-viewer * { box-sizing: border-box; }
.mhr :where(h2, p, ol) { margin: 0; padding: 0; list-style: none; }

/* The room takes the colour of the film */
.mhr__ambient { position: absolute; inset: -12%; z-index: -1; pointer-events: none; }
.mhr__ambient span {
	position: absolute; inset: 0; background-size: cover; background-position: center;
	filter: blur(90px) saturate(1.5) brightness(.42); opacity: 0; transition: opacity 1.2s ease;
}
.mhr__ambient span.is-on { opacity: 1; }
.mhr__ambient::after {
	content: ''; position: absolute; inset: 0;
	background:
		radial-gradient(ellipse 62% 58% at 50% 56%, transparent, rgb(13 15 21 / .72)),
		linear-gradient(180deg, var(--mhr-ground) 8%, rgb(13 15 21 / .25) 34%, rgb(13 15 21 / .25) 70%, var(--mhr-ground) 92%);
}

.mhr__head {
	display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem 2rem;
	max-width: 1440px; margin: 0 auto clamp(1.75rem, 3vw, 2.5rem); padding-inline: var(--mhr-gut);
}
.mhr__title { font: 600 clamp(2.25rem, 5vw, 5rem)/1.04 var(--mhr-display); letter-spacing: -.02em; }
.mhr__intro { max-width: 46ch; margin-top: .75rem; color: var(--mhr-muted); font-size: 1.0625rem; line-height: 1.5; }
.mhr__follow {
	display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; padding: .4rem 1.1rem .4rem .9rem;
	border-radius: 999px; box-shadow: inset 0 0 0 1px var(--mhr-line); color: inherit; font-weight: 600; text-decoration: none;
	transition: background-color .2s, color .2s;
}
.mhr__follow:hover { background: #FFFFFF; color: #000000; }

/* Without JS: a plain rail */
.mhr__stage { outline-offset: 6px; }
.mhr__track { display: flex; gap: 1rem; overflow-x: auto; scroll-snap-type: x mandatory; padding-inline: var(--mhr-gut); }
.mhr__card { flex: 0 0 var(--mhr-w); scroll-snap-align: center; }
.mhr__link {
	position: relative; display: block; width: 100%; aspect-ratio: 9 / 16; overflow: hidden;
	border-radius: var(--mhr-radius); background: #20232F; color: inherit; text-decoration: none;
}
.mhr__poster, .mhr__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.mhr__poster { transition: filter .7s var(--mhr-ease), transform .9s var(--mhr-ease); }
.mhr__video { opacity: 0; transition: opacity .45s ease; }
.mhr__video.is-playing { opacity: 1; }

/* Caption inside the active card */
.mhr__shade {
	position: absolute; inset: auto 0 0; z-index: 2; display: block; padding: 5rem 1.15rem 1.1rem;
	background: linear-gradient(transparent, rgb(0 0 0 / .78)); pointer-events: none;
	transition: opacity .45s ease;
}
.mhr__card-caption { display: -webkit-box; font-size: 1rem; line-height: 1.4; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mhr__card-date { display: block; margin-top: .3rem; font-size: .8125rem; color: #D5D8E0; }

/* Play button: white ground, black icon */
.mhr__play {
	position: absolute; left: 50%; top: 50%; z-index: 3; display: grid; place-items: center;
	width: 76px; height: 76px; margin: -38px 0 0 -38px; border-radius: 50%;
	background: #FFFFFF; color: #000000; box-shadow: 0 12px 30px -8px rgb(0 0 0 / .55);
	transition: opacity .25s ease, transform .3s var(--mhr-ease);
}
.mhr__link:hover .mhr__play { transform: scale(1.08); }
.mhr__link:active .mhr__play { transform: scale(.96); }

/* With JS: the stage */
.mhr-js .mhr .mhr__stage { height: var(--mhr-h); perspective: 2200px; touch-action: pan-y; cursor: grab; user-select: none; }
.mhr-js .mhr .mhr__stage:active { cursor: grabbing; }
.mhr-js .mhr .mhr__track { position: relative; display: block; height: 100%; padding: 0; overflow: visible; }
.mhr-js .mhr .mhr__card {
	position: absolute; left: 50%; top: 0; width: var(--mhr-w); height: var(--mhr-h); margin-left: calc(var(--mhr-w) / -2);
	transform: translate3d(calc(var(--x, 0) * var(--mhr-unit)), 0, 0) rotateY(calc(var(--o, 0) * -3deg)) scale(var(--s, 1));
	transition: transform .8s var(--mhr-ease), opacity .5s ease;
	will-change: transform;
}
.mhr-js .mhr .mhr__card.is-far { opacity: 0; pointer-events: none; }
.mhr-js .mhr .mhr__link { height: 100%; aspect-ratio: auto; cursor: pointer; -webkit-user-drag: none; }
.mhr-js .mhr .mhr__poster { -webkit-user-drag: none; pointer-events: none; }

/* Side cards sit back in the dark; their button stays pure white */
.mhr-js .mhr .mhr__card:not(.is-active) .mhr__poster { filter: brightness(calc(.68 - var(--a, 0) * .08)) saturate(.82); }
.mhr-js .mhr .mhr__card:not(.is-active):hover .mhr__poster { filter: brightness(.88) saturate(.95); }
.mhr-js .mhr .mhr__card:not(.is-active) .mhr__shade { opacity: 0; }
.mhr-js .mhr .mhr__card:not(.is-active) .mhr__play { width: 54px; height: 54px; margin: -27px 0 0 -27px; }
.mhr-js .mhr .mhr__card:not(.is-active) .mhr__play svg { width: 22px; height: 22px; }
.mhr-js .mhr .mhr__card.is-active .mhr__link {
	box-shadow: 0 0 0 1px rgb(255 255 255 / .16), 0 44px 90px -30px rgb(0 0 0 / .9);
}
.mhr-js .mhr .mhr__card.is-playing .mhr__play { opacity: 0; transform: scale(.8); pointer-events: none; }
.mhr-js .mhr .mhr__card.is-playing .mhr__shade { opacity: 0; }

/* Control bar: count, timeline, controls on one line */
.mhr__bar { display: none; }
.mhr-js .mhr .mhr__bar {
	position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.5rem; align-items: center;
	max-width: 980px; margin: clamp(1.25rem, 2.5vw, 1.75rem) auto 0; padding-inline: var(--mhr-gut);
}
.mhr__segments { display: flex; gap: 5px; }
.mhr__segments button {
	position: relative; flex: 1; height: 26px; padding: 0; border: 0; background: none; cursor: pointer;
}
.mhr__segments button::before, .mhr__segments button::after {
	content: ''; position: absolute; left: 0; right: 0; top: 12px; height: 2px; border-radius: 2px;
}
.mhr__segments button::before { background: var(--mhr-line); transition: background-color .2s; }
.mhr__segments button:hover::before { background: rgb(255 255 255 / .45); }
.mhr__segments button::after { background: #FFFFFF; transform: scaleX(var(--p, 0)); transform-origin: 0 50%; }
.mhr__segments button:focus-visible { outline: 2px solid var(--mhr-ink); outline-offset: -2px; border-radius: 4px; }
.mhr__controls { display: flex; align-items: center; gap: .15rem; }
.mhr__btn {
	display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%;
	background: transparent; color: inherit; cursor: pointer; transition: background-color .2s, color .2s, transform .15s var(--mhr-ease);
}
.mhr__btn:hover { background: rgb(255 255 255 / .12); }
.mhr__btn:active { transform: scale(.94); }
/* The slideshow control is an outlined pill, unlike the solid round buttons on the cards */
.mhr__btn--main {
	display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
	width: auto; min-width: 116px; padding: 0 1.1rem 0 .85rem; border-radius: 999px;
	box-shadow: inset 0 0 0 1.5px rgb(255 255 255 / .55);
	font: 600 .9375rem/1 inherit; font-family: inherit;
}
.mhr__btn--main[hidden] { display: none; }
.mhr__btn--main:hover { background: rgb(255 255 255 / .12); box-shadow: inset 0 0 0 1.5px #FFFFFF; }
.mhr__btn--main svg { width: 18px; height: 18px; }
.mhr__l-play { display: none; }
[aria-pressed='true'] > .mhr__l-pause { display: none; }
[aria-pressed='true'] > .mhr__l-play { display: inline; }
.mhr__btn:focus-visible, .mhr__stage:focus-visible, .mhr__link:focus-visible, .mhr__follow:focus-visible { outline: 2px solid var(--mhr-ink); outline-offset: 3px; }
.mhr__i-play, .mhr__i-on { display: none; }
[aria-pressed='true'] > .mhr__i-pause { display: none; }
[aria-pressed='true'] > .mhr__i-play { display: block; }
[aria-pressed='true'] > .mhr__i-off { display: none; }
[aria-pressed='true'] > .mhr__i-on { display: block; }
.mhr__live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Viewer */
.mhr-viewer {
	position: fixed; inset: 0; width: 100%; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0;
	background: #0B0C11; color: #F3F4F7; overflow: hidden;
}
.mhr-viewer::backdrop { background: #0B0C11; }
.mhr-viewer__ambient { position: absolute; inset: -10%; background-size: cover; background-position: center; filter: blur(90px) brightness(.34) saturate(1.4); }
.mhr-viewer__frame {
	position: absolute; left: 50%; top: 50%; height: min(100dvh, 177.78vw); aspect-ratio: 9 / 16; transform: translate(-50%, -50%); overflow: hidden; background: #000; touch-action: none;
}
.mhr-viewer__frame video, .mhr-viewer__frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.mhr-viewer__frame video { background: transparent; }
.mhr-viewer__shade { position: absolute; inset: auto 0 0; padding: 4rem 1.25rem 1.25rem; background: linear-gradient(transparent, rgb(0 0 0 / .78)); }
.mhr-viewer__caption { margin: 0; font-size: 1rem; line-height: 1.45; max-height: 6.5em; overflow-y: auto; }
.mhr-viewer__foot { display: flex; justify-content: space-between; gap: 1rem; margin-top: .6rem; font-size: .875rem; color: #C9CCD6; }
.mhr-viewer__foot a { color: #fff; font-weight: 600; text-decoration: underline; text-underline-offset: .2em; }
.mhr-viewer__progress { position: absolute; inset: 0 0 auto; height: 3px; background: rgb(255 255 255 / .22); }
.mhr-viewer__progress span { display: block; height: 100%; background: #fff; transform: scaleX(0); transform-origin: 0 50%; }
.mhr-viewer__center { position: absolute; left: 50%; top: 50%; display: grid; place-items: center; width: 76px; height: 76px; margin: -38px 0 0 -38px; border-radius: 50%; background: #FFFFFF; color: #000000; opacity: 0; pointer-events: none; transition: opacity .2s; }
.mhr-viewer.is-paused .mhr-viewer__center { opacity: 1; }
.mhr-viewer__msg { position: absolute; inset: 40% 1.5rem auto; padding: 1rem; border-radius: 12px; background: rgb(0 0 0 / .72); text-align: center; }
.mhr-viewer__msg a { color: #fff; text-decoration: underline; }
.mhr-viewer__tools { position: absolute; top: 1rem; right: 1rem; display: flex; gap: .4rem; z-index: 2; }
.mhr-viewer__side { position: absolute; top: 50%; right: 1.25rem; transform: translateY(-50%); display: flex; flex-direction: column; gap: .5rem; z-index: 2; }
.mhr-viewer .mhr__btn { background: rgb(19 21 29 / .62); color: #fff; }
.mhr-viewer .mhr__btn:hover { background: rgb(19 21 29 / .9); }
.mhr-viewer .mhr__btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.mhr-admin-note { padding: 1rem; background: #FFF4CE; color: #13151D; }

@media (max-width: 800px) {
	.mhr { --mhr-h: min(58vh, 136vw); }
	.mhr__head { align-items: flex-start; flex-direction: column; }
	.mhr__play { width: 68px; height: 68px; margin: -34px 0 0 -34px; }
	.mhr-js .mhr .mhr__bar { grid-template-columns: minmax(0, 1fr); gap: .5rem; }
	.mhr__controls { grid-column: 1 / -1; justify-content: center; }
	.mhr__btn--main { min-width: 44px; width: 44px; padding: 0; }
	.mhr__l-play, .mhr__l-pause, [aria-pressed='true'] > .mhr__l-play { display: none; }
	.mhr-viewer__side { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	.mhr *, .mhr-viewer * { transition-duration: .01ms !important; }
}
