/**
 * クリニックパターン 1 テンプレート ヘッダー
 *
 * 1920px 幅の広いヘッダー。`octheme/template-parts/header-clinic-pattern-1.php`
 * から呼び出される。メガメニューの装飾は `oc-hp-header.css` の
 * `:is(.oc-hp-header--pc, .cp1-header)` スコープに統合済みのため
 * 本ファイルではレイアウトのみ定義する。SP ドロワーは `.oc-hp-drawer`
 * スタイル群（同 oc-hp-header.css）を流用。
 */

.cp1-header {
	--cp1h-navy: #08265c;
	--cp1h-navy-soft: #25446f;
	--cp1h-orange: #0abab5;
	--cp1h-orange-light: #0fc9c4;
	--cp1h-orange-dark: #089a96;
	--cp1h-text-muted: #65758f;
	--cp1h-shadow-cta: 0 8px 18px rgba(10, 186, 181, 0.32);
	--cp1h-shadow-cta-hover: 0 12px 24px rgba(10, 186, 181, 0.44);
	--cp1h-font-display: Montserrat, sans-serif;

	position: relative;
	z-index: 30;
	background: #fff;
	color: var(--cp1h-navy);
	font-family: "Noto Sans JP", -apple-system, BlinkMacSystemFont,
		"Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
	-webkit-font-smoothing: antialiased;
}

.cp1-header.is-sticky {
	position: sticky;
	top: 0;
	z-index: 100;
}

/* `:where()` で specificity を 0 に下げ、ブロック側の個別スタイル
   （例: .cp1-header__logo-img--sp { display:none }）が常に上書きできるようにする。 */
:where(.cp1-header) * {
	box-sizing: border-box;
}

:where(.cp1-header) img {
	display: block;
	max-width: 100%;
}

