/*
 * ヘッダー（浮かぶカプセル型のメニュー）の見た目
 * 作りは src/components/SiteHeader.astro、動きは public/wizard/js/header.js。
 * 色は style.css の :root の変数（--navy-600 など）を使う。
 * 画面幅の切り替えは、ほかと同じく 1080px の1か所だけ。
 */

.wz-header {
	position: fixed;
	top: 14px;
	left: 0;
	right: 0;
	z-index: 1000;
	display: flex;
	justify-content: center;
	pointer-events: none;
	transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.3s ease;
}

/* 下にスクロールしている間は隠す（メニューを開いているときは隠さない） */
.wz-header.is-hidden:not(.is-open) {
	transform: translateY(calc(-100% - 24px));
	opacity: 0;
}

.wz-capsule {
	pointer-events: auto;
	position: relative;
	width: min(1180px, calc(100% - 32px));
	height: 64px;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 0 9px 0 26px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.78);
	-webkit-backdrop-filter: saturate(160%) blur(16px);
	backdrop-filter: saturate(160%) blur(16px);
	border: 1px solid rgba(255, 255, 255, 0.65);
	box-shadow:
		0 12px 32px -14px rgba(3, 18, 36, 0.32),
		0 1px 0 rgba(255, 255, 255, 0.8) inset;
	transition: box-shadow 0.3s ease, background-color 0.3s ease;
}

.wz-header.is-scrolled .wz-capsule {
	background: rgba(255, 255, 255, 0.9);
	box-shadow:
		0 16px 40px -16px rgba(3, 18, 36, 0.38),
		0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

/* ---- ロゴ ---- */
.wz-logo {
	flex: none;
	display: flex;
	align-items: center;
}

.wz-logo img {
	height: 26px;
	width: auto;
	display: block;
}

/* ---- PC のメニュー ---- */
.wz-nav {
	margin-left: auto;
}

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

.wz-nav-item {
	position: static;
	margin: 0;
}

.wz-nav-link {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 44px;
	padding: 0 16px;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--navy-950);
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.04em;
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.wz-nav-link:hover,
.has-panel.is-open > .wz-nav-link {
	background: rgba(10, 61, 128, 0.07);
	color: var(--navy-600);
}

.wz-nav-link:focus-visible,
.wz-cta:focus-visible,
.wz-menu-button:focus-visible,
.wz-card:focus-visible,
.wz-sheet a:focus-visible {
	outline: 2px solid var(--navy-500);
	outline-offset: 2px;
}

/* 今いるページの項目に小さな点 */
.wz-nav-item.is-current > .wz-nav-link::after {
	content: "";
	position: absolute;
	left: 50%;
	bottom: 6px;
	width: 4px;
	height: 4px;
	margin-left: -2px;
	border-radius: 50%;
	background: var(--navy-600);
}

.wz-chevron {
	width: 12px;
	height: 12px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.6;
	stroke-linecap: round;
	stroke-linejoin: round;
	transition: transform 0.3s ease;
}

.has-panel.is-open .wz-chevron {
	transform: rotate(180deg);
}

/* ---- お問い合わせのボタン ---- */
.wz-cta {
	flex: none;
	margin-left: 8px;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	height: 46px;
	padding: 0 20px 0 24px;
	border-radius: 999px;
	background: var(--navy-600);
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-decoration: none;
	box-shadow: 0 8px 18px -8px rgba(10, 61, 128, 0.7);
	transition: background-color 0.25s ease, box-shadow 0.25s ease;
}

.wz-cta:hover {
	background: var(--navy-800);
	color: #fff;
	box-shadow: 0 10px 22px -8px rgba(10, 61, 128, 0.8);
}

.wz-cta svg,
.wz-card-arrow,
.wz-sheet-cta svg {
	width: 16px;
	height: 16px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
	transition: transform 0.25s ease;
}

.wz-cta:hover svg {
	transform: translateX(3px);
}

/* ---- 下の項目のパネル（Flooring / Services） ---- */
.wz-panel {
	position: absolute;
	top: calc(100% + 12px);
	left: 50%;
	width: min(760px, calc(100vw - 32px));
	padding: 22px;
	border-radius: 28px;
	background: rgba(255, 255, 255, 0.94);
	-webkit-backdrop-filter: saturate(160%) blur(18px);
	backdrop-filter: saturate(160%) blur(18px);
	border: 1px solid rgba(255, 255, 255, 0.7);
	box-shadow: 0 28px 64px -24px rgba(3, 18, 36, 0.4);
	opacity: 0;
	visibility: hidden;
	transform: translate(-50%, -6px);
	transition: opacity 0.25s ease, transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), visibility 0s linear 0.35s;
}

