@charset "UTF-8";

/* ========================================
   デスクトップヘッダー（ace-webmarketing 由来）
   .header-inner 幅のみ ace-life-home の 77svw
   ======================================== */

.header__nav a:focus,
.header__nav a:focus-visible,
.header-logo a:focus,
.header-logo a:focus-visible {
	outline: none;
	box-shadow: none;
}

.header {
	padding-block: 30px 40px;
	position: sticky;
	top: 0;
	z-index: 999;
}

@media (width >= 768px) {
	.header {
		pointer-events: none;
	}

	/* PC ヘッダーのみ「私たちについて」を非表示（モバイルドロワーでは表示） */
	.header-menu__list > .is-pc-hidden {
		display: none;
	}
}

/* life-home 準拠の幅 */
.header-inner {
	position: relative;
	display: flex;
	align-items: center;
	gap: 10px;
	justify-content: space-between;
	width: 77svw;
	margin-inline: auto;
}

.header-logo {
	--logo-width: 165px;
	--logo-height: 43px;
	--color-mask-bg: #606060;
	flex: var(--logo-width) 0 0;
	width: var(--logo-width);
	height: var(--logo-height);
	background-color: var(--color-mask-bg);
	mask-image: url("../images/ace_logo.png");
	mask-size: cover;
	transition: background-color 0.4s;
	position: relative;
	z-index: 20;
	pointer-events: auto;
}

.header-logo a {
	display: block;
	width: 100%;
	height: 100%;
	position: relative;
	z-index: 21;
	pointer-events: auto;
}

.header-logo .sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
}

@media (width <= 767px) {
	/*
	 * ace214.com（fake_tcd074）準拠:
	 * 初期は通常フロー（relative）。scrollY > 330 で body.header_fix_mobile が付き固定表示。
	 * .header-inner の水平位置（83svw / 中央寄せ）はそのまま。
	 */
	.header {
		position: relative;
		top: auto;
		left: auto;
		width: 100%;
		padding-block: 16px 22px;
		background: transparent;
	}

	.header-inner {
		width: 83svw;
	}

	.header-logo {
		--logo-width: 84px;
		--logo-height: 22px;
	}

	/* 固定化でフローから外れる分の高さを確保（padding 16+22 + ロゴ 22 ≈ 60px） */
	body.header_fix_mobile {
		padding-top: 60px;
	}

	.header_fix_mobile .header {
		position: fixed;
		top: 0;
		left: 0;
		width: 100%;
		background: #fff;
		box-shadow: 0 0 15px 5px rgba(0, 0, 0, 0.1);
		animation: slide_down_menu 0.5s ease;
	}

	/* ドロワー: 全画面シェル + 右290pxパネル（ace-inc 準拠） */
	.header__nav {
		display: block;
		position: fixed;
		top: 0;
		left: 0;
		z-index: 1000;
		width: 100%;
		height: 100vh;
		height: 100dvh;
		margin: 0;
		background: transparent;
		border-radius: 0;
		pointer-events: none;
		transform: translateX(100%);
		transition: transform 0.4s cubic-bezier(0.645, 0.045, 0.355, 1);
	}

	html.is-active .header__nav {
		pointer-events: auto;
	}

	/*
	 * 交差アニメーション（ace-inc 準拠）
	 * シェルが 100% → 0 に動く間、内側のレイヤーは -200% → 0、パネルは 100% → 0 に動く。
	 * 結果としてレイヤーは画面左外から右へ、パネルは画面右外から左へ進み、途中ですれ違う。
	 * パネルだけ 0.6s と長いため、暗幕が敷かれたあとを追ってパネルが収まる。
	 */
	html.is-active .header__nav,
	html.is-active .l-gnav__layer,
	html.is-active .l-gnav__outer {
		transform: translateX(0);
	}

	.l-gnav__outer {
		position: absolute;
		top: 0;
		right: 0;
		z-index: 2;
		box-sizing: border-box;
		width: 290px;
		height: 100%;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
		background: #02030a;
		transform: translateX(100%);
		transition: transform 0.6s cubic-bezier(0.645, 0.045, 0.355, 1);
	}

	.l-gnav__inner {
		display: flex;
		align-items: flex-start;
		box-sizing: border-box;
		position: relative;
		min-height: 100%;
		padding: 120px 40px 40px;
	}

	.l-gnav__layer {
		display: block;
		position: absolute;
		top: 0;
		left: 0;
		z-index: 1;
		width: 100%;
		height: 100%;
		cursor: pointer;
		background: linear-gradient(
			to right,
			rgba(2, 3, 10, 0.68) 0%,
			rgba(2, 3, 10, 0.68) 75%,
			rgba(2, 3, 10, 0) 100%
		);
		transform: translateX(-200%);
		transition: transform 0.4s cubic-bezier(0.645, 0.045, 0.355, 1);
	}

	.menu-close {
		display: block;
		position: absolute;
		top: 30px;
		right: 30px;
		z-index: 3;
	}

	.menu-close__button {
		display: grid;
		grid-template: "line" 2px / 24px;
		place-content: center;
		width: 24px;
		height: 24px;
		padding: 0;
		cursor: pointer;
		background: transparent;
		border: 0;
	}

	.menu-close__button span {
		display: none;
	}

	.menu-close__button::before,
	.menu-close__button::after {
		grid-area: line;
		content: "";
		background: #fff;
		border-radius: 1px;
	}

	.menu-close__button::before {
		transform: rotate(45deg);
	}

	.menu-close__button::after {
		transform: rotate(-45deg);
	}

	/*
	 * ハンバーガーは初期から表示（ace214.com #menu_button 準拠）。
	 * ヘッダー内 absolute なので、通常時はヘッダーと一緒に流れ、固定時はヘッダーに追従する。
	 */
	.menu-open {
		display: flex;
		position: absolute;
		top: 0;
		right: max(20px, calc((100% - 83svw) / 2));
		bottom: 0;
		z-index: 1001;
		align-items: center;
		height: auto;
	}

	/* 線はスライドアウトで消える。操作だけ無効化し、閉じるボタンを邪魔しない */
	html.is-active .menu-open {
		pointer-events: none;
	}

	.menu-open__button {
		overflow: hidden;
		display: block;
		position: relative;
		width: 24px;
		height: 24px;
		padding: 0;
		cursor: pointer;
		background: transparent;
		border: 0;
	}

	/* 2本線（上: line / 下: label）。開くと左へスライドアウト */
	.menu-open__line,
	.menu-open__label {
		display: block;
		position: absolute;
		right: 0;
		height: 2px;
		margin: 0;
		padding: 0;
		overflow: hidden;
		font-size: 0;
		line-height: 0;
		color: transparent;
		background: #000;
		transition: transform 0.3s cubic-bezier(0.215, 0.61, 0.355, 1);
	}

	.menu-open__line {
		top: 7px;
		width: 100%;
	}

	.menu-open__label {
		bottom: 7px;
		width: 14px;
	}

	html.is-active .menu-open__line,
	html.is-active .menu-open__label {
		transform: translateX(-100%);
	}

	.sub-menu {
		display: none;
	}

	html.is-active {
		overflow: hidden;
		height: 100%;
	}
}

