/* =============================================================================
   共通｜ヘッダー
   囲いのボーダーは使わない。地と面の色の差で切り離す
   1000px 以上は1段に並べ、999px 以下は引き出し式にする
   ============================================================================= */

.hts-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: var(--hts-surface);
}

.hts-header__inner {
	max-width: var(--hts-container-wide);
	margin: 0 auto;
	padding: 26px var(--hts-container-pad);
	display: flex;
	align-items: center;
	gap: clamp(24px, 3vw, 48px);
}

/* 共通｜ヘッダーのロゴ */
.hts-logo {
	display: inline-flex;
	align-items: center;
	/* SVG の左右に箱の14.5%（箱44pxで6.4px）の余白が入っているので、ここは少しでよい */
	gap: 4px;
	color: var(--hts-logo-color);
	text-decoration: none;
	flex: none;
}

.hts-logo__mark {
	display: block;
	/*
	 * SVG の箱は 55 × 55 で、中の図形は箱の高さの 69.5%。
	 * 幅で指定すると縦に伸びるので、高さを基準にして幅を自動にする。
	 * 大きさを変えるならこの1行だけ。
	 */
	height: 44px;
	width: auto;
	fill: currentColor;
}

/* 書き出した SVG に fill 属性や class が残っていても、ここで上書きする */
.hts-logo__mark path,
.hts-logo__mark polygon {
	fill: currentColor;
}

.hts-logo__name {
	font-family: var(--hts-font-heading);
	font-weight: 700;
	/*
	 * 20px より小さくしないこと。--hts-logo-color（#3994E3）と白の比は 3.23 で、
	 * 太字 18.66px 以上（大きい文字の扱い）でようやく 3:1 を満たす。
	 * 小さくするなら色を --hts-accent-text（#1D79C9・4.54）に変える。
	 */
	font-size: 26px;
	letter-spacing: 0.08em;
	line-height: 1;
}

/* 1000px 以上は1段。999px 以下は下のブロックで縦に戻す。
   gap は電話番号とお問い合わせのあいだ。ナビとのあいだは下で足す。 */
.hts-header__body {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 20px;
	margin-left: auto;
}

.hts-header__body > .hts-gnav {
	margin-right: calc(clamp(28px, 3vw, 48px) - 20px);
}

.hts-gnav__list {
	display: flex;
	align-items: center;
	gap: clamp(28px, 2.6vw, 44px);
}

.hts-gnav__item {
	position: relative;
	display: flex;
	align-items: center;
	gap: 2px;
}

.hts-gnav__link {
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.04em;
	color: var(--hts-ink);
	text-decoration: none;
	white-space: nowrap;
}

.hts-gnav__item--has-children > .hts-gnav__link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

/* 会社案内の子には印が無い。事業のパネルの中だけで出す。
   まとめ名は引き出しの中だけで出す */
.hts-gnav__icon,
.hts-gnav__label-sp,
.hts-gnav__group {
	display: none;
}

.hts-gnav__link:hover,
.hts-gnav__link:focus-visible {
	color: var(--hts-accent-text);
}

/* 現在地は色でも太さでも示さない。青は印とホバーだけに残す */

