/**
 * Header & Footer Builder — front end.
 */

:root {
	--hfb-panel-width: 360px;
	--hfb-sticky-offset: 0px;
}

.hfb-header,
.hfb-footer {
	box-sizing: border-box;
	width: 100%;
}

.hfb-header *,
.hfb-header *::before,
.hfb-header *::after,
.hfb-footer *,
.hfb-footer *::before,
.hfb-footer *::after,
.hfb-offcanvas *,
.hfb-offcanvas *::before,
.hfb-offcanvas *::after,
.hfb-toggle *,
.hfb-logo * {
	box-sizing: border-box;
}

.hfb-header__inner,
.hfb-footer__inner {
	width: 100%;
}

/* ---------------------------------------------------------------- Menus */

.hfb-nav {
	width: 100%;
}

.hfb-menu,
.hfb-menu ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.hfb-menu {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.15rem;
}

.hfb-menu li {
	position: relative;
	margin: 0;
}

.hfb-menu a {
	display: block;
	padding: 0.5rem 0.75rem;
	color: inherit;
	text-decoration: none;
	line-height: 1.4;
}

.hfb-menu a:hover,
.hfb-menu a:focus-visible {
	text-decoration: underline;
}

.hfb-nav__notice {
	margin: 0;
	padding: 0.5rem 0.75rem;
	font-size: 0.875rem;
	background: rgba(0, 0, 0, 0.06);
	border-radius: 6px;
}

/* Dropdowns */

