/*
 * Global styles: :root variables and site-wide rules. Loaded after assets/css/base.css.
 * Author: Fin-Code.
 */

:root {
	--primary-color: #163767;
	--primary-color-rgb: 24, 68, 154;
	--font-color: #363D4A;
	--font-color-rgb: 54, 61, 74;
	--font-color-muted: #868B92;
	--gray-border-color: #E1E7F2;
	--card-background-color: #F3F5FA;
	--menu-background-color: #F4F6FB;
	--font-family: 'PT Root UI', sans-serif;

	--content-width: 1320px;
	--content-side-padding: 30px;

	/* Шапка (верхнее меню) */
	--logo-bg: #132E59;
	--header-top-height: 54px;
	--header-sub-height: 65px;
	--header-full-height: calc(var(--header-top-height) + var(--header-sub-height));
	--header-pad-x: 60px;
	--logo-wide-width: 196px;
	--mobile-header-height: 56px;
	--mobile-home-sub-height: 53px;
	/* Height of the emergency alert strip above the header (template-parts/ui/emergency-alert) */
	--me-alert-height: 0px;
}



/* Всегда резервируем место под вертикальный скроллбар, чтобы при блокировке
   прокрутки (полное меню, offcanvas) страница и фиксированная шапка не «прыгали». */
html {
	scrollbar-gutter: stable;
	scroll-behavior: smooth;
	scroll-padding-top: calc(var(--me-alert-height) + var(--mobile-header-height));
}

