/*
 * _proekt-single.css - single project hero, thumbnails, gallery and lightbox.
 *
 * Split by ADR-023 file-per-section guard.
 */

/* ═══════════════════════════════════════════════════════════════
   SINGLE: /portfolio/<slug>/ — без изменений (Mohawk prose)
   ═══════════════════════════════════════════════════════════════ */

.mh__breadcrumbs {
	padding: 16px 56px;
	font-family: var(--font-mh-mono);
	font-size: var(--text-eyebrow); /* 11px → token */
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--fg-quiet);
}
.mh__breadcrumbs a {
	color: var(--fg-quiet);
	text-decoration: none;
	transition: color 160ms ease;
}
.mh__breadcrumbs a:hover { color: var(--accent); }
.mh__breadcrumbs-sep { margin: 0 8px; }

.mh__proekt-hero {
	display: grid;
	grid-template-columns: minmax(0, 0.78fr) minmax(520px, 1.22fr);
	gap: clamp(28px, 4.2vw, 64px);
	align-items: center;
	padding-top: clamp(20px, 3vw, 44px);
}
.mh__proekt-hero-head {
	display: flex;
	flex-direction: column;
	gap: 14px;
	align-self: center;
	max-width: 680px;
}
.mh__proekt-hero .mh__h2 {
	max-width: 9.5em;
	font-size: clamp(44px, 4.25vw, 72px);
	line-height: 0.98;
}
.mh__proekt-hero .mh__section-lead {
	max-width: 520px;
}
.mh__proekt-hero-format {
	font-family: var(--font-mh-mono);
	font-size: var(--text-mono-sm); /* 12px → token */
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--fg-quiet);
	margin: 0;
}
.mh__proekt-hero-media {
	position: relative;
	display: block;
	align-self: start;
	justify-self: stretch;
	max-width: 720px;
}
.mh__proekt-hero-img {
	position: relative;
	appearance: none;
	overflow: hidden;
	isolation: isolate;
	background: rgba(var(--rgb-graphite-900, 26, 26, 26), 0.1);
	border: 1px solid var(--line);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	width: 100%;
	height: clamp(360px, 35vw, 520px);
	max-width: 100%;
	justify-self: stretch;
	box-sizing: border-box;
	cursor: zoom-in;
	box-shadow: 0 20px 54px rgba(var(--rgb-graphite-900, 26, 26, 26), 0.105);
}
.mh__proekt-hero-img::before {
	content: "";
	position: absolute;
	inset: -22px;
	z-index: -1;
	background:
		linear-gradient(0deg, rgba(var(--rgb-paper, 248, 244, 236), 0.18), rgba(var(--rgb-paper, 248, 244, 236), 0.18)),
		var(--proekt-photo-bg) center / cover no-repeat;
	filter: blur(18px) saturate(0.9);
	transform: scale(1.06);
	opacity: 0.56;
}
.mh__proekt-hero-img img {
	position: relative;
	z-index: 1;
	width: 100%;
	height: 100%;
	max-width: 100%;
	max-height: none;
	object-fit: contain;
	display: block;
}
.mh__proekt-hero-thumbs {
	position: absolute;
	top: 14px;
	right: 14px;
	bottom: 14px;
	z-index: 2;
	display: flex;
	flex-direction: column;
	gap: 8px;
	width: 74px;
	max-height: none;
	box-sizing: border-box;
	overflow-x: hidden;
	overflow-y: auto;
	padding: 7px;
	background: rgba(var(--rgb-paper, 248, 244, 236), 0.84);
	border: 1px solid rgba(var(--rgb-graphite-900, 26, 26, 26), 0.14);
	box-shadow: 0 12px 28px rgba(var(--rgb-graphite-900, 26, 26, 26), 0.12);
	backdrop-filter: blur(6px);
	scrollbar-width: thin;
}
.mh__proekt-hero-thumb {
	position: relative;
	appearance: none;
	display: grid;
	place-items: center;
	min-width: 0;
	height: 58px;
	overflow: hidden;
	padding: 3px;
	border: 1px solid var(--line);
	background: rgba(var(--rgb-paper, 248, 244, 236), 0.78);
	cursor: zoom-in;
	opacity: 0.78;
	transition:
		opacity 180ms ease,
		border-color 180ms ease,
		transform 180ms var(--ease-out, ease),
		box-shadow 180ms var(--ease-out, ease);
}
.mh__proekt-hero-thumb.is-active {
	border-color: var(--accent);
	opacity: 1;
	box-shadow: inset 0 0 0 2px var(--accent), 0 10px 24px rgba(var(--rgb-graphite-900, 26, 26, 26), 0.08);
}
.mh__proekt-hero-thumb:hover {
	transform: none;
	opacity: 1;
	border-color: rgba(var(--rgb-graphite-900, 26, 26, 26), 0.34);
	box-shadow: 0 10px 22px rgba(var(--rgb-graphite-900, 26, 26, 26), 0.08);
}
.mh__proekt-hero-thumb img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

