/**
 * Shared chrome: fog mount, header, drawer (single source).
 * Loaded on all pages that use header.php; front also loads it before deferred common.css.
 *
 * @package komono
 */

body.is-menu-open {
	overflow: hidden;
}

/* fog 未初期化の間は背面を見せる（全面グレー回避）。WebGL 初回描画後に .is-fog-ready */
body {
	background-color: #fff;
}

.c-site-fog {
	position: fixed;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	opacity: 0;
	background: transparent;
	transition: opacity 0.4s ease;
}

.c-site-fog.is-fog-ready {
	opacity: 1;
}

/* Three 失敗時のみごく薄い静止背景（全面の濃グレーは使わない） */
.c-site-fog.is-fog-fallback {
	opacity: 1;
	background: linear-gradient(118deg, #f2f2f2 0%, #ebebeb 50%, #f0f0f0 100%);
	background-color: #ededed;
}

.c-site-fog canvas {
	width: 100%;
	height: 100%;
	display: block;
}

.c-header {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	z-index: 1001;
	height: 74px;
	background: rgba(255, 255, 255, 0.57);
}

.c-header__logo {
	position: absolute;
	top: 16px;
	left: 50%;
	width: 44px;
	height: 42.369px;
	transform: translateX(-50%);
}

.c-header__logo img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.c-header__menu {
	position: absolute;
	top: 24px;
	right: 31px;
	color: #000;
	font-family: "Noto Serif JP", serif;
	font-size: 14px;
	font-weight: 400;
	letter-spacing: 0.2em;
	line-height: 1;
	text-decoration: none;
	text-transform: lowercase;
	padding-bottom: 14px;
}

.c-header__menu::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 6px;
	width: 48px;
	height: 1px;
	background: currentColor;
}

.c-header__menu::before {
	content: "";
	position: absolute;
	left: 50%;
	bottom: -3px;
	width: 3px;
	height: 3px;
	border-radius: 50%;
	background: currentColor;
	transform: translateX(-50%);
	transition: bottom 0.28s ease;
}

body.is-menu-open .c-header__menu::before {
	bottom: -6px;
}

.c-drawer {
	box-sizing: border-box;
	position: fixed;
	top: 74px;
	right: 0;
	z-index: 1000;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	width: min(100vw, 420px);
	height: calc(100dvh - 74px);
	padding: 0 41px 86px;
	background: #4d4d4d;
	color: #fff;
	font-family: "Noto Sans JP", sans-serif;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translateX(32px);
	transition: opacity 0.35s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0.45s;
}

.c-drawer.is-open {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateX(0);
	transition: opacity 0.35s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s;
}

.c-drawer__nav {
	position: absolute;
	top: calc(50dvh - 74px);
	left: 41px;
	right: 41px;
	transform: translateY(-50%);
	display: flex;
	flex-direction: column;
	gap: 20px;
	font-size: 14px;
	font-weight: 400;
	letter-spacing: 0.1em;
	line-height: 1.35;
}

.c-drawer__nav a {
	color: inherit;
	text-decoration: none;
}

.c-drawer__subnav {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: -4px;
	padding-left: 13px;
}

.c-drawer__subnav a::before {
	content: "—";
	margin-right: 7px;
}

.c-drawer__close {
	position: relative;
	align-self: center;
	margin-top: auto;
	color: inherit;
	font-size: 14px;
	letter-spacing: 0.1em;
	line-height: 1;
	text-decoration: none;
	padding-bottom: 14px;
}

.c-drawer__close::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 6px;
	width: 43px;
	height: 1px;
	background: currentColor;
}

.c-drawer__close::before {
	content: "";
	position: absolute;
	left: 50%;
	bottom: -3px;
	width: 3px;
	height: 3px;
	border-radius: 50%;
	background: currentColor;
	transform: translateX(-50%);
}

/* フッター法務リンク（chrome は全テンプレで読み込み） */
.c-footer__legal {
	margin-top: 14px;
	text-align: center;
}

.c-footer__legal a {
	color: #4d4d4d;
	font-family: "Noto Sans JP", sans-serif;
	font-size: 10px;
	font-weight: 400;
	letter-spacing: 0.1em;
	line-height: 1.4;
	text-decoration: none;
}

@media (max-width: 767px) {
	.c-header {
		height: 59px;
	}

	.c-header__logo {
		top: 8px;
		left: 16px;
		transform: none;
	}

	.c-header__menu {
		top: 16px;
		right: 16px;
	}

	/* functions.php の早期スタイルを上書きし、安定後に表示 */
	html.is-header-chrome-ready .c-header__menu {
		visibility: visible;
	}

	.c-drawer {
		top: 59px;
		left: 0;
		right: 0;
		width: auto;
		height: calc(100dvh - 59px);
		/* 閉じた状態を画面外に置き、読み込み中の一瞬の誤表示を防ぐ */
		transform: translate3d(100%, 0, 0);
	}

	.c-drawer.is-open {
		transform: translate3d(0, 0, 0);
	}

	.c-drawer__nav {
		top: calc(50% - 20px);
	}

	.c-footer__legal {
		margin-top: 12px;
	}
}
