/*
 * Header panels when the navigation comes only from WordPress menus (inc/tpm-nav-wp.php, Hub s677).
 * Loaded only in that mode (preview of menu copies, or the switch «Only WordPress menus»).
 *  - Every panel: as many columns as the menu has column headings, each column at least 280 px
 *    (TPM Research asked for ≥ 240 px; with the icon and the branch indent a column needs 280 px for
 *    «Карта життєвого циклу проєкту» to stay on one line — measured on dev 21.11).
 *    The old index-bound layout of the second panel (#tx2-panel-1: two columns, first spanning two rows)
 *    is cancelled: the layout follows the menu, not the panel's position.
 *  - Item with class col-plaque: a full-width plaque above the columns («System overview»).
 */

body.tpm-nav-wp .tpm-hv2-head .tx2-panel {
	width: max-content !important;
	max-width: calc(100vw - 48px) !important;
}

body.tpm-nav-wp .tpm-hv2-head .tx2-panel .tx2-cols {
	display: grid !important;
	grid-template-columns: repeat(var(--tpm-nav-cols, 3), minmax(280px, 1fr)) !important; /* own variable: an admin widget pins --tx2-cols of the second panel */
	grid-template-rows: none !important;
	gap: 22px 28px !important;
}

body.tpm-nav-wp .tpm-hv2-head .tx2-panel .tx2-col {
	grid-row: auto !important;
	grid-column: auto !important;
	min-width: 280px !important;
}

body.tpm-nav-wp .tpm-hv2-head .tx2-panel__inner.has-banner {
	grid-template-columns: minmax(0, 1fr) 240px !important;
}

body.tpm-nav-wp .tpm-hv2-head .tx2-main {
	min-width: 0;
}

body.tpm-nav-wp .tpm-hv2-head .tx2-plaque {
	margin: 0 0 14px;
}

body.tpm-nav-wp .tpm-hv2-head .tx2-plaque .tx2-link {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-height: 44px;
	padding: 6px 16px 6px 10px;
	border-radius: 12px;
	background: #fff;
}

body.tpm-nav-wp .tpm-hv2-head .tx2-plaque .tx2-link strong {
	font-weight: 700;
}

body.tpm-nav-wp .tpm-hv2-head .tx2-plaque .tx2-icon {
	width: 40px !important;
	height: 32px !important;
	flex-basis: 40px !important;
}

body.tpm-nav-wp .tpm-hv2-head .tx2-col__title > svg,
body.tpm-nav-wp .tpm-hv2-head .tx2-col__title > .tx2-icon {
	width: 36px;
	height: 30px;
	flex: 0 0 36px;
}

body.tpm-nav-wp .tpm-hv2-head .tx2-link .tpm-nav-pict {
	width: 28px;
	height: 26px;
	flex: 0 0 28px;
	fill: none;
}

body.tpm-nav-wp .tpm-hv2-head .tx2-link .tpm-nav-pict[viewBox="0 0 62 40"],
body.tpm-nav-wp .tpm-hv2-head .tx2-link .tpm-nav-pict[viewBox="0 0 200 160"] {
	width: 38px;
	flex-basis: 38px;
}

/* Mobile panel of the header (tx2) and the plaque inside it */
body.tpm-nav-wp .tx2-mobile .tx2-plaque {
	margin: 8px 0 4px;
}

/* ===========================================================================
 * G-027 (Alex 23.11.2026): desktop panels as in the approved PDF «TPM-EN-Megamenus».
 * The form (c1 / c2 / c3w / c3a / c3b) and the grid come from inc/tpm-header-v2.php
 * (tpm_hv2_composition: from the menu structure, not from the panel position).
 * Picture fills its own rectangle; column = card with a heading strip; branch line per list
 * ends with a curve at its last link (no straight tail below, no gap before the curve).
 * Earlier layers in page/widget styles (2026-11-10 navigation) are overridden only here.
 * ========================================================================= */


