/**
 * Global header (ElementsKit template "NT Header"): contact bar, main row layout,
 * active menu item and the mobile menu extras added by nt-header.js.
 *
 * The logo is not styled here: its size stays as set by the theme (.nt-header .nt-logo).
 * Sticky behaviour stays in the theme (.nt-header.nt-is-sticky); the contact bar sits
 * outside .nt-header, so it scrolls away while the main row sticks.
 */

/* ---------- Contact bar ---------- */

.nt-topbar-contacts {
	--nthc-color: #3a3d3e;
	--nthc-hover: #1f5d48;
	--nthc-icon: #1f5d48;
	--nthc-divider: #dad5cc;
	--nthc-gap: 24px;
}

.nt-topbar-contacts__list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: 0 var(--nthc-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

.nt-topbar-contacts__item {
	display: flex;
	align-items: center;
	gap: var(--nthc-gap);
	margin: 0;
}

.nt-topbar-contacts__item + .nt-topbar-contacts__item::before {
	content: "";
	width: 1px;
	height: 14px;
	background: var(--nthc-divider);
}

.nt-topbar-contacts__link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 36px;
	color: var(--nthc-color);
	font-size: 14px;
	line-height: 1.3;
	text-decoration: none;
	transition: color .2s ease;
}

a.nt-topbar-contacts__link:hover,
a.nt-topbar-contacts__link:focus-visible {
	color: var(--nthc-hover);
}

.nt-topbar-contacts__link .ntp-icon {
	flex: none;
	width: 16px;
	height: 16px;
	color: var(--nthc-icon);
}

