/* =============================================================
   HP テンプレート ヘッダー
   ============================================================= */

/* --------------------------------------------------------------
   グローバル: viewport 幅連動 rem スケーリング
   デスクトップ (>1140px): 1rem = 16px
   1140px 以下〜769px: 1rem = 1.4035vw  (1140px で 16px)
   768px 以下: 1rem = 16px (SP は固定)
   374px 以下: 1rem = 4.064vw (極小画面でも縮小)

   このファイルは hp テンプレート選択時のみ enqueue されるので、
   カスタム案件の site には影響しない。
   -------------------------------------------------------------- */
html {
	font-size: 16px;
}

@media (max-width: 1140px) {
	html {
		font-size: 1.4035vw;
	}
}

@media screen and (max-width: 768px) {
	html {
		font-size: 16px;
	}
}

@media (max-width: 374px) {
	html {
		font-size: 4.0642vw;
	}
}

:root {
	--oc-hp-header-height: 90px;
}

.oc-hp-header a {
	text-decoration: none;
	color: inherit;
}

.oc-hp-header__meta {
	font-size: 0.75rem;
	font-weight: 400;
	line-height: 1.5;
	margin: 0;
	color: #666;
}

/* ==== PC ==== */
.oc-hp-header--pc {
	position: relative;
	z-index: 100;
	background: #fff;
	box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

.oc-hp-header--pc.is-sticky {
	position: sticky;
	top: 0;
}

body.admin-bar .oc-hp-header--pc.is-sticky,
body.admin-bar .oc-hp-header--sp.is-sticky,
body.admin-bar .cp1-header.is-sticky {
	top: 32px;
}

@media (max-width: 782px) {
	body.admin-bar .oc-hp-header--pc.is-sticky,
	body.admin-bar .oc-hp-header--sp.is-sticky,
	body.admin-bar .cp1-header.is-sticky {
		top: 46px;
	}
}

.oc-hp-header--pc .oc-hp-header__inner {
	max-width: 1440px;
	margin: 0 auto;
	padding: 1rem 1.5rem;
}

.oc-hp-header--pc .oc-hp-header__body {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 2rem;
}

.oc-hp-header--pc .oc-hp-header__logo img {
	max-height: 56px;
	width: auto;
	display: block;
}

.oc-hp-header--pc .oc-hp-header__logo-text {
	font-size: 1.25rem;
	font-weight: 700;
	color: var(--wp--preset--color--primary, #2B4857);
}

.oc-hp-header--pc .oc-hp-header__contents {
	display: flex;
	align-items: center;
	gap: 1.5rem;
}

.oc-hp-header--pc .oc-hp-header__box {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 0.5rem;
}

.oc-hp-header--pc .oc-hp-header__tel {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	color: var(--wp--preset--color--primary, #2B4857);
}

.oc-hp-header__sns-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	color: var(--wp--preset--color--primary, #2B4857);
	transition: opacity 0.2s;
}

.oc-hp-header__sns-link:hover {
	opacity: 0.7;
}

.oc-hp-header__tel-link {
	display: flex;
	align-items: center;
	gap: 0.375rem;
}

.oc-hp-header__tel-number {
	font-size: 1.375rem;
	font-weight: 700;
	letter-spacing: 0.02em;
}

.oc-hp-header__tel-caption {
	font-size: 0.75rem;
	color: #666;
}

.oc-hp-header--pc .oc-hp-header__menus {
	display: flex;
	gap: 1.5rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

/* メガメニューのアンカー。li が position:relative でないと、megamenu の
   絶対配置が直近の配置済み祖先（cp1 では .cp1-header 全体）基準になり、
   メニューとメガメニューの間にヘッダー高さ分の巨大な隙間が空く。
   HP / cp1 両ヘッダーとも li 基準にする。 */
:is(.oc-hp-header--pc, .cp1-header) .oc-hp-header__menu-item {
	position: relative;
}

.oc-hp-header--pc .oc-hp-header__menus > li > a {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	font-size: 0.95rem;
	font-weight: 500;
	padding: 0.5rem 0;
	transition: color 0.2s;
}

.oc-hp-header--pc .oc-hp-header__menus > li > a:hover {
	color: var(--wp--preset--color--primary, #2B4857);
}

/* 親メニューに ▼ 矢印 */
:is(.oc-hp-header--pc, .cp1-header) .oc-hp-header__menu-item--has-mega > a::after {
	content: "";
	display: inline-block;
	width: 0.4em;
	height: 0.4em;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: rotate(45deg) translateY(-2px);
	margin-left: 0.2rem;
	transition: transform 0.2s;
}

:is(.oc-hp-header--pc, .cp1-header) .oc-hp-header__menu-item--has-mega:hover > a::after {
	transform: rotate(225deg) translateY(-1px);
}

/* ============ Mega Menu (PC hover) ============ */
:is(.oc-hp-header--pc, .cp1-header) .oc-hp-header__megamenu {
	position: absolute;
	top: calc(100% + 0.5rem);
	left: 50%;
	transform: translateX(-50%) translateY(-8px);
	min-width: 640px;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
	padding: 1.5rem;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
	z-index: 50;
}

:is(.oc-hp-header--pc, .cp1-header) .oc-hp-header__menu-item--has-mega:hover > .oc-hp-header__megamenu,
:is(.oc-hp-header--pc, .cp1-header) .oc-hp-header__menu-item--has-mega:focus-within > .oc-hp-header__megamenu {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateX(-50%) translateY(0);
}

:is(.oc-hp-header--pc, .cp1-header) .oc-hp-header__megamenu::before {
	content: "";
	position: absolute;
	top: -8px;
	left: 50%;
	transform: translateX(-50%) rotate(45deg);
	width: 16px;
	height: 16px;
	background: #fff;
	box-shadow: -2px -2px 3px rgba(0, 0, 0, 0.04);
}

/* ホバーギャップ対策: 親リンクとメガメニューの間の 0.5rem の隙間を透明な
   ブリッジで埋め、カーソルが隙間に入った瞬間に親 li の :hover が外れて
   メニューが閉じるのを防ぐ。
   ※ブリッジは必ず「親 li」側の擬似要素に置く。メガメニュー側に置くと、
   メニューが閉じる瞬間に megamenu の pointer-events:none を継承して
   ブリッジ自身が無反応になり機能しない（li は常に pointer-events:auto）。
   上の li position:relative とセットで、HP / cp1 両ヘッダーに適用。 */
:is(.oc-hp-header--pc, .cp1-header) .oc-hp-header__menu-item--has-mega::after {
	content: "";
	position: absolute;
	top: calc(100% - 1px);
	left: 0;
	right: 0;
	height: calc(0.5rem + 2px);
}

:is(.oc-hp-header--pc, .cp1-header) .oc-hp-header__megamenu-list {
	list-style: none;
	display: grid;
	grid-template-columns: repeat(4, minmax(120px, 1fr));
	gap: 0.75rem;
	padding: 0;
	margin: 0;
	position: relative;
}

.oc-hp-header__megamenu-item a {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.5rem;
	padding: 0.75rem 0.5rem;
	border-radius: 8px;
	text-decoration: none;
	color: inherit;
	transition: background 0.2s;
}

.oc-hp-header__megamenu-item a:hover {
	background: #f5f7fa;
}

.oc-hp-header__megamenu-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	background: #E5EEF5;
	border-radius: 50%;
	flex-shrink: 0;
}

.oc-hp-header__megamenu-icon img {
	width: 70%;
	height: 70%;
	object-fit: contain;
	display: block;
}

.oc-hp-header__megamenu-item .oc-hp-header__menu-text {
	font-size: 0.85rem;
	font-weight: 600;
	text-align: center;
	color: var(--wp--preset--color--primary, #2B4857);
	line-height: 1.3;
}

.oc-hp-header--pc .oc-hp-header__btn a {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	background: var(--wp--preset--color--primary, #2B4857);
	color: #fff;
	padding: 0.875rem 1.5rem;
	border-radius: 999px;
	font-weight: 700;
	font-size: 0.95rem;
	transition: opacity 0.3s;
}

.oc-hp-header--pc .oc-hp-header__btn a:hover {
	opacity: 0.85;
}

/* ==========================================================================
   SP ヘッダー + ドロワー (元ensembleの忠実再現)
   ========================================================================== */

.oc-hp-header--sp {
	display: none;
}

.oc-hp-drawer {
	display: none;
}

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

@media (max-width: 900px) {
	/* ヘッダー 64px 分の余白（HP テンプレート選択時のみ。cp1 ヘッダー等を
	   利用するページに padding が漏れないよう body.oc-hp にスコープ） */
	body.oc-hp.oc-header-sticky-enabled {
		padding-top: 64px;
	}


	.oc-hp-header--pc {
		display: none;
	}

	/* ---- SP ヘッダー本体 (固定64px) ---- */
	.oc-hp-header--sp {
		display: flex;
		justify-content: center;
		align-items: center;
		position: relative;
		width: 100%;
		height: 64px;
		top: auto;
		left: auto;
		background: #fff;
		box-shadow: 0 0 15px rgba(0, 0, 0, 0.08);
		transform: translateY(0);
		transition: all 0.5s;
		z-index: 300;
	}

	.oc-hp-header--sp.is-sticky {
		position: fixed;
		top: 0;
		left: 0;
	}

	.oc-hp-header--sp.is-active {
		background: #011c40;
	}

	.oc-hp-header__sp-inner {
		padding-left: 4vw;
		padding-right: 64px;
		width: 100%;
	}

	.oc-hp-header__meta {
		font-size: 0.55rem;
		line-height: 1.5;
		text-align: center;
		margin: 0 0 1px;
		opacity: 0.6;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	.oc-hp-header__sp-body {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 1rem;
		padding-right: 5.87vw;
	}

	.oc-hp-header__sp-logo {
		flex: 1;
		position: relative;
		width: 100%;
		max-width: 160px;
		z-index: 200;
	}

	.oc-hp-header__sp-logo img {
		width: 100%;
		height: auto;
		display: block;
	}

	.oc-hp-header__sp-links {
		display: flex;
		align-items: center;
		justify-content: flex-end;
		gap: 13px;
		list-style: none;
		padding: 0;
		margin: 0;
		pointer-events: auto;
		transition: all 0.5s;
	}

	.oc-hp-header--sp.is-active .oc-hp-header__sp-links {
		opacity: 0;
		pointer-events: none;
	}

	.oc-hp-header__sp-link a {
		display: flex;
		flex-direction: column;
		align-items: center;
		gap: 3px;
		color: var(--wp--preset--color--primary, #008CD6);
		text-decoration: none;
	}

	.oc-hp-header__sp-link-icon {
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.oc-hp-header__sp-link-icon:not(.oc-hp-header__sp-link-icon--instagram) svg {
		width: 18px;
		height: 18px;
	}

	.oc-hp-header__sp-link-icon--instagram svg {
		width: 40px;
		height: 40px;
	}

	.oc-hp-header__sp-link-text {
		font-size: 0.75rem;
		font-weight: 700;
		line-height: 1.5;
	}

	/* ---- バーガーボタン (固定右上 64x64) ---- */
	.oc-hp-drawer {
		display: block;
	}

	body.oc-hp .oc-hp-drawer {
		position: absolute;
		top: 0;
		right: 0;
		z-index: 400;
	}

	.oc-hp-drawer__toggle {
		position: absolute;
		width: 64px;
		height: 64px;
		top: 0;
		right: 0;
		background: var(--wp--preset--color--primary, #008CD6);
		border: 0;
		padding: 0;
		cursor: pointer;
		transition: all 0.5s;
		/* SP ヘッダー (z:300) より上に出す */
		z-index: 400;
	}

	body.oc-hp.oc-header-sticky-enabled .oc-hp-drawer__toggle {
		position: fixed;
	}

	body.admin-bar.oc-hp.oc-header-sticky-enabled .oc-hp-drawer__toggle {
		top: 32px;
	}

	body.admin-bar .oc-hp-drawer__contents {
		top: 32px;
		height: calc(100vh - 32px);
	}

	.oc-hp-drawer__toggle[aria-expanded="true"] {
		z-index: 401;
	}

	.oc-hp-drawer__bars {
		/* position: absolute にすることで button の text-align: center による
		 * 二重中央寄せを回避。ensemble は <div>(block) なので
		 * relative + left: 50% で成立していた。 */
		position: absolute;
		width: 16px;
		height: 6px;
		top: 18px;
		left: 50%;
		transform: translateX(-50%);
		z-index: 1000;
	}

	.oc-hp-drawer__bar {
		position: absolute;
		width: 16px;
		height: 2px;
		background: #fff;
		top: 0;
		left: 0;
		transition: all 0.5s;
	}

	.oc-hp-drawer__bar--1 {
		top: 0;
	}

	.oc-hp-drawer__bar--2 {
		top: 4px;
	}

	.oc-hp-drawer__toggle[aria-expanded="true"] .oc-hp-drawer__bar--1 {
		top: calc(50% - 1px);
		transform: rotate(-35deg);
	}

	.oc-hp-drawer__toggle[aria-expanded="true"] .oc-hp-drawer__bar--2 {
		top: calc(50% - 1px);
		transform: rotate(35deg);
	}

	.oc-hp-drawer__bar-label {
		position: absolute;
		top: 16px;
		left: 50%;
		transform: translateX(-50%);
		font-size: 0.75rem;
		font-weight: 700;
		line-height: 1.5;
		color: #fff;
		letter-spacing: 0;
	}

	/* ---- ドロワー本体 (フルスクリーン紺色) ---- */
	.oc-hp-drawer__contents {
		position: fixed;
		display: flex;
		flex-direction: column;
		justify-content: space-between;
		width: 100%;
		height: 100vh;
		top: 0;
		left: 0;
		color: #fff;
		background: #064e4c;
		padding: 8.53vw 8vw 8vw;
		margin-top: 64px;
		cursor: auto;
		opacity: 0;
		pointer-events: none;
		overflow-y: auto;
		transition: all 0.5s;
		/* SP ヘッダー (z:300) より上 */
		z-index: 350;
	}

	.oc-hp-drawer__contents.is-active {
		opacity: 1;
		pointer-events: auto;
	}

	/* ---- ナビ部分 ---- */
	.oc-hp-drawer__nav-wrap {
		flex: 1;
		display: flex;
		flex-wrap: wrap;
		align-items: flex-start;
		align-content: flex-start; /* wrap 時の行間を gap 以上に伸ばさない */
		gap: 8vw 1.5vw;
	}

	.oc-hp-drawer__nav--01 {
		flex: 1 1 100%;
		width: 100%;
	}

	.oc-hp-drawer__nav--02,
	.oc-hp-drawer__nav--03 {
		width: calc(50% - 0.75vw);
	}

	.oc-hp-drawer__menus {
		display: flex;
		flex-wrap: wrap;
		width: 100%;
		gap: 2.93vw;
		list-style: none;
		padding: 0;
		margin: 0;
	}

	.oc-hp-drawer__menus--row2 {
		justify-content: space-between;
		gap: 2.13vw 8vw;
	}

	.oc-hp-drawer__menus--row2 .oc-hp-drawer__menu {
		width: calc(50% - 4vw);
	}

	.oc-hp-drawer__menu {
		width: 100%;
	}

	.oc-hp-drawer__menu a {
		display: flex;
		justify-content: space-between;
		align-items: center;
		gap: 1.33vw;
		font-size: 3.73vw;
		color: #fff;
		text-decoration: none;
	}

	.oc-hp-drawer__menu--big {
		width: 100%;
		margin-bottom: 4.27vw;
	}

	.oc-hp-drawer__menu--big a {
		display: inline-flex;
		gap: 4vw;
		justify-content: flex-start;
	}

	.oc-hp-drawer__menu--big .oc-hp-drawer__menu-text {
		font-size: 4.8vw;
		font-weight: 700;
		line-height: 1;
		letter-spacing: 0.05em;
	}

	.oc-hp-drawer__menu--big .oc-hp-drawer__menu-arrow {
		display: none;
	}

	.oc-hp-drawer__menu-arrow {
		display: inline-block;
		flex-shrink: 0;
		width: 5.07vw;
		height: 5.07vw;
		position: relative;
	}

	.oc-hp-drawer__menu-arrow::before,
	.oc-hp-drawer__menu-arrow::after {
		content: "";
		position: absolute;
		background: #fff;
	}

	.oc-hp-drawer__menu-arrow::before {
		top: 50%;
		left: 20%;
		right: 20%;
		height: 1.5px;
		transform: translateY(-50%);
	}

	.oc-hp-drawer__menu-arrow::after {
		top: calc(50% - 4px);
		right: 20%;
		width: 8px;
		height: 8px;
		border-top: 1.5px solid #fff;
		border-right: 1.5px solid #fff;
		background: transparent;
		transform: rotate(45deg);
	}

	/* ---- CTA エリア ---- */
	.oc-hp-drawer__cta {
		width: 100%;
		margin-top: 12vw;
	}

	.oc-hp-drawer__cta-btns {
		display: grid;
		grid-template-columns: 1fr;
		gap: 1.07vw;
		list-style: none;
		padding: 0;
		margin: 0;
	}

	.oc-hp-drawer__cta-btn a {
		display: flex;
		align-items: center;
		gap: 2.13vw;
		background: var(--wp--preset--color--primary, #008CD6);
		padding: 3.2vw 10.67vw;
		text-decoration: none;
		color: #fff;
	}

	.oc-hp-drawer__cta-icon {
		flex-shrink: 0;
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.oc-hp-drawer__cta-icon svg {
		width: 6.4vw;
		height: 6.4vw;
		object-fit: contain;
	}

	.oc-hp-drawer__cta-text {
		flex: 1;
		font-size: 4.27vw;
		font-weight: 700;
		line-height: 1.5;
		color: #fff;
	}

	.oc-hp-drawer__cta-arrow {
		flex-shrink: 0;
		display: inline-block;
		width: 4.8vw;
		height: 4.8vw;
		position: relative;
	}

	.oc-hp-drawer__cta-arrow::before {
		content: "";
		position: absolute;
		top: calc(50% - 4px);
		right: 20%;
		width: 8px;
		height: 8px;
		border-top: 1.5px solid #fff;
		border-right: 1.5px solid #fff;
		transform: rotate(45deg);
	}

	.oc-hp-drawer__cta-tel {
		flex: 1;
		margin-top: 8.53vw;
	}

	.oc-hp-drawer__cta-tel a {
		display: block;
		height: 100%;
		color: #fff;
		text-decoration: none;
	}

	.oc-hp-drawer__cta-tel-text {
		font-size: 3.73vw;
		font-weight: 700;
		line-height: 1.5;
		text-align: center;
		margin: 0;
	}

	.oc-hp-drawer__cta-tel-row {
		position: relative;
		display: flex;
		align-items: center;
		justify-content: center;
		top: 1.33vw;
		gap: 3.2vw;
	}

	.oc-hp-drawer__cta-tel-icon {
		flex-shrink: 0;
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.oc-hp-drawer__cta-tel-icon svg {
		width: 12.8vw;
		height: 12.8vw;
	}

	.oc-hp-drawer__cta-tel-number {
		font-size: 8.53vw;
		font-weight: 700;
		line-height: 1.5;
		margin: 0;
	}

	/* ---- CLOSE ボタン ---- */
	.oc-hp-drawer__close {
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 2.67vw;
		margin-top: 8.53vw;
		background: transparent;
		border: 0;
		color: #fff;
		cursor: pointer;
		padding: 0;
	}

	.oc-hp-drawer__close-icon {
		position: relative;
		flex-shrink: 0;
		display: inline-block;
		width: 4vw;
		height: 2.93vw;
	}

	.oc-hp-drawer__close-icon::before,
	.oc-hp-drawer__close-icon::after {
		content: "";
		position: absolute;
		width: 4.27vw;
		height: 0.53vw;
		top: 50%;
		left: 50%;
		background: #fff;
	}

	.oc-hp-drawer__close-icon::before {
		transform: translate(-50%, -50%) rotate(-35deg);
	}

	.oc-hp-drawer__close-icon::after {
		transform: translate(-50%, -50%) rotate(35deg);
	}

	.oc-hp-drawer__close-text {
		font-size: 3.73vw;
		font-weight: 700;
		letter-spacing: 0.05em;
	}
}

@media (max-width: 782px) {
	body.admin-bar.oc-hp.oc-header-sticky-enabled .oc-hp-drawer__toggle,
	body.admin-bar .oc-hp-drawer__contents {
		top: 46px;
	}

	body.admin-bar .oc-hp-drawer__contents {
		height: calc(100vh - 46px);
	}
}