.hfb-nav--inline .hfb-submenu {
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 100;
	min-width: 220px;
	padding: 0.35rem;
	background: var(--hfb-dropdown-bg, #ffffff);
	color: var(--hfb-dropdown-color, #0f172a);
	border-radius: 8px;
	box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

.hfb-nav--inline .hfb-submenu .hfb-submenu {
	top: -0.35rem;
	left: 100%;
}

.hfb-nav--inline .hfb-submenu a {
	padding: 0.45rem 0.65rem;
	border-radius: 5px;
}

.hfb-nav--inline .hfb-submenu a:hover,
.hfb-nav--inline .hfb-submenu a:focus-visible {
	background: rgba(15, 23, 42, 0.06);
	text-decoration: none;
}

@media (min-width: 783px) {
	.hfb-nav--inline li:hover > .hfb-submenu,
	.hfb-nav--inline li:focus-within > .hfb-submenu {
		opacity: 1;
		visibility: visible;
		transform: translateY(0);
	}
}

.hfb-nav--inline li.hfb-submenu-open > .hfb-submenu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

/* Submenu toggle button */

.hfb-submenu-toggle {
	position: absolute;
	top: 0.35rem;
	right: 0.15rem;
	display: none;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	padding: 0;
	color: inherit;
	background: transparent;
	border: 0;
	border-radius: 4px;
	cursor: pointer;
	line-height: 1;
}

.hfb-submenu-toggle:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 1px;
}

.hfb-submenu-toggle__icon {
	display: block;
	width: 0.55rem;
	height: 0.55rem;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg) translate(-1px, -1px);
	transition: transform 0.2s ease;
}

.hfb-submenu-open > .hfb-submenu-toggle .hfb-submenu-toggle__icon {
	transform: rotate(225deg) translate(-1px, -1px);
}

/* Off-canvas lists */

.hfb-nav--offcanvas .hfb-menu {
	display: block;
}

.hfb-nav--offcanvas .hfb-menu a {
	padding: 0.65rem 2.5rem 0.65rem 0;
}

.hfb-nav--offcanvas .hfb-submenu {
	display: none;
	padding-left: 0.9rem;
}

.hfb-nav--offcanvas li.hfb-submenu-open > .hfb-submenu {
	display: block;
}

.hfb-nav--offcanvas .hfb-submenu-toggle {
	display: inline-flex;
	top: 0.3rem;
}

/* Small screens: turn inline menus into accordions */

@media (max-width: 782px) {
	.hfb-nav--inline .hfb-menu {
		display: block;
	}

	.hfb-nav--inline .hfb-menu a {
		padding-right: 2.5rem;
	}

	.hfb-nav--inline .hfb-submenu {
		position: static;
		display: none;
		min-width: 0;
		padding: 0 0 0 0.9rem;
		background: transparent;
		box-shadow: none;
		opacity: 1;
		visibility: visible;
		transform: none;
	}

	.hfb-nav--inline li.hfb-submenu-open > .hfb-submenu {
		display: block;
	}

	.hfb-nav--inline .hfb-submenu-toggle {
		display: inline-flex;
	}
}

/* --------------------------------------------------------------- Toggle */

.hfb-toggle {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.5rem;
	color: inherit;
	background: transparent;
	border: 0;
	border-radius: 6px;
	cursor: pointer;
	font: inherit;
	line-height: 1;
}

.hfb-toggle:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.hfb-toggle__bars {
	display: inline-flex;
	flex-direction: column;
	justify-content: center;
	gap: 4px;
	width: 20px;
	height: 16px;
}

.hfb-toggle__bars span {
	display: block;
	width: 100%;
	height: 2px;
	background: currentColor;
	border-radius: 2px;
	transition: transform 0.2s ease, opacity 0.2s ease;
}

.hfb-toggle[aria-expanded="true"] .hfb-toggle__bars span:nth-child(1) {
	transform: translateY(6px) rotate(45deg);
}

.hfb-toggle[aria-expanded="true"] .hfb-toggle__bars span:nth-child(2) {
	opacity: 0;
}

.hfb-toggle[aria-expanded="true"] .hfb-toggle__bars span:nth-child(3) {
	transform: translateY(-6px) rotate(-45deg);
}

/* ------------------------------------------------------------ Off-canvas */

.hfb-offcanvas {
	position: fixed;
	inset: 0;
	z-index: 99990;
	visibility: hidden;
	pointer-events: none;
}

.hfb-offcanvas.is-open {
	visibility: visible;
	pointer-events: auto;
}

.hfb-offcanvas__overlay {
	position: absolute;
	inset: 0;
	z-index: 0;
	background: var(--hfb-overlay, rgba(15, 23, 42, 0.55));
	opacity: 0;
	transition: opacity 0.25s ease;
}

.hfb-offcanvas.is-open .hfb-offcanvas__overlay {
	opacity: 1;
}

.hfb-offcanvas__panel {
	position: absolute;
	top: 0;
	bottom: 0;
	z-index: 1;
	display: flex;
	flex-direction: column;
	width: var(--hfb-panel-width, 360px);
	max-width: 92vw;
	overflow-y: auto;
	overscroll-behavior: contain;
	background: var(--hfb-panel-bg, #ffffff);
	color: var(--hfb-panel-color, #0f172a);
	outline: none;
	box-shadow: 0 0 40px rgba(15, 23, 42, 0.18);
	transition: transform 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.hfb-offcanvas--right .hfb-offcanvas__panel {
	right: 0;
	transform: translateX(105%);
}

.hfb-offcanvas--left .hfb-offcanvas__panel {
	left: 0;
	transform: translateX(-105%);
}

.hfb-offcanvas.is-open .hfb-offcanvas__panel {
	transform: translateX(0);
}

.hfb-offcanvas__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 1rem 1.25rem;
	border-bottom: 1px solid rgba(15, 23, 42, 0.1);
}

.hfb-offcanvas__title {
	font-weight: 600;
	font-size: 1rem;
}

.hfb-offcanvas__close {
	padding: 0.25rem 0.5rem;
	color: inherit;
	background: transparent;
	border: 0;
	border-radius: 4px;
	font-size: 1.6rem;
	line-height: 1;
	cursor: pointer;
}

.hfb-offcanvas__close:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 1px;
}

.hfb-offcanvas__body {
	padding: 1rem 1.25rem 2.5rem;
}

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

/* --------------------------------------------------------------- Sticky */

.hfb-header--sticky {
	position: sticky;
	top: var(--hfb-sticky-offset, 0px);
	z-index: 9990;
}

.hfb-header--sticky.is-stuck {
	box-shadow: 0 6px 24px rgba(15, 23, 42, 0.1);
}

/* ----------------------------------------------------------------- Logo */

.hfb-logo {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	color: inherit;
	text-decoration: none;
}

.hfb-logo__img {
	display: block;
	width: auto;
	max-height: 100%;
	height: auto;
}

.hfb-logo__text {
	font-weight: 700;
	font-size: 1.25rem;
	line-height: 1.2;
}

/* ---------------------------------------------------------------- Misc */

.hfb-embed {
	width: 100%;
}

/* Respect reduced motion */

@media (prefers-reduced-motion: reduce) {
	.hfb-offcanvas__panel,
	.hfb-offcanvas__overlay,
	.hfb-submenu,
	.hfb-toggle__bars span,
	.hfb-submenu-toggle__icon {
		transition: none !important;
	}
}
