/* ==================================================================
   Mirror Hall — Instagram Feed — assets/css/mirror-hall.css
   Everything is namespaced under .mhi-root so it can never collide with
   the active theme or other plugins.
   ================================================================== */

.mhi-root {
	position: relative;
	background: var(--mhi-bg, #0a0a0a);
	padding: 0;
	overflow: hidden;
	color: #f5f3ef;
	text-align: left;
	isolation: isolate;
	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Follows the site's light/dark toggle (arena-casino theme sets
   data-theme on <html>) in preference to the admin's configured
   background_color — a more specific selector than the rule above, so it
   wins in the cascade without needing !important, even though --mhi-bg
   itself is set inline per-instance. */
html[data-theme="light"] .mhi-root {
	background: #f3ede4;
}

.mhi-root *,
.mhi-root *::before,
.mhi-root *::after {
	box-sizing: border-box;
}

/* ---------------- Header ---------------- */

.mhi-header {
	padding: clamp(32px, 6vw, 64px) clamp(20px, 5vw, 64px) 0;
	text-align: center;
}

.mhi-title {
	margin: 0 0 12px;
	font-size: clamp(22px, 3vw, 32px);
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #f5f3ef;
}

.mhi-subtitle {
	margin: 0 auto;
	max-width: 640px;
	font-size: clamp(14px, 1.6vw, 17px);
	line-height: 1.6;
	color: #f5f3ef;
}

/* Same light/dark toggle as .mhi-root above: white copy on the dark
   background, black copy once the site flips to light mode. */
html[data-theme="light"] .mhi-title,
html[data-theme="light"] .mhi-subtitle {
	color: #000;
}

/* ---------------- 3D stage ---------------- */

.mhi-stage {
	position: relative;
	height: clamp(500px, 54vw, 660px);
	perspective: 1600px;
	perspective-origin: 50% 40%;
	/* Desktop is driven by plain hover (mousemove), not click-drag, so no
	   grab cursor here — the page scrolls completely natively past this
	   section. Touch still drags/swipes, so vertical panning is left to
	   the browser (pan-y) while JS reads horizontal touch movement. */
	touch-action: pan-y;
	-webkit-user-select: none;
	user-select: none;
}

@media (hover: hover) and (pointer: fine) {
	.mhi-stage {
		cursor: ew-resize;
	}
}

.mhi-track {
	position: absolute;
	inset: 0;
	transform-style: preserve-3d;
}

.mhi-card {
	position: absolute;
	top: 50%;
	left: 50%;
	width: min(400px, 68vw);
	aspect-ratio: 4 / 5;
	display: flex;
	flex-direction: column;
	border-radius: var(--mhi-radius, 20px);
	overflow: hidden;
	background: #141210;
	border: 1px solid rgba(232, 198, 117, 0.18);
	box-shadow: 0 30px 60px rgba(0, 0, 0, 0.55);
	text-decoration: none;
	color: inherit;
	backface-visibility: hidden;
	will-change: transform, opacity;
	/* No transform here on purpose — GSAP owns it completely (including the
	   -50%/-50% self-centering, via xPercent/yPercent in mirror-hall.js).
	   An inline style GSAP writes would silently override a CSS transform
	   here anyway, so declaring one in both places would just be
	   misleading about which one is actually in effect. */
}

.mhi-card:focus-visible {
	outline: 2px solid #e8c675;
	outline-offset: 3px;
}

.mhi-card__header {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 14px;
	background: rgba(10, 9, 8, 0.92);
	flex: 0 0 auto;
}

.mhi-card__avatar {
	width: 30px;
	height: 30px;
	border-radius: 50%;
	object-fit: cover;
	border: 1px solid rgba(232, 198, 117, 0.4);
	flex: 0 0 auto;
}

.mhi-card__meta {
	flex: 1 1 auto;
	min-width: 0;
	text-align: left;
	display: flex;
	flex-direction: column;
	line-height: 1.25;
}

.mhi-card__username {
	font-weight: 600;
	font-size: 12.5px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.mhi-card__time {
	font-size: 11px;
	color: rgba(245, 243, 239, 0.5);
}

.mhi-card__ig-icon {
	width: 18px;
	height: 18px;
	color: #e8c675;
	flex: 0 0 auto;
}

.mhi-card__media {
	position: relative;
	flex: 1 1 auto;
	min-height: 0;
	display: block;
	background: #0a0908;
}

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

.mhi-card__play {
	position: absolute;
	inset: 0;
	margin: auto;
	width: 46px;
	height: 46px;
	border-radius: 50%;
	background: rgba(10, 9, 8, 0.5);
	border: 1.5px solid rgba(245, 243, 239, 0.85);
	pointer-events: none;
}

.mhi-card__play::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 54%;
	transform: translate(-50%, -50%);
	border-style: solid;
	border-width: 8px 0 8px 13px;
	border-color: transparent transparent transparent rgba(245, 243, 239, 0.95);
}

.mhi-card__stack {
	position: absolute;
	top: 10px;
	right: 10px;
	width: 18px;
	height: 18px;
	border-radius: 5px;
	border: 1.5px solid rgba(245, 243, 239, 0.9);
	background: rgba(10, 9, 8, 0.35);
	box-shadow: -3px 3px 0 -1px rgba(10, 9, 8, 0.5), -3px 3px 0 0 rgba(245, 243, 239, 0.5);
	pointer-events: none;
}

/* ---------------- Reflection ---------------- */

.mhi-card__reflection {
	position: absolute;
	top: 100%;
	left: 0;
	width: 100%;
	height: 55%;
	display: block;
	overflow: hidden;
	border-radius: inherit;
	transform: scaleY(-1);
	opacity: 0.45;
	pointer-events: none;
	-webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.35), transparent 78%);
	mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.35), transparent 78%);
}

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

.mhi-root--no-reflection .mhi-card__reflection {
	display: none;
}

/* ---------------- Reduced-motion / no-JS fallback ---------------- */
/* mhi-root--static is applied by JS itself when prefers-reduced-motion
   matches, or as the initial state before JS has finished building the 3D
   stage — either way, this is a fully usable horizontally-scrolling strip,
   never an empty section. */

.mhi-root--static .mhi-stage {
	height: auto;
	perspective: none;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x proximity;
	-webkit-overflow-scrolling: touch;
	padding: 4px;
}

.mhi-root--static .mhi-track {
	position: static;
	display: flex;
	gap: 20px;
	justify-content: flex-start;
	transform-style: flat;
	width: max-content;
	margin: 0 auto;
}

.mhi-root--static .mhi-card {
	position: static;
	transform: none !important;
	opacity: 1 !important;
	scroll-snap-align: center;
	flex: 0 0 auto;
	width: 260px;
}

.mhi-root--static .mhi-card__reflection {
	display: none;
}

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

@media (max-width: 1024px) {
	.mhi-root {
		padding: 0;
	}

	.mhi-stage {
		height: clamp(420px, 66vw, 560px);
		perspective: 1200px;
	}

	.mhi-card {
		width: min(340px, 74vw);
	}
}

@media (max-width: 640px) {
	.mhi-root {
		padding: 0;
	}

	.mhi-stage {
		height: clamp(380px, 90vw, 480px);
		perspective: 900px;
	}

	.mhi-card {
		width: min(280px, 80vw);
	}
}

@media (prefers-reduced-motion: reduce) {
	.mhi-card {
		transition: none !important;
	}
}