/* Gallery (single) */
.mh__proekt-gallery-grid {
	counter-reset: proekt-gallery;
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: clamp(10px, 1.2vw, 16px);
	align-items: stretch;
}
.mh__proekt-gallery-item {
	counter-increment: proekt-gallery;
	position: relative;
	display: block;
	appearance: none;
	min-width: 0;
	padding: 6px;
	border: 1px solid var(--line);
	border-radius: 0;
	overflow: hidden;
	background:
		linear-gradient(180deg, rgba(var(--rgb-paper, 248, 244, 236), 0.94), rgba(var(--rgb-paper, 248, 244, 236), 0.68)),
		var(--paper);
	cursor: zoom-in;
	box-shadow: 0 8px 22px rgba(var(--rgb-graphite-900, 26, 26, 26), 0.055);
	transition:
		transform 220ms var(--ease-out, ease),
		box-shadow 220ms var(--ease-out, ease),
		border-color 220ms ease;
}
.mh__proekt-gallery-item::before {
	content: counter(proekt-gallery, decimal-leading-zero);
	position: absolute;
	top: 10px;
	left: 10px;
	z-index: 2;
	padding: 5px 7px 4px;
	background: rgba(var(--rgb-graphite-900, 26, 26, 26), 0.86);
	color: var(--paper);
	font-family: var(--font-mh-mono);
	font-size: 10px;
	line-height: 1;
	letter-spacing: 0.08em;
}
.mh__proekt-gallery-item img {
	width: 100%;
	height: clamp(150px, 14vw, 230px);
	object-fit: contain;
	display: block;
	transition: transform 320ms var(--ease-out, ease);
}
.mh__proekt-gallery-item:hover img {
	transform: scale(1.015);
}
.mh__proekt-gallery-item:hover {
	transform: translateY(-3px);
	border-color: rgba(var(--rgb-graphite-900, 26, 26, 26), 0.34);
	box-shadow: 0 16px 34px rgba(var(--rgb-graphite-900, 26, 26, 26), 0.1);
}
.mh__proekt-gallery-zoom {
	position: absolute;
	right: 12px;
	bottom: 12px;
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	background: rgba(var(--rgb-graphite-900, 26, 26, 26), 0.84);
	color: var(--paper);
	border: 1px solid rgba(var(--rgb-paper, 248, 244, 236), 0.62);
	font-family: var(--font-mh-mono);
	font-size: 20px;
	line-height: 1;
	opacity: 0;
	transform: translateY(4px);
	transition:
		opacity 180ms ease,
		transform 180ms var(--ease-out, ease),
		background 180ms ease;
}
.mh__proekt-hero-img:hover .mh__proekt-gallery-zoom,
.mh__proekt-gallery-item:hover .mh__proekt-gallery-zoom,
.mh__proekt-hero-img:focus-visible .mh__proekt-gallery-zoom,
.mh__proekt-gallery-item:focus-visible .mh__proekt-gallery-zoom {
	opacity: 1;
	transform: translateY(0);
}
.mh__proekt-hero-img:focus-visible,
.mh__proekt-hero-thumb:focus-visible,
.mh__proekt-gallery-item:focus-visible,
.mh__proekt-lightbox-close:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 3px;
}
.mh__proekt-lightbox[hidden] {
	display: none;
}
.mh-proekt-lightbox-open {
	overflow: hidden;
}
.mh__proekt-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: grid;
	place-items: center;
	align-items: center;
	justify-items: center;
	padding: clamp(18px, 4vw, 48px);
	background: rgba(var(--rgb-graphite-900, 26, 26, 26), 0.88);
}
.mh__proekt-lightbox-img {
	max-width: min(1120px, 94vw);
	max-height: 88vh;
	width: auto;
	height: auto;
	object-fit: contain;
	background: var(--paper);
	border: 1px solid rgba(var(--rgb-paper, 248, 244, 236), 0.34);
	box-shadow: 0 30px 90px rgba(var(--rgb-black), 0.42);
}
.mh__proekt-lightbox-close {
	position: fixed;
	top: 18px;
	right: 18px;
	z-index: 2;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border: 1px solid var(--accent);
	background: var(--accent);
	color: var(--ink);
	font-size: 34px;
	line-height: 1;
	cursor: pointer;
}

