/* ==========================================================
   Base
   ========================================================== */

* {
	box-sizing: border-box;
	margin: 0px;
	padding: 0px;
}

html {
	scroll-behavior: initial!important;
	margin-top: 0px!important;
	scrollbar-gutter: stable;
}

:root {
	/* Палітра */
	--text: #1d2430;
	--text-muted: #4b515b;
	--bg: #f3f1ec;
	--dark: #1e2632;
	--accent: #a63c22;
	--accent-hover: #8c3019;
	--line: #1d2430;
	--line-soft: #cfcbc2;
	--panel: #e6e3dc;
	--white: #ffffff;
	--card-bg: #e2dfd8;

	/* Шрифти */
	--font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	--font-display: "Literata", Georgia, "Times New Roman", serif;
	--font-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;

	/* Сторінка моделі: фон за замовчуванням (якщо в ACF нічого не задано) */
	--viewer-bg: var(--bg);

	/* Сітка */
	--container: 1360px;
	--gutter: 40px;
	--section: 80px;
	--header-h: 88px;

	/* Відстань від краю контенту до краю екрана — для слайдерів «до краю екрана» */
	--bleed: max(var(--gutter), (100vw - var(--container)) / 2);
}

body {
	margin: 0;
	font-size: 16px;
	line-height: 1.5;
	background-color: var(--bg);
	color: var(--text);
	font-family: var(--font-body);
	-webkit-font-smoothing: antialiased;
}

/* WP додає body класи .page / .post, на які в style.css є margin */
body.page,
body.post {
	margin: 0;
}

/* Скидання стилів _s: абзаци, списки, посилання, заголовки */
p {
	margin: 0;
}

ul,
ol {
	margin: 0;
	padding: 0;
	list-style: none;
}

a,
a:visited,
a:hover,
a:focus,
a:active {
	color: inherit;
}

a {
	text-decoration: none;
}

/* normalize у style.css дає h1 margin: 0.67em 0 — відступи заголовків задаємо явно в компонентах */
h1,
h2,
h3,
h4 {
	clear: none;
	margin: 0;
}

img {
	display: block;
	max-width: 100%;
	height: auto;
}

/* ==========================================================
   Компоненти
   ========================================================== */

.container {
	width: 100%;
	max-width: calc(var(--container) + 2 * var(--gutter));
	margin: 0 auto;
	padding: 0 var(--gutter);
}

.section {
	padding: var(--section) 0;
}

/* Дрібний моноширинний підпис: кікер, мета, тривалість */
.label {
	font-family: var(--font-mono);
	font-size: 0.875em;
	font-weight: 400;
	line-height: 1.4;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--text-muted);
}

.section-title {
	font-family: var(--font-display);
	font-size: clamp(1.75em, 3.4vw, 3em);
	font-weight: 700;
	line-height: 1.05;
}

.section-head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 24px;
	margin-bottom: 32px;
}

.accent {
	color: var(--accent);
}

/* Кнопки */
.btn,
.btn:visited {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 48px;
	padding: 0 24px;
	border: 1.5px solid currentColor;
	font-size: 1em;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn .icon {
	width: 18px;
	height: 18px;
	transition: transform 0.2s ease;
}

.btn:hover .icon {
	transform: translateX(3px);
}

.btn--primary,
.btn--primary:visited {
	border-color: var(--accent);
	background-color: var(--accent);
	color: var(--white);
}

.btn--primary:hover,
.btn--primary:focus-visible {
	border-color: var(--accent-hover);
	background-color: var(--accent-hover);
	color: var(--white);
}

.btn--outline,
.btn--outline:visited {
	color: var(--text);
}

.btn--outline:hover,
.btn--outline:focus-visible {
	border-color: var(--text);
	background-color: var(--text);
	color: var(--bg);
}

.btn--light,
.btn--light:visited {
	color: var(--white);
}

.btn--light:hover,
.btn--light:focus-visible {
	border-color: var(--white);
	background-color: var(--white);
	color: var(--dark);
}

.buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.link-underline,
.link-underline:visited {
	font-weight: 600;
	text-decoration: underline;
	text-decoration-thickness: 1.5px;
	text-underline-offset: 4px;
}

.link-underline:hover {
	color: var(--accent);
}

/* Бейджі об'єкта */
.tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.tag {
	padding: 4px 10px;
	border: 1px solid var(--text);
	font-size: 0.875em;
	font-weight: 500;
	line-height: 1.3;
}

:where(a, button, [tabindex]):focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 3px;
}

/* ==========================================================
   Хедер
   ========================================================== */

.site-header {
	position: relative;
	z-index: 1000;
	background-color: var(--bg);
}

/* Десктоп: логотип зліва, меню по центру, мови справа */
.site-header__inner {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
	align-items: center;
	gap: 32px;
	height: var(--header-h);
}

.site-header__logo,
.site-header__logo:visited {
	flex: none;
	justify-self: start;
	font-family: var(--font-display);
	font-size: 1.25em;
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0.02em;
}

/* На десктопі обгортка «прозора»: меню і мови — окремі колонки сітки */
.site-header__panel {
	display: contents;
}

.header-menu {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 28px;
}

.header-menu a {
	font-size: 1em;
	font-weight: 500;
	transition: color 0.2s ease;
}

.header-menu a:hover,
.header-menu .current-menu-item > a {
	color: var(--accent);
}

.lang-switch {
	display: flex;
	justify-self: end;
	gap: 16px;
}

.lang-switch a {
	display: block;
	padding: 4px 0;
	border-bottom: 2px solid transparent;
	font-size: 0.875em;
	font-weight: 500;
	color: var(--text-muted);
}

.lang-switch a:hover {
	color: var(--text);
}

.lang-switch a.is-active {
	border-bottom-color: var(--text);
	color: var(--text);
}

.site-header__burger {
	display: none;
}

/* ==========================================================
   Футер
   ========================================================== */

.site-footer {
	padding: 80px 0 32px;
	background-color: var(--dark);
	color: var(--white);
}

.site-footer__top {
	display: grid;
	grid-template-columns: 1.5fr 1fr 1fr;
	gap: 48px;
}

.site-footer__title {
	margin-bottom: 16px;
	font-family: var(--font-display);
	font-size: 1.375em;
	font-weight: 700;
	line-height: 1.2;
}

.site-footer__text {
	max-width: 360px;
	color: rgba(255, 255, 255, 0.75);
}

