/**
 * Horizon — публичная тема CCC.
 * Референс вида: YOOtheme Horizon demo (структура/токены).
 * Стили свои, префикс horizon-; без hotlink на demo.yootheme.com.
 *
 * @author CCC
 */

:root {
	--horizon-font: "Work Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
	--horizon-color-text: #292929;
	--horizon-color-muted: #a0a0a0;
	--horizon-color-meta: #8a8a8a;
	--horizon-color-accent: #f91b24;
	--horizon-color-bg: #ffffff;
	--horizon-color-footer-bg: #fafafa;
	--horizon-color-border: #e9e9e9;
	--horizon-header-h: 80px;
	--horizon-container: 1200px;
	--horizon-text-max: 720px;
	/* Оверрайд глобальных инпутов CCC (css/cotcustom.css) */
	--cotcustom-input-focus: #292929;
}

html {
	font-family: var(--horizon-font);
	color: var(--horizon-color-text);
	background: var(--horizon-color-bg);
	-webkit-font-smoothing: antialiased;
}

body.horizon-site {
	margin: 0;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	font-family: var(--horizon-font);
	color: var(--horizon-color-text);
	background: var(--horizon-color-bg);
}

.horizon-main {
	flex: 1 0 auto;
	width: 100%;
}

/* ——— Header ——— */
.horizon-header {
	background: var(--horizon-color-bg);
	z-index: 100;
}

.horizon-header .uk-navbar-container:not(.uk-navbar-transparent) {
	background: var(--horizon-color-bg);
}

.horizon-header .uk-navbar-nav > li > a {
	min-height: var(--horizon-header-h);
	padding: 0 15px;
	font-size: 12px;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 1px;
	color: var(--horizon-color-muted);
	position: relative;
}

.horizon-header .uk-navbar-nav > li > a:hover,
.horizon-header .uk-navbar-nav > li.uk-active > a {
	color: var(--horizon-color-text);
}

/* Красная черта сверху у активного пункта (как в демо) */
.horizon-header .uk-navbar-nav > li > a::before {
	content: "";
	position: absolute;
	top: 0;
	left: 15px;
	right: 15px;
	height: 0;
	background: transparent;
	transition: height 0.1s ease, background-color 0.1s ease;
}

.horizon-header .uk-navbar-nav > li.uk-active > a::before {
	height: 2px;
	background: var(--horizon-color-accent);
}

.horizon-logo {
	display: inline-flex;
	align-items: center;
	min-height: var(--horizon-header-h);
}

.horizon-logo img {
	display: block;
	height: 12px;
	width: auto;
}

/* Переключатель языка: текущий код + dropdown (и desktop, и mobile) */
.horizon-locale {
	position: relative;
	padding-left: 8px !important;
	padding-right: 4px !important;
}

.horizon-locale__current {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.25rem;
	min-height: 2.25rem;
	padding: 0 8px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--horizon-color-text);
	border: 1px solid var(--horizon-color-border);
	border-radius: 2px;
}

.horizon-locale__current:hover {
	color: var(--horizon-color-text);
	border-color: var(--horizon-color-muted);
	text-decoration: none;
}

.horizon-locale__dropdown {
	min-width: 4.5rem;
	padding: 4px 0;
}

.horizon-locale__list {
	margin: 0;
	padding: 0;
}

.horizon-locale__link {
	display: block;
	padding: 8px 14px !important;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-align: center;
	text-decoration: none;
	color: var(--horizon-color-muted) !important;
}

.horizon-locale__link:hover,
.horizon-locale__link.selected,
.horizon-locale__el.selected .horizon-locale__link,
.horizon-locale__link[aria-current="true"] {
	color: var(--horizon-color-text) !important;
	background: transparent;
	box-shadow: inset 0 -2px 0 var(--horizon-color-accent);
}

/* ——— Page (single) ——— */
.horizon-page {
	padding: 40px 0 80px;
}

/* С hero: без верхнего padding — cover сразу под шапкой сайта */
.horizon-page:has(.horizon-page__hero) {
	padding-top: 0;
}

/* Hero cover (blueimg) — full-bleed; высоты как Siena .page_hero */
.horizon-page__hero {
	position: relative;
	display: block;
	margin: 0 0 40px;
	width: 100%;
}