@media (min-width: 1201px) {
body.tpm-nav-wp header.tpm-hv2-head .tx2-panel.tx2-c {
	--tx2c-nav: #233445;
	--tx2c-ink: #253746;
	--tx2c-muted: #526271;
	--tx2c-pale: #e7eef6;
	--tx2c-line: #dce3ea;
	--tx2c-curve: #aebbc9;
	width: min(var(--tx2-c-w, 1060px), calc(100vw - 48px)) !important;
	max-width: calc(100vw - 48px) !important;
	padding: 0 !important;
	background: #fff !important;
	border: 1px solid #bcc9d4 !important;
	border-radius: 8px !important;
	box-shadow: 0 7px 20px rgba(35, 52, 69, .1) !important;
	overflow: hidden auto !important;
	color: var(--tx2c-ink);
	font: 16px/1.25 "Roboto Condensed", "Arial Narrow", Arial, sans-serif;
}
body.tpm-nav-wp header.tpm-hv2-head .tx2-panel.tx2-c .tx2-panel__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	height: 48px;
	padding: 0 12px 0 15px;
	background: var(--tx2c-nav);
	color: #fff;
}
body.tpm-nav-wp header.tpm-hv2-head .tx2-panel.tx2-c .tx2-panel__title {
	font: 700 21px/1.2 "Roboto Condensed", "Arial Narrow", Arial, sans-serif;
}
body.tpm-nav-wp header.tpm-hv2-head .tx2-panel.tx2-c .tx2-panel__close {
	display: grid;
	place-items: center;
	width: 42px;
	height: 34px;
	padding: 0;
	border: 1px solid #627488;
	border-radius: 5px;
	background: none;
	color: #fff;
	cursor: pointer;
}
body.tpm-nav-wp header.tpm-hv2-head .tx2-panel.tx2-c .tx2-panel__close:hover { background: #354d62; }
body.tpm-nav-wp header.tpm-hv2-head .tx2-panel.tx2-c .tx2-panel__close svg {
	width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.25;
}
body.tpm-nav-wp header.tpm-hv2-head .tx2-panel.tx2-c .tx2-panel__inner {
	display: grid !important;
	grid-template-columns: var(--tx2-c-grid) !important;
	grid-template-rows: auto 1fr;
	gap: 10px !important;
	padding: 12px !important;
	align-items: stretch !important;
}
body.tpm-nav-wp header.tpm-hv2-head .tx2-panel.tx2-c .tx2-main,
body.tpm-nav-wp header.tpm-hv2-head .tx2-panel.tx2-c .tx2-cols { display: contents !important; }

/* Placement of the five forms */
body.tpm-nav-wp header.tpm-hv2-head .tx2-c--c1 .tx2-panel__inner { grid-template-rows: auto; }
body.tpm-nav-wp header.tpm-hv2-head .tx2-c--c1 .tx2-banners { grid-area: 1 / 1 !important; }
body.tpm-nav-wp header.tpm-hv2-head .tx2-c--c1 .tx2-col { grid-area: 1 / 2 !important; }
body.tpm-nav-wp header.tpm-hv2-head .tx2-c--c2 .tx2-banners,
body.tpm-nav-wp header.tpm-hv2-head .tx2-c--c3w .tx2-banners { grid-area: 1 / 1 !important; }
body.tpm-nav-wp header.tpm-hv2-head .tx2-c--c2 .tx2-col:nth-child(1),
body.tpm-nav-wp header.tpm-hv2-head .tx2-c--c3w .tx2-col:nth-child(1) { grid-area: 2 / 1 !important; }
body.tpm-nav-wp header.tpm-hv2-head .tx2-c--c2 .tx2-col:nth-child(2),
body.tpm-nav-wp header.tpm-hv2-head .tx2-c--c3w .tx2-col:nth-child(2) { grid-area: 1 / 2 / 3 / 3 !important; }
body.tpm-nav-wp header.tpm-hv2-head .tx2-c--c3w .tx2-col:nth-child(3) { grid-area: 1 / 3 / 3 / 4 !important; }
body.tpm-nav-wp header.tpm-hv2-head .tx2-c--c3a .tx2-banners,
body.tpm-nav-wp header.tpm-hv2-head .tx2-c--c3b .tx2-banners { grid-area: 1 / 1 / 3 / 2 !important; }
body.tpm-nav-wp header.tpm-hv2-head .tx2-c--c3a .tx2-col:nth-child(1) { grid-area: 1 / 2 !important; }
body.tpm-nav-wp header.tpm-hv2-head .tx2-c--c3a .tx2-col:nth-child(2) { grid-area: 2 / 2 !important; }
body.tpm-nav-wp header.tpm-hv2-head .tx2-c--c3a .tx2-col:nth-child(3) { grid-area: 1 / 3 / 3 / 4 !important; }
body.tpm-nav-wp header.tpm-hv2-head .tx2-c--c3b .tx2-col:nth-child(1) { grid-area: 1 / 2 / 3 / 3 !important; }
body.tpm-nav-wp header.tpm-hv2-head .tx2-c--c3b .tx2-col:nth-child(2) { grid-area: 1 / 3 !important; }
body.tpm-nav-wp header.tpm-hv2-head .tx2-c--c3b .tx2-col:nth-child(3) { grid-area: 2 / 3 !important; }

/* Picture: fills its rectangle to the edges */
body.tpm-nav-wp header.tpm-hv2-head .tx2-panel.tx2-c .tx2-banners {
	display: grid !important;
	width: auto !important;
	min-width: 0 !important;
	flex: none !important;
	gap: 0 !important;
}
body.tpm-nav-wp header.tpm-hv2-head .tx2-panel.tx2-c .tx2-banner {
	position: relative;
	display: flex !important;
	align-items: flex-end;
	min-height: 120px !important;
	height: 100%;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 5px !important;
	background-color: #dce3ea;
	background-size: cover !important;
	background-position: center !important;
	background-repeat: no-repeat !important;
	overflow: hidden;
	color: #fff !important;
	text-decoration: none !important;
	box-shadow: none !important;
}
body.tpm-nav-wp header.tpm-hv2-head .tx2-panel.tx2-c a.tx2-banner::before {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, transparent 32%, rgba(17, 34, 48, .88) 100%) !important;
}
body.tpm-nav-wp header.tpm-hv2-head .tx2-panel.tx2-c div.tx2-banner::before { display: none !important; }
body.tpm-nav-wp header.tpm-hv2-head .tx2-panel.tx2-c a.tx2-banner::after {
	content: "";
	position: absolute;
	right: 13px;
	bottom: 15px;
	width: 6px;
	height: 6px;
	border-right: 1px solid #fff;
	border-top: 1px solid #fff;
	transform: rotate(45deg);
}
body.tpm-nav-wp header.tpm-hv2-head .tx2-panel.tx2-c .tx2-banner__text {
	position: relative;
	display: grid;
	gap: 2px;
	padding: 11px 27px 10px 12px;
	font-size: 13px;
	line-height: 1.18;
	text-shadow: 0 1px 4px #192b38;
}
body.tpm-nav-wp header.tpm-hv2-head .tx2-panel.tx2-c .tx2-banner__text b {
	display: block;
	font: 700 18px/1.15 "Roboto Condensed", "Arial Narrow", Arial, sans-serif !important;
	color: #fff !important;
}
body.tpm-nav-wp header.tpm-hv2-head .tx2-panel.tx2-c a.tx2-banner:hover b { text-decoration: underline; }