/* ページを持たない親。項目そのものが開閉のボタン。ボタンはブラウザの書体になる */
.hts-gnav__toggle {
	appearance: none;
	background: none;
	border: 0;
	padding: 0;
	font-family: inherit;
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.04em;
	color: var(--hts-ink);
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.hts-gnav__caret {
	display: block;
	width: 7px;
	height: 7px;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: translateY(-2px) rotate(45deg);
	transition: transform var(--hts-transition);
}

.hts-gnav__item.is-open .hts-gnav__caret {
	transform: translateY(2px) rotate(-135deg);
}

.hts-gnav__sub {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 10em;
	margin-top: 16px;
	padding: 0;
	/* 角丸の外に、項目の重ね色がはみ出さないようにする */
	overflow: hidden;
	background: var(--hts-surface);
	border-radius: var(--hts-radius-md);
	/* 浮いているものなので、影だけで地から離す。囲いの線は引かない */
	box-shadow: 0 4px 16px rgba(31, 36, 43, 0.12);
}

.hts-gnav__sub a {
	display: block;
	padding: 10px 20px;
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.04em;
	color: var(--hts-ink);
	text-decoration: none;
	white-space: nowrap;
}

.hts-gnav__sub a:hover,
.hts-gnav__sub a:focus-visible {
	color: var(--hts-accent-text);
	background: var(--hts-surface-tint);
}

/* 事業の5分類。フォトの撮影メニューと同じく、上に印・下に名前の3列 */
.hts-gnav__sub--icons {
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 6px;
	width: 32em;
	padding: 10px;
}

.hts-gnav__sub--icons a {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	gap: 8px;
	min-height: 108px;
	padding: 16px 8px;
	font-size: 13px;
	line-height: 1.45;
	text-align: center;
	white-space: normal;
	border-radius: var(--hts-radius-md);
}

.hts-gnav__sub--icons .hts-gnav__icon {
	display: flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	background: none;
	color: var(--hts-accent-text);
}

.hts-gnav__sub--icons .hts-gnav__icon svg {
	width: 28px;
	height: 28px;
}

.hts-gnav__sub--icons .hts-gnav__label,
.hts-gnav__sub--icons .hts-gnav__label-sp {
	display: flex;
	flex-direction: column;
	align-items: center;
}

.hts-gnav__sub--icons .hts-gnav__label-sp > span {
	white-space: nowrap;
}

.hts-gnav__sub--icons a:has(.hts-gnav__label-sp) .hts-gnav__label {
	display: none;
}

.hts-gnav__sub--icons a:hover,
.hts-gnav__sub--icons a:focus-visible {
	background: var(--hts-surface-tint);
	color: var(--hts-ink);
}

/* お問い合わせ。ヘッダーで唯一の塗りのボタン */
.hts-gnav__link--contact {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--hts-dark);
	color: #fff;
	font-family: var(--hts-font-heading);
	font-size: 13px;
	line-height: 1;
	padding: 13px 22px;
	letter-spacing: 0.1em;
	border-radius: var(--hts-radius-md);
}

.hts-gnav__link--contact:hover,
.hts-gnav__link--contact:focus-visible {
	background: var(--hts-dark-hover);
	color: #fff;
}

/*
 * 電話番号 — 塗りにしない。お問い合わせを主、こちらを従にする。
 * 受話器のアイコンを入れるときは、TEL の span を SVG に差し替える。
 */
.hts-header__tel a {
	display: inline-flex;
	align-items: baseline;
	gap: 7px;
	font-family: var(--hts-font-heading);
	font-size: 18px;
	letter-spacing: 0.04em;
	color: var(--hts-ink);
	text-decoration: none;
	white-space: nowrap;
}

.hts-header__tel a:hover,
.hts-header__tel a:focus-visible {
	color: var(--hts-accent-text);
}

.hts-header__tel-label {
	font-size: 10px;
	letter-spacing: 0.18em;
	color: var(--hts-muted);
}

/* 開け閉めの仕掛け。引き出し本体は JavaScript を使わない */
.hts-drawer__toggle,
.hts-drawer__button {
	display: none;
}

/* マウスではホバーで開き、離すと閉じる。
   クリックで付く focus では開いたままにしない。キーボードの focus-visible だけ開く。
   margin のすき間は li の ::after が受け取る。パネルの overflow の内側に置くと切れる。
   999px 以下の引き出し指定は、このブロックより後ろ。 */
@media (hover: hover) {
	.hts-gnav__item--has-children:hover > .hts-gnav__sub,
	.hts-gnav__item--has-children:has(:focus-visible) > .hts-gnav__sub {
		display: block;
	}

	/* display:block にすると、上に印・下に名前の3列が崩れる */
	.hts-gnav__item--has-children:hover > .hts-gnav__sub--icons,
	.hts-gnav__item--has-children:has(:focus-visible) > .hts-gnav__sub--icons {
		display: grid;
	}

	.hts-gnav__item--has-children:hover .hts-gnav__caret,
	.hts-gnav__item--has-children:has(:focus-visible) .hts-gnav__caret {
		transform: translateY(2px) rotate(-135deg);
	}

	/* パネルの上端に 4px 重ね、1px の割れ目でホバーが切れないようにする。
	   クリックは手前のパネルが受ける */
	.hts-gnav__item--has-children::after {
		content: '';
		position: absolute;
		z-index: 1;
		top: 100%;
		left: 0;
		width: 100%;
		height: 20px;
	}

	.hts-gnav__sub {
		z-index: 2;
	}
}