.horizon-page__hero .blueimg-preview {
	margin-bottom: 0;
	border-radius: 0;
}

/* Siena beta-main / beta-mobile: 250 → 350@960 → 400@1200 */
.horizon-page__hero .blueimg-preview__bg {
	border-radius: 0;
	height: 250px;
}

@media (min-width: 960px) {
	.horizon-page__hero .blueimg-preview__bg {
		height: 350px;
	}
}

@media (min-width: 1200px) {
	.horizon-page__hero .blueimg-preview__bg {
		height: 400px;
	}
}

/* Подпись hero (title файла), логика Siena ::after — один блок */
.horizon-page__hero-caption {
	position: absolute;
	bottom: 10px;
	left: 10px;
	z-index: 2;
	padding: 5px 10px;
	font-size: 12px;
	line-height: 1.3;
	color: #fff;
	background: rgba(68, 68, 68, 0.47);
}

/* Коллаж gallery после текста */
.horizon-page__gallery {
	margin-top: 2.5rem;
}

.horizon-page-collage {
	display: flex;
	aspect-ratio: 1 / 1;
	max-height: min(70vh, 560px);
	overflow: hidden;
	border-radius: 12px;
	gap: 0.5rem;
}

/* Мобилка: только первый кадр (как @xl:grid у референса) */
.horizon-page-collage__cell {
	position: relative;
	display: none;
	overflow: hidden;
	border-radius: 8px;
	min-height: 0;
	text-decoration: none;
	color: inherit;
	cursor: pointer;
}

.horizon-page-collage__cell:first-child {
	display: block;
	flex: 1 1 auto;
	width: 100%;
}

.horizon-page-collage__cell .blueimg-figure {
	position: absolute;
	inset: 0;
	height: 100%;
	margin: 0;
	border-radius: inherit;
	box-shadow: none;
	min-height: 0;
}

.horizon-page-collage__cell .blueimg-figure__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: inherit;
	transform: none;
}

.horizon-page-collage__cell:hover .blueimg-figure__img {
	transform: scale(1.03);
}

.horizon-page-collage__more {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.45);
	color: #fff;
	font-size: 1.5rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	pointer-events: none;
}

@media (min-width: 960px) {
	.horizon-page-collage {
		display: grid;
		aspect-ratio: 1024 / 508;
		max-height: none;
	}

	.horizon-page-collage__cell {
		display: block;
	}

	/* 1: один кадр на всю ширину */
	.horizon-page-collage--1 {
		grid-template-columns: 1fr;
		grid-template-rows: 1fr;
	}

	/* 2: два равных */
	.horizon-page-collage--2 {
		grid-template-columns: 1fr 1fr;
		grid-template-rows: 1fr;
	}

	/* 3: большой слева, 2 справа */
	.horizon-page-collage--3 {
		grid-template-columns: 1.2fr 1fr;
		grid-template-rows: 1fr 1fr;
	}

	.horizon-page-collage--3 .horizon-page-collage__cell--lead {
		grid-column: 1;
		grid-row: 1 / -1;
	}

	/* 4: сетка 2×2 */
	.horizon-page-collage--4 {
		grid-template-columns: 1fr 1fr;
		grid-template-rows: 1fr 1fr;
	}

	/* 5+: большой слева (2×2), 4 мелких справа */
	.horizon-page-collage--5 {
		grid-template-columns: repeat(4, 1fr);
		grid-template-rows: 1fr 1fr;
	}

	.horizon-page-collage--5 .horizon-page-collage__cell--lead {
		grid-column: 1 / 3;
		grid-row: 1 / 3;
	}
}

.horizon-page__media {
	margin-bottom: 40px;
}

.horizon-page__media img {
	display: block;
	width: 100%;
	height: auto;
	object-fit: cover;
	max-height: 520px;
}

.horizon-page__head {
	text-align: center;
	max-width: var(--horizon-text-max);
	margin: 0 auto 32px;
	padding: 0 20px;
}

.horizon-page__title {
	margin: 0 0 12px;
	font-size: clamp(1.75rem, 3vw, 2.5rem);
	font-weight: 400;
	line-height: 1.25;
	letter-spacing: -0.01em;
	color: var(--horizon-color-text);
}

