/*
 * _proekt-fan.css - single project fan gallery variant.
 *
 * Split by ADR-023 file-per-section guard.
 */

/* Single case hero fan gallery. Vanilla adaptation of the card-fan idea. */
.mh__proekt-hero {
	grid-template-columns: minmax(0, 0.82fr) minmax(420px, 1.18fr);
	min-height: clamp(560px, 68vh, 760px);
	align-items: center;
	overflow: hidden;
}

.mh__proekt-hero-media {
	position: relative;
	display: block;
	align-self: center;
	justify-self: stretch;
	max-width: min(820px, 100%);
	min-height: clamp(420px, 44vw, 620px);
	overflow: visible;
}

.mh__proekt-fan {
	position: relative;
	display: grid;
	grid-template-rows: 1fr auto;
	gap: 18px;
	min-height: inherit;
}

.mh__proekt-fan-stage {
	position: relative;
	min-height: clamp(390px, 40vw, 560px);
	overflow: visible;
	isolation: isolate;
}

.mh__proekt-fan-stage::before {
	content: "";
	position: absolute;
	inset: 9% 2% 7%;
	z-index: 0;
	background:
		linear-gradient(90deg, rgba(var(--rgb-paper, 248, 244, 236), 0), rgba(var(--rgb-paper, 248, 244, 236), 0.78) 50%, rgba(var(--rgb-paper, 248, 244, 236), 0)),
		repeating-linear-gradient(135deg, rgba(var(--rgb-graphite-900, 26, 26, 26), 0.045) 0 1px, transparent 1px 12px);
	border-top: 1px solid rgba(var(--rgb-graphite-900, 26, 26, 26), 0.16);
	border-bottom: 1px solid rgba(var(--rgb-graphite-900, 26, 26, 26), 0.16);
	opacity: 0.62;
	pointer-events: none;
}

.mh__proekt-hero-shot {
	--fan-x: 0px;
	--fan-y: 0px;
	--fan-rot: 0deg;
	--fan-scale: 1;
	position: absolute;
	top: 50%;
	left: 50%;
	width: clamp(245px, 23vw, 340px);
	height: clamp(340px, 37vw, 520px);
	padding: 0;
	border: 1px solid rgba(var(--rgb-graphite-900, 26, 26, 26), 0.28);
	border-radius: 0;
	background: var(--paper);
	box-shadow: 0 26px 64px rgba(var(--rgb-graphite-900, 26, 26, 26), 0.18);
	cursor: zoom-in;
	overflow: hidden;
	transform:
		translate(-50%, -50%)
		translate(var(--fan-x), var(--fan-y))
		rotate(var(--fan-rot))
		scale(var(--fan-scale));
	transform-origin: 50% 72%;
	opacity: 0.72;
	filter: saturate(0.86) contrast(0.96);
	transition:
		transform 420ms cubic-bezier(0.2, 0.8, 0.2, 1),
		opacity 240ms ease,
		filter 240ms ease,
		box-shadow 240ms ease,
		border-color 240ms ease;
}

.mh__proekt-hero-shot img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 420ms var(--ease-out, ease);
}

.mh__proekt-hero-shot.is-active {
	opacity: 1;
	filter: none;
	border-color: var(--accent);
	box-shadow: 0 34px 80px rgba(var(--rgb-graphite-900, 26, 26, 26), 0.24);
}

.mh__proekt-hero-shot.is-active img {
	transform: scale(1.015);
}

.mh__proekt-hero-shot:not(.is-active) {
	cursor: pointer;
}

.mh__proekt-hero-shot.is-hidden {
	opacity: 0;
	pointer-events: none;
	filter: blur(3px);
}

.mh__proekt-hero-shot-num {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 2;
	padding: 6px 8px 5px;
	background: rgba(var(--rgb-graphite-900, 26, 26, 26), 0.88);
	color: var(--paper);
	font-size: var(--text-mono-3xs);
	line-height: 1;
	letter-spacing: 0.08em;
}

.mh__proekt-fan-controls {
	position: relative;
	z-index: 20;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
}

.mh__proekt-fan-arrow {
	appearance: none;
	display: grid;
	place-items: center;
	width: 42px;
	height: 42px;
	border: 1px solid rgba(var(--rgb-graphite-900, 26, 26, 26), 0.28);
	border-radius: 0;
	background: rgba(var(--rgb-paper, 248, 244, 236), 0.78);
	color: var(--fg);
	font-size: 30px;
	line-height: 1;
	cursor: pointer;
	transition:
		background 180ms ease,
		border-color 180ms ease,
		transform 180ms var(--ease-out, ease);
}

.mh__proekt-fan-arrow:hover {
	background: var(--accent);
	border-color: var(--accent);
	transform: translateY(-1px);
}

.mh__proekt-fan-count {
	min-width: 78px;
	text-align: center;
	color: var(--fg-quiet);
	font-size: var(--text-mono-2xs);
	letter-spacing: 0.12em;
}

.mh__proekt-hero-shot:hover .mh__proekt-gallery-zoom,
.mh__proekt-hero-shot:focus-visible .mh__proekt-gallery-zoom {
	opacity: 1;
	transform: translateY(0);
}

.mh__proekt-hero-shot:focus-visible,
.mh__proekt-fan-arrow:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 4px;
}

@media (max-width: 1180px) {
	.mh__proekt-hero {
		grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
		min-height: auto;
	}

	.mh__proekt-hero-media {
		min-height: clamp(380px, 48vw, 560px);
	}

	.mh__proekt-fan-stage {
		min-height: clamp(360px, 46vw, 520px);
	}
}

@media (max-width: 960px) {
	.mh__proekt-hero {
		grid-template-columns: 1fr;
		overflow: visible;
	}

	.mh__proekt-hero-media {
		max-width: 100%;
		min-height: clamp(390px, 62vw, 560px);
		margin: 0;
	}

	.mh__proekt-fan-stage {
		min-height: clamp(360px, 58vw, 520px);
	}
}

@media (max-width: 640px) {
	.mh__proekt-hero-media {
		display: block;
		margin-left: 0;
		margin-right: 0;
		min-height: 390px;
	}

	.mh__proekt-fan {
		gap: 12px;
	}

	.mh__proekt-fan-stage {
		min-height: 340px;
		overflow: hidden;
	}

	.mh__proekt-fan-stage::before {
		inset: 11% -10% 8%;
	}

	.mh__proekt-hero-shot {
		width: min(62vw, 250px);
		height: 315px;
		box-shadow: 0 20px 46px rgba(var(--rgb-graphite-900, 26, 26, 26), 0.18);
	}

	.mh__proekt-fan-arrow {
		width: 38px;
		height: 38px;
	}
}