/* カプセルとパネルの隙間でマウスが外れないよう、見えない橋を架ける */
.wz-panel::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: -16px;
	height: 16px;
}

.has-panel.is-open > .wz-panel {
	opacity: 1;
	visibility: visible;
	transform: translate(-50%, 0);
	transition-delay: 0s;
}

.wz-panel-head {
	display: flex;
	align-items: baseline;
	gap: 12px;
	margin: 0 6px 14px;
}

.wz-panel-en {
	font-size: 22px;
	font-weight: 700;
	letter-spacing: 0.02em;
	color: var(--navy-950);
}

.wz-panel-ja {
	font-size: 12px;
	color: var(--gray-650, #6b7280);
	letter-spacing: 0.08em;
}

.wz-panel-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.wz-card {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 10px 14px 10px 10px;
	border-radius: 18px;
	color: var(--navy-950);
	text-decoration: none;
	transition: background-color 0.2s ease;
}

.wz-card:hover,
.wz-card.is-current {
	background: rgba(10, 61, 128, 0.06);
	color: var(--navy-950);
}

.wz-card-media {
	flex: none;
	width: 88px;
	height: 66px;
	border-radius: 12px;
	overflow: hidden;
	background: var(--navy-200);
}

.wz-card-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.5s ease;
}

.wz-card:hover .wz-card-media img {
	transform: scale(1.06);
}

.wz-card-text {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
}

.wz-card-en {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--navy-600);
}

.wz-card-title {
	font-size: 15px;
	font-weight: 700;
	line-height: 1.4;
}

