/* =============================================================================
   Component: Header — sticky top bar
   ========================================================================== */

.tt-header {
	position: sticky;
	top: 0;
	z-index: var(--z-header);
	background: var(--tt-bg);
	border-bottom-left-radius: 12px;
	border-bottom-right-radius: 12px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
	transition: box-shadow var(--dur-base) var(--ease);
}

.tt-header.is-scrolled {
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.24);
}

.tt-header__inner {
	display: flex;
	align-items: center;
	gap: var(--space-5);
	width: 100%;
	min-height: 110px;
	padding-block: 0;
	padding-inline: clamp(16px, 7vw, 140px);
}

.tt-header__brand {
	position: fixed;
	top: calc((110px - 64px) / 2);
	left: clamp(16px, 7vw, 140px);
	z-index: calc(var(--z-drawer) + 1);
	display: inline-flex;
	align-items: center;
	gap: var(--space-4);
	color: inherit;
	text-decoration: none;
}

.tt-header__brand:focus-visible {
	outline: 2px solid var(--tt-ink);
	outline-offset: 4px;
	border-radius: 2px;
}

.tt-header__logo,
.tt-header__brand .custom-logo,
.tt-header__brand .custom-logo-link img {
	display: block;
	height: 64px;
	width: auto;
	max-width: 64px;
	object-fit: contain;
}

.tt-header__wordmark {
	display: inline-flex;
	flex-direction: column;
	justify-content: center;
	text-align: center;
	font-family: "Noto Sans JP", sans-serif;
	font-size: 16px;
	font-weight: 600;
	color: #000000;
	line-height: 1.4;
}

.tt-header__wordmark-jp,
.tt-header__wordmark-en {
	font: inherit;
	color: inherit;
	letter-spacing: 0;
}

/* --- Desktop nav ----------------------------------------------------- */

.tt-nav {
	flex: 1 1 auto;
	display: flex;
	justify-content: flex-end;
}

.tt-nav__list {
	display: flex;
	gap: var(--space-7);
	align-items: center;
	list-style: none;
	margin: 0;
	padding: 0;
}

.tt-nav__list a,
.tt-nav__list a:visited {
	display: inline-block;
	padding: 10px 0;
	font-family: "Montserrat", sans-serif;
	font-size: 20px;
	font-weight: 600;
	line-height: 1;
	letter-spacing: 0;
	color: #000000;
	text-decoration: none;
	position: relative;
	white-space: nowrap;
}

.tt-nav__list a::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -2px;
	height: 1px;
	background: var(--tt-ink);
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform var(--dur-base) var(--ease);
}

.tt-nav__list a:hover::after,
.tt-nav__list a:focus-visible::after,
.tt-nav__list .is-current a::after,
.tt-nav__list .current-menu-item a::after {
	transform: scaleX(1);
}

.tt-nav__list a:focus-visible {
	outline: 2px solid var(--tt-ink);
	outline-offset: 6px;
	border-radius: 2px;
}

/* --- Hamburger toggle (1つでハンバーガー⇄Xを兼ねる) ------------------ */
/* position: fixed でドロワーOPEN時もヘッダーstacking contextから抜けて常に最前面 */

.tt-header__toggle {
	display: none;
	position: fixed;
	top: calc((110px - 44px) / 2);
	right: clamp(16px, 7vw, 140px);
	z-index: calc(var(--z-drawer) + 1);
	width: 44px;
	height: 44px;
	padding: 10px;
	background: transparent;
	border: 1px solid var(--tt-ink);
	border-radius: var(--radius-button);
	cursor: pointer;
	flex-direction: column;
	justify-content: space-between;
	align-items: stretch;
	transition: background var(--dur-base) var(--ease), transform var(--dur-fast) var(--ease);
}

.tt-header__toggle:hover,
.tt-header__toggle:focus,
.tt-header__toggle:focus-visible,
.tt-header__toggle:active {
	/* 親_sテーマの button { background:#e6e6e6 } を全状態で打ち消す */
	background: transparent;
}

.tt-header__toggle:active {
	transform: scale(0.94);
}

.tt-header__toggle:focus-visible {
	outline: 2px solid var(--tt-ink);
	outline-offset: 2px;
}

.tt-header__toggle-bar {
	display: block;
	height: 2px;
	background: var(--tt-ink);
	transition: transform var(--dur-base) var(--ease), opacity var(--dur-fast) var(--ease);
	transform-origin: center;
}

/* X animation when drawer is open
   inner area = 44 - (border 1×2) - (padding 10×2) = 22px。
   バー3本(2px)+gap 2つ(8px)で配置→ Bar1中心=1px / Bar3中心=21px → 中央=11px
   よって translateY は ±10px (1+10=11, 21-10=11) で対称X */
.tt-header__toggle[aria-expanded="true"] .tt-header__toggle-bar:nth-child(1) {
	transform: translateY(10px) rotate(45deg);
}

.tt-header__toggle[aria-expanded="true"] .tt-header__toggle-bar:nth-child(2) {
	opacity: 0;
}

.tt-header__toggle[aria-expanded="true"] .tt-header__toggle-bar:nth-child(3) {
	transform: translateY(-10px) rotate(-45deg);
}

/* --- Responsive (≤1200px: ハンバーガー表示・モバイルレイアウト) ----- */

@media (max-width: 1200px) {
	/* ≤1200px: ヘッダー要素自体は layout から消す (height:0) ことで、
	   hero がページ最上部から始まる。ブランドと toggle は position:fixed で
	   常に最前面に浮いて hero の上に重なる。 */
	.tt-header,
	.tt-header.is-scrolled {
		background: transparent;
		box-shadow: none;
		border-bottom-left-radius: 0;
		border-bottom-right-radius: 0;
	}

	.tt-header__inner {
		min-height: 0;
		padding: 0;
		gap: 0;
	}

	.tt-nav {
		display: none;
	}

	.tt-header__toggle {
		display: inline-flex;
		top: calc((72px - 44px) / 2);
		right: var(--space-4);
	}

	.tt-header__brand {
		top: calc((72px - 48px) / 2);
		left: var(--space-4);
	}

	.tt-header__logo,
	.tt-header__brand .custom-logo,
	.tt-header__brand .custom-logo-link img {
		height: 48px;
		max-width: 48px;
	}

	.tt-header__wordmark {
		font-size: 14px;
	}
}
