/* Site header: desktop layout. Mobile rules are in header-mobile.css and are applied
   at and below the breakpoint chosen in Header Settings. */

.civet-header {
	--civet-primary: var(--wp--preset--color--primary, #3559c7);
	--civet-text: #0c0c0c;
	--civet-line: rgba(12, 12, 12, 0.1);
	position: relative;
	background: #fff;
	color: var(--civet-text);
	font-family: var(--wp--preset--font-family--body, "DM Sans", sans-serif);
	font-size: 16px;
	line-height: 1.4;
	box-shadow: 0 1px 0 var(--civet-line);
	transition: box-shadow 0.2s ease;
}

.civet-header *,
.civet-header *::before,
.civet-header *::after {
	box-sizing: border-box;
}

.civet-header .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Keep the header at the top while scrolling (switched on and off in Header Settings). */
body.civet-header-sticky header.wp-block-template-part {
	position: sticky;
	top: 0;
	z-index: 999;
}

body.civet-header-sticky.admin-bar header.wp-block-template-part {
	top: 32px;
}

@media (max-width: 782px) {
	body.civet-header-sticky.admin-bar header.wp-block-template-part {
		top: 46px;
	}
}

.civet-header.is-scrolled {
	box-shadow: 0 6px 20px rgba(12, 12, 12, 0.1);
}

.civet-header__inner {
	display: flex;
	align-items: center;
	gap: 24px;
	max-width: 1320px;
	min-height: 76px;
	margin: 0 auto;
	padding: 10px 24px;
}

/* Logo and company name, upper left. */
.civet-header__brand {
	display: flex;
	flex: 0 1 auto;
	align-items: center;
	gap: 12px;
	min-width: 0;
	color: inherit;
	text-decoration: none;
}

.civet-header__logo {
	display: block;
	flex: 0 0 auto;
	width: auto;
	height: var(--civet-logo-h, 48px);
	max-width: none;
	object-fit: contain;
}

.civet-header__name {
	margin: 0;
	padding: 0;
	text-transform: none;
	font-family: var(--wp--preset--font-family--heading, "Roboto Serif", serif);
	font-size: clamp(18px, 2vw, 26px);
	font-weight: 600;
	line-height: 1.15;
	letter-spacing: 0;
	color: #0c0c0c;
	white-space: nowrap;
}

/* Menu, social icons and login sit together on the right. */
.civet-header__panel {
	display: flex;
	flex: 1 1 auto;
	align-items: center;
	justify-content: flex-end;
	gap: 28px;
	min-width: 0;
}

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

.civet-nav__item {
	position: relative;
	display: flex;
	align-items: center;
	margin: 0;
}

.civet-nav__link,
.civet-nav__sublink {
	font: inherit;
	font-weight: 600;
	color: #000;
	text-decoration: none;
	white-space: nowrap;
}

.civet-nav__link {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 12px;
	border: 0;
	border-radius: 6px;
	background: none;
	font-size: 16.8px;
	cursor: pointer;
	transition: color 0.15s ease, background-color 0.15s ease;
}

.civet-nav__link:hover,
.civet-nav__link:focus-visible,
.civet-nav__item.is-open > .civet-nav__link {
	color: var(--civet-primary);
	background: rgba(53, 89, 199, 0.07);
}

.civet-nav__link.is-current {
	color: var(--civet-primary);
}

.civet-nav__link.is-current::after {
	content: "";
	position: absolute;
	right: 12px;
	bottom: 3px;
	left: 12px;
	height: 2px;
	border-radius: 2px;
	background: var(--civet-primary);
}

/* Small arrow next to items that have a submenu. */
.civet-nav__caret {
	display: inline-block;
	width: 7px;
	height: 7px;
	margin-top: -3px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
	transition: transform 0.2s ease;
}

.civet-nav__subtoggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 36px;
	margin-left: -8px;
	padding: 0;
	border: 0;
	border-radius: 6px;
	background: none;
	color: #000;
	cursor: pointer;
}

.civet-nav__subtoggle:hover,
.civet-nav__subtoggle:focus-visible {
	color: var(--civet-primary);
}

.civet-nav__item.is-open .civet-nav__caret {
	margin-top: 3px;
	transform: rotate(225deg);
}

/* Submenu: a card that drops down under its parent. */
.civet-nav__sub {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	z-index: 20;
	min-width: 220px;
	margin: 0;
	padding: 8px;
	list-style: none;
	border: 1px solid var(--civet-line);
	border-radius: 10px;
	background: #fff;
	box-shadow: 0 16px 40px rgba(12, 12, 12, 0.14);
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}

/* A small invisible bridge so the card stays open while the pointer travels to it. */
.civet-nav__sub::before {
	content: "";
	position: absolute;
	top: -8px;
	right: 0;
	left: 0;
	height: 8px;
}

.civet-nav__item.has-sub:hover > .civet-nav__sub,
.civet-nav__item.has-sub.is-open > .civet-nav__sub {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.civet-nav__subitem {
	margin: 0;
}

.civet-nav__sublink {
	display: block;
	padding: 10px 14px;
	border-radius: 6px;
	font-size: 15.5px;
	font-weight: 500;
}

.civet-nav__sublink:hover,
.civet-nav__sublink:focus-visible {
	color: var(--civet-primary);
	background: rgba(53, 89, 199, 0.08);
}

.civet-nav__sublink.is-current {
	color: var(--civet-primary);
}

/* Social icons, cart and login. */
.civet-header__actions {
	display: flex;
	align-items: center;
	gap: 16px;
}

.civet-header__actions .wp-block-social-links {
	margin: 0;
	padding: 0;
	gap: 8px;
}

.civet-header__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 10px 22px;
	border-radius: 6px;
	background: var(--civet-primary);
	color: #fff;
	font-size: 14.4px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	white-space: nowrap;
	transition: filter 0.15s ease;
}

.civet-header__button:hover,
.civet-header__button:focus-visible {
	color: #fff;
	filter: brightness(1.12);
}

.civet-header__cart {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
}

/* Menu button: only shown at the mobile breakpoint. */
.civet-header__toggle {
	display: none;
}

.civet-header a:focus-visible,
.civet-header button:focus-visible {
	outline: 2px solid var(--civet-primary);
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	.civet-header *,
	.civet-header *::before,
	.civet-header *::after {
		transition: none !important;
	}
}
