/**
 * Domio site header — improved from brand reference.
 */

.domio-header {
	--domio-header-bg: #121212;
	--domio-header-accent: #04e78d;
	--domio-header-cta: #004c3e;
	--domio-header-cta-hover: #04e78d;
	--domio-header-text: #ffffff;
	--domio-header-muted: rgba(255, 255, 255, 0.72);
	--domio-header-shell: var(
		--domio-shell-width,
		min(1300px, calc(100% - 2.5rem))
	);
	--domio-header-font: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;

	position: sticky;
	top: 0;
	z-index: 1000;
	background: var(--domio-header-bg);
	color: var(--domio-header-text);
	font-family: var(--domio-header-font);
	box-shadow: 0 1px 0 rgb(255 255 255 / 6%);
	transition: box-shadow 0.2s ease;
}

/* Hide leftover Elementor header / spacers when Domio header is active */
body.domio-has-header .elementor-location-header,
body.domio-has-header .elementor-location-header.elementor,
body.domio-has-header [data-elementor-type="header"] {
	display: none !important;
	height: 0 !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	overflow: hidden !important;
	border: 0 !important;
}

.domio-header.is-scrolled {
	box-shadow: 0 8px 28px rgb(0 0 0 / 28%);
}

.domio-header__shell {
	width: var(--domio-header-shell);
	margin-inline: auto;
}

.domio-header__top {
	border-bottom: 1px solid rgb(255 255 255 / 8%);
}

.domio-header__contacts {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35rem 1.5rem;
	list-style: none;
	margin: 0;
	padding: 0.55rem 0;
}

.domio-header__contact {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	color: #ffffff !important;
	text-decoration: none;
	font-size: 0.875rem;
	font-weight: 500;
	letter-spacing: 0.01em;
	transition: color 0.15s ease, opacity 0.15s ease;
}

.domio-header__contact span {
	color: inherit !important;
}

.domio-header__contact:hover,
.domio-header__contact:focus-visible {
	color: var(--domio-header-accent) !important;
}

.domio-header__contact:focus-visible {
	outline: 2px solid var(--domio-header-accent);
	outline-offset: 3px;
}

.domio-header__contact-icon {
	display: inline-flex;
	color: inherit !important;
	opacity: 1;
}

.domio-header__contact-icon svg {
	stroke: currentColor;
}

.domio-header__main-inner {
	display: flex;
	align-items: center;
	gap: 1.25rem;
	min-height: 4.5rem;
	padding-block: 0.65rem;
}

.domio-header__brand {
	display: inline-flex;
	align-items: center;
	gap: 0.65rem;
	text-decoration: none;
	color: inherit;
	flex-shrink: 0;
}

.domio-header__brand:focus-visible {
	outline: 2px solid var(--domio-header-accent);
	outline-offset: 4px;
}

.domio-header__logo-img {
	display: block;
	height: 42px;
	width: auto;
	max-width: 200px;
	object-fit: contain;
}

.domio-header__logo-text-only {
	color: var(--domio-header-accent);
	font-size: 1.35rem;
	font-weight: 700;
	letter-spacing: -0.03em;
}

.domio-header__nav {
	margin-left: auto;
}

.domio-header__menu {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.15rem 0.15rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.domio-header__menu > .menu-item {
	position: relative;
}

.domio-header__menu > .menu-item > a {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	padding: 0.55rem 0.7rem;
	color: var(--domio-header-text);
	text-decoration: none;
	font-size: 0.9375rem;
	font-weight: 500;
	line-height: 1.2;
	border-radius: 0.3rem;
	transition: color 0.15s ease, background-color 0.15s ease;
}

.domio-header__menu > .menu-item > a:hover,
.domio-header__menu > .menu-item > a:focus-visible,
.domio-header__menu > .menu-item.current-menu-item > a,
.domio-header__menu > .menu-item.current-menu-ancestor > a {
	color: var(--domio-header-accent);
}

.domio-header__menu > .menu-item > a:focus-visible {
	outline: 2px solid var(--domio-header-accent);
	outline-offset: 2px;
}

.domio-header__menu .menu-item-has-children > a::after {
	content: "";
	width: 0.4rem;
	height: 0.4rem;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: rotate(45deg) translateY(-1px);
	opacity: 0.75;
}

.domio-header__menu .sub-menu {
	position: absolute;
	top: calc(100% + 0.35rem);
	left: 0;
	min-width: 14rem;
	margin: 0;
	padding: 0.45rem;
	list-style: none;
	background: #1a1a1a;
	border: 1px solid rgb(255 255 255 / 8%);
	border-radius: 0.45rem;
	box-shadow: 0 16px 40px rgb(0 0 0 / 35%);
	opacity: 0;
	visibility: hidden;
	transform: translateY(0.35rem);
	transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
	z-index: 20;
}

.domio-header__menu .sub-menu .menu-item {
	position: relative;
}

.domio-header__menu .sub-menu .sub-menu {
	top: -0.45rem;
	left: calc(100% + 0.2rem);
	transform: translateX(0.25rem);
	z-index: 21;
}

.domio-header__menu > .menu-item:hover > .sub-menu,
.domio-header__menu > .menu-item:focus-within > .sub-menu,
.domio-header__menu .sub-menu > .menu-item:hover > .sub-menu,
.domio-header__menu .sub-menu > .menu-item:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: none;
}