@media (min-width: 769px) {
	html {
		scroll-padding-top: calc(var(--me-alert-height) + var(--header-sub-height));
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
}

body {
	font-family: var(--font-family);
	color: var(--font-color);
	margin: 0 !important;
}

a,
a:visited {
	text-decoration: none;
	color: var(--primary-color);
}

a:hover {
	text-decoration: underline;
}

a[href^="tel:"],
a[href^="mailto:"] {
	white-space: nowrap;
}

a:focus,
a:focus-visible,
:focus,
:focus-visible {
	outline: unset;
}

button {
	font-family: var(--font-family);
}

button:not([disabled]) {
	cursor: pointer;
}

button:active,
input[type="button"]:active,
input[type="reset"]:active,
input[type="submit"]:active {
	border-color: var(--gray-border-color);
}

/* ============================================
   Контент
   ============================================ */

.me-site {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

.me-content {
	flex: 1;
	width: 100%;
	display: flex;
	flex-direction: column;
	/* Фиксированная шапка: отступ = высота нижней строки (верхняя — оверлей, не сдвигает контент). */
	padding-top: calc(var(--me-alert-height) + var(--mobile-header-height));
}

@media (min-width: 769px) {
	.me-content {
		padding-top: calc(var(--me-alert-height) + var(--header-top-height) + var(--header-sub-height));
	}
}

/* Блокировка прокрутки при открытом мобильном меню */
body.me-menu-open {
	overflow: hidden;
}

/* ============================================
   Main
   ============================================ */

.me-main {
	flex: 1;
	margin: 0;
	width: 100%;
}

.me-container {
	max-width: calc(var(--content-width) + 2 * var(--content-side-padding));
	padding: 0 var(--content-side-padding);
	margin: 0 auto;
}

.me-section {
	padding-top: 80px;
	padding-bottom: 80px;
}

.me-main>.me-section:last-child {
	padding-bottom: 160px;
}

.me-columns {
	display: flex;
	gap: 25px;
}

.me-columns>* {
	flex: 1;
}

/* me-links-with-arrow */

.me-links-with-arrow {
	display: flex;
	flex-direction: column;
	align-items: stretch;
}

a.me-link-with-arrow {
	position: relative;
	font-size: 24px;
	color: var(--font-color);
	border-bottom: 1px solid var(--gray-border-color);
	padding: 22px 25px 22px 0px;
}

a.me-link-with-arrow::after {
	content: '';
	position: absolute;
	right: 0;
	top: 0;
	bottom: 0;
	width: 15px;
	background-image: url('/assets/icons/top-right-arrow.svg');
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center center;
}

a.me-link-with-arrow:hover {
	text-decoration: none;
	color: var(--primary-color);
	font-weight: 500;
}

a.me-link-with-arrow:hover::after {
	width: 20px;
	background-image: url('/assets/icons/top-right-arrow-hover.svg');
}

.skip-link {
	position: absolute;
	left: -9999px;
	z-index: 999999;
}

.skip-link:focus {
	left: 6px;
	top: 7px;
	width: auto;
	height: auto;
	padding: 8px 16px;
	background: #000;
	color: #fff;
	text-decoration: none;
}

/* me-table: data tables on the document pages (the wrapper scrolls horizontally on narrow screens) */

.me-table {
	overflow-x: auto;
}

.me-table table {
	width: 100%;
	border-collapse: collapse;
}

.me-table th,
.me-table td {
	padding: 12px 16px;
	border: 1px solid var(--gray-border-color);
	text-align: left;
	vertical-align: top;
	font-size: 16px;
	line-height: 1.3;
}

.me-table th {
	font-weight: 500;
	background-color: var(--card-background-color);
}

.me-table--numbers td:not(:first-child),
.me-table--numbers th:not(:first-child) {
	text-align: right;
	white-space: nowrap;
}

@media (max-width: 768px) {
	.me-table th,
	.me-table td {
		padding: 10px 12px;
		font-size: 14px;
	}
}

/* ============================================
   Маркированные списки (.me-bullets)
   ============================================ */

.me-bullets,
.me-list__bullets {
	list-style: none;
	margin: 0;
	padding: 0;
}

.me-bullets > li,
.me-list__bullets > li {
	position: relative;
	padding-left: 18px;
	margin-bottom: 8px;
	font-size: 16px;
	line-height: 1.1;
	color: var(--font-color);
}

.me-bullets > li:last-child,
.me-list__bullets > li:last-child {
	margin-bottom: 0;
}

.me-bullets > li::before,
.me-list__bullets > li::before {
	content: '';
	position: absolute;
	left: 0;
	top: 6px;
	width: 8px;
	height: 6px;
	background: var(--primary-color);
	clip-path: polygon(25% 0, 100% 0, 75% 100%, 0 100%);
}

/* Вложенный уровень — светлое длинное тире */
.me-bullets--sub {
	list-style: none;
	margin: 0;
	padding: 0;
}

.me-bullets--sub > li {
	position: relative;
	padding-left: 16px;
	margin-bottom: 8px;
	font-size: 14px;
	line-height: 1.3;
	color: var(--font-color);
}

.me-bullets--sub > li:last-child {
	margin-bottom: 0;
}

.me-bullets--sub > li::before {
	top: 0.6em;
	width: 10px;
	height: 1px;
	background: #d5ddeb;
	clip-path: none;
}

.me-bullets > li > .me-bullets--sub {
	margin-top: 8px;
}

/* ============================================
   404
   ============================================ */

body.error404 .me-main {
	display: flex;
	flex-direction: column;
}

.me-error-404 {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding-top: 80px;
	padding-bottom: 80px;
}

.me-error-404__code {
	margin: 0 0 32px;
	font-size: 140px;
	font-weight: 500;
	line-height: 1;
	color: var(--primary-color);
	opacity: 0.12;
	user-select: none;
}

.me-error-404__title {
	margin-bottom: 24px;
}

.me-error-404__text {
	max-width: 480px;
	margin-bottom: 40px;
}

.me-error-404__actions {
	margin-top: 20px;
	display: flex;
	justify-content: center;
}


/* mobile */

@media (max-width: 768px) {
	:root {
		--content-side-padding: 16px;
	}

	*[hom] {
		display: none;
	}

	.me-section {
		padding-top: 40px;
		padding-bottom: 40px;
	}

	.me-main>.me-section:last-child {
		padding-bottom: 80px;
	}

	.me-columns {
		flex-flow: column nowrap;
		gap: 20px;
	}

	a.me-link-with-arrow {
		font-size: 20px;
	}

	.me-error-404 {
		padding-top: 40px;
		padding-bottom: 40px;
	}

	.me-error-404__code {
		font-size: 96px;
		margin-bottom: 24px;
	}

	.me-error-404__title {
		margin-bottom: 16px;
	}

	.me-error-404__text {
		margin-bottom: 32px;
	}
}