.footer-menu {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.footer-menu a:hover,
.site-footer__contacts a:hover {
	color: rgba(255, 255, 255, 0.7);
}

.site-footer__contacts .label {
	margin-bottom: 12px;
	color: rgba(255, 255, 255, 0.6);
}

/* Соцмережі під контактами: іконка + назва */
.site-footer__contacts .socials {
	margin-top: 20px;
}

.socials__link {
	display: inline-flex;
	align-items: center;
	gap: 10px;
}

.socials__link .icon {
	flex: none;
	width: 20px;
	height: 20px;
}

.site-footer__contacts ul {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.site-footer__bottom {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 12px 32px;
	margin-top: 64px;
	padding-top: 24px;
	border-top: 1px solid rgba(255, 255, 255, 0.2);
	font-size: 0.875em;
	color: rgba(255, 255, 255, 0.6);
}

/* ==========================================================
   Головна: hero
   ========================================================== */

.hero {
	padding: 72px 0 88px;
}

.hero__inner {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 46%;
	align-items: center;
	gap: clamp(48px, 7.8vw, 112px);
}

.hero__kicker {
	margin-bottom: 0;
}

.hero__title {
	margin: 20px 0px 32px 0px;
	font-family: var(--font-display);
	font-size: clamp(2.75em, 5.6vw, 5em);
	font-weight: 700;
	line-height: 1.2;
}

.hero__text {
	max-width: 500px;
	margin: 0 0 32px;
	font-size: 1.125em;
}

/* Слайдер фото (стилі .media-slider — як у вкладках сторінки об'єкта) */
.hero__image {
	position: relative;
	aspect-ratio: 534 / 452;
	overflow: hidden;
	background-color: var(--card-bg);
}

.hero__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* ==========================================================
   Головна: переваги
   ========================================================== */

/* Переваги без власного нижнього відступу: простір дає наступна секція.
   Якщо блоку об'єктів немає, одразу йде темна «Історія» — тоді відступ потрібен тут */
.features + .history {
	margin-top: var(--section);
}

.features__list {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 32px;
}

.feature {
	padding-top: 24px;
	border-top: 2px solid var(--line);
}

.feature .icon {
	width: 26px;
	height: 26px;
	margin-bottom: 16px;
}

.feature__title {
	margin-bottom: 8px;
	font-family: var(--font-display);
	font-size: 1.5em;
	font-weight: 600;
	line-height: 1.2;
}

.feature__text {
	color: var(--text-muted);
}

/* ==========================================================
   Головна: об'єкти
   ========================================================== */

/* На планшеті й мобільному картки — слайдер до краю екрана, без прокрутки сторінки вбік */
.objects {
	overflow-x: clip;
}

.objects__list {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 32px;
}

.object-card__link {
	display: flex;
	flex-direction: column;
	height: 100%;
}

.object-card__image {
	display: block;
	aspect-ratio: 362 / 250;
	margin-bottom: 16px;
	overflow: hidden;
	background-color: var(--card-bg);
}

/* Фото чорно-біле, при наведенні на картку — кольорове */
.object-card__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	filter: grayscale(1);
	transition: transform 0.5s ease, filter 0.4s ease;
}

.object-card__link:hover .object-card__image img,
.object-card__link:focus-visible .object-card__image img {
	filter: grayscale(0);
	transform: scale(1.04);
}

.object-card__meta {
	margin-bottom: 8px;
}

.object-card__title {
	margin-bottom: 14px;
	font-family: var(--font-display);
	font-size: 1.75em;
	font-weight: 600;
	line-height: 1.15;
	transition: color 0.2s ease;
}

.object-card__link:hover .object-card__title {
	color: var(--accent);
}

/* ==========================================================
   Головна: історія
   ========================================================== */

.history {
	/* Слайди виходять до краю екрана; горизонтальної прокрутки сторінки не буде */
	overflow-x: clip;
	background-color: var(--dark);
	color: var(--white);
}

.history__head {
	margin-bottom: 0;
}

/* Слайдер: 5 слайдів у видимій області, решта — прокруткою (стрілки, точки, свайп) */
.history__list {
	--slide-gap: 36px;
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: calc((100% - 4 * var(--slide-gap)) / 5);
	gap: var(--slide-gap);
	/* Список розтягнутий до країв екрана, перший слайд — по краю контейнера */
	margin: 48px calc(-1 * var(--bleed)) 32px;
	padding: 0 var(--bleed);
	scroll-padding: 0 var(--bleed);
	overflow-x: auto;
	scroll-behavior: smooth;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	overscroll-behavior-x: contain;
}

.history__list::-webkit-scrollbar {
	display: none;
}

.history__list > li {
	scroll-snap-align: start;
}

/* Стрілки в рядку заголовка */
.slider-nav {
	display: flex;
	flex: none;
	gap: 8px;
}

.slider-nav[hidden],
.slider-dots[hidden] {
	display: none;
}

.slider-nav__btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 1.5px solid currentColor;
	border-radius: 0;
	background: none;
	color: inherit;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.slider-nav__btn .icon {
	width: 20px;
	height: 20px;
}

.history .slider-nav__btn:hover:not(:disabled) {
	background-color: var(--white);
	color: var(--dark);
}

.slider-nav__btn:disabled {
	opacity: 0.3;
	cursor: default;
}

/* Точки під слайдами: по одній на кожну позицію прокрутки */
.slider-dots {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 4px;
	margin: 0 0 40px;
}

/* Точки на світлому фоні (слайдер карток об'єктів на планшеті й мобільному) */
.slider-dots--dark {
	margin-top: 24px;
}

/* .slider-dots.slider-dots--dark — сильніше за базові білі точки нижче */
.slider-dots.slider-dots--dark button::before {
	background-color: rgba(29, 36, 48, 0.25);
}

.slider-dots.slider-dots--dark button:hover::before {
	background-color: rgba(29, 36, 48, 0.5);
}

.slider-dots.slider-dots--dark button[aria-current="true"]::before {
	background-color: var(--text);
}

/* Без кнопки під точками (поле history_button порожнє) — без нижнього відступу */
.slider-dots:last-child {
	margin-bottom: 0;
}

.slider-dots button {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	cursor: pointer;
}

.slider-dots button::before {
	content: "";
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background-color: rgba(255, 255, 255, 0.3);
	transition: background-color 0.2s ease, transform 0.2s ease;
}

.slider-dots button:hover::before {
	background-color: rgba(255, 255, 255, 0.6);
}

.slider-dots button[aria-current="true"]::before {
	background-color: var(--white);
	transform: scale(1.2);
}

.history__item {
	padding-top: 24px;
	border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.history__year {
	display: block;
	margin-bottom: 12px;
	font-family: var(--font-display);
	font-size: clamp(2.5em, 4.4vw, 4em);
	font-weight: 600;
	line-height: 1;
}

.history__text {
	color: rgba(255, 255, 255, 0.75);
}

/* ==========================================================
   Головна: мапа і маршрути
   ========================================================== */

.map-section__inner {
	display: grid;
	grid-template-columns: minmax(0, 1.62fr) minmax(0, 1fr);
	align-items: center;
	gap: 48px;
}

.map-section__map {
	position: relative;
	aspect-ratio: 682 / 418;
	border: 1px solid var(--line-soft);
	background-color: var(--card-bg);
}

.map-section__overlay {
	position: absolute;
	inset: 0;
	z-index: 500;
}

.map-section__text {
	margin: 20px 0 24px;
	color: var(--text-muted);
}

.routes {
	margin-bottom: 32px;
	border-top: 1.5px solid var(--line);
}

.route {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	padding: 14px 0;
	border-bottom: 1.5px solid var(--line);
}

a.route:hover .route__title {
	color: var(--accent);
}

.route__duration {
	flex: none;
}

/* ==========================================================
   Головна: 3D-моделі та аудіогід
   ========================================================== */

.media {
	padding-top: 0;
}

.media__inner {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 32px;
}

.panel {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	padding: 40px;
	background-color: var(--panel);
}

.panel__title {
	font-family: var(--font-display);
	font-size: clamp(1.75em, 2.8vw, 2.5em);
	font-weight: 700;
	line-height: 1.05;
}

.panel__image {
	width: 100%;
	margin-top: 24px;
}

.panel__image img {
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

.panel__text {
	margin: 20px 0 16px;
	color: var(--text-muted);
}

/* Аудіоплеєр */
.audio-player {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	align-items: center;
	gap: 16px;
	width: 100%;
	margin-top: 24px;
	padding: 20px 24px 24px;
	background-color: var(--white);
}

.audio-player__toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background-color: var(--accent);
	color: var(--white);
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.audio-player__toggle:hover {
	background-color: var(--accent-hover);
}

.audio-player__toggle .icon {
	width: 22px;
	height: 22px;
}

.audio-player .icon-pause,
.audio-player.is-playing .icon-play {
	display: none;
}

.audio-player.is-playing .icon-pause {
	display: block;
}

.audio-player__info {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.audio-player__name {
	font-weight: 600;
}

a.audio-player__name:hover {
	color: var(--accent);
}

/* Кілька плеєрів підряд (панель «Аудіогід» на головній) */
.audio-list {
	display: flex;
	flex-direction: column;
	gap: 12px;
	width: 100%;
	margin-top: 24px;
}

.audio-list .audio-player {
	margin-top: 0;
}

/* Сторінка «Аудіогіди»: картка — фото, плеєр, посилання на сторінку-джерело */
.audio-card {
	display: flex;
	flex-direction: column;
}

/* Плеєр заповнює решту висоти картки — картки в ряду однакові незалежно від довжини назви;
   кнопка й назва по центру, смуга прогресу — внизу */
.audio-card .audio-player {
	flex: 1;
	grid-template-rows: 1fr auto;
	align-content: stretch;
	margin-top: 0;
}

.audio-card__image {
	margin-bottom: 0;
}

.audio-card:hover .audio-card__image img {
	filter: grayscale(0);
	transform: scale(1.04);
}

.audio-player__meta {
	text-transform: none;
}

.audio-player__progress {
	position: relative;
	grid-column: 1 / -1;
	height: 4px;
	background-color: var(--line-soft);
	cursor: pointer;
}

/* Більша зона кліку, ніж сама смуга */
.audio-player__progress::before {
	content: "";
	position: absolute;
	inset: -10px 0;
}

.audio-player__progress span {
	display: block;
	width: 0;
	height: 100%;
	background-color: var(--accent);
}

/* ==========================================================
   Головна: про проєкт
   ========================================================== */

.about {
	padding-top: 0;
}

.about__inner {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 64px;
}

.about__text {
	margin: 20px 0 24px;
	color: var(--text-muted);
}

.about__partners .label {
	margin-bottom: 16px;
}

.partners {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 32px 40px;
}

/* Комірка — межі, за які логотип не виходить (без рамки) */
.partner {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100px;
	font-size: 0.875em;
	color: var(--text-muted);
	text-align: center;
	transition: opacity 0.2s ease;
}

a.partner:hover {
	opacity: 0.7;
}

/* Ширину задає style з PHP (однакова площа логотипів); межі комірки — як і раніше */
.partner img {
	max-width: 100%;
	max-height: 100%;
	height: auto;
	object-fit: contain;
}

/* ==========================================================
   Leaflet: мапи і мітки
   ========================================================== */

.leaflet-map {
	/* Власний контекст накладання: z-index контролів Leaflet (до 1000) не перекриє хедер */
	isolation: isolate;
	width: 100%;
	height: 100%;
	background-color: var(--card-bg);
	font-family: var(--font-body);
}

.leaflet-map--static {
	position: absolute;
	inset: 0;
}

.map-page .leaflet-map--full {
	height: calc(100vh - var(--header-h));
	height: calc(100dvh - var(--header-h));
	min-height: 420px;
}

.map-marker-wrap {
	background: none;
	border: 0;
}

.map-marker {
	display: block;
	width: 52px;
	height: 52px;
	overflow: hidden;
	border: 3px solid var(--white);
	border-radius: 50%;
	background-color: var(--dark);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
	transition: transform 0.2s ease;
}

.map-marker img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.map-marker--empty {
	background-color: var(--accent);
}

.leaflet-marker-icon:hover .map-marker {
	transform: scale(1.1);
}

.leaflet-popup-content-wrapper {
	border-radius: 0;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* .leaflet-container — щоб перебити leaflet.css, який підключається пізніше */
.leaflet-container .leaflet-popup-content {
	margin: 20px;
	font-size: calc(16em / 12); /* 16px: батьківський .leaflet-container має 12px */
	line-height: 1.4;
}

/* Фото і текст з однаковим відступом від країв вікна (margin вище) */
.map-popup {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.map-popup__image {
	width: 100%;
	aspect-ratio: 3 / 2;
	margin-bottom: 6px;
	object-fit: cover;
}

.map-popup__title {
	font-family: var(--font-display);
	font-size: 1.25em;
	font-weight: 600;
	line-height: 1.2;
}

.map-popup__link {
	align-self: flex-start;
	margin-top: 4px;
	color: var(--text) !important;
}

/* Підказка з назвою колонії при наведенні на зону */
.leaflet-container .map-tooltip {
	padding: 6px 10px;
	border: 0;
	border-radius: 0;
	background-color: var(--dark);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
	font-family: var(--font-display);
	font-size: calc(16em / 12); /* 16px: батьківський .leaflet-container має 12px */
	font-weight: 600;
	color: var(--white);
}

.leaflet-container .map-tooltip::before {
	border-top-color: var(--dark);
}

/* ==========================================================
   Сторінка об'єкта
   ========================================================== */

/* Скидання кнопок-посилань (вкладки, «Текст розповіді», «Усі фото») */
.tab,
.audio-bar__text-toggle,
.object-gallery__all {
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	font: inherit;
	line-height: 1.3;
	color: inherit;
	cursor: pointer;
}

/* Хлібні крихти */
.breadcrumbs {
	margin-bottom: 24px;
	font-size: 0.875em;
}

.breadcrumbs ol {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 8px;
}

.breadcrumbs li + li::before {
	content: "/";
	margin-right: 8px;
	color: var(--text-muted);
}


.breadcrumbs a:hover {
	color: var(--accent);
}

/* Шапка */
.object-intro {
	padding: 32px 0 40px;
}

.object-intro__meta {
	margin-bottom: 12px;
}

.object-intro__title {
	font-family: var(--font-display);
	font-size: clamp(2em, 4.4vw, 4em);
	font-weight: 700;
	line-height: 1.1;
}

.object-intro__lead {
	max-width: 760px;
	margin-top: 16px;
	font-size: 1.125em;
}

/* Медіа і паспорт */
.object-main__inner {
	display: grid;
	grid-template-columns: minmax(0, 1.78fr) minmax(0, 1fr);
	align-items: start;
	gap: 48px;
}

.tabs {
	display: flex;
	gap: 8px;
	margin-bottom: 12px;
	overflow-x: auto;
	scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
	display: none;
}

.tab {
	flex: none;
	min-height: 40px;
	padding: 0 16px;
	border: 1.5px solid var(--text);
	font-size: 0.875em;
	font-weight: 600;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.tab:hover,
.tab.is-active {
	background-color: var(--text);
	color: var(--bg);
}

.object-media__panel {
	position: relative;
	aspect-ratio: 3 / 2;
	overflow: hidden;
	background-color: var(--card-bg);
}

.object-media__panel[hidden] {
	display: none;
}

/* Слайдер архівних світлин: одне фото на всю вкладку, стрілки по боках */
.media-slider {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: 100%;
	grid-template-rows: 100%;
	height: 100%;
	overflow-x: auto;
	/* Лише вбік: інакше overflow-x: auto вмикає й вертикальну прокрутку, і колесо миші «гортає» фото */
	overflow-y: hidden;
	scroll-behavior: smooth;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	overscroll-behavior-x: contain;
}

.media-slider::-webkit-scrollbar {
	display: none;
}

.media-slider > li {
	height: 100%;
	min-height: 0;
	overflow: hidden;
	scroll-snap-align: start;
}

.media-slider__nav[hidden] {
	display: none;
}

/* Стрілки слайдера фото: стримані — без рамки, напівпрозорі; чіткіші при наведенні на фото */
.media-slider__btn {
	position: absolute;
	top: 50%;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	padding: 0;
	border: 0;
	border-radius: 0;
	background-color: rgba(243, 241, 236, 0.55);
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
	color: var(--text);
	line-height: 1;
	cursor: pointer;
	opacity: 0.7;
	transform: translateY(-50%);
	transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

[data-slider-root]:hover .media-slider__btn,
.media-slider__btn:focus-visible {
	opacity: 1;
}

.media-slider__btn:hover:not(:disabled) {
	background-color: rgba(243, 241, 236, 0.9);
}

/* На першому / останньому фото відповідна стрілка не показується */
.media-slider__btn:disabled {
	opacity: 0 !important;
	pointer-events: none;
}

.media-slider__btn .icon {
	width: 18px;
	height: 18px;
}

.media-slider__btn--prev {
	left: 12px;
}

.media-slider__btn--next {
	right: 12px;
}

/* Фон 3D як на сторінці моделі: фото → градієнт → колір (поля фону моделі) */
.object-media__panel--model {
	background-color: var(--model-bg-color, var(--card-bg));
	background-image: var(--model-bg-image, none), var(--model-bg-gradient, none);
	background-position: center;
	background-size: cover;
}

.object-media__panel .model-viewer {
	display: block;
	width: 100%;
	height: 100%;
	--poster-color: transparent;
	background-color: transparent;
}

.object-media__panel .model-viewer::part(default-progress-bar) {
	height: 3px;
	background-color: var(--accent);
}

.object-media__expand {
	position: absolute;
	top: 12px;
	right: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border: 1.5px solid var(--text);
	background-color: rgba(243, 241, 236, 0.9);
	transition: background-color 0.2s ease, color 0.2s ease;
}

.object-media__expand:hover {
	background-color: var(--text);
	color: var(--bg);
}

.object-media__expand .icon {
	width: 20px;
	height: 20px;
}

/* Кнопка AR (лише іконка): на телефоні — слот model-viewer (.ar-btn), на комп'ютері — QR-вікно (.ar-qr-btn).
   Вигляд як у кнопки розгортання: квадратна світла плашка з контуром */
.ar-btn,
.ar-qr-btn {
	position: absolute;
	right: 12px;
	bottom: 12px;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1.5px solid var(--text);
	border-radius: 0;
	background-color: rgba(243, 241, 236, 0.9);
	color: var(--text);
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.ar-btn:hover,
.ar-qr-btn:hover {
	background-color: var(--text);
	color: var(--bg);
}

/* Іконка AR дрібна всередині свого поля — тому більша за інші іконки кнопок */
.ar-btn .icon,
.ar-qr-btn .icon {
	width: 28px;
	height: 28px;
}

.ar-qr-btn[hidden] {
	display: none;
}

/* Сторінка моделі: внизу праворуч з бічним відступом сторінки */
.model-page .ar-btn,
.model-page .ar-qr-btn {
	right: var(--gutter);
	bottom: max(24px, env(safe-area-inset-bottom));
}

/* Вікно з QR-кодом — у межах плеєра: затемнення на весь плеєр, картка по центру */
.qr-modal {
	position: absolute;
	inset: 0;
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 12px;
	overflow: auto;
	background-color: rgba(20, 25, 32, 0.7);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	container-type: size;
}

.qr-modal[hidden] {
	display: none;
}

.qr-modal__box {
	position: relative;
	width: min(400px, 100%);
	max-height: 100%;
	margin: auto;
	padding: 32px 28px 24px;
	overflow: auto;
	background-color: var(--bg);
	color: var(--text);
	text-align: center;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.qr-modal__close {
	position: absolute;
	top: 4px;
	right: 4px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--text);
	cursor: pointer;
}

.qr-modal__close:hover {
	color: var(--accent);
}

.qr-modal__title {
	margin: 0 24px 16px;
	font-family: var(--font-display);
	font-size: 1.25em;
	font-weight: 600;
	line-height: 1.2;
}

/* QR зменшується, якщо плеєр невисокий (одиниці від висоти .qr-modal) */
.qr-modal__code {
	width: min(200px, 40cqh);
	min-width: 120px;
	aspect-ratio: 1;
	margin: 0 auto 16px;
	padding: 6px;
	background-color: var(--white);
}

.qr-modal__code svg {
	display: block;
	width: 100%;
	height: 100%;
}

.qr-modal__text {
	margin: 0;
	font-size: 0.875em;
	line-height: 1.5;
	color: var(--text-muted);
}

/* Телефон без AR (вбудований браузер): вікно на весь екран, кнопки замість QR */
.qr-modal--app {
	position: fixed;
	z-index: 1000;
	padding: 16px;
}

.qr-modal__actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: 20px;
}

.qr-modal__btn {
	width: 100%;
	font-size: 0.9375em;
}

.object-media__photo {
	display: block;
	height: 100%;
	cursor: zoom-in;
}

.object-media__photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.passport__title {
	margin-bottom: 16px;
	font-family: var(--font-display);
	font-size: 1.5em;
	font-weight: 600;
	line-height: 1.2;
}

.passport__list {
	margin: 0;
	border-bottom: 1.5px solid var(--line);
}

.passport__row {
	padding: 12px 0;
	border-top: 1.5px solid var(--line);
}

.passport__row dt {
	margin-bottom: 4px;
}

.passport__row dd {
	margin: 0;
}

.passport__map {
	width: 100%;
	margin-top: 20px;
}

/* Аудіогід: плеєр у рядок */
.object-audio {
	padding-top: 48px;
}

.audio-bar {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto auto;
	align-items: center;
	gap: 24px;
	padding: 24px 32px;
	background-color: var(--panel);
}

.audio-bar .icon-pause,
.audio-bar.is-playing .icon-play {
	display: none;
}

.audio-bar.is-playing .icon-pause {
	display: block;
}

.audio-bar__name {
	display: block;
	margin-bottom: 12px;
	font-weight: 600;
}

.audio-bar .audio-player__progress {
	grid-column: auto;
}

.audio-bar__time {
	text-transform: none;
	white-space: nowrap;
}

.audio-bar__text-toggle {
	white-space: nowrap;
}

.audio-text {
	padding: 24px 32px 32px;
	border-top: 1px solid var(--line-soft);
	background-color: var(--panel);
}

.audio-text[hidden] {
	display: none;
}

/* Текст з редактора (WYSIWYG) */
.text-content > * + * {
	margin-top: 1em;
}

.text-content a {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.text-content ul,
.text-content ol {
	padding-left: 1.25em;
	list-style: disc;
}

.text-content ol {
	list-style: decimal;
}

/* Історія та архітектура */
.object-story__inner {
	display: grid;
	grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
	align-items: start;
	gap: 64px;
}

.object-story__inner--single {
	grid-template-columns: minmax(0, 860px);
}

.object-story__texts {
	display: flex;
	flex-direction: column;
	gap: 48px;
}

.object-story__block .section-title {
	margin-bottom: 20px;
}

.aside-photo {
	margin: 0;
}

.aside-photo a {
	display: block;
	cursor: zoom-in;
}

.aside-photo img {
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	background-color: var(--card-bg);
}

.aside-photo figcaption,
.quote figcaption {
	margin-top: 8px;
	font-size: 0.875em;
	color: var(--text-muted);
}

.quote {
	margin: 32px 0 0;
	padding: 20px 0;
	border-top: 1.5px solid var(--line);
	border-bottom: 1.5px solid var(--line);
}

.aside-photo + .quote {
	margin-top: 32px;
}

.object-story__aside > .quote:first-child {
	margin-top: 0;
}

.quote blockquote {
	margin: 0;
	padding: 0;
	font-family: var(--font-display);
	font-size: 1.375em;
	font-weight: 600;
	line-height: 1.3;
}

/* Галерея: перше фото ширше. Одразу після історії — без подвійного відступу */
.object-story + .object-gallery {
	padding-top: 0;
}

.gallery-grid {
	display: grid;
	grid-template-columns: minmax(0, 1.65fr) repeat(3, minmax(0, 1fr));
	grid-auto-rows: clamp(180px, 21vw, 300px);
	gap: 12px;
}

/* Менше 4 фото — ряд усе одно на всю ширину, перше фото ширше */
.gallery-grid--count-3 {
	grid-template-columns: minmax(0, 1.65fr) repeat(2, minmax(0, 1fr));
}

.gallery-grid--count-2 {
	grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
}

/* Одне фото — на всю ширину, низьке й широке */
.gallery-grid--count-1 {
	grid-template-columns: minmax(0, 1fr);
	grid-auto-rows: auto;
}

.gallery-grid--count-1 .gallery-grid__item a {
	aspect-ratio: 21 / 9;
}

.gallery-grid__item a {
	display: block;
	height: 100%;
	overflow: hidden;
	background-color: var(--card-bg);
	cursor: zoom-in;
}

.gallery-grid__item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.5s ease;
}

.gallery-grid__item a:hover img {
	transform: scale(1.04);
}

/* Як дістатися: темна смуга, як «Історія» на головній */
.object-directions {
	background-color: var(--dark);
	color: var(--white);
}

.object-directions__inner {
	display: grid;
	grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
	align-items: center;
	gap: 56px;
}

.object-directions__map {
	position: relative;
	aspect-ratio: 16 / 9;
	background-color: #2e3a48;
}

.object-directions__text {
	margin-top: 16px;
	color: rgba(255, 255, 255, 0.75);
}

.object-directions .btn {
	margin-top: 28px;
}

/* Лайтбокс */
.lightbox {
	width: 100vw;
	max-width: none;
	height: 100vh;
	height: 100dvh;
	max-height: none;
	margin: 0;
	padding: 24px 96px;
	border: 0;
	background: none;
	color: var(--white);
	/* Швидкі кліки по стрілках не виділяють фото (синя підсвітка) */
	-webkit-user-select: none;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
}

.lightbox__image {
	-webkit-user-drag: none;
}

/* Підпис можна виділити й скопіювати */
.lightbox__caption {
	-webkit-user-select: text;
	user-select: text;
}

.lightbox[open] {
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Напівпрозорий фон з розмиттям сторінки під ним */
.lightbox::backdrop {
	background-color: rgba(20, 25, 32, 0.7);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
}

/* Відкриття: фон проявляється, фото збільшується з 94% */
.lightbox[open],
.lightbox[open]::backdrop {
	animation: lightbox-fade-in 0.25s ease both;
}

.lightbox[open] .lightbox__image {
	animation: lightbox-zoom-in 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

/* Гортання: нове фото коротко проявляється */
.lightbox[open] .lightbox__image.is-swapping {
	animation: lightbox-fade-in 0.25s ease both;
}

/* Закриття (клас ставить JS перед close()) */
.lightbox.is-closing,
.lightbox.is-closing::backdrop {
	animation: lightbox-fade-out 0.2s ease both;
}

.lightbox.is-closing .lightbox__image {
	animation: lightbox-zoom-out 0.2s ease both;
}

@keyframes lightbox-fade-in {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

@keyframes lightbox-fade-out {
	from {
		opacity: 1;
	}
	to {
		opacity: 0;
	}
}

@keyframes lightbox-zoom-in {
	from {
		opacity: 0;
		transform: scale(0.94);
	}
	to {
		opacity: 1;
		transform: scale(1);
	}
}

@keyframes lightbox-zoom-out {
	from {
		opacity: 1;
		transform: scale(1);
	}
	to {
		opacity: 0;
		transform: scale(0.96);
	}
}

@media (prefers-reduced-motion: reduce) {
	.lightbox[open],
	.lightbox[open]::backdrop,
	.lightbox[open] .lightbox__image,
	.lightbox.is-closing,
	.lightbox.is-closing::backdrop,
	.lightbox.is-closing .lightbox__image {
		animation: none;
	}
}

body.lightbox-open {
	overflow: hidden;
}

.lightbox__figure {
	display: flex;
	flex-direction: column;
	align-items: center;
	max-width: 100%;
	max-height: 100%;
	margin: 0;
}

.lightbox__image {
	max-width: 100%;
	max-height: calc(100dvh - 120px);
	width: auto;
	object-fit: contain;
}

.lightbox__caption {
	margin-top: 12px;
	font-size: 0.875em;
	color: rgba(255, 255, 255, 0.75);
	text-align: center;
}

.lightbox__btn {
	position: fixed;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 1.5px solid var(--white);
	border-radius: 0;
	background: none;
	color: var(--white);
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.lightbox__btn:hover {
	background-color: var(--white);
	color: var(--dark);
}

.lightbox__btn[hidden] {
	display: none;
}

.lightbox__close {
	top: 24px;
	right: 24px;
}

.lightbox__prev,
.lightbox__next {
	top: 50%;
	transform: translateY(-50%);
}

.lightbox__prev {
	left: 24px;
}

.lightbox__next {
	right: 24px;
}

@media screen and (max-width: 1023px) {
	.object-intro {
		padding: 24px 0 32px;
	}

	.object-main__inner,
	.object-story__inner,
	.object-directions__inner {
		grid-template-columns: minmax(0, 1fr);
		gap: 40px;
	}

	.audio-bar {
		gap: 16px 20px;
		padding: 20px 24px;
	}

	.audio-text {
		padding: 20px 24px 28px;
	}

	.gallery-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		grid-auto-rows: clamp(160px, 32vw, 280px);
	}

	/* 3 фото: перше на всю ширину, під ним два */
	.gallery-grid--count-3 .gallery-grid__item:first-child {
		grid-column: 1 / -1;
	}

	.gallery-grid--count-1 {
		grid-template-columns: minmax(0, 1fr);
		grid-auto-rows: auto;
	}

	.gallery-grid--count-1 .gallery-grid__item a {
		aspect-ratio: 16 / 9;
	}
}

@media screen and (max-width: 767px) {
	.breadcrumbs {
		margin-bottom: 16px;
	}

	/* В один рядок; якщо не вміщається — прокрутка вбік до країв екрана */
	.breadcrumbs ol {
		flex-wrap: nowrap;
		margin: 0 calc(-1 * var(--gutter));
		padding: 0 var(--gutter);
		overflow-x: auto;
		white-space: nowrap;
		scrollbar-width: none;
		-webkit-overflow-scrolling: touch;
	}

	.breadcrumbs ol::-webkit-scrollbar {
		display: none;
	}

	.breadcrumbs li {
		flex: none;
	}

	.object-intro__lead {
		font-size: 1em;
	}

	/* Вкладки медіа і кнопка «на весь екран» — компактніші */
	.tabs {
		gap: 6px;
		margin-bottom: 8px;
	}

	.tab {
		min-height: 34px;
		padding: 0 12px;
		font-size: 0.8125em;
	}

	.object-media__expand {
		top: 8px;
		right: 8px;
		width: 36px;
		height: 36px;
	}

	.object-media__expand .icon {
		width: 16px;
		height: 16px;
	}

	/* Кнопка AR — того ж розміру, що й розгортання, у правому нижньому куті */
	.object-media__panel .ar-btn,
	.object-media__panel .ar-qr-btn {
		right: 8px;
		bottom: 8px;
		width: 36px;
		height: 36px;
	}

	.object-media__panel .ar-btn .icon,
	.object-media__panel .ar-qr-btn .icon {
		width: 24px;
		height: 24px;
	}

	.object-audio {
		padding-top: 40px;
	}

	/* Аудіо: кнопка і назва зі смугою; час і «Текст розповіді» — рядком нижче */
	.audio-bar {
		grid-template-columns: auto minmax(0, 1fr);
		margin: 0 calc(-1 * var(--gutter));
		padding: 20px var(--gutter);
	}

	.audio-bar__time,
	.audio-bar__text-toggle {
		grid-column: 2;
	}

	.audio-bar__time {
		margin-top: -8px;
	}

	.audio-bar__text-toggle {
		justify-self: start;
	}

	.audio-text {
		margin: 0 calc(-1 * var(--gutter));
		padding: 20px var(--gutter) 24px;
	}

	.object-story__texts {
		gap: 40px;
	}

	.quote blockquote {
		font-size: 1.25em;
	}

	.gallery-grid {
		gap: 8px;
		grid-auto-rows: 42vw;
	}

	.gallery-grid--count-1 {
		grid-auto-rows: auto;
	}

	.gallery-grid--count-1 .gallery-grid__item a {
		aspect-ratio: 4 / 3;
	}

	.object-directions__map {
		aspect-ratio: 4 / 3;
	}

	.object-directions .btn {
		width: 100%;
	}

	.lightbox {
		padding: 72px 16px 88px;
	}

	.lightbox__image {
		max-height: calc(100dvh - 200px);
	}

	.lightbox__close {
		top: 16px;
		right: 16px;
	}

	/* Стрілки — внизу по боках */
	.lightbox__prev,
	.lightbox__next {
		top: auto;
		bottom: 24px;
		transform: none;
	}

	.lightbox__prev {
		left: 16px;
	}

	.lightbox__next {
		right: 16px;
	}
}

/* ==========================================================
   Сторінка «Про проєкт»
   Шапка, «Чому зараз», картки об'єктів — компоненти сторінки об'єкта і головної
   ========================================================== */

/* Заголовок «Про проєкт» більший, ніж на сторінці об'єкта: до 80px, як hero на головній */
.project-intro__title {
	font-size: clamp(2em, 5.6vw, 5em);
}

/* Руда частина заголовка — окремим першим рядком */
.project-intro__title .accent {
	display: block;
}

/* Реквізити: 3 колонки з лінією зверху */
.credits {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 32px;
	margin: 48px 0 0;
}

.credits__item {
	padding-top: 16px;
	border-top: 2px solid var(--line);
}

.credits__item dt {
	margin-bottom: 8px;
}

.credits__item dd {
	margin: 0;
}

.credits__value {
	font-family: var(--font-display);
	font-size: 1.25em;
	font-weight: 600;
	line-height: 1.25;
}

.credits__list {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

/* Новий підхід: темна смуга, пункти 2×2 з номерами */
.project-approach {
	background-color: var(--dark);
	color: var(--white);
}

.project-approach__text {
	max-width: 760px;
	margin-top: 20px;
	font-size: 1.125em;
	color: rgba(255, 255, 255, 0.8);
}

.approach-list {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 40px 48px;
	margin-top: 48px;
}

.approach-list__item {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	gap: 20px;
	padding-top: 24px;
	border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.approach-list__number {
	font-family: var(--font-display);
	font-size: 2.75em;
	font-weight: 600;
	line-height: 1;
}

.approach-list__title {
	margin-bottom: 8px;
	font-family: var(--font-display);
	font-size: 1.375em;
	font-weight: 600;
	line-height: 1.2;
}

.approach-list__text {
	color: rgba(255, 255, 255, 0.75);
}

/* Знакові об'єкти: 4 картки в ряд */
.project-objects__head {
	margin-bottom: 32px;
}

.project-objects__head .page-head__text {
	margin-top: 12px;
	font-size: 1em;
}

.objects__list--four {
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 24px;
}

.objects__list--four .object-card__title {
	margin-bottom: 8px;
	font-size: 1.375em;
}

/* Мета під назвою, а не над нею — як у макеті */
.objects__list--four .object-card__link {
	display: grid;
	grid-template-areas: "image" "title" "meta";
	align-content: start;
}

.objects__list--four .object-card__image {
	grid-area: image;
}

.objects__list--four .object-card__title {
	grid-area: title;
}

.objects__list--four .object-card__meta {
	grid-area: meta;
	margin: 0;
	font-family: var(--font-body);
	letter-spacing: 0;
	text-transform: none;
}

/* Що це змінить: сіра панель */
.project-change-section {
	padding-top: 0;
}

/* Без блоку об'єктів після темної смуги «Новий підхід» — повернути верхній відступ,
   інакше панель / партнери прилипають до смуги */
.project-approach + .project-change-section,
.project-approach + .project-partners {
	padding-top: var(--section);
}

.project-change {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
	align-items: start;
	gap: 64px;
	padding: 56px 64px;
	background-color: var(--panel);
}

.project-change__lead {
	margin-top: 20px;
	font-family: var(--font-display);
	font-size: 1.5em;
	font-weight: 600;
	line-height: 1.3;
}

.project-change__text {
	color: var(--text-muted);
}

/* Партнери: до 5 логотипів — 5 у ряд */
.project-partners {
	padding-top: 0;
}

.project-partners__title {
	margin-bottom: 32px;
}

.partners--five {
	grid-template-columns: repeat(5, minmax(0, 1fr));
}

/* Більші логотипи на «Про проєкт» — вища комірка */
.project-partners .partner {
	height: 120px;
}

.project-partners__note {
	max-width: 760px;
	margin-top: 32px;
	font-size: 0.875em;
	color: var(--text-muted);
}

@media screen and (max-width: 1023px) {
	.credits {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 24px 32px;
		margin-top: 40px;
	}

	.approach-list {
		gap: 32px;
	}

	.project-change {
		grid-template-columns: minmax(0, 1fr);
		gap: 32px;
		padding: 40px;
	}

	.partners--five {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media screen and (max-width: 767px) {
	.credits {
		grid-template-columns: minmax(0, 1fr);
		gap: 20px;
		margin-top: 32px;
	}

	.project-approach__text {
		font-size: 1em;
	}

	.approach-list {
		grid-template-columns: minmax(0, 1fr);
		gap: 28px;
		margin-top: 32px;
	}

	.approach-list__number {
		font-size: 2.25em;
	}

	.approach-list__title {
		font-size: 1.25em;
	}

	.project-change {
		margin: 0 calc(-1 * var(--gutter));
		padding: 40px var(--gutter);
	}

	.project-change__lead {
		font-size: 1.25em;
	}

	.partners--five {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* ==========================================================
   Список моделей (шаблон «Список моделей»)
   ========================================================== */

.page-head {
	max-width: 760px;
	margin-bottom: 48px;
}

.page-head__text {
	margin-top: 20px;
	font-size: 1.125em;
	color: var(--text-muted);
}

/* Контент сторінки: відступ між абзацами, посилання підкреслені */
.page-head__text > * + * {
	margin-top: 1em;
}

.page-head__text a {
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* Сітка карток; самі картки — .object-card з блоку об'єктів */
.cards-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 48px 32px;
}

/* ==========================================================
   Сторінка моделі: плеєр на весь екран
   ========================================================== */

/* Без прокрутки і без зарезервованого місця під скролбар (scrollbar-gutter з html) */
html:has(body.single-models) {
	overflow: hidden;
	scrollbar-gutter: auto;
}

body.single-models {
	overflow: hidden;
}

.model-page {
	position: relative;
	width: 100%;
	height: 100vh;
	height: 100dvh;
	/* Кастомний фон з ACF: фото → градієнт → колір */
	background-color: var(--model-bg-color, var(--viewer-bg));
	background-image: var(--model-bg-image, none), var(--model-bg-gradient, none);
	background-position: center;
	background-size: cover;
	background-repeat: no-repeat;
}

/* Плеєр прозорий, щоб було видно фон сторінки */
.model-page .model-viewer,
.model-page .model-fallback {
	display: block;
	width: 100%;
	height: 100%;
	--poster-color: transparent;
	background-color: transparent;
}

.model-page .model-fallback {
	object-fit: contain;
}

/* Смуга завантаження model-viewer — в акцентному кольорі */
.model-page .model-viewer::part(default-progress-bar) {
	height: 3px;
	background-color: var(--accent);
}

/* Верхня панель поверх плеєра: кнопка назад зліва, назва по центру */
.model-bar {
	position: absolute;
	top: 0;
	right: 0;
	left: 0;
	z-index: 2;
	display: grid;
	grid-template-columns: 48px minmax(0, 1fr) 48px;
	align-items: start;
	gap: 16px;
	padding: 32px var(--gutter);
	pointer-events: none;
}

.model-heading {
	text-align: center;
}

.model-heading__kicker {
	margin-bottom: 8px;
}

.model-title {
	font-family: var(--font-display);
	font-size: clamp(1.75em, 3vw, 3em);
	font-weight: 700;
	line-height: 1.1;
}

/* Квадратна контурна кнопка, як .btn--outline */
.model-back,
.model-back:visited {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border: 1.5px solid var(--text);
	background-color: rgba(243, 241, 236, 0.85);
	color: var(--text);
	pointer-events: auto;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.model-back:hover,
.model-back:focus-visible {
	background-color: var(--text);
	color: var(--bg);
}

.model-back .icon {
	width: 22px;
	height: 22px;
}

/* ==========================================================
   Ноутбук
   ========================================================== */

@media screen and (max-width: 1199px) {
	:root {
		--section: 72px;
	}

	.site-header__inner {
		gap: 24px;
	}

	.header-menu {
		gap: 8px 20px;
	}


	.history__list {
		--slide-gap: 24px;
	}

	.panel {
		padding: 32px;
	}
}

/* ==========================================================
   Планшет
   ========================================================== */

@media screen and (max-width: 1023px) {
	:root {
		--gutter: 24px;
		--section: 64px;
		--header-h: 64px;
	}

	/* Хедер: бургер і повноекранне меню */
	.site-header {
		position: sticky;
		top: 0;
	}

	.site-header__inner {
		display: flex;
		justify-content: space-between;
	}

	.site-header__burger {
		position: relative;
		display: flex;
		align-items: center;
		justify-content: center;
		width: 44px;
		height: 44px;
		margin-right: -10px;
		padding: 0;
		border: 0;
		border-radius: 0;
		background: none;
		color: var(--text);
		cursor: pointer;
	}

	.site-header__burger span,
	.site-header__burger span::before,
	.site-header__burger span::after {
		position: absolute;
		width: 24px;
		height: 2px;
		background-color: currentColor;
		transition: transform 0.25s ease, opacity 0.2s ease;
	}

	.site-header__burger span::before,
	.site-header__burger span::after {
		content: "";
		left: 0;
	}

	.site-header__burger span::before {
		transform: translateY(-7px);
	}

	.site-header__burger span::after {
		transform: translateY(7px);
	}

	.menu-open .site-header__burger span {
		background-color: transparent;
	}

	.menu-open .site-header__burger span::before {
		background-color: var(--text);
		transform: rotate(45deg);
	}

	.menu-open .site-header__burger span::after {
		background-color: var(--text);
		transform: rotate(-45deg);
	}

	.site-header__panel {
		display: flex;
		position: fixed;
		top: var(--header-h);
		right: 0;
		bottom: 0;
		left: 0;
		flex-direction: column;
		align-items: flex-start;
		justify-content: space-between;
		gap: 40px;
		padding: 32px var(--gutter) max(32px, env(safe-area-inset-bottom));
		overflow-y: auto;
		background-color: var(--bg);
		border-top: 1px solid var(--line-soft);
		opacity: 0;
		visibility: hidden;
		transform: translateY(-8px);
		transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s;
	}

	.menu-open .site-header__panel {
		opacity: 1;
		visibility: visible;
		transform: none;
		transition: opacity 0.25s ease, transform 0.25s ease;
	}

	body.menu-open {
		overflow: hidden;
	}

	.site-header__nav {
		width: 100%;
	}

	.header-menu {
		flex-direction: column;
		gap: 0;
	}

	.header-menu a {
		display: block;
		padding: 14px 0;
		border-bottom: 1px solid var(--line-soft);
		font-family: var(--font-display);
		font-size: 1.75em;
		font-weight: 600;
		line-height: 1.2;
	}

	.lang-switch {
		gap: 24px;
	}

	.lang-switch a {
		font-size: 1em;
	}

	/* Hero: текст, під ним фото */
	.hero {
		padding: 40px 0 56px;
	}

	.hero__inner {
		grid-template-columns: minmax(0, 1fr);
		gap: 40px;
	}

	.hero__text {
		max-width: 600px;
	}

	/* Переваги 2×2 */
	.features__list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 40px 24px;
	}

	/* Горизонтальні слайдери: об'єкти й історія */
	.slider {
		display: grid;
		grid-auto-flow: column;
		grid-template-columns: none;
		grid-auto-columns: calc((100% - 24px) / 2.15);
		gap: 24px;
		margin-right: calc(-1 * var(--bleed));
		margin-left: calc(-1 * var(--bleed));
		padding: 0 var(--bleed) 4px;
		overflow-x: auto;
		scroll-padding: 0 var(--bleed);
		scroll-snap-type: x mandatory;
		scrollbar-width: none;
		-webkit-overflow-scrolling: touch;
	}

	.slider::-webkit-scrollbar {
		display: none;
	}

	.slider > li {
		scroll-snap-align: start;
	}

	.history__list {
		grid-auto-columns: calc((100% - 48px) / 3.2);
		margin: 40px calc(-1 * var(--bleed)) 24px;
	}

	/* Мапа над текстом */
	.map-section__inner {
		grid-template-columns: minmax(0, 1fr);
		gap: 40px;
	}

	.media__inner {
		gap: 24px;
	}

	.panel {
		padding: 28px;
	}

	.about__inner {
		grid-template-columns: minmax(0, 1fr);
		gap: 40px;
	}

	.site-footer {
		padding-top: 64px;
	}

	.site-footer__top {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 40px 32px;
	}

	.site-footer__brand {
		grid-column: 1 / -1;
	}

	/* Список моделей */
	.page-head {
		margin-bottom: 40px;
	}

	.cards-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 40px 24px;
	}

	/* Сторінка моделі */
	.model-bar {
		padding-top: 24px;
	}
}

/* ==========================================================
   Мобільні
   ========================================================== */

@media screen and (max-width: 767px) {
	:root {
		--gutter: 16px;
		--section: 56px;
	}

	.section-head {
		align-items: flex-start;
		flex-direction: column;
		gap: 12px;
		margin-bottom: 24px;
	}

	.hero {
		padding: 28px 0 48px;
	}

	.hero__text {
		margin: 0 0 28px;
		font-size: 1em;
	}

	.buttons .btn {
		flex: 1 1 100%;
	}

	.features__list {
		grid-template-columns: minmax(0, 1fr);
		gap: 28px;
	}

	.feature {
		display: grid;
		grid-template-columns: auto minmax(0, 1fr);
		column-gap: 16px;
		padding-top: 20px;
	}

	.feature .icon {
		grid-row: span 2;
		margin: 0;
	}

	.feature__title {
		font-size: 1.25em;
	}

	.slider {
		grid-auto-columns: 82%;
		gap: 16px;
	}

	.history__list {
		grid-auto-columns: 62%;
		margin: 32px calc(-1 * var(--bleed)) 20px;
	}

	/* На мобільному лише точки і свайп, без стрілок */
	.slider-nav {
		display: none;
	}

	.slider-dots {
		margin-bottom: 32px;
	}

	.object-card__title {
		font-size: 1.5em;
	}

	.page-head {
		margin-bottom: 32px;
	}

	.page-head__text {
		margin-top: 16px;
		font-size: 1em;
	}

	.cards-grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 32px;
	}

	.history .btn {
		width: 100%;
	}

	.map-section__map {
		aspect-ratio: 1 / 1;
	}

	.map-section .btn {
		width: 100%;
	}

	.media__inner {
		grid-template-columns: minmax(0, 1fr);
		gap: 16px;
	}

	.panel {
		margin: 0 calc(-1 * var(--gutter));
		padding: 32px var(--gutter);
	}

	.audio-player {
		padding: 16px;
	}

	.partners {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 24px 32px;
	}

	/* Останній логотип у ряду сам — по центру на всю ширину */
	.partners li:last-child:nth-child(2n + 1) {
		grid-column: 1 / -1;
	}

	.partner {
		height: 88px;
	}

	.site-footer {
		padding: 56px 0 24px;
	}

	.site-footer__top {
		grid-template-columns: minmax(0, 1fr);
		gap: 32px;
	}

	.site-footer__bottom {
		flex-direction: column;
		margin-top: 40px;
	}

	.map-popup__title {
		font-size: 1.125em;
	}
}

@media screen and (max-width: 575px) {
	.model-bar {
		grid-template-columns: 44px minmax(0, 1fr) 44px;
		gap: 12px;
		padding-top: max(16px, env(safe-area-inset-top));
	}

	.model-back {
		width: 44px;
		height: 44px;
	}

	.model-heading__kicker {
		margin-bottom: 4px;
	}

	.model-title {
		font-size: 1.5em;
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		transition: none !important;
	}
}