.domio-header__menu .sub-menu a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	padding: 0.65rem 0.75rem;
	color: var(--domio-header-text);
	text-decoration: none;
	font-size: 0.9rem;
	border-radius: 0.3rem;
}

.domio-header__menu .sub-menu .menu-item-has-children > a::after {
	transform: rotate(-45deg);
	flex-shrink: 0;
}

.domio-header__menu .sub-menu a:hover,
.domio-header__menu .sub-menu a:focus-visible {
	background: rgb(4 231 141 / 12%);
	color: var(--domio-header-accent);
}

.domio-header__cta {
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	margin: 0;
	padding: 6px 14px !important;
	min-height: 32px !important;
	background: var(--domio-header-cta) !important;
	color: #fff !important;
	text-decoration: none;
	font-family: var(--domio-header-font);
	font-size: 12px !important;
	font-weight: 500 !important;
	line-height: 1.3 !important;
	letter-spacing: normal;
	text-align: center;
	text-transform: none;
	white-space: nowrap;
	border: 0 !important;
	border-radius: 20px !important;
	box-shadow: none;
	cursor: pointer;
	user-select: none;
	-webkit-font-smoothing: antialiased;
	transition: background-color 0.12s ease, transform 0.06s ease;
	flex-shrink: 0;
}

.domio-header__cta:hover,
.domio-header__cta:focus-visible {
	background: var(--domio-header-cta-hover);
	color: #121212 !important;
}

.domio-header__cta:active {
	transform: scale(0.98);
}

.domio-header__cta:focus-visible {
	outline: 2px solid var(--domio-header-accent);
	outline-offset: 3px;
}

.domio-header__cta--mobile {
	display: none !important;
}

.domio-header__menu .button > a,
.domio-header__menu a.button,
.domio-header__menu .wp-element-button {
	padding: 6px 14px !important;
	min-height: 32px !important;
	font-size: 12px !important;
	line-height: 1.3 !important;
	border-radius: 20px !important;
}

.domio-header__toggle {
	display: none;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	aspect-ratio: 1 / 1;
	width: 2.75rem;
	height: 2.75rem;
	min-width: 2.75rem;
	max-width: 2.75rem;
	min-height: 2.75rem;
	max-height: 2.75rem;
	margin-left: auto;
	padding: 0 !important;
	border: 1px solid rgb(255 255 255 / 14%) !important;
	border-radius: 0.4rem !important;
	background: transparent !important;
	color: #fff !important;
	box-shadow: none !important;
	line-height: 1;
	cursor: pointer;
}

.domio-header__toggle:hover,
.domio-header__toggle:focus,
.domio-header.is-nav-open .domio-header__toggle {
	background: transparent !important;
	color: #fff !important;
	border-color: rgb(255 255 255 / 14%) !important;
}

.domio-header__toggle:focus-visible {
	outline: 2px solid var(--domio-header-accent);
	outline-offset: 2px;
}

.domio-header__toggle-bars {
	position: relative;
	display: block;
	width: 1.15rem;
	height: 2px;
	background: currentColor;
	border-radius: 2px;
}

.domio-header__toggle-bars::before,
.domio-header__toggle-bars::after {
	content: "";
	position: absolute;
	left: 0;
	width: 100%;
	height: 2px;
	background: currentColor;
	border-radius: 2px;
	transition: transform 0.2s ease, top 0.2s ease, opacity 0.2s ease;
}

.domio-header__toggle-bars::before {
	top: -6px;
}

.domio-header__toggle-bars::after {
	top: 6px;
}

.domio-header.is-nav-open .domio-header__toggle-bars {
	background: transparent;
}

.domio-header.is-nav-open .domio-header__toggle-bars::before {
	top: 0;
	transform: rotate(45deg);
}

.domio-header.is-nav-open .domio-header__toggle-bars::after {
	top: 0;
	transform: rotate(-45deg);
}

.domio-header__sub-toggle {
	display: none;
}

