/**
 * Global Science — Header Navigation
 */

.gs-header {
	background-color: var(--gs-color-white);
	border-bottom: 1px solid color-mix(in srgb, var(--gs-color-text) 12%, transparent);
	position: sticky;
	top: 0;
	z-index: 200;
}

.gs-header.is-scrolled {
	box-shadow: 0 4px 16px color-mix(in srgb, var(--gs-color-text) 8%, transparent);
}

.gs-header__container {
	box-sizing: border-box;
	margin-inline: auto;
	max-width: 1400px;
}

.gs-header__inner {
	align-items: center;
	display: flex;
	gap: 1.5rem;
	justify-content: space-between;
	padding-block: 1.5rem;
}

/* ------------------------------------------------------------------
 * Logo
 * ------------------------------------------------------------------ */
.gs-header__logo {
	flex-shrink: 0;
}

.gs-header__logo-link {
	display: block;
	line-height: 0;
	text-decoration: none;
}

.gs-header__logo-link:hover {
	opacity: 0.85;
}

.gs-header__logo-image {
	display: block;
	height: auto;
	max-height: 48px;
	width: auto;
}

/* ------------------------------------------------------------------
 * Menu toggle
 * ------------------------------------------------------------------ */
.gs-header__menu-toggle {
	align-items: center;
	background: transparent;
	border: 0;
	color: var(--gs-color-text);
	cursor: pointer;
	display: none;
	flex-shrink: 0;
	justify-content: center;
	margin: 0;
	padding: 0.5rem;
}

.gs-header__menu-toggle-icon {
	display: grid;
	gap: 6px;
	height: 18px;
	width: 24px;
}

.gs-header__menu-toggle-line {
	background-color: currentColor;
	display: block;
	height: 2px;
	transition: transform 0.2s ease, opacity 0.2s ease;
	width: 100%;
}

.gs-header.is-nav-open .gs-header__menu-toggle-line:nth-child(1) {
	transform: translateY(8px) rotate(45deg);
}

.gs-header.is-nav-open .gs-header__menu-toggle-line:nth-child(2) {
	opacity: 0;
}

.gs-header.is-nav-open .gs-header__menu-toggle-line:nth-child(3) {
	transform: translateY(-8px) rotate(-45deg);
}

/* ------------------------------------------------------------------
 * Primary navigation
 * ------------------------------------------------------------------ */
.gs-header__nav {
	flex: 1;
}

.gs-header__nav-list {
	display: flex;
	flex-wrap: wrap;
	gap: 40px;
	justify-content: flex-end;
	list-style: none;
	margin: 0;
	padding: 0;
}

.gs-header__nav-item {
	position: relative;
}

.gs-header__nav-link,
.gs-header__submenu-link {
	color: var(--gs-color-text);
	font-family: "Yu Mincho", "Hiragino Mincho ProN", "MS PMincho", serif;
	font-size: clamp(0.8125rem, 1.2vw, 1rem);
	font-weight: 400;
	letter-spacing: 0.04em;
	text-decoration: none;
}

.gs-header__nav-link:hover,
.gs-header__nav-link:focus,
.gs-header__submenu-link:hover,
.gs-header__submenu-link:focus {
	color: var(--gs-color-text);
	opacity: 0.75;
	text-decoration: none;
}

.gs-header__submenu {
	background-color: var(--gs-color-white);
	border: 1px solid color-mix(in srgb, var(--gs-color-text) 15%, transparent);
	box-shadow: 0 8px 24px color-mix(in srgb, var(--gs-color-text) 10%, transparent);
	left: 0;
	list-style: none;
	margin: 0;
	min-width: 11rem;
	opacity: 0;
	padding: 0.5rem 0;
	pointer-events: none;
	position: absolute;
	top: 100%;
	visibility: hidden;
	z-index: 100;
}

.gs-header__nav-item--has-child:hover .gs-header__submenu,
.gs-header__nav-item--has-child:focus-within .gs-header__submenu {
	opacity: 1;
	pointer-events: auto;
	visibility: visible;
}

.gs-header__submenu-item {
	margin: 0;
}

.gs-header__submenu-link {
	display: block;
	padding: 0.625rem 1.25rem;
}

.gs-header__submenu-link:hover,
.gs-header__submenu-link:focus {
	background-color: color-mix(in srgb, var(--gs-color-section) 35%, var(--gs-color-white));
	opacity: 1;
}

/* ------------------------------------------------------------------
 * Mobile
 * ------------------------------------------------------------------ */
@media (max-width: 1280px) {
	.gs-header__inner {
		flex-wrap: nowrap;
	}

	.gs-header.is-nav-open .gs-header__inner {
		flex-wrap: wrap;
	}

	.gs-header__logo {
		flex: 1;
		min-width: 0;
	}

	.gs-header__logo-image {
		max-width: min(100%, 200px);
	}

	.gs-header__menu-toggle {
		display: inline-flex;
	}

	.gs-header__nav {
		display: none;
		flex: 1 0 100%;
		padding-top: 0.5rem;
		width: 100%;
	}

	.gs-header.is-nav-open .gs-header__nav {
		display: block;
	}

	.gs-header__nav-list {
		flex-direction: column;
		gap: 0;
		justify-content: flex-start;
	}

	.gs-header__nav-item {
		border-top: 1px solid color-mix(in srgb, var(--gs-color-text) 12%, transparent);
	}

	.gs-header__nav-link {
		display: block;
		font-size: 1rem;
		padding-block: 1rem;
	}

	.gs-header__submenu {
		border: 0;
		box-shadow: none;
		display: none;
		min-width: 0;
		opacity: 1;
		padding: 0 0 0.75rem;
		pointer-events: auto;
		position: static;
		visibility: visible;
	}

	.gs-header__nav-item--has-child:hover .gs-header__submenu,
	.gs-header__nav-item--has-child:focus-within .gs-header__submenu {
		display: none;
	}

	.gs-header__nav-item--has-child.is-submenu-open .gs-header__submenu {
		display: block;
	}

	.gs-header__submenu-link {
		font-size: 0.9375rem;
		padding-block: 0.5rem;
		padding-inline: 1rem 0;
	}
}
