/**
 * Галерея / Наши проекты — Figma 1:4329
 * Hero: 1:4332 (лево) + 1:4330 (право); список: 1:4340
 */

body.page-template-gallery-php,
body.page-template-page-templates-gallery-php,
.gallery-page {
	background: var(--bg-dark-blue);
	color: var(--txt-white);
}

.gallery-page__hero {
	padding: 40px 0 0;
}

.gallery-page__title {
	margin: 0 0 48px;
	font-size: clamp(40px, 5vw, 96px);
	font-weight: 500;
	letter-spacing: -0.08em;
	line-height: 1;
	text-transform: uppercase;
	color: var(--txt-white);
}

.gallery-page__subtitle {
	margin: 0 0 40px;
	max-width: 52ch;
	font-size: 20px;
	line-height: 1.5;
	color: var(--txt-light-grey);
}

.gallery-page__content {
	padding: 80px 0 200px;
}

.gallery-page__empty {
	margin: 0;
	color: var(--txt-light-grey);
	font-size: 18px;
}

/* —— Hero 1:4332 (left) + 1:4330 (right) —— */
.gallery-hero {
	margin-top: 0;
}

.gallery-hero__inner {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
	align-items: stretch;
}

.gallery-hero__left {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: space-between;
	gap: 40px;
	min-height: 780px;
	padding: 32px 48px;
	border-radius: 12px;
	background: var(--bg-blue, #384250);
	box-sizing: border-box;
}

.gallery-hero__title {
	margin: 0;
	font-size: clamp(40px, 5vw, 96px);
	font-weight: 500;
	letter-spacing: -0.08em;
	line-height: 1;
	text-transform: uppercase;
	text-align: center;
	color: var(--txt-white, #f9f0ec);
	white-space: nowrap;
}

.gallery-hero__stage {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 48px;
	width: 100%;
	max-width: 631px;
}

.gallery-hero__nav {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 64px;
	height: 64px;
	padding: 4px;
	border: 1px solid var(--txt-white, #f9f0ec);
	border-radius: 8px;
	background: transparent;
	color: var(--txt-white, #f9f0ec);
	cursor: pointer;
	transition: background 0.2s ease, border-color 0.2s ease;
}

.gallery-hero__nav:hover {
	background: rgba(249, 240, 236, 0.08);
}

.gallery-hero__nav-icon {
	display: block;
	width: 12px;
	height: 14px;
	object-fit: contain;
}

.gallery-hero__nav-icon--next {
	transform: scaleX(-1);
}

.gallery-hero__frame {
	position: relative;
	width: 339px;
	height: 339px;
	max-width: 100%;
	border-radius: 12px;
	overflow: hidden;
	background: #1c212a;
	flex-shrink: 0;
}

.gallery-hero__slide {
	position: absolute;
	inset: 0;
	margin: 0;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.35s ease, visibility 0.35s ease;
}

.gallery-hero__slide.is-active {
	opacity: 1;
	visibility: visible;
}

.gallery-hero__slide img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	pointer-events: none;
}

.gallery-hero__text {
	margin: 0;
	width: 100%;
	max-width: 631px;
	font-size: 24px;
	font-weight: 400;
	letter-spacing: -0.03em;
	line-height: 1.5;
	text-align: center;
	color: var(--txt-white, #f9f0ec);
}

.gallery-hero__right {
	position: relative;
	min-height: 780px;
	border-radius: 12px;
	overflow: hidden;
	background: #1c212a;
}

.gallery-hero__feature {
	position: absolute;
	inset: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	padding: 32px;
	box-sizing: border-box;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.35s ease, visibility 0.35s ease;
}

.gallery-hero__feature.is-active {
	opacity: 1;
	visibility: visible;
}

.gallery-hero__feature img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	pointer-events: none;
	border-radius: 12px;
}

.gallery-hero__feature-label {
	position: relative;
	z-index: 1;
	margin: 0;
	padding: 0;
	background: none;
	border-radius: 0;
	backdrop-filter: none;
	font-size: 36px;
	font-weight: 500;
	letter-spacing: -0.06em;
	line-height: 1.2;
	text-transform: uppercase;
	color: var(--txt-light-grey, #bfbfbf);
	white-space: nowrap;
}

/* —— Filters — Figma 1:4340 —— */
.gallery-filters {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-bottom: 40px;
}

.gallery-filters__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 18px 32px;
	border: 0;
	border-radius: 12px;
	background: var(--bg-blue, #384250);
	color: var(--txt-white, #f9f0ec);
	font-family: var(--font, 'Inter', sans-serif);
	font-size: 20px;
	font-weight: 600;
	letter-spacing: -0.05em;
	line-height: 1;
	text-transform: uppercase;
	white-space: nowrap;
	cursor: pointer;
	transition: background 0.2s ease;
}

.gallery-filters__btn:hover,
.gallery-filters__btn.is-active {
	background: var(--bg-coffee, #ca9d75);
}

/* —— Projects rail — Figma 1:4340 —— */
.gallery-rail {
	position: relative;
}

.gallery-rail__track {
	display: flex;
	align-items: flex-start;
	gap: 20px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
	padding-bottom: 24px;
	cursor: grab;
	user-select: none;
}

.gallery-rail__track::-webkit-scrollbar {
	display: none;
}

.gallery-rail__track.is-dragging {
	cursor: grabbing;
	scroll-snap-type: none;
}

.gallery-card {
	flex: 0 0 600px;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 16px;
	height: 774px;
	margin: 0;
	scroll-snap-align: start;
}

.gallery-card:nth-child(4n + 2),
.gallery-card:nth-child(4n + 4) {
	flex-basis: 445px;
	width: 445px;
	height: 500px;
}

.gallery-card:nth-child(4n + 3) {
	flex-basis: 755px;
	width: 755px;
	height: 769px;
}

.gallery-card[hidden] {
	display: none;
}

.gallery-card__media {
	flex: 1 1 auto;
	width: 100%;
	min-height: 0;
	border-radius: 12px;
	overflow: hidden;
	background: #1c212a;
}

.gallery-card__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	pointer-events: none;
	transition: transform 0.4s ease;
}

.gallery-card:hover .gallery-card__media img {
	transform: scale(1.03);
}

.gallery-card__meta {
	display: flex;
	flex-direction: column;
	gap: 4px;
	flex-shrink: 0;
	width: 100%;
	max-width: 457px;
}

.gallery-card:nth-child(4n + 3) .gallery-card__meta {
	max-width: 100%;
}

.gallery-card__title {
	margin: 0;
	font-size: 36px;
	font-weight: 500;
	letter-spacing: -0.06em;
	line-height: 1.2;
	text-transform: uppercase;
	color: var(--txt-white, #f9f0ec);
}

.gallery-card__cat {
	margin: 0;
	font-size: 18px;
	font-weight: 400;
	letter-spacing: -0.02em;
	line-height: 1.4;
	color: var(--txt-light-grey, #bfbfbf);
}

.gallery-rail__hint {
	position: absolute;
	left: 52%;
	top: 58%;
	z-index: 2;
	transform: translate(-50%, -50%);
	pointer-events: none;
	opacity: 1;
	transition: opacity 0.35s ease;
}

.gallery-rail__drag {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 118px;
	height: 118px;
	/* padding: 18px 32px; */
	border-radius: 999px;
	background: var(--bg-coffee, #ca9d75);
	color: var(--txt-white, #f9f0ec);
	font-family: var(--font, 'Inter', sans-serif);
	font-size: 20px;
	font-weight: 600;
	letter-spacing: -0.05em;
	line-height: 1;
	text-transform: uppercase;
	white-space: nowrap;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

@media (max-width: 1100px) {
	.gallery-hero__inner {
		grid-template-columns: 1fr;
	}

	.gallery-hero__left,
	.gallery-hero__right {
		min-height: 0;
	}

	.gallery-hero__left {
		padding: 28px 24px;
		gap: 28px;
	}

	.gallery-hero__title {
		white-space: normal;
		font-size: clamp(36px, 8vw, 64px);
	}

	.gallery-hero__stage {
		gap: 16px;
	}

	.gallery-hero__frame {
		width: min(339px, 56vw);
		height: min(339px, 56vw);
	}

	.gallery-hero__text {
		font-size: 18px;
	}

	.gallery-hero__right {
		min-height: 420px;
	}

	.gallery-hero__feature-label {
		font-size: 24px;
		white-space: normal;
		text-align: right;
	}

	.gallery-card,
	.gallery-card:nth-child(4n + 2),
	.gallery-card:nth-child(4n + 3),
	.gallery-card:nth-child(4n + 4) {
		flex-basis: min(420px, 78vw);
		width: min(420px, 78vw);
		height: auto;
	}

	.gallery-card__media {
		aspect-ratio: 3 / 4;
		height: auto;
		flex: none;
	}

	.gallery-card:nth-child(4n + 3) .gallery-card__media {
		aspect-ratio: 4 / 3;
	}

	.gallery-card__title {
		font-size: 28px;
	}

	.gallery-rail__hint {
		left: 60%;
		top: 42%;
	}
}

@media (max-width: 700px) {
	.gallery-page__hero {
		padding-top: 24px;
	}

	.gallery-page__title {
		margin-bottom: 32px;
	}

	.gallery-page__content {
		padding: 48px 0 100px;
	}

	.gallery-hero__left {
		padding: 24px 16px;
		gap: 24px;
	}

	.gallery-hero__stage {
		gap: 10px;
	}

	.gallery-hero__nav {
		width: 44px;
		height: 44px;
	}

	.gallery-hero__frame {
		width: min(240px, 48vw);
		height: min(240px, 48vw);
	}

	.gallery-hero__text {
		font-size: 16px;
	}

	.gallery-hero__right {
		min-height: 280px;
	}

	.gallery-hero__feature {
		padding: 20px;
	}

	.gallery-hero__feature-label {
		font-size: 18px;
	}

	.gallery-filters {
		margin-bottom: 24px;
		gap: 6px;
	}

	.gallery-filters__btn {
		padding: 12px 16px;
		font-size: 13px;
		border-radius: 10px;
	}

	.gallery-card,
	.gallery-card:nth-child(4n + 2),
	.gallery-card:nth-child(4n + 3),
	.gallery-card:nth-child(4n + 4) {
		flex-basis: min(300px, 85vw);
		width: min(300px, 85vw);
	}

	.gallery-card__title {
		font-size: 20px;
	}

	.gallery-card__cat {
		font-size: 15px;
	}

	.gallery-rail__drag {
		min-width: 88px;
		height: 88px;
		padding: 12px 20px;
		font-size: 14px;
	}

	.gallery-rail__hint {
		display: none;
	}
}