/* Admin bar already offsets the page via html margin-top;
   do not add sticky top offset or a white gap appears. */

/* Domio sivupohja: transparent overlay header over hero */
body.domio-template.domio-has-header .domio-header {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	width: 100%;
	background: rgb(18 18 18 / 28%);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	box-shadow: none;
	transition:
		background-color 0.2s ease,
		box-shadow 0.2s ease,
		backdrop-filter 0.2s ease;
}

body.admin-bar.domio-template.domio-has-header .domio-header {
	top: 32px;
}

@media (max-width: 782px) {
	body.admin-bar.domio-template.domio-has-header .domio-header {
		top: 46px;
	}
}

body.domio-template.domio-has-header .domio-header__top {
	border-bottom-color: rgb(255 255 255 / 14%);
}

body.domio-template.domio-has-header .domio-header.is-scrolled,
body.domio-template.domio-has-header .domio-header.is-nav-open {
	background: rgb(18 18 18 / 92%);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	box-shadow: 0 8px 28px rgb(0 0 0 / 28%);
}

body.domio-template.domio-has-header .domio-header.is-scrolled .domio-header__top,
body.domio-template.domio-has-header .domio-header.is-nav-open .domio-header__top {
	border-bottom-color: rgb(255 255 255 / 8%);
}

@media (max-width: 980px) {
	.domio-header__toggle {
		display: inline-flex;
	}

	.domio-header__cta--desktop {
		display: none;
	}

	.domio-header__nav {
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		margin: 0;
		padding: 0.75rem 1.25rem 1.25rem;
		background: #161616;
		border-bottom: 1px solid rgb(255 255 255 / 8%);
		box-shadow: 0 18px 40px rgb(0 0 0 / 35%);
		display: none;
	}

	.domio-header.is-nav-open .domio-header__nav {
		display: block;
		max-height: min(75vh, 36rem);
		overflow-y: auto;
	}

	.domio-header__menu {
		flex-direction: column;
		align-items: stretch;
		gap: 0.15rem;
	}

	.domio-header__menu .menu-item {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		position: static;
	}

	.domio-header__menu .menu-item > a {
		flex: 1 1 auto;
		min-width: 0;
		padding: 0.85rem 0.5rem;
		border-radius: 0.35rem;
	}

	.domio-header__menu .menu-item-has-children > a::after {
		display: none;
	}

	.domio-header__sub-toggle {
		display: inline-flex;
		flex: 0 0 2.5rem;
		align-items: center;
		justify-content: center;
		box-sizing: border-box;
		aspect-ratio: 1 / 1;
		width: 2.5rem;
		height: 2.5rem;
		min-width: 2.5rem;
		padding: 0 !important;
		border: 0 !important;
		border-radius: 0.35rem !important;
		background: transparent !important;
		color: #fff !important;
		box-shadow: none !important;
		cursor: pointer;
	}

	.domio-header__sub-toggle:hover,
	.domio-header__sub-toggle:focus {
		background: rgb(255 255 255 / 8%) !important;
		color: var(--domio-header-accent) !important;
	}

	.domio-header__sub-toggle:focus-visible {
		outline: 2px solid var(--domio-header-accent);
		outline-offset: 2px;
	}

	.domio-header__sub-toggle span {
		display: block;
		width: 0.45rem;
		height: 0.45rem;
		border-right: 1.5px solid currentColor;
		border-bottom: 1.5px solid currentColor;
		transform: rotate(45deg);
		transition: transform 0.2s ease;
	}

	.menu-item-has-children.is-sub-open > .domio-header__sub-toggle span {
		transform: rotate(225deg) translate(-1px, -1px);
	}

	.domio-header__menu .sub-menu {
		display: none;
		flex-basis: 100%;
		width: 100%;
		position: static;
		opacity: 1;
		visibility: visible;
		transform: none;
		box-shadow: none;
		border: 0;
		background: transparent;
		padding: 0 0 0.35rem 0.85rem;
		min-width: 0;
	}

	.domio-header__menu .sub-menu .sub-menu {
		padding-left: 0.85rem;
		left: auto;
		top: auto;
	}

	.menu-item-has-children.is-sub-open > .sub-menu {
		display: block;
	}

	.domio-header__cta--mobile {
		display: flex !important;
		width: 100%;
		margin-top: 0.75rem;
	}
}

@media (max-width: 600px) {
	.domio-header__contacts {
		gap: 0.35rem 1rem;
	}

	.domio-header__contact span:not(.domio-header__contact-icon) {
		font-size: 0.8125rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.domio-header,
	.domio-header__contact,
	.domio-header__menu a,
	.domio-header__cta,
	.domio-header__menu .sub-menu {
		transition: none;
	}
}
