/*
 * capture 20260915-155144-header-navigation-item · корни: «Header — Navigation item», «header»
 *
 * Шапка fond-manifest.ru. Ось Breakpoint из Figma — container query по ширине .fmh:
 *   до 767     Mobile (768 and less) и Mini Tablet (767 and less), меню бургером
 *   768–1023   Mini Tablet (768-1024), меню бургером
 *   1024–1259  Tablet (1024-1260)
 *   от 1260    Desktop (1260 and more), Mega Dropdown
 * Пути к шрифтам относительные: файл подключается напрямую, без склейки Битрикса.
 */

/* Веса на 100 легче макета по просьбе заказчика: SemiBold → Medium, Medium → Regular */
@font-face {
	font-family: "FM Header";
	src: url("../fonts/montserrat/Montserrat-Regular.woff") format("woff");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "FM Header";
	src: url("../fonts/montserrat/Montserrat-Medium.woff") format("woff");
	font-weight: 500;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "FM Header Alt";
	src: url("../fonts/montserrat/MontserratAlternates-Medium.ttf") format("truetype");
	font-weight: 500;
	font-style: normal;
	font-display: swap;
}

.fmh {
	--fmh-blue: #4d53c6;
	--fmh-blue-dark: #3f43a0;
	--fmh-current: #b0b4ff;
	--fmh-muted: #868686;
	container: fmh / inline-size;
	position: relative;
	z-index: 1000;
	background: var(--fmh-blue);
	color: #fff;
	font-family: "FM Header", Montserrat, Arial, sans-serif;
	text-align: left;
}

/*
 * Сброс: на сайте подключены Bootstrap и styles.css с глобальными правилами.
 * Специфичность через :where() не выше элементного селектора, иначе сброс
 * перебивает классы компонента. Файл подключается после ShowHead и выигрывает по порядку.
 * Исключение — цвет ссылок: у Bootstrap a:hover (0,1,1), поэтому .fmh a:hover
 * и цвета ниже с двойным классом.
 */
.fmh *,
.fmh *::before,
.fmh *::after {
	box-sizing: border-box;
}

.fmh a,
.fmh a:hover,
.fmh a:focus {
	color: inherit;
	text-decoration: none;
}

:where(.fmh) ul,
:where(.fmh) li,
:where(.fmh) p {
	margin: 0;
	padding: 0;
	list-style: none;
}

:where(.fmh) button {
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	color: inherit;
	font: inherit;
	cursor: pointer;
}

:where(.fmh) img,
:where(.fmh) svg {
	display: block;
}

/* обводок фокуса нет нигде на сайте, см. глобальное правило в styles.css */
.fmh :focus,
.fmh :focus-visible {
	outline: none;
}

/* пока открыт бургер или Mega Dropdown, страница не скроллится (site-header.js) */
html.fmh-lock {
	overflow: hidden;
	scrollbar-gutter: stable;
}

/* trim:cap-height из макета */
.fmh__link-text,
.fmh__contact span,
.fmh__btn span,
.fmh__mega-title,
.fmh__mega-link,
.fmh__mega-more span {
	text-box: trim-both cap alphabetic;
}

/* ---------- до 767: Mobile ---------- */

.fmh__body {
	padding: 10px 0;
}

.fmh.is-open .fmh__body {
	padding-bottom: 0;
}

.fmh__top {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	grid-template-areas:
		"brand brand"
		"buttons toggle";
	align-items: center;
	gap: 10px 40px;
	padding: 0 10px;
}

.fmh.is-open .fmh__top {
	column-gap: 20px;
}

.fmh__brand {
	grid-area: brand;
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
}

.fmh__logo {
	flex: none;
	width: 60px;
	height: 60px;
}

.fmh__name {
	flex: 1 1 0;
	min-width: 0;
	font-family: "FM Header Alt", MontserratAlternates, Montserrat, Arial, sans-serif;
	font-weight: 500;
	font-size: 17px;
	line-height: 21px;
	text-transform: uppercase;
}

.fmh__name-line {
	display: block;
}

.fmh__contacts {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 20px;
}

.fmh__contacts--top {
	display: none;
	grid-area: contacts;
}

.fmh__contact {
	display: flex;
	align-items: center;
	gap: 10px;
	font-weight: 400;
	font-size: 16px;
	line-height: 1;
	white-space: nowrap;
}