.nt-topbar-contacts__sr {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.nt-topbar-contacts__notice {
	margin: 0;
	padding: 6px 10px;
	border: 1px dashed #c9b98f;
	background: #fbf8ef;
	color: #5c4a1a;
	font-size: 13px;
}

/* ---------- Main row: logo | centred menu | button ---------- */

@media (min-width: 1025px) {
	.nt-header > .e-con-inner {
		display: grid;
		grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
		align-items: center;
		column-gap: 24px;
	}

	.nt-header > .e-con-inner > .nt-menu,
	.nt-header > .e-con-inner > .nt-button {
		width: auto;
	}

	/* Full cell width, capped by the theme's max-width, so the logo keeps its original size. */
	.nt-header > .e-con-inner > .nt-logo {
		justify-self: start;
		width: 100%;
	}

	.nt-header > .e-con-inner > .nt-button {
		justify-self: end;
	}

	/* Active page: the green set in the menu widget plus a thin green underline. */
	.nt-header .elementskit-navbar-nav > li.current-menu-item > a,
	.nt-header .elementskit-navbar-nav > li.current-menu-ancestor > a {
		text-decoration: underline;
		text-decoration-color: currentColor;
		text-decoration-thickness: 2px;
		text-underline-offset: 9px;
	}
}

/* Narrow desktops: keep the five items and the button on one line. */
@media (min-width: 1025px) and (max-width: 1199px) {
	.nt-header .elementskit-navbar-nav > li > a {
		padding-left: 11px;
		padding-right: 11px;
	}

	.nt-header .nt-btn a {
		font-size: 17px;
	}
}

/* Phone / e-mail shortcuts added by nt-header.js: never on desktop, shown below only while sticky. */
.nt-quick-contacts {
	display: none;
}

/* Button: text and arrow on one line. */
.nt-header .nt-btn a.elementskit-btn {
	white-space: nowrap;
}

/* ---------- Tablet and mobile: logo | button + hamburger ---------- */

@media (max-width: 1024px) {
	.nt-header > .e-con-inner {
		column-gap: 12px;
	}

	.nt-header > .e-con-inner > .nt-button {
		order: 2;
		width: auto;
		flex: 1 1 auto;
	}

	.nt-header > .e-con-inner > .nt-menu {
		order: 4;
		width: auto;
		flex: 0 0 auto;
		align-items: flex-end;
		padding-right: 10px;
	}

	/* Hamburger: softly rounded 44px button, thin dark lines, subtle border. */
	.nt-header .nt-menu .elementskit-menu-hamburger {
		display: inline-flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 5px;
		width: 44px;
		min-width: 44px;
		height: 44px;
		padding: 0;
		border: 1px solid #dfd9ce;
		border-radius: 10px;
		background: #fff;
	}

	/* Line colours: menu widget → Style → Hamburger Menu (Elementor). */
	.nt-header .nt-menu .elementskit-menu-hamburger .elementskit-menu-hamburger-icon {
		display: block;
		width: 20px;
		height: 1.5px;
		margin: 0;
		opacity: 1;
	}

	.nt-header .nt-menu .elementskit-menu-hamburger:focus-visible,
	.nt-quick-contacts__link:focus-visible,
	.nt-topbar-contacts__link:focus-visible {
		outline: 2px solid #1f5d48;
		outline-offset: 2px;
	}

	/* Phone / e-mail shortcuts (nt-header.js): only while sticky, when the contact bar is gone. */
	.nt-quick-contacts {
		order: 3;
		align-items: center;
		gap: 6px;
	}

	.nt-header.nt-is-sticky .nt-quick-contacts {
		display: flex;
	}

	.nt-quick-contacts__link {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 44px;
		height: 44px;
		border: 1px solid #dfd9ce;
		border-radius: 10px;
		background: #fff;
		color: #1f5d48;
		transition: background-color .2s ease, border-color .2s ease;
	}

	.nt-quick-contacts__link:hover {
		border-color: #1f5d48;
		background: #f3f6f2;
		color: #1f5d48;
	}

	.nt-quick-contacts__link .ntp-icon {
		width: 18px;
		height: 18px;
	}

	/*
	 * The theme's slide-in animation keeps a transform on the sticky header (fill-mode "both"),
	 * which traps the fixed offcanvas menu inside the 70–100px header. Same animation, no lasting transform.
	 */
	html body .nt-header.nt-is-sticky {
		animation-fill-mode: none;
	}

	/* No page scrolling behind the open menu (class set by nt-header.js). */
	html.nt-menu-open,
	html.nt-menu-open body {
		overflow: hidden;
	}

	.nt-header .nt-btn a {
		font-size: 17px;
	}

	.nt-topbar-contacts__link {
		min-height: 44px;
	}

	/* Offcanvas menu: the active page in green, comfortable rows. */
	.nt-header .elementskit-menu-container .elementskit-navbar-nav > li > a {
		min-height: 48px;
	}
}

/* The theme hides the button up to 768px; tablets from 768px keep it. */
@media (min-width: 768px) and (max-width: 1024px) {
	.nt-header > .e-con-inner > .nt-button {
		display: flex;
	}
}

/* ---------- Phones: compact two-level header ---------- */

@media (max-width: 767px) {
	.nt-header > .e-con-inner {
		column-gap: 6px;
	}

	/* The complete original logo, scaled proportionally (the theme caps the column at 120px). */
	.nt-header > .e-con-inner > .nt-logo {
		padding-top: 8px;
		padding-bottom: 8px;
	}

	.nt-header > .e-con-inner > .nt-logo img {
		width: 76px;
		height: auto;
	}

	.nt-header > .e-con-inner > .nt-menu,
	.nt-header > .e-con-inner > .nt-quick-contacts {
		margin-left: auto;
	}

	.nt-header.nt-is-sticky > .e-con-inner > .nt-menu {
		margin-left: 0;
	}

	/* Contact bar: centred, one line when it fits, otherwise two lines (nt-header.js). */
	.nt-topbar .elementor-widget-nt-header-contacts {
		width: 100%;
	}

	.nt-topbar-contacts__list {
		justify-content: center;
		--nthc-gap: 14px;
	}

	.nt-topbar-contacts__link {
		gap: 7px;
		min-height: 40px;
		font-size: 14px;
	}

	.nt-topbar-contacts--stacked .nt-topbar-contacts__list {
		flex-direction: column;
	}

	.nt-topbar-contacts--stacked .nt-topbar-contacts__item::before {
		display: none;
	}

	.nt-topbar-contacts--stacked .nt-topbar-contacts__link {
		min-height: 34px;
	}

	/* The WordPress toolbar scrolls away on phones (it is not fixed below 601px). */
	html body.admin-bar .nt-header.nt-is-sticky {
		top: 0;
	}
}

@media (max-width: 430px) {
	.nt-topbar-contacts__link {
		font-size: 13px;
	}
}

@media (min-width: 601px) and (max-width: 767px) {
	html body.admin-bar .nt-header.nt-is-sticky {
		top: 46px;
	}
}

/* ---------- Mobile menu extras (contacts + header button), added by nt-header.js ---------- */

.nt-mobile-extras {
	display: none;
}

@media (max-width: 767px) {
	.nt-mobile-extras {
		display: block;
		margin: 16px 15px 24px;
		padding-top: 18px;
		border-top: 1px solid #e3ded4;
	}

	.nt-mobile-extras .nt-topbar-contacts__list {
		flex-direction: column;
		align-items: stretch;
		gap: 2px;
	}

	.nt-mobile-extras .nt-topbar-contacts__item::before {
		display: none;
	}

	.nt-mobile-extras .nt-topbar-contacts__link {
		gap: 12px;
		min-height: 44px;
		color: #26292a;
		font-size: 16px;
		word-break: break-word;
	}

	.nt-mobile-extras .nt-topbar-contacts__link .ntp-icon {
		width: 18px;
		height: 18px;
		color: #1f5d48;
	}

	.nt-mobile-extras__cta {
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 10px;
		min-height: 48px;
		margin-top: 16px;
		padding: 12px 20px;
		border-radius: 50px;
		background: #1f5d48;
		color: #fff;
		font-size: 17px;
		font-weight: 500;
		line-height: 1.2;
		text-align: center;
		text-decoration: none;
	}

	.nt-mobile-extras__cta:hover,
	.nt-mobile-extras__cta:focus-visible {
		background: #164535;
		color: #fff;
	}

	.nt-mobile-extras__cta svg,
	.nt-mobile-extras__cta i {
		width: 15px;
		height: 15px;
		font-size: 15px;
		fill: currentColor;
	}
}