.horizon-page__meta {
	margin: 0;
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 1.5px;
	text-transform: uppercase;
	color: var(--horizon-color-meta);
}

.horizon-page__body {
	max-width: var(--horizon-text-max);
	margin: 0 auto;
	padding: 0 20px;
	font-size: 1.05rem;
	line-height: 1.75;
	color: #555;
}

.horizon-page__body p {
	margin: 0 0 1.25em;
}

/* Плагин tags есть, но тегов у страницы нет — блок не показываем */
.horizon-page__tags:not(:has(a)) {
	display: none;
}

.horizon-page__body h2,
.horizon-page__body h3 {
	color: var(--horizon-color-text);
	font-weight: 500;
	margin: 2em 0 0.75em;
}

.horizon-page__crumbs {
	max-width: var(--horizon-container);
	margin: 0 auto 24px;
	padding: 0 20px;
	font-size: 12px;
	color: var(--horizon-color-muted);
}

.horizon-page__crumbs a {
	color: var(--horizon-color-muted);
	text-decoration: none;
}

.horizon-page__admin,
.horizon-page__extras {
	max-width: var(--horizon-text-max);
	margin: 48px auto 0;
	padding: 0 20px;
}


/* ——— List (news / category) ——— */
.horizon-list {
	padding: 48px 0 80px;
}

/* Page add/edit: форма узкая; hero — отдельный full-bleed блок над ней */
.horizon-page-form {
	max-width: min(900px, 100%);
	margin-left: auto;
	margin-right: auto;
	padding-left: 16px;
	padding-right: 16px;
	box-sizing: border-box;
}

.horizon-list__title {
	text-align: center;
	font-size: clamp(1.75rem, 3vw, 2.25rem);
	font-weight: 400;
	margin: 0 0 40px;
}

.horizon-list__row {
	margin-bottom: 64px;
}

.horizon-list__card {
	display: block;
	text-decoration: none;
	color: inherit;
}

/* Превью списка — сетка в blueimg.css (.blueimg-list-grid) */

.horizon-list__card-title {
	margin: 0 0 10px;
	/* Крупнее и над сеткой картинок */
	font-size: clamp(1.75rem, 2.8vw, 2.35rem);
	font-weight: 400;
	line-height: 1.3;
	color: var(--horizon-color-text);
}

.horizon-list__card-meta {
	margin: 0 0 12px;
	font-size: 11px;
	letter-spacing: 1.2px;
	text-transform: uppercase;
	color: var(--horizon-color-meta);
}

.horizon-list__card-excerpt {
	margin: 0;
	font-size: 1rem;
	line-height: 1.65;
	color: #666;
}

.horizon-list__paging {
	margin-top: 48px;
	text-align: center;
}

/* ——— Footer ——— */
.horizon-footer {
	background: var(--horizon-color-footer-bg);
	border-top: 1px solid var(--horizon-color-border);
	padding: 64px 0 32px;
	flex-shrink: 0;
}

.horizon-footer__title {
	margin: 0 0 16px;
	font-size: 14px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 1px;
}

.horizon-footer__nav {
	list-style: none;
	margin: 0;
	padding: 0;
}

.horizon-footer__nav a {
	display: inline-block;
	padding: 4px 0;
	color: var(--horizon-color-muted);
	text-decoration: none;
	font-size: 14px;
}

.horizon-footer__nav a:hover {
	color: var(--horizon-color-text);
}

.horizon-footer__mail {
	color: var(--horizon-color-text);
	text-decoration: none;
	font-size: 14px;
}

.horizon-footer__social {
	margin-top: 16px;
}

.horizon-footer__bottom {
	margin-top: 48px;
	padding-top: 24px;
	border-top: 1px solid var(--horizon-color-border);
	font-size: 12px;
	color: var(--horizon-color-muted);
}

.horizon-footer__bottom a {
	color: var(--horizon-color-muted);
	text-decoration: none;
	margin-right: 16px;
}

.horizon-footer__bottom a:hover {
	color: var(--horizon-color-text);
}

/* Warnings / forms inside theme */
.horizon-main .uk-alert {
	max-width: var(--horizon-container);
	margin-left: auto;
	margin-right: auto;
}