.fmh__contact--phone {
	gap: 6px;
}

.fmh__icon {
	flex: none;
	width: 20px;
	height: 20px;
}

.fmh__buttons {
	grid-area: buttons;
	display: flex;
	gap: 10px;
	min-width: 0;
}

.fmh__btn {
	flex: 1 1 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 12px 10px;
	border-radius: 7px;
	font-weight: 500;
	font-size: 11px;
	line-height: 1;
	white-space: nowrap;
	transition: background-color .15s;
}

.fmh .fmh__btn.fmh__btn--secondary {
	background: var(--fmh-blue);
	box-shadow: inset 0 0 0 1.35px #fff, inset 0 0 7.02px #fff;
	color: #fff;
}

.fmh .fmh__btn.fmh__btn--primary {
	background: #fff;
	color: var(--fmh-blue-dark);
}

.fmh__toggle {
	grid-area: toggle;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 22px;
}

.fmh__toggle-icon {
	display: none;
	flex: none;
	overflow: visible;
}

.fmh__toggle-icon--burger-sm {
	display: block;
	width: 30px;
	height: 24px;
}

.fmh.is-open .fmh__toggle {
	width: 25px;
	height: 24.72px;
}

.fmh.is-open .fmh__toggle-icon--burger-sm {
	display: none;
}

.fmh.is-open .fmh__toggle-icon--close-sm {
	display: block;
	width: 27px;
	height: 27px;
}

.fmh__panel {
	display: none;
}

/* открытый бургер доходит до низа окна (--fmh-panel-h считает site-header.js),
   скроллятся только пункты, почта и телефон всегда видны внизу */
.fmh.is-open .fmh__panel {
	display: flex;
	flex-direction: column;
	gap: 100px;
	height: var(--fmh-panel-h, auto);
	margin-top: 10px;
	padding: 30px 20px;
}