@media (max-width: 960px) {
	.mh__proekt-hero {
		grid-template-columns: 1fr;
		gap: 24px;
	}
	.mh__proekt-hero .mh__h2 {
		max-width: 12em;
	}
	.mh__proekt-hero-media {
		grid-template-columns: minmax(0, 1fr) 92px;
		max-width: 100%;
	}
	.mh__proekt-hero-img {
		justify-self: stretch;
		height: min(58vh, 560px);
	}
	.mh__proekt-hero-img img {
		max-height: none;
	}
	.mh__proekt-gallery-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 12px;
	}
	.mh__proekt-gallery-item img {
		height: 180px;
	}
	.mh__breadcrumbs { padding: 12px 24px; }
}

@media (max-width: 640px) {
	.mh__proekt-hero-media {
		display: grid;
		grid-template-columns: 1fr;
		margin-left: -24px;
		margin-right: -24px;
	}
	.mh__proekt-hero-img {
		margin-inline: 24px;
		height: min(54vh, 420px);
	}
	.mh__proekt-hero-img img {
		max-height: none;
	}
	.mh__proekt-hero-thumbs {
		display: flex;
		flex-direction: row;
		gap: 8px;
		max-height: none;
		overflow-x: auto;
		overflow-y: hidden;
		padding: 0 24px 4px;
		scroll-snap-type: x mandatory;
		-webkit-overflow-scrolling: touch;
	}
	.mh__proekt-hero-thumbs::-webkit-scrollbar {
		display: none;
	}
	.mh__proekt-hero-thumb {
		flex: 0 0 88px;
		scroll-snap-align: start;
	}
	.mh__proekt-gallery-grid {
		display: flex;
		gap: 12px;
		margin-left: -24px;
		margin-right: -24px;
		padding: 0 24px 12px;
		overflow-x: auto;
		overscroll-behavior-x: contain;
		scroll-snap-type: x mandatory;
		scroll-padding-inline: 24px;
		-webkit-overflow-scrolling: touch;
	}
	.mh__proekt-gallery-grid::-webkit-scrollbar {
		display: none;
	}
	.mh__proekt-gallery-item,
	.mh__proekt-gallery-item:nth-child(n) {
		flex: 0 0 min(82vw, 360px);
		scroll-snap-align: start;
		padding: 5px;
	}
	.mh__proekt-gallery-item img {
		height: 300px;
	}
}