/* Column = card with a heading strip */
body.tpm-nav-wp header.tpm-hv2-head .tx2-panel.tx2-c .tx2-col {
	position: relative;
	display: flex !important;
	flex-direction: column;
	min-width: 0 !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 1px solid var(--tx2c-line);
	border-radius: 5px;
	background: #fff;
	overflow: hidden;
}
body.tpm-nav-wp header.tpm-hv2-head .tx2-panel.tx2-c .tx2-col__title {
	display: flex !important;
	align-items: center;
	gap: 6px !important;
	min-height: 28px;
	margin: 0 !important;
	padding: 5px 9px !important;
	background: var(--tx2c-pale);
	color: var(--tx2c-ink) !important;
	font: 700 13px/1.2 "Roboto Condensed", "Arial Narrow", Arial, sans-serif !important;
	letter-spacing: .06em !important;
	text-transform: uppercase !important;
}
body.tpm-nav-wp header.tpm-hv2-head .tx2-panel.tx2-c .tx2-col__title > svg,
body.tpm-nav-wp header.tpm-hv2-head .tx2-panel.tx2-c .tx2-col__title > .tx2-icon,
body.tpm-nav-wp header.tpm-hv2-head .tx2-panel.tx2-c .tx2-col__title > span:not(.tx2-icon) {
	display: inline-grid !important;
	place-items: center;
	width: 16px !important; height: 16px !important; flex: 0 0 16px !important;
	padding: 0 !important; margin: 0 !important; background: none !important;
}
body.tpm-nav-wp header.tpm-hv2-head .tx2-panel.tx2-c .tx2-col__title svg,
body.tpm-nav-wp header.tpm-hv2-head .tx2-panel.tx2-c .tx2-col__title img {
	display: block; width: 16px !important; height: 16px !important; max-width: 16px !important; object-fit: contain;
}

/* Lists and branch lines: each link draws the line from the top of its row to a curve at its
   middle; every row but the last carries the line on to its bottom. So the line ends exactly
   at the last curve, at every level. */