.cp1-header__catchcopy {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.cp1-header__inner {
	max-width: 1920px;
	margin: 0 auto;
	padding: 0 42px;
	height: 112px;
	display: flex;
	align-items: center;
	gap: 30px;
}

.cp1-header__logo {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	color: inherit;
	text-decoration: none;
}

.cp1-header__logo-img {
	/* ヘッダー高さ (112px) を超えないよう max-height を設定。
	   width / height は max-* にしてアスペクト比を保つ。 */
	max-width: 300px;
	max-height: 80px;
	width: auto;
	height: auto;
	object-fit: contain;
	object-position: left center;
}

.cp1-header__logo-img--sp {
	display: none;
}

.cp1-header__logo-text {
	font-size: 18px;
	font-weight: 800;
	color: var(--cp1h-navy);
}

.cp1-header__nav {
	flex: 1;
	min-width: 0;
}

.cp1-header__menus {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 28px;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 14px;
	font-weight: 700;
	color: var(--cp1h-navy);
	white-space: nowrap;
}

.cp1-header__menus > li > a {
	display: inline-flex;
	align-items: center;
	padding: 8px 0;
	color: var(--cp1h-navy);
	text-decoration: none;
	transition: color 0.2s;
}

.cp1-header__menus > li > a:hover,
.cp1-header__menus > li > a:focus {
	color: var(--cp1h-orange);
}

/* メガメニューの矢印インジケーター（hp と同じ装飾を踏襲） */
.cp1-header__menus .oc-hp-header__menu-item--has-mega > a::after {
	content: "";
	width: 6px;
	height: 6px;
	margin-left: 6px;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: rotate(45deg) translateY(-2px);
	display: inline-block;
	transition: transform 0.2s;
}

.cp1-header__right {
	flex-shrink: 0;
	margin-left: 14px;
	display: flex;
	align-items: center;
	gap: 22px;
}

.cp1-header__tel {
	display: flex;
	align-items: center;
	gap: 10px;
	color: var(--cp1h-navy);
	text-decoration: none;
}

.cp1-header__tel-icon {
	width: 22px;
	height: 22px;
	flex-shrink: 0;
	color: var(--cp1h-navy);
}

.cp1-header__tel-text {
	display: flex;
	flex-direction: column;
}

.cp1-header__tel-number {
	font-family: var(--cp1h-font-display);
	font-weight: 800;
	font-size: 22px;
	line-height: 1;
	letter-spacing: 0.01em;
	color: var(--cp1h-navy);
	white-space: nowrap;
}

.cp1-header__tel-hours {
	margin-top: 5px;
	font-size: 11px;
	font-weight: 600;
	color: var(--cp1h-text-muted);
	white-space: nowrap;
}

.cp1-header__cta,
.cp1-header__cta:hover,
.cp1-header__cta:focus,
.cp1-header__cta:active,
.cp1-header__cta:visited {
	color: #fff;
}

.cp1-header__cta {
	width: 154px;
	height: 60px;
	padding: 0 14px;
	display: flex;
	align-items: center;
	gap: 8px;
	border-radius: 12px;
	background: var(--cp1h-orange-light);
	white-space: nowrap;
	text-decoration: none;
	transition: background 0.2s ease;
}

.cp1-header__cta:hover {
	background: var(--cp1h-orange);
}

.cp1-header__cta-icon {
	width: 22px;
	height: 22px;
	flex-shrink: 0;
	color: currentColor;
}

.cp1-header__cta-text {
	flex: 1;
	display: flex;
	flex-direction: column;
	line-height: 1.15;
}

.cp1-header__cta-text small {
	font-size: 9px;
	font-weight: 700;
	letter-spacing: 0.04em;
	opacity: 0.95;
}

.cp1-header__cta-text strong {
	font-size: 15px;
	font-weight: 800;
	letter-spacing: 0.04em;
}

.cp1-header__hamburger {
	display: none;
}

@media (max-width: 1280px) {
	.cp1-header__inner {
		padding: 0 32px;
		height: 88px;
		gap: 18px;
	}

	.cp1-header__logo-img {
		max-width: 240px;
		max-height: 64px;
	}

	.cp1-header__menus {
		gap: 16px;
		font-size: 13px;
	}

	.cp1-header__right {
		gap: 16px;
		margin-left: 0;
	}

	.cp1-header__tel-number {
		font-size: 18px;
	}

	.cp1-header__cta {
		width: 130px;
		height: 54px;
	}

	.cp1-header__cta-text strong {
		font-size: 13px;
	}
}

@media (max-width: 768px) {
	.cp1-header__inner {
		padding: 0 24px;
		height: 72px;
		gap: 12px;
	}

	.cp1-header__logo-img--pc {
		display: none;
	}

	.cp1-header__logo-img--sp {
		display: block;
		max-width: 172px;
		max-height: 52px;
	}

	.cp1-header__nav,
	.cp1-header__right {
		display: none;
	}

	.cp1-header__hamburger {
		margin-left: auto;
		width: 40px;
		height: 40px;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 6px;
		background: transparent;
		border: 0;
		padding: 0;
		cursor: pointer;
		/* HP テンプレートの .oc-hp-drawer__toggle が position:fixed; top:0; right:0
		   で右上隅に固定するルールを上書き。cp1 ヘッダー内では flex 行の通常配置に戻す。 */
		position: static;
		top: auto;
		right: auto;
		z-index: auto;
		transition: none;
	}

	.cp1-header__hamburger span {
		display: block;
		width: 28px;
		height: 3px;
		background: var(--cp1h-navy);
		border-radius: 2px;
		transition: transform 0.2s, opacity 0.2s;
	}

	/* ドロワー展開中はバーを × に変形 (oc-hp-header.js が is-open を切り替える) */
	.cp1-header__hamburger.is-open span:nth-child(1) {
		transform: translateY(9px) rotate(45deg);
	}

	.cp1-header__hamburger.is-open span:nth-child(2) {
		opacity: 0;
	}

	.cp1-header__hamburger.is-open span:nth-child(3) {
		transform: translateY(-9px) rotate(-45deg);
	}
}