.wz-card-note {
	font-size: 12px;
	line-height: 1.5;
	color: var(--gray-650, #6b7280);
}

.wz-card-arrow {
	margin-left: auto;
	flex: none;
	color: var(--navy-600);
	opacity: 0.5;
}

.wz-card:hover .wz-card-arrow {
	opacity: 1;
	transform: translateX(3px);
}

/* ---- スマホ用（PC では出さない） ---- */
.wz-menu-button,
.wz-sheet {
	display: none;
}

@media (max-width: 1080px) {
	.wz-header {
		top: 10px;
	}

	.wz-capsule {
		height: 58px;
		padding: 0 7px 0 20px;
	}

	.wz-logo img {
		height: 22px;
	}

	.wz-nav,
	.wz-cta {
		display: none;
	}

	.wz-menu-button {
		margin-left: auto;
		display: inline-flex;
		align-items: center;
		gap: 10px;
		height: 44px;
		padding: 0 10px 0 18px;
		border: 0;
		border-radius: 999px;
		background: var(--navy-950);
		color: #fff;
		font: inherit;
		font-size: 12px;
		font-weight: 700;
		letter-spacing: 0.14em;
		cursor: pointer;
	}

	.wz-menu-icon {
		position: relative;
		width: 26px;
		height: 26px;
		border-radius: 50%;
		background: rgba(255, 255, 255, 0.14);
	}

	.wz-menu-icon span,
	.wz-menu-icon::before {
		content: "";
		position: absolute;
		left: 7px;
		right: 7px;
		height: 1.6px;
		border-radius: 2px;
		background: #fff;
		transition: transform 0.3s ease, top 0.3s ease;
	}

	.wz-menu-icon::before {
		top: 9.5px;
	}

	.wz-menu-icon span {
		top: 14.5px;
	}

	.wz-header.is-open .wz-menu-icon::before {
		top: 12px;
		transform: rotate(45deg);
	}

	.wz-header.is-open .wz-menu-icon span {
		top: 12px;
		transform: rotate(-45deg);
	}

	.wz-sheet {
		pointer-events: auto;
		display: block;
		position: absolute;
		top: calc(100% + 10px);
		left: 50%;
		width: min(560px, calc(100% - 32px));
		max-height: calc(100vh - 110px);
		max-height: calc(100dvh - 110px);
		overflow-y: auto;
		padding: 10px 10px 14px;
		border-radius: 28px;
		background: rgba(255, 255, 255, 0.97);
		-webkit-backdrop-filter: saturate(160%) blur(18px);
		backdrop-filter: saturate(160%) blur(18px);
		border: 1px solid rgba(255, 255, 255, 0.7);
		box-shadow: 0 28px 64px -24px rgba(3, 18, 36, 0.45);
		opacity: 0;
		visibility: hidden;
		transform: translate(-50%, -8px) scale(0.98);
		transform-origin: top center;
		transition: opacity 0.25s ease, transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), visibility 0s linear 0.35s;
	}

	.wz-header.is-open .wz-sheet {
		opacity: 1;
		visibility: visible;
		transform: translate(-50%, 0) scale(1);
		transition-delay: 0s;
	}

	.wz-sheet-list {
		margin: 0;
		padding: 0;
		list-style: none;
	}

	.wz-sheet-list > li + li {
		border-top: 1px solid rgba(10, 61, 128, 0.08);
	}

	.wz-sheet-link,
	.wz-sheet-head {
		display: flex;
		align-items: baseline;
		justify-content: space-between;
		gap: 12px;
		margin: 0;
		padding: 16px 14px;
		color: var(--navy-950);
		text-decoration: none;
	}

	.wz-sheet-link span,
	.wz-sheet-head span {
		font-size: 22px;
		font-weight: 700;
		letter-spacing: 0.01em;
	}

	.wz-sheet-link small,
	.wz-sheet-head small {
		font-size: 12px;
		color: var(--gray-650, #6b7280);
		letter-spacing: 0.08em;
	}

	.wz-sheet-link[aria-current="page"] span {
		color: var(--navy-600);
	}

	.wz-sheet-group ul {
		margin: -6px 0 10px;
		padding: 0 6px;
		list-style: none;
	}

	.wz-sheet-sublink {
		display: block;
		padding: 10px 12px 10px 22px;
		border-radius: 14px;
		position: relative;
		font-size: 15px;
		font-weight: 600;
		color: var(--navy-800);
		text-decoration: none;
	}

	.wz-sheet-sublink::before {
		content: "";
		position: absolute;
		left: 10px;
		top: 50%;
		width: 5px;
		height: 1.6px;
		background: var(--navy-500);
	}

	.wz-sheet-sublink:hover,
	.wz-sheet-sublink[aria-current="page"] {
		background: rgba(10, 61, 128, 0.06);
	}

	.wz-sheet-cta {
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 10px;
		margin: 8px 4px 0;
		height: 54px;
		border-radius: 999px;
		background: var(--navy-600);
		color: #fff;
		font-size: 15px;
		font-weight: 700;
		letter-spacing: 0.06em;
		text-decoration: none;
	}

	.wz-sheet-cta:hover {
		background: var(--navy-800);
		color: #fff;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wz-header,
	.wz-capsule,
	.wz-panel,
	.wz-sheet,
	.wz-card-media img,
	.wz-chevron,
	.wz-menu-icon span,
	.wz-menu-icon::before {
		transition: none !important;
	}
}