/* 指では押して開く。マウスのクリックでは開いたままにしない */
@media (hover: none) {
	.hts-gnav__item.is-open .hts-gnav__sub {
		display: block;
	}

	.hts-gnav__item.is-open > .hts-gnav__sub--icons {
		display: grid;
	}
}

/* ---------------------------------------------------------------------------
   999px 以下 — 引き出し式にする
   メニューが4項目＋ボタン＋電話番号で、1000px を切ると1段に収まらない
   -------------------------------------------------------------------------- */
@media (max-width: 999px) {
	.hts-header__inner {
		padding: 16px var(--hts-container-pad);
		gap: 16px;
		flex-wrap: wrap;
	}

	.hts-logo__mark {
		height: 36px;
	}

	.hts-logo__name {
		font-size: 21px;
	}

	.hts-drawer__button {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 44px;
		height: 44px;
		margin-left: auto;
		cursor: pointer;
	}

	/* 3本は同じ中心から出す。×は回転だけにする。ずらしてから回すと交点がずれる */
	.hts-drawer__bars,
	.hts-drawer__bars::before,
	.hts-drawer__bars::after {
		display: block;
		width: 22px;
		height: 2px;
		background: var(--hts-ink);
		transition: transform var(--hts-transition), background-color var(--hts-transition);
	}

	.hts-drawer__bars {
		position: relative;
	}

	.hts-drawer__bars::before,
	.hts-drawer__bars::after {
		content: '';
		position: absolute;
		left: 0;
		top: 0;
	}

	.hts-drawer__bars::before {
		transform: translateY(-7px);
	}

	.hts-drawer__bars::after {
		transform: translateY(7px);
	}

	.hts-drawer__toggle:checked + .hts-drawer__button .hts-drawer__bars {
		background: transparent;
	}

	.hts-drawer__toggle:checked + .hts-drawer__button .hts-drawer__bars::before {
		transform: rotate(45deg);
	}

	.hts-drawer__toggle:checked + .hts-drawer__button .hts-drawer__bars::after {
		transform: rotate(-45deg);
	}

	.hts-drawer__toggle:focus-visible + .hts-drawer__button {
		outline: 2px solid var(--hts-accent-text);
		outline-offset: 2px;
	}

	.hts-header__body {
		display: none;
		flex-direction: column;
		order: 3;
		width: 100%;
		margin-left: 0;
		align-items: stretch;
		gap: 0;
		padding-bottom: 8px;
	}

	.hts-header__body > .hts-gnav {
		margin-right: 0;
	}

	/* 開いているあいだは、ヘッダーを画面いっぱいに固定する */
	body:has(.hts-drawer__toggle:checked) {
		overflow: hidden;
	}

	.hts-header:has(.hts-drawer__toggle:checked) {
		position: fixed;
		inset: 0;
		z-index: 100;
		height: 100vh;
		height: 100dvh;
		overflow: hidden;
		display: flex;
		flex-direction: column;
	}

	.hts-header:has(.hts-drawer__toggle:checked) .hts-header__inner {
		flex: 1;
		min-height: 0;
		width: 100%;
		max-width: none;
		display: grid;
		grid-template-columns: 1fr auto;
		grid-template-rows: auto minmax(0, 1fr);
		align-items: stretch;
	}

	.hts-header:has(.hts-drawer__toggle:checked) .hts-logo,
	.hts-header:has(.hts-drawer__toggle:checked) .hts-drawer__button {
		align-self: center;
	}

	.hts-drawer__toggle:checked ~ .hts-header__body {
		display: grid;
		grid-column: 1 / -1;
		grid-row: 2;
		grid-template-columns: 1fr 1fr;
		grid-template-rows: minmax(0, 1fr) auto;
		gap: 12px;
		min-height: 0;
		overflow: hidden;
	}

	.hts-drawer__toggle:checked ~ .hts-header__body > .hts-gnav {
		grid-column: 1 / -1;
		min-height: 0;
		overflow: auto;
	}

	.hts-gnav__list {
		flex-direction: column;
		align-items: stretch;
		gap: 0;
	}

	.hts-gnav__item {
		display: block;
	}

	.hts-gnav__item + .hts-gnav__item {
		margin-top: 0;
	}

	.hts-gnav__link,
	.hts-gnav__item--has-children > .hts-gnav__link {
		display: block;
		padding: 15px 4px;
		font-size: 15px;
	}

	/* 子は常に開く。PC用の開閉ボタンと ∨ は出さない */
	.hts-gnav__caret,
	.hts-gnav__link.hts-gnav__toggle {
		display: none;
	}

	/* 保有資格から下。サービスカードとの差を、罫で埋める。まとめ名は出さない */
	.hts-gnav__item:not(:has(> .hts-gnav__sub--icons)) > .hts-gnav__link,
	.hts-gnav__sub:not(.hts-gnav__sub--icons) a {
		border-bottom: 1px solid var(--hts-rule);
	}

	/* 事業ページへのリンク。アイコンのすぐ上の細い文字だと押せない */
	.hts-gnav__item:has(> .hts-gnav__sub--icons) > a.hts-gnav__link {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
		min-height: 52px;
		margin: 4px 0 14px;
		padding: 14px 16px;
		background: var(--hts-surface-tint);
		border-radius: var(--hts-radius-md);
	}

	.hts-gnav__item:has(> .hts-gnav__sub--icons) > a.hts-gnav__link .hts-gnav__caret {
		display: block;
		flex: none;
		transform: rotate(-45deg);
	}

	.hts-gnav__item--has-children::after {
		content: none;
	}

	.hts-gnav__sub {
		display: block;
		position: static;
		min-width: 0;
		margin: 0;
		padding: 0;
		background: none;
		border-radius: 0;
		box-shadow: none;
	}

	.hts-gnav__sub a {
		padding: 15px 4px;
		font-size: 15px;
		color: var(--hts-ink);
	}

	/* 事業の5分類は2列。5件目だけ下に1枚。ホバーで display:block に戻さない */
	.hts-gnav__item--has-children:hover > .hts-gnav__sub--icons,
	.hts-gnav__item--has-children:has(:focus-visible) > .hts-gnav__sub--icons,
	.hts-gnav__item.is-open > .hts-gnav__sub--icons,
	.hts-gnav__sub--icons {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 8px;
		width: auto;
		min-width: 0;
		padding: 0 0 8px;
	}

	.hts-gnav__sub--icons li:last-child:nth-child(odd) {
		grid-column: 1 / -1;
	}

	.hts-gnav__sub--icons a {
		flex-direction: row;
		justify-content: center;
		gap: 8px;
		min-height: 64px;
		padding: 10px 8px;
		font-size: 12px;
		text-align: left;
		color: var(--hts-ink);
		background: var(--hts-surface-tint);
	}

	.hts-gnav__sub--icons .hts-gnav__label,
	.hts-gnav__sub--icons .hts-gnav__label-sp {
		align-items: flex-start;
	}

	.hts-gnav__sub--icons .hts-gnav__icon,
	.hts-gnav__sub--icons .hts-gnav__icon svg {
		width: 22px;
		height: 22px;
		background: none;
	}

	/* 電話とお問い合わせ。下に2列の大きなボタン */
	.hts-header__tel {
		display: flex;
		margin: 0;
		padding: 0;
		min-height: 72px;
	}

	.hts-header__tel a {
		display: flex;
		flex: 1;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 4px;
		min-height: 72px;
		padding: 12px 8px;
		background: var(--hts-surface-tint);
		border-radius: var(--hts-radius-md);
		font-size: 15px;
		font-weight: 700;
		line-height: 1.2;
		color: var(--hts-ink);
	}

	.hts-header__tel a:hover,
	.hts-header__tel a:focus-visible {
		color: var(--hts-ink);
		background: var(--hts-surface-tint);
	}

	.hts-header__tel-label {
		font-size: 10px;
		color: var(--hts-muted);
	}

	.hts-gnav__link--contact {
		display: flex;
		align-items: center;
		justify-content: center;
		width: auto;
		min-height: 72px;
		margin: 0;
		padding: 12px 8px;
		font-size: 15px;
	}
}
