/* ---------------------------------------------
   VH Header
   --------------------------------------------- */

:root {
	--vh-header-bg: #ffffff;
	--vh-header-text: #1a1a1a;
	--vh-header-accent: #1a1a1a;
	--vh-header-accent-text: #ffffff;
	--vh-header-border: rgba(0, 0, 0, 0.08);
	--vh-header-height: 84px;
	--vh-header-height-sticky: 68px;
	--vh-header-max: 1240px;
}

.vh-header {
	position: sticky;
	top: 0;
	z-index: 999;
	background: var(--vh-header-bg);
	border-bottom: 1px solid var(--vh-header-border);
	transition: box-shadow 0.25s ease, background 0.25s ease;
}

.vh-header.is-stuck {
	box-shadow: 0 2px 18px rgba(0, 0, 0, 0.07);
}

.vh-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 32px;
	max-width: var(--vh-header-max);
	min-height: var(--vh-header-height);
	margin: 0 auto;
	padding: 0 24px;
	transition: min-height 0.25s ease;
}

.vh-header.is-stuck .vh-header__inner {
	min-height: var(--vh-header-height-sticky);
}

/* --- Lógó --- */

.vh-header__brand {
	display: flex;
	align-items: center;
	flex-shrink: 0;
}

.vh-header__brand .custom-logo-link {
	display: block;
	line-height: 0;
}

.vh-header__brand img {
	display: block;
	width: auto;
	max-height: 52px;
	transition: max-height 0.25s ease;
}

.vh-header.is-stuck .vh-header__brand img {
	max-height: 42px;
}

.vh-header__sitename {
	font-size: 1.35rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	color: var(--vh-header-text);
	text-decoration: none;
}

/* --- Valmynd --- */

.vh-header__nav {
	display: flex;
	flex: 1 1 auto;
	justify-content: flex-end;
}

.vh-nav__list {
	display: flex;
	align-items: center;
	gap: 4px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.vh-nav__list li {
	position: relative;
	margin: 0;
}

.vh-nav__list a {
	display: block;
	padding: 10px 14px;
	font-size: 0.95rem;
	font-weight: 500;
	letter-spacing: 0.01em;
	color: var(--vh-header-text);
	text-decoration: none;
	border-radius: 4px;
	transition: opacity 0.2s ease, background 0.2s ease;
}

.vh-nav__list a:hover,
.vh-nav__list a:focus-visible {
	opacity: 0.6;
}

.vh-nav__list .current-menu-item > a,
.vh-nav__list .current-menu-ancestor > a {
	text-decoration: underline;
	text-underline-offset: 6px;
	text-decoration-thickness: 1px;
}

/* --- Undirvalmynd --- */

.vh-nav--desktop .sub-menu {
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 10;
	min-width: 210px;
	margin: 0;
	padding: 8px;
	list-style: none;
	background: var(--vh-header-bg);
	border: 1px solid var(--vh-header-border);
	border-radius: 6px;
	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.1);
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.vh-nav--desktop li:hover > .sub-menu,
.vh-nav--desktop li:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.vh-nav--desktop .menu-item-has-children > a::after {
	content: "";
	display: inline-block;
	width: 6px;
	height: 6px;
	margin-left: 7px;
	vertical-align: 2px;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: rotate(45deg);
}

/* --- Hnappur --- */

.vh-header__actions {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-shrink: 0;
}

.vh-header__cta {
	display: inline-block;
	padding: 13px 26px;
	font-size: 0.9rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	color: var(--vh-header-accent-text);
	background: var(--vh-header-accent);
	border-radius: 999px;
	text-decoration: none;
	white-space: nowrap;
	transition: opacity 0.2s ease;
}

.vh-header__cta:hover,
.vh-header__cta:focus-visible {
	opacity: 0.82;
	color: var(--vh-header-accent-text);
}

/* --- Hamborgari --- */

.vh-header__toggle {
	display: none;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	width: 44px;
	height: 44px;
	padding: 0;
	background: none;
	border: 0;
	cursor: pointer;
}

.vh-header__toggle-bar {
	display: block;
	width: 24px;
	height: 2px;
	margin: 0 auto;
	background: var(--vh-header-text);
	transition: transform 0.25s ease, opacity 0.2s ease;
}

.vh-header__toggle[aria-expanded="true"] .vh-header__toggle-bar:nth-child(1) {
	transform: translateY(7px) rotate(45deg);
}

.vh-header__toggle[aria-expanded="true"] .vh-header__toggle-bar:nth-child(2) {
	opacity: 0;
}

.vh-header__toggle[aria-expanded="true"] .vh-header__toggle-bar:nth-child(3) {
	transform: translateY(-7px) rotate(-45deg);
}

/* --- Farsímaspjald --- */

.vh-header__panel {
	display: none;
	padding: 8px 24px 28px;
	background: var(--vh-header-bg);
	border-top: 1px solid var(--vh-header-border);
}

.vh-header__panel .vh-nav__list {
	flex-direction: column;
	align-items: stretch;
	gap: 0;
}

.vh-header__panel .vh-nav__list a {
	padding: 14px 0;
	font-size: 1.05rem;
	border-bottom: 1px solid var(--vh-header-border);
	border-radius: 0;
}

.vh-header__panel .sub-menu {
	margin: 0 0 0 16px;
	padding: 0;
	list-style: none;
}

.vh-header__panel .sub-menu a {
	font-size: 0.95rem;
	opacity: 0.75;
}

.vh-header__cta--panel {
	display: block;
	margin-top: 22px;
	text-align: center;
}

.vh-header__overlay {
	position: fixed;
	inset: 0;
	z-index: 998;
	background: rgba(0, 0, 0, 0.35);
}

/* --- Skip link --- */

.vh-skip-link.screen-reader-text:focus {
	position: absolute;
	top: 8px;
	left: 8px;
	z-index: 1000;
	width: auto;
	height: auto;
	padding: 12px 20px;
	clip: auto;
	clip-path: none;
	background: var(--vh-header-bg);
	color: var(--vh-header-text);
	border-radius: 4px;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

/* --- Brotpunktur --- */

@media (max-width: 921px) {
	:root {
		--vh-header-height: 68px;
		--vh-header-height-sticky: 60px;
	}

	.vh-header__nav {
		display: none;
	}

	.vh-header__toggle {
		display: flex;
	}

	.vh-header__actions .vh-header__cta {
		display: none;
	}

	.vh-header__panel {
		display: block;
	}

	body.vh-panel-open {
		overflow: hidden;
	}
}