.fmh.is-open .fmh__nav {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.fmh.is-open .fmh__contacts--panel {
	flex: none;
}

.fmh__menu {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 25px;
}

/* высота — cap-height, округлённый до целого, как у текстового бокса в Figma */
.fmh__link {
	display: flex;
	align-items: center;
	gap: 6px;
	height: 13px;
	font-weight: 500;
	font-size: 18px;
	line-height: 1;
	white-space: nowrap;
	transition: color .15s, background-color .15s;
}

.fmh .fmh__link.is-current {
	color: var(--fmh-current);
}

.fmh__chevron {
	display: none;
	flex: none;
	width: 12px;
	height: 6px;
	overflow: visible;
}

.fmh__chevron-lg {
	flex: none;
	width: 16px;
	height: 8px;
	overflow: visible;
}

.fmh__link[aria-expanded="true"] .fmh__chevron,
.fmh__link[aria-expanded="true"] .fmh__chevron-lg {
	transform: rotate(180deg);
}

/* Mega Dropdown внутри бургера: макета нет, простой раскрывающийся список */
.fmh__mega {
	display: flex;
	flex-direction: column;
	gap: 25px;
	padding: 25px 0 0 20px;
}

.fmh__mega[hidden],
.fmh__overlay,
.fmh__mega-group--all .fmh__mega-title {
	display: none;
}

.fmh__mega-group,
.fmh__mega-cols,
.fmh__mega-list {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.fmh__mega-title {
	color: rgba(255, 255, 255, .6);
	font-weight: 500;
	font-size: 14px;
}

.fmh__mega-link {
	display: block;
	font-weight: 500;
	font-size: 16px;
	line-height: 20px;
	transition: color .15s;
}

.fmh__mega-more {
	align-self: flex-start;
	display: flex;
	align-items: center;
	gap: 6px;
	font-weight: 500;
	font-size: 16px;
	line-height: 1;
	transition: color .15s;
}

.fmh__arrow {
	flex: none;
	width: 20px;
	height: 11px;
}

.fmh__shadow {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	height: 15px;
	background: linear-gradient(0deg, rgba(255, 255, 255, 0) 0%, rgba(98, 98, 98, .3) 100%);
	pointer-events: none;
}

@media (hover: hover) {
	.fmh .fmh__link:hover {
		color: var(--fmh-current);
	}

	.fmh .fmh__btn.fmh__btn--secondary:hover {
		background: #5c62d6;
	}

	.fmh .fmh__btn.fmh__btn--primary:hover {
		background: #e8e9ff;
	}
}

/* ---------- 768–1023: Mini Tablet ---------- */

@container fmh (min-width: 768px) {
	.fmh__body,
	.fmh.is-open .fmh__body {
		padding: 25px 0;
	}

	.fmh__top,
	.fmh.is-open .fmh__top {
		grid-template-columns: auto minmax(0, 1fr);
		grid-template-areas:
			"contacts toggle"
			"brand toggle"
			"buttons buttons";
		gap: 5px 0;
		padding: 0 40px;
	}

	.fmh__contacts--top {
		display: flex;
		flex-wrap: nowrap;
		gap: 19px;
	}

	.fmh__contacts--top .fmh__contact {
		gap: 6px;
		font-size: 18px;
	}

	.fmh__contacts--top .fmh__contact--mail .fmh__icon {
		width: 23px;
		height: 23px;
	}

	.fmh__contacts--top .fmh__contact--phone .fmh__icon {
		width: 22px;
		height: 22px;
	}

	.fmh__brand {
		gap: 21px;
	}

	.fmh__logo {
		width: 110px;
		height: 110px;
	}

	.fmh__name {
		flex: none;
		width: 453px;
		font-size: 32px;
		line-height: 35px;
	}

	.fmh__buttons {
		gap: 10px;
		padding-top: 20px;
	}

	.fmh__btn {
		padding: 15px 10px;
		border-radius: 10px;
		font-size: 20px;
	}

	.fmh__toggle {
		justify-self: end;
		width: 62px;
		height: 43px;
	}

	.fmh.is-open .fmh__toggle {
		width: 44px;
		height: 43.5px;
	}

	.fmh__toggle-icon--burger-sm,
	.fmh.is-open .fmh__toggle-icon--close-sm {
		display: none;
	}

	.fmh__toggle-icon--burger {
		display: block;
		width: 62px;
		height: 46px;
	}

	.fmh.is-open .fmh__toggle-icon--burger {
		display: none;
	}

	.fmh.is-open .fmh__toggle-icon--close {
		display: block;
		width: 47px;
		height: 46px;
	}

	.fmh.is-open .fmh__panel {
		margin-top: 8px;
		padding: 30px 40px;
	}

	.fmh__menu {
		gap: 40px;
	}

	.fmh__link {
		height: 20px;
		font-size: 28px;
	}

	.fmh__contacts--panel {
		flex-wrap: nowrap;
		gap: 25px;
	}

	.fmh__contacts--panel .fmh__contact {
		gap: 10px;
		font-size: 22px;
	}

	.fmh__contacts--panel .fmh__icon {
		width: 25px;
		height: 25px;
	}

	.fmh__mega {
		gap: 35px;
		padding: 35px 0 0 30px;
	}

	.fmh__mega-group,
	.fmh__mega-cols,
	.fmh__mega-list {
		gap: 25px;
	}

	.fmh__mega-title {
		font-size: 18px;
	}

	.fmh__mega-link,
	.fmh__mega-more {
		font-size: 22px;
		line-height: 28px;
	}

	.fmh__shadow {
		height: 30px;
	}
}

/* ---------- 1024–1259: Tablet ---------- */

@container fmh (min-width: 1024px) {
	.fmh__body,
	.fmh.is-open .fmh__body {
		padding: 27px 0 0;
	}

	.fmh__top,
	.fmh.is-open .fmh__top {
		grid-template-areas:
			"contacts buttons"
			"brand buttons";
		gap: 11px 8px;
	}

	.fmh__brand {
		align-self: end;
	}

	.fmh__buttons {
		flex-direction: column;
		align-items: flex-end;
		align-self: stretch;
		gap: 20px;
		padding-top: 0;
	}

	.fmh__btn {
		flex: none;
		padding: 18px 20px;
	}

	.fmh .fmh__btn.fmh__btn--secondary {
		box-shadow: inset 0 0 0 2px #fff, inset 0 0 10.4px #fff;
	}

	.fmh__toggle {
		display: none;
	}

	.fmh__panel,
	.fmh.is-open .fmh__panel {
		display: block;
		height: auto;
		margin-top: 8px;
		padding: 0;
	}

	.fmh.is-open .fmh__nav {
		min-height: auto;
		overflow: visible;
	}

	.fmh__contacts--panel {
		display: none;
	}

	/* пункты не переносятся: горизонтальный скролл, мышью — перетаскиванием (site-header.js) */
	.fmh__menu {
		flex-direction: row;
		flex-wrap: nowrap;
		justify-content: safe center;
		align-items: stretch;
		gap: 2px;
		overflow-x: auto;
		overflow-y: hidden;
		overscroll-behavior-x: contain;
		scrollbar-width: none;
	}

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

	.fmh__menu.is-draggable {
		cursor: grab;
	}

	.fmh__menu.is-dragging {
		cursor: grabbing;
		user-select: none;
	}

	.fmh__menu.is-dragging .fmh__link {
		pointer-events: none;
	}

	.fmh__item {
		flex: none;
	}

	/* в макете обычные пункты горизонтального меню 19px, кнопка Mega Dropdown 20px */
	.fmh__link {
		height: 50px;
		padding: 0 15px;
		font-size: 19px;
	}

	.fmh__link--mega {
		font-size: 20px;
	}

	.fmh__chevron {
		display: block;
	}

	.fmh__chevron-lg {
		display: none;
	}

	.fmh .fmh__link--mega[aria-expanded="true"] {
		border-radius: 10px 10px 0 0;
		background: #fff;
		color: var(--fmh-blue);
	}

	/* 1224 = поля 80+80 и колонки 212+640+212; на узком «Все проекты» уходит вниз */
	.fmh__mega {
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		z-index: 2;
		flex-direction: row;
		flex-wrap: wrap;
		align-items: flex-start;
		gap: 45px clamp(40px, calc((100cqi - 1224px) / 2), 126px);
		max-height: var(--fmh-free, 70vh);
		padding: 45px 40px 55px;
		overflow: auto;
		overscroll-behavior: contain;
		background: #fff;
		color: #000;
	}

	.fmh__mega-group {
		gap: 45px;
	}

	.fmh__mega-title {
		color: var(--fmh-muted);
		font-size: 20px;
	}

	.fmh__mega-cols {
		flex-direction: row;
		align-items: flex-start;
		gap: 45px;
	}

	.fmh__mega-list {
		gap: 35px;
		width: 318px;
	}

	.fmh__mega-list:first-child {
		width: 277px;
	}

	.fmh__mega-group:first-child .fmh__mega-list {
		width: 212px;
	}

	.fmh__mega-link,
	.fmh__mega-more {
		font-size: 20px;
		line-height: 24px;
	}

	.fmh__mega-group--all {
		width: 212px;
	}

	.fmh__mega-group--all .fmh__mega-title {
		display: block;
		visibility: hidden;
	}

	.fmh__overlay {
		display: block;
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		z-index: 1;
		height: var(--fmh-free, 100vh);
		background: rgba(0, 5, 99, .4);
	}

	.fmh__overlay[hidden] {
		display: none;
	}

	@media (hover: hover) {
		.fmh .fmh__mega-link:hover,
		.fmh .fmh__mega-more:hover {
			color: var(--fmh-blue);
		}
	}
}

/* ---------- от 1260: Desktop ---------- */

@container fmh (min-width: 1260px) {
	.fmh__body,
	.fmh.is-open .fmh__body {
		padding-top: 22px;
	}

	.fmh__top,
	.fmh.is-open .fmh__top {
		grid-template-columns: minmax(0, 1fr) auto;
		grid-template-rows: repeat(3, minmax(0, 1fr));
		grid-template-areas:
			"brand contacts"
			"brand buttons"
			"brand buttons";
		height: 110px;
		padding: 0 70px;
	}

	.fmh__brand,
	.fmh__contacts--top,
	.fmh__buttons {
		align-self: stretch;
	}

	.fmh__contacts--top {
		justify-content: flex-end;
	}

	.fmh__buttons {
		flex-direction: row;
		justify-content: flex-end;
		align-items: flex-start;
		gap: 25px;
	}

	.fmh__menu {
		justify-content: flex-start;
		padding: 0 46px;
	}

	.fmh__mega {
		padding: 45px 80px 55px;
	}
}