/* モーション低減設定では交差アニメーションを省き、開閉だけを即座に反映する */
@media (prefers-reduced-motion: reduce) {
	.header__nav,
	.l-gnav__layer,
	.l-gnav__outer,
	.menu-open__line,
	.menu-open__label {
		transition-duration: 0.01ms;
	}
}

@keyframes slide_down_menu {
	from {
		top: -60px;
	}

	to {
		top: 0;
	}
}

.header__nav {
	align-content: center;
}

@media (width >= 768px) {
	.header__nav {
		pointer-events: auto;
		background: rgba(255, 255, 255, 0.85);
		border-radius: 100px;
	}

	.menu-open,
	.menu-close,
	.sub-menu,
	.l-gnav__layer {
		display: none;
	}

	/* ドロワー用のラッパーは PC ではボックスを作らず、リストを直接の子として扱わせる */
	.l-gnav__outer,
	.l-gnav__inner {
		display: contents;
	}
}

.header-menu__list {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	align-items: center;
	column-gap: clamp(1.5rem, 2.5vw, 3rem);
	margin: 0;
	padding: 25px 48px;
	list-style: none;
}

.header-menu__list ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.header-menu__list > li {
	font-size: 15px;
}

.header-menu__list > li > a {
	font-weight: 500;
	color: #333;
	text-decoration: none;
}

@media (any-hover: hover) {
	.header-menu__list > li > a {
		transition: opacity 0.3s;
	}

	.header-menu__list > li > a:hover {
		opacity: 0.5;
	}
}

@media (width <= 767px) {
	/* 余白は .l-gnav__inner が持つため、リスト自体は素の縦並びにする */
	.header-menu__list {
		flex-direction: column;
		flex-wrap: nowrap;
		row-gap: 1.5rem;
		align-items: flex-start;
		width: 100%;
		padding: 0;
		column-gap: 0;
	}

	.header-menu__list > li > a {
		color: #fff;
	}
}