body.tpm-nav-wp header.tpm-hv2-head .tx2-panel.tx2-c .tx2-list,
body.tpm-nav-wp header.tpm-hv2-head .tx2-panel.tx2-c .tx2-sublist {
	position: relative;
	list-style: none !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	columns: auto !important;
}
body.tpm-nav-wp header.tpm-hv2-head .tx2-panel.tx2-c .tx2-list { flex: 1; display: flex; flex-direction: column; }
body.tpm-nav-wp header.tpm-hv2-head .tx2-panel.tx2-c .tx2-list > li { flex: 1; }
body.tpm-nav-wp header.tpm-hv2-head .tx2-panel.tx2-c .tx2-list > li + li { border-top: 1px solid #e9edf1; }
body.tpm-nav-wp header.tpm-hv2-head .tx2-panel.tx2-c .tx2-list li {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-width: 0;
	margin: 0 !important;
	padding: 0 !important;
}
body.tpm-nav-wp header.tpm-hv2-head .tx2-panel.tx2-c .tx2-list li::before { content: none !important; display: none !important; }
body.tpm-nav-wp header.tpm-hv2-head .tx2-panel.tx2-c .tx2-list li::after {
	content: none !important;
	display: none !important;
	background: none !important;
}
body.tpm-nav-wp header.tpm-hv2-head .tx2-panel.tx2-c .tx2-list li:not(:last-child)::after {
	content: "" !important;
	display: block !important;
	position: absolute;
	left: 12px;
	top: 0;
	bottom: -1px;
	width: 0;
	border-left: 1px solid var(--tx2c-curve);
	pointer-events: none;
}
body.tpm-nav-wp header.tpm-hv2-head .tx2-panel.tx2-c .tx2-link {
	position: relative;
	display: flex !important;
	align-items: center;
	gap: 8px !important;
	min-height: 39px !important;
	margin: 0 !important;
	padding: 6px 24px 6px 26px !important;
	color: var(--tx2c-ink) !important;
	text-decoration: none !important;
	font-size: 15px;
	line-height: 1.15;
	border-radius: 0 !important;
	background: none;
}
body.tpm-nav-wp header.tpm-hv2-head .tx2-panel.tx2-c .tx2-link:hover { background: #f5f9fc !important; }
body.tpm-nav-wp header.tpm-hv2-head .tx2-panel.tx2-c .tx2-link::before {
	content: "";
	position: absolute;
	left: 12px;
	top: 0;
	height: 50%;
	width: 8px;
	border-left: 1px solid var(--tx2c-curve);
	border-bottom: 1px solid var(--tx2c-curve);
	border-bottom-left-radius: 6px;
	pointer-events: none;
}
body.tpm-nav-wp header.tpm-hv2-head .tx2-panel.tx2-c .tx2-link::after {
	content: "";
	position: absolute;
	right: 10px;
	top: 50%;
	width: 5px;
	height: 5px;
	border-right: 1px solid #667685;
	border-top: 1px solid #667685;
	transform: translateY(-50%) rotate(45deg);
}
body.tpm-nav-wp header.tpm-hv2-head .tx2-panel.tx2-c .tx2-link strong {
	font: 700 15px/1.15 "Roboto Condensed", "Arial Narrow", Arial, sans-serif !important;
	color: var(--tx2c-ink) !important;
}
body.tpm-nav-wp header.tpm-hv2-head .tx2-panel.tx2-c .tx2-link small {
	display: block;
	margin-top: 3px;
	color: var(--tx2c-muted) !important;
	font: 400 12px/1.2 "Roboto Condensed", "Arial Narrow", Arial, sans-serif !important;
}
body.tpm-nav-wp header.tpm-hv2-head .tx2-panel.tx2-c .tx2-link .tx2-icon,
body.tpm-nav-wp header.tpm-hv2-head .tx2-panel.tx2-c .tx2-link .tpm-nav-pict {
	width: 19px !important;
	height: 19px !important;
	flex: 0 0 19px !important;
	color: #334e63;
}
body.tpm-nav-wp header.tpm-hv2-head .tx2-panel.tx2-c .tx2-link .tx2-icon img {
	display: block; width: 100%; height: 100%; object-fit: contain;
}
body.tpm-nav-wp header.tpm-hv2-head .tx2-panel.tx2-c .tx2-sublist { margin: 0 0 4px 20px !important; }
body.tpm-nav-wp header.tpm-hv2-head .tx2-panel.tx2-c .tx2-sublist .tx2-link { min-height: 32px !important; font-size: 14px; }
body.tpm-nav-wp header.tpm-hv2-head .tx2-panel.tx2-c .tx2-sublist .tx2-link strong { font-size: 14px !important; }
body.tpm-nav-wp header.tpm-hv2-head .tx2-panel.tx2-c .tx2-sublist .tx2-icon,
body.tpm-nav-wp header.tpm-hv2-head .tx2-panel.tx2-c .tx2-sublist .tpm-nav-pict { width: 16px !important; height: 16px !important; flex-basis: 16px !important; }
/* A link with sub-links: its curve sits at its own row, not at the middle of the whole block */
body.tpm-nav-wp header.tpm-hv2-head .tx2-panel.tx2-c .tx2-list li:has(> .tx2-sublist) { justify-content: flex-start; }

/* Wide column (Learning → Instructors): two lists side by side, each with its own line */
body.tpm-nav-wp header.tpm-hv2-head .tx2-panel.tx2-c .tx2-list-pair {
	flex: 1;
	display: grid;
	grid-template-columns: 1fr 1fr;
}
body.tpm-nav-wp header.tpm-hv2-head .tx2-panel.tx2-c .tx2-list-pair > .tx2-list + .tx2-list { border-left: 1px solid var(--tx2c-line) !important; }
}
