/*
 * Vendix parts: the theme header and footer (drawn only when no Vendix or
 * Elementor layout replaces them) and the back to top button.
 *
 * This file also loads when the base styles are off, so every token has a fallback.
 */

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

.site-header {
	position: relative;
	z-index: 100;
	border-block-end: 1px solid var(--vt-border, #e5e7eb);
	background-color: #ffffff;
}

.site-header-inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	min-height: 72px;
	padding-block: 0.75rem;
}

.site-branding {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

.site-branding .custom-logo-link {
	display: block;
}

.site-branding .custom-logo {
	display: block;
	width: auto;
	max-height: 60px;
}

.site-title {
	margin: 0;
	font-size: 1.5rem;
	font-weight: 600;
	line-height: 1.2;
}

.site-title a {
	color: var(--vt-heading, #1f2328);
	text-decoration: none;
}

.site-description {
	margin: 0;
	color: var(--vt-muted, #6b7280);
	font-size: 0.875rem;
}

/* Header menu --------------------------------------------------------- */

.site-navigation ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-navigation a {
	display: block;
	padding: 0.5rem 0.875rem;
	color: var(--vt-heading, #1f2328);
	text-decoration: none;
}

.site-navigation a:hover,
.site-navigation .current-menu-item > a,
.site-navigation .current-menu-ancestor > a {
	color: var(--vt-accent, #1f6feb);
}

.vt-menu-toggle {
	display: none;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid var(--vt-border, #e5e7eb);
	border-radius: var(--vt-radius, 4px);
	background-color: transparent;
	color: var(--vt-heading, #1f2328);
	cursor: pointer;
}

.vt-menu-toggle:hover,
.vt-menu-toggle:focus {
	background-color: var(--vt-surface, #f6f7f9);
	color: var(--vt-heading, #1f2328);
}

/* Three lines: the span is the middle one, ::before and ::after the others. */
.vt-menu-toggle-icon,
.vt-menu-toggle-icon::before,
.vt-menu-toggle-icon::after {
	display: block;
	width: 20px;
	height: 2px;
	border-radius: 2px;
	background-color: currentColor;
	transition: transform 0.2s, background-color 0.2s;
}

.vt-menu-toggle-icon {
	position: relative;
}

.vt-menu-toggle-icon::before,
.vt-menu-toggle-icon::after {
	content: "";
	position: absolute;
	left: 0;
}

.vt-menu-toggle-icon::before {
	top: -6px;
}

.vt-menu-toggle-icon::after {
	top: 6px;
}

.vt-menu-toggle[aria-expanded="true"] .vt-menu-toggle-icon {
	background-color: transparent;
}

.vt-menu-toggle[aria-expanded="true"] .vt-menu-toggle-icon::before {
	transform: translateY(6px) rotate(45deg);
}

.vt-menu-toggle[aria-expanded="true"] .vt-menu-toggle-icon::after {
	transform: translateY(-6px) rotate(-45deg);
}

/* Desktop: a row with dropdowns on hover and keyboard focus. */
@media (min-width: 1025px) {
	.site-navigation > ul {
		display: flex;
		flex-wrap: wrap;
	}

	.site-navigation li {
		position: relative;
	}

	.site-navigation .menu-item-has-children > a::after {
		content: "";
		display: inline-block;
		width: 0.4em;
		height: 0.4em;
		margin-inline-start: 0.4em;
		/* Physical sides: the arrow points down in both reading directions. */
		border-bottom: 1.5px solid currentColor;
		border-right: 1.5px solid currentColor;
		transform: translateY(-0.15em) rotate(45deg);
	}

	.site-navigation .sub-menu {
		position: absolute;
		top: 100%;
		inset-inline-start: 0;
		z-index: 10;
		display: none;
		min-width: 200px;
		padding-block: 0.375rem;
		border: 1px solid var(--vt-border, #e5e7eb);
		border-radius: var(--vt-radius, 4px);
		background-color: #ffffff;
		box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
	}

	.site-navigation .sub-menu .sub-menu {
		top: -0.375rem;
		inset-inline-start: 100%;
	}

	.site-navigation li:hover > .sub-menu,
	.site-navigation li:focus-within > .sub-menu {
		display: block;
	}
}

/* Tablet and phone: the toggle opens the menu as a list under the header. */
@media (max-width: 1024px) {
	.vt-menu-toggle {
		display: inline-flex;
	}

	.site-navigation {
		display: none;
		flex-basis: 100%;
		padding-block-end: 0.5rem;
	}

	.site-navigation.is-open {
		display: block;
	}

	.site-navigation li {
		border-block-start: 1px solid var(--vt-border, #e5e7eb);
	}

	.site-navigation a {
		padding-inline: 0;
	}

	.site-navigation .sub-menu {
		padding-inline-start: 1rem;
	}
}

/* Footer -------------------------------------------------------------- */

.site-footer {
	border-block-start: 1px solid var(--vt-border, #e5e7eb);
	color: var(--vt-muted, #6b7280);
	font-size: 0.875rem;
}

.site-footer-inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding-block: 1.5rem;
}

.footer-navigation ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1.25rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.footer-navigation a {
	color: inherit;
	text-decoration: none;
}

.footer-navigation a:hover {
	color: var(--vt-accent, #1f6feb);
}

.site-info p:last-child {
	margin-block-end: 0;
}

@media (max-width: 767px) {
	.site-footer-inner {
		flex-direction: column;
		text-align: center;
	}

	.footer-navigation ul {
		justify-content: center;
	}
}

/* Back to top --------------------------------------------------------- */

.vt-back-to-top {
	position: fixed;
	inset-block-end: 24px;
	inset-inline-end: 24px;
	z-index: 999;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background-color: var(--vt-accent, #1f6feb);
	color: #ffffff;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
	cursor: pointer;
	transition: opacity 0.2s, transform 0.2s;
}

.vt-back-to-top:hover,
.vt-back-to-top:focus {
	background-color: var(--vt-accent, #1f6feb);
	color: #ffffff;
	transform: translateY(-2px);
}

.vt-back-to-top[hidden] {
	display: none;
}
