/* ==========================================================================
   03. ヘッダー (Header)
   - 全プロパティ 100% A-Z 昇順ソート絶対厳守
   ========================================================================== */
.l-header {
	background-color: var(--wp--preset--color--white, #ffffff);
	box-shadow: none;
	position: sticky;
	top: 0;
	transition:
		background-color 0.3s ease,
		box-shadow 0.3s ease;
	width: 100%;
	z-index: 1000;
}

.l-header.is-scrolled {
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.l-header ul {
	list-style: none;
}

/* 子コンテナ */
.l-header__inner {
	align-items: center;
	display: flex;
	justify-content: space-between;
	margin-left: auto;
	margin-right: auto;
	max-width: 1280px;
	padding: 24px;
}

/* ロゴマーク */
.l-header__logo {
	max-width: 280px;
}

.l-header__logo a {
	display: inline-block;
	line-height: 0;
}

.l-header__logo a span {
	display: inline-block;
}

.l-header__logo a span.logo {
	margin-bottom: 5px;
}

.l-header__logo img {
	height: auto;
	width: 100%;
}

/* モバイル用ハンバーガーメニュー */
.l-header__hamburger {
	align-items: center;
	background: transparent;
	border: none;
	cursor: pointer;
	display: flex;
	flex-direction: column;
	gap: 6px;
	height: 48px;
	justify-content: center;
	padding: 0;
	width: 48px;
}

@media (min-width: 1024px) {
	.l-header__hamburger {
		display: none;
	}
}

.l-header__hamburger span {
	background-color: var(--wp--preset--color--primary, #003e7e);
	border-radius: 2px;
	display: block;
	height: 2px;
	transition:
		opacity 0.3s ease,
		transform 0.3s ease;
	width: 28px;
}

.l-header__hamburger.is-active span:nth-child(1) {
	transform: translateY(8px) rotate(45deg);
}

.l-header__hamburger.is-active span:nth-child(2) {
	opacity: 0;
}

.l-header__hamburger.is-active span:nth-child(3) {
	transform: translateY(-8px) rotate(-45deg);
}

/* モバイル用ドロワーメニュー */
.l-header__drawer {
	background-color: var(--wp--preset--color--white, #ffffff);
	height: calc(100vh - 80px);
	left: 0;
	opacity: 0;
	overflow-y: auto;
	padding: 40px 24px;
	position: fixed;
	top: 90px;
	transition:
		opacity 0.3s ease,
		visibility 0.3s ease;
	visibility: hidden;
	width: 100%;
	z-index: 999;
}

.l-header__drawer.is-open {
	opacity: 1;
	visibility: visible;
}

.l-header__drawer-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
	text-align: center;
}

.l-header__drawer-list a {
	color: var(--wp--preset--color--darkgray, #333333);
	font-size: 1.125rem;
	font-weight: 700;
	transition: color 0.3s ease;
}

/* SPドロワー内のサブメニュー（縦並び展開） */
.l-header__drawer .sub-menu {
	display: flex;
	flex-direction: column;
	gap: 5px;
	margin-top: 0;
	padding-left: 0;
}

.l-header__drawer .sub-menu a {
	color: var(--wp--preset--color--gray, #666666);
	font-size: 0.95rem;
	font-weight: 500;
}

@media (max-width: 1023px) {
	.l-header__drawer .menu-item.u-sp-hidden,
	.l-header__drawer .menu-item.u-sp-hidden > .sub-menu {
		display: none !important;
	}
}

/* デスクトップ用グローバルメニュー */
.l-header__nav {
	display: none;
}

.l-header__nav-list {
	align-items: center;
	display: flex;
	gap: 1em;
}

@media (min-width: 1024px) {
	.l-header__nav {
		display: block;
	}
}

@media (min-width: 1200px) {
	.l-header__nav-list {
		gap: 1.25em;
	}
}

.l-header__nav-list a {
	color: var(--wp--preset--color--darkgray, #333333);
	display: inline-block;
	font-size: 0.9375rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	padding-bottom: 8px;
	padding-top: 8px;
	position: relative;
	text-decoration: none;
	transition: color 0.3s ease;
	white-space: nowrap;
}

@media (min-width: 1200px) {
	.l-header__nav-list a {
		font-size: 1.125rem;
	}
}

.l-header__nav-list a::after {
	background-color: var(--wp--preset--color--primary, #003e7e);
	bottom: 0;
	content: "";
	height: 3px;
	left: 0;
	position: absolute;
	transform: scaleX(0);
	transition: transform 0.3s ease;
	width: 100%;
}

.l-header__nav-list a:hover {
	color: var(--wp--preset--color--primary, #003e7e);
}

.l-header__nav-list a:hover::after {
	transform: scaleX(1);
}

.l-header__nav-list .current-menu-item > a,
.l-header__nav-list .current-post-ancestor > a {
	color: var(--wp--preset--color--primary, #003e7e);
}

.l-header__nav-list .current-menu-item > a::after,
.l-header__nav-list .current-post-ancestor > a::after {
	transform: scaleX(1);
}

/* --------------------------------------------------------------------------
   PC グローバルメニュー：ドロップダウンメニュー (.sub-menu)
   - 親要素とサブメニューを物理的隙間0pxで密着
   -------------------------------------------------------------------------- */
@media (min-width: 1024px) {
	.l-header,
	.l-header__inner {
		overflow: visible !important;
	}

	.l-header__nav {
		overflow: visible !important;
		position: relative;
	}

	.l-header__nav-list > .menu-item {
		padding-bottom: 14px;
		padding-top: 14px;
		position: relative;
	}

	.l-header__nav-list > .menu-item-has-children > a {
		padding-right: 14px;
	}

	/* 子階層を持つ親項目の下向き矢印 */
	.l-header__nav-list > .menu-item-has-children > a::before {
		border-left: 4px solid transparent;
		border-right: 4px solid transparent;
		border-top: 5px solid currentColor;
		content: "";
		display: inline-block;
		height: 0;
		position: absolute;
		right: 0;
		top: calc(50% - 2px);
		transition: transform 0.3s ease;
		width: 0;
	}

	.l-header__nav-list > .menu-item-has-children:hover > a::before {
		transform: rotate(180deg);
	}

	/* ドロップダウンパネル本体 */
	.l-header__nav-list .sub-menu {
		background-color: var(--wp--preset--color--white, #ffffff);
		border-radius: 15px;
		box-shadow: 6px 6px 10px 0px rgba(0, 0, 0, 0.1);
		box-sizing: border-box;
		display: block;
		left: 50%;
		margin: 0;
		min-width: 200px;
		opacity: 0;
		pointer-events: none;
		position: absolute;
		right: auto;
		top: calc(100% - 8px);
		transform: translateX(-50%) translateY(-6px);
		transition:
			opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1),
			transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
			visibility 0.25s cubic-bezier(0.16, 1, 0.3, 1);
		visibility: hidden;
		white-space: nowrap;
		width: max-content;
		z-index: 1000;
	}

	/* 上部三角矢印 */
	.l-header__nav-list .sub-menu::before {
		border-bottom: 7px solid var(--wp--preset--color--white, #ffffff);
		border-left: 7px solid transparent;
		border-right: 7px solid transparent;
		border-top: none;
		content: "";
		height: 0;
		left: 50%;
		position: absolute;
		top: -7px;
		transform: translateX(-50%);
		width: 0;
	}

	/* 子メニュー項目リンク */
	.l-header__nav-list .sub-menu li {
		margin: 0;
		padding: 0;
		width: 100%;
	}

	.l-header__nav-list .sub-menu a {
		box-sizing: border-box;
		color: var(--wp--preset--color--darkgray, #333333);
		display: block;
		font-size: 15px;
		font-weight: 500;
		letter-spacing: 0.02em;
		line-height: 1.5;
		padding: 10px 20px;
		text-align: left;
		transition:
			background-color 0.2s ease,
			color 0.2s ease,
			padding-left 0.2s ease;
		width: 100%;
	}

	.l-header__nav-list .sub-menu li:first-child a {
		border-radius: 15px 15px 0 0;
	}

	.l-header__nav-list .sub-menu li:last-child a {
		border-radius: 0 0 15px 15px;
	}

	.l-header__nav-list .sub-menu a::after {
		display: none;
	}

	/* 子リンク ホバー時 */
	.l-header__nav-list .sub-menu a:hover {
		background-color: var(--wp--preset--color--lightblue, #f0f6fa);
		color: var(--wp--preset--color--primary, #003e7e);
		padding-left: 24px;
	}

	/* ホバー・フォーカス時表示 */
	.l-header__nav-list > .menu-item:hover > .sub-menu,
	.l-header__nav-list > .menu-item > a:focus + .sub-menu,
	.l-header__nav-list > .menu-item .sub-menu:focus-within {
		opacity: 1;
		pointer-events: auto;
		transform: translateX(-50%) translateY(0);
		visibility: visible;
	}

	/* 右端項目の画面外はみ出し防止ガード（右吸着） */
	.l-header__nav-list > .menu-item:last-child .sub-menu,
	.l-header__nav-list > .menu-item:nth-last-child(2) .sub-menu {
		left: auto;
		right: 0;
		transform: translateY(-6px);
	}

	.l-header__nav-list > .menu-item:last-child .sub-menu::before,
	.l-header__nav-list > .menu-item:nth-last-child(2) .sub-menu::before {
		left: auto;
		right: 24px;
		transform: none;
	}

	.l-header__nav-list > .menu-item:last-child:hover > .sub-menu,
	.l-header__nav-list > .menu-item:nth-last-child(2):hover > .sub-menu {
		transform: translateY(0);
	}
}