/*
 * layout.css — ヘッダー・フッター・ページ共通レイアウト。
 * ヘッダーはスクロール追従（sticky）。1280px 以上で横並び、未満でハンバーガーメニュー。
 * ヘッダーは白のごく薄いグラデーション。下端にローズの細い線を入れ、スクロールすると影が付く。
 */

/* ------------------------------------------------------------
 * ヘッダーの高さ（アンカー移動時の位置合わせにも使う）
 * ------------------------------------------------------------ */
:root {
	--ws-header-h: 56px;
	--ws-adminbar-h: 0px;
}

@media (min-width: 1280px) {
	:root {
		--ws-header-h: 80px;
	}
}

/* ログイン中は WordPress の管理バーの分だけ下げる（600px 以下では管理バーが追従しないため 0）。 */
.admin-bar {
	--ws-adminbar-h: 32px;
}

@media (max-width: 782px) {
	.admin-bar {
		--ws-adminbar-h: 46px;
	}
}

@media (max-width: 600px) {
	.admin-bar {
		--ws-adminbar-h: 0px;
	}
}

/* ページ内リンクで移動したとき、見出しが追従ヘッダーに隠れないようにする。 */
.ws-main,
.ws-main [id] {
	scroll-margin-top: calc(var(--ws-header-h) + var(--ws-adminbar-h) + 16px);
}

@media (prefers-reduced-motion: no-preference) {
	html {
		scroll-behavior: smooth;
	}
}

/* ------------------------------------------------------------
 * ヘッダー
 * ------------------------------------------------------------ */
.ws-header {
	position: sticky;
	top: var(--ws-adminbar-h);
	z-index: 50;
	/* 白から、ごく薄い青みのある白へのグラデーション。 */
	/* すりガラス（backdrop-filter）は使わない: ページ全体の文字のにじみ方が変わってしまうため。 */
	background: linear-gradient(180deg, var(--ws-color-white) 0%, #fafbfd 100%);
	border-bottom: 1px solid transparent;
	transition: box-shadow 0.3s ease;
}

/* 下端の細い線（左はローズ、右へ向かって薄いネイビーに変わる） */
.ws-header::after {
	position: absolute;
	right: 0;
	bottom: -1px;
	left: 0;
	height: 1px;
	background: linear-gradient(90deg, var(--ws-color-coral) 0%, var(--ws-color-rose) 16%, rgba(217, 98, 122, 0.24) 44%, rgba(18, 33, 63, 0.1) 100%);
	content: "";
	pointer-events: none;
}

/* スクロール中は影を付けて、ページから少し浮かせる */
.ws-header.is-scrolled {
	box-shadow: 0 10px 30px rgba(18, 33, 63, 0.1);
}

/* メニューを開いている間は、ドロワーと同じ白にそろえる */
.ws-header.is-open {
	background: var(--ws-color-white);
}

.ws-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0 16px;
	max-width: 1440px;
	min-height: var(--ws-header-h);
	margin-inline: auto;
	padding-inline: var(--ws-gutter);
}

.ws-header__brand {
	display: flex;
	flex: 1 1 0;
	align-items: center;
	min-width: 0;
}

.ws-header__site-name,
.ws-header__brand .custom-logo-link {
	display: inline-flex;
	align-items: center;
	min-height: var(--ws-tap);
	color: var(--ws-color-navy);
	text-decoration: none;
}

.ws-header__site-name {
	font-size: clamp(0.9375rem, 0.85rem + 0.5vw, 1.125rem);
	font-weight: 700;
	line-height: 1.4;
	letter-spacing: 0.06em;
	transition: color 0.2s;
}

/* 社名の左に添える、ローズの短い縦線 */
.ws-header__site-name::before {
	flex: 0 0 auto;
	width: 3px;
	height: 1.25em;
	margin-right: 12px;
	background: linear-gradient(180deg, var(--ws-color-coral) 0%, var(--ws-color-rose-deep) 100%);
	border-radius: 2px;
	content: "";
}

a.ws-header__site-name:hover {
	color: var(--ws-color-rose-deeper);
}

.ws-header__brand .custom-logo {
	width: auto;
	max-height: 40px;
}

/* ハンバーガーボタン */
.ws-header__toggle {
	display: inline-flex;
	flex: 0 0 var(--ws-tap);
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 5px;
	width: var(--ws-tap);
	height: var(--ws-tap);
	padding: 0;
	background-color: var(--ws-color-white);
	border: 1px solid rgba(18, 33, 63, 0.14);
	border-radius: 50%;
	color: var(--ws-color-navy);
	cursor: pointer;
	transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.ws-header__toggle-bar {
	display: block;
	width: 18px;
	height: 2px;
	background-color: currentColor;
	border-radius: 1px;
	transition: transform 0.2s, opacity 0.2s;
}

/* 真ん中の線だけ短くして、右にそろえる */
.ws-header__toggle-bar--middle {
	width: 12px;
	margin-left: 6px;
}

/* 開いている間: ネイビーの丸に白い × */
.ws-header.is-open .ws-header__toggle {
	background-color: var(--ws-color-navy);
	border-color: var(--ws-color-navy);
	color: var(--ws-color-white);
}

.ws-header.is-open .ws-header__toggle-bar--top {
	transform: translateY(7px) rotate(45deg);
}

.ws-header.is-open .ws-header__toggle-bar--middle {
	opacity: 0;
}

.ws-header.is-open .ws-header__toggle-bar--bottom {
	transform: translateY(-7px) rotate(-45deg);
}

/*
 * ナビとCTAのパネル。
 * SPでは閉じた状態が初期値。開くとヘッダーの下に重ねて表示し、本文の位置は動かさない。
 * 画面の高さに収まらない場合はパネルの中をスクロールできる。
 */
.ws-header__panel {
	display: none;
	position: absolute;
	top: 100%;
	right: 0;
	left: 0;
	max-height: calc(100vh - var(--ws-header-h) - var(--ws-adminbar-h));
	max-height: calc(100dvh - var(--ws-header-h) - var(--ws-adminbar-h));
	padding: 4px var(--ws-gutter) 24px;
	overflow-y: auto;
	overscroll-behavior: contain;
	background-color: var(--ws-color-white);
	border-top: 1px solid var(--ws-color-line);
	box-shadow: 0 16px 32px rgba(18, 33, 63, 0.12);
}

.ws-header.is-open .ws-header__panel {
	display: block;
}

/* JavaScript が無効な場合は、パネルを開いた状態でヘッダー内に並べる。 */
.no-js .ws-header__inner {
	flex-wrap: wrap;
}

.no-js .ws-header__panel {
	display: block;
	position: static;
	flex: 0 0 100%;
	max-height: none;
	padding-inline: 0;
	box-shadow: none;
}

.no-js .ws-header__toggle {
	display: none;
}

.ws-nav__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.ws-nav__list > li > a,
.ws-nav__list > li > span {
	display: flex;
	align-items: center;
	min-height: 48px;
	padding: 4px;
	border-bottom: 1px solid var(--ws-color-line);
	color: var(--ws-color-text);
	font-size: 0.9375rem;
	font-weight: 500;
	line-height: 1.4;
	letter-spacing: 0.04em;
	text-decoration: none;
	transition: color 0.2s;
}

.ws-nav__list > li > a:hover {
	color: var(--ws-color-rose-deep);
}

.ws-header__cta {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 20px;
}

.ws-header__cta .ws-button {
	flex: 1 1 200px;
	letter-spacing: 0.06em;
	transition: background-color 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

/* ヘッダーのボタン: ネイビーはわずかなグラデーションと影を付ける */
.ws-header__cta .ws-button--primary {
	background-image: linear-gradient(135deg, #22386a 0%, var(--ws-color-navy) 64%);
	box-shadow: 0 8px 18px rgba(18, 33, 63, 0.2);
}

.ws-header__cta a.ws-button--primary:hover {
	background-image: linear-gradient(135deg, #1a2d58 0%, var(--ws-color-navy-deep) 64%);
	box-shadow: 0 10px 22px rgba(18, 33, 63, 0.28);
}

@media (min-width: 1280px) {
	.ws-header__inner,
	.no-js .ws-header__inner {
		flex-wrap: nowrap;
		gap: 0 24px;
	}

	.ws-header__brand {
		flex: 0 0 auto;
	}

	.ws-header__toggle {
		display: none;
	}

	.ws-header__panel,
	.ws-header.is-open .ws-header__panel,
	.no-js .ws-header__panel {
		display: flex;
		position: static;
		flex: 1 1 auto;
		align-items: center;
		justify-content: flex-end;
		gap: 20px;
		min-width: 0;
		max-height: none;
		padding: 0;
		overflow: visible;
		background-color: transparent;
		border-top: 0;
		box-shadow: none;
	}

	.ws-nav__list {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		justify-content: flex-end;
	}

	.ws-nav__list > li > a,
	.ws-nav__list > li > span {
		position: relative;
		min-height: var(--ws-tap);
		padding: 4px 14px;
		border-bottom: 0;
		letter-spacing: 0.08em;
		white-space: nowrap;
	}

	/* カーソルを合わせると、下にローズの線が左から伸びる */
	.ws-nav__list > li > a::after {
		position: absolute;
		right: 14px;
		bottom: 6px;
		left: 14px;
		height: 1px;
		background: linear-gradient(90deg, var(--ws-color-coral) 0%, var(--ws-color-rose) 100%);
		content: "";
		transform: scaleX(0);
		transform-origin: left center;
		transition: transform 0.3s ease;
	}

	.ws-nav__list > li > a:hover::after,
	.ws-nav__list > li > a:focus-visible::after,
	.ws-nav__list > .current-menu-item > a::after {
		transform: scaleX(1);
	}

	.ws-header__cta {
		flex: 0 0 auto;
		flex-wrap: nowrap;
		gap: 10px;
		margin-top: 0;
	}

	.ws-header__cta .ws-button {
		flex: 0 0 auto;
		min-height: 46px;
		padding: 8px 24px;
		white-space: nowrap;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ws-header,
	.ws-header__toggle,
	.ws-header__toggle-bar,
	.ws-nav__list > li > a::after {
		transition: none;
	}
}

/* ------------------------------------------------------------
 * 本文領域
 * ------------------------------------------------------------ */
.ws-main {
	display: block;
	min-height: 40vh;
}

/* ------------------------------------------------------------
 * フッター（濃いネイビー）
 * 1400px 以上: 会社名・ナビ・メッセージ・お問い合わせボタンを1行に並べる。
 * それ未満: メッセージとボタン → 会社名 → ナビ の順に縦に並べる。
 * ------------------------------------------------------------ */
.ws-footer {
	padding: clamp(40px, 6vw, 64px) 0 20px;
	background-color: var(--ws-color-navy);
	color: var(--ws-color-white);
}

.ws-footer__inner {
	width: 100%;
	max-width: 1440px;
	margin-inline: auto;
	padding-inline: var(--ws-gutter);
}

.ws-footer__top {
	display: flex;
	flex-direction: column;
	gap: 20px;
	padding-bottom: clamp(24px, 4vw, 36px);
}

.ws-footer__lead {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	order: -1;
	gap: 20px;
	padding-bottom: 28px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.ws-footer__message {
	margin: 0;
	font-size: clamp(1.125rem, 1rem + 0.6vw, 1.375rem);
	font-weight: 600;
	line-height: 1.7;
	letter-spacing: 0.08em;
}

.ws-footer__lead .ws-button {
	min-height: 52px;
	padding: 10px 30px;
	font-size: 0.9375rem;
}

.ws-footer__name {
	margin: 0;
	font-size: 1.0625rem;
	font-weight: 600;
	line-height: 1.5;
	letter-spacing: 0.08em;
}

.ws-footer__list {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0 16px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ws-footer__list > li > a,
.ws-footer__list > li > span {
	display: inline-flex;
	align-items: center;
	min-height: var(--ws-tap);
	color: rgba(255, 255, 255, 0.9);
	font-size: 0.8125rem;
	line-height: 1.5;
	letter-spacing: 0.06em;
	text-decoration: none;
}

.ws-footer__list > li > a:hover {
	color: var(--ws-color-white);
	text-decoration: underline;
	text-underline-offset: 0.3em;
}

.ws-footer__bottom {
	padding-top: 12px;
	border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.ws-footer__copyright {
	margin: 4px 0 0;
	color: rgba(255, 255, 255, 0.72);
	font-size: 0.75rem;
	line-height: 1.6;
}

@media (min-width: 768px) {
	.ws-footer__lead {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
	}

	.ws-footer__list {
		display: flex;
		flex-wrap: wrap;
		gap: 0 28px;
	}

	.ws-footer__bottom {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		justify-content: space-between;
		gap: 0 32px;
	}

	.ws-footer__copyright {
		margin-top: 0;
	}
}

@media (min-width: 1400px) {
	.ws-footer__top {
		flex-direction: row;
		align-items: center;
		gap: 40px;
	}

	.ws-footer__name {
		flex: 0 0 auto;
	}

	.ws-footer__nav {
		flex: 0 1 auto;
	}

	.ws-footer__lead {
		flex: 0 0 auto;
		order: 0;
		gap: 28px;
		margin-left: auto;
		padding-bottom: 0;
		border-bottom: 0;
	}

	.ws-footer__message {
		font-size: 1rem;
	}

	.ws-footer__list {
		gap: 0 20px;
	}

	.ws-footer__list > li > a,
	.ws-footer__list > li > span {
		white-space: nowrap;
	}
}

/* ------------------------------------------------------------
 * 画面下の小さなお問い合わせボタン（スマホだけ。表示・非表示は assets/js/sticky-cta.js）
 * ------------------------------------------------------------ */
.ws-sticky-cta {
	display: none;
}

/* ============================================================
 * ハンバーガーメニュー（1279px 以下）: 開くと、ヘッダーの下を画面いっぱいに覆うドロワーになる。
 * 上にナビ、下にCTAをまとめる。後ろのページ（フッターなど）は見せず、スクロールもさせない。
 * ============================================================ */
@media (max-width: 1279px) {
	.ws-menu-open {
		overflow: hidden;
	}

	.ws-header.is-open .ws-header__panel {
		display: flex;
		flex-direction: column;
		height: calc(100vh - var(--ws-header-h) - var(--ws-adminbar-h) - 1px);
		height: calc(100dvh - var(--ws-header-h) - var(--ws-adminbar-h) - 1px);
		max-height: none;
		padding: 12px var(--ws-gutter) calc(28px + env(safe-area-inset-bottom, 0px));
		background:
			radial-gradient(70% 42% at 100% 100%, rgba(242, 150, 154, 0.16) 0%, rgba(242, 150, 154, 0) 70%),
			var(--ws-color-white);
		box-shadow: none;
		animation: ws-drawer-in 0.3s ease both;
	}

	.ws-header.is-open .ws-nav {
		flex: 0 0 auto;
	}

	/* ナビの上に小さな英字の見出しを置く */
	.ws-header.is-open .ws-nav::before {
		display: block;
		margin: 16px 2px 6px;
		color: var(--ws-color-rose-deep);
		font-family: var(--ws-font-en);
		font-size: 0.6875rem;
		font-weight: 600;
		line-height: 1.4;
		letter-spacing: 0.28em;
		content: "MENU";
	}

	.ws-header.is-open .ws-nav__list {
		counter-reset: ws-nav;
	}

	.ws-header.is-open .ws-nav__list > li {
		counter-increment: ws-nav;
	}

	.ws-header.is-open .ws-nav__list > li > a,
	.ws-header.is-open .ws-nav__list > li > span {
		justify-content: flex-start;
		min-height: 64px;
		padding: 4px 2px;
		color: var(--ws-color-navy);
		font-size: 1.0625rem;
		font-weight: 600;
		letter-spacing: 0.08em;
	}

	/* 項目の前に 01, 02 … の小さな番号を付ける */
	.ws-header.is-open .ws-nav__list > li > a::before,
	.ws-header.is-open .ws-nav__list > li > span::before {
		flex: 0 0 auto;
		width: 36px;
		color: var(--ws-color-rose-deep);
		font-family: var(--ws-font-en);
		font-size: 0.75rem;
		font-weight: 600;
		letter-spacing: 0.12em;
		content: counter(ws-nav, decimal-leading-zero);
	}

	/* リンクの右端に小さな矢印を置く */
	.ws-header.is-open .ws-nav__list > li > a::after {
		flex: 0 0 auto;
		width: 8px;
		height: 8px;
		margin-right: 4px;
		margin-left: auto;
		border-top: 1px solid var(--ws-color-rose-deep);
		border-right: 1px solid var(--ws-color-rose-deep);
		content: "";
		transform: rotate(45deg);
	}

	/* CTAはドロワーの下端にまとめる */
	.ws-header.is-open .ws-header__cta {
		flex-direction: column;
		flex-wrap: nowrap;
		gap: 12px;
		margin-top: auto;
		padding-top: 28px;
	}

	.ws-header.is-open .ws-header__cta .ws-button {
		flex: 0 0 auto;
		width: 100%;
		min-height: 54px;
		font-size: 0.9375rem;
	}
}

/* タブレット幅のドロワー: CTAを横に2つ並べる（1つのボタンが横に長くなりすぎないようにする） */
@media (min-width: 768px) and (max-width: 1279px) {
	.ws-header.is-open .ws-header__cta {
		flex-direction: row;
	}

	.ws-header.is-open .ws-header__cta .ws-button {
		flex: 1 1 0;
		width: auto;
	}
}

@keyframes ws-drawer-in {
	from {
		opacity: 0;
		transform: translateY(-8px);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ws-header.is-open .ws-header__panel {
		animation: none;
	}
}

/* ============================================================
 * スマホ（767px 以下）専用
 * ============================================================ */
@media (max-width: 767px) {
	/* ヘッダー: 会社名を少し小さく */
	.ws-header__site-name {
		font-size: 0.9375rem;
		letter-spacing: 0.06em;
	}

	/* 画面下の小さなお問い合わせボタン（右下に1つだけ。帯にはしない） */
	.ws-sticky-cta {
		position: fixed;
		right: 16px;
		bottom: calc(16px + env(safe-area-inset-bottom, 0px));
		z-index: 40;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		min-height: 50px;
		padding: 0 22px 0 24px;
		background-color: var(--ws-color-rose-deep);
		border-radius: 999px;
		box-shadow: 0 10px 24px rgba(18, 33, 63, 0.24);
		color: var(--ws-color-white);
		font-size: 0.875rem;
		font-weight: 600;
		line-height: 1.4;
		letter-spacing: 0.08em;
		text-decoration: none;
		opacity: 0;
		visibility: hidden;
		transform: translateY(12px);
		transition: opacity 0.4s ease, transform 0.4s ease, visibility 0s linear 0.4s;
	}

	.ws-sticky-cta::after {
		margin-left: 10px;
		content: "\2192";
	}

	.ws-sticky-cta.is-visible {
		opacity: 1;
		visibility: visible;
		transform: none;
		transition-delay: 0s;
	}

	/* メニューを開いている間は出さない */
	.ws-menu-open .ws-sticky-cta {
		display: none;
	}

	/*
	 * フッター: メッセージとボタン → 会社名とナビ → プライバシーポリシーとコピーライト。
	 * PCの並びを縦に積むのではなく、余白を詰めて短くまとめる。
	 */
	.ws-footer {
		padding: 48px 0 calc(20px + env(safe-area-inset-bottom, 0px));
	}

	.ws-footer__top {
		gap: 10px;
		padding-bottom: 16px;
	}

	.ws-footer__lead {
		gap: 20px;
		margin-bottom: 14px;
		padding-bottom: 30px;
	}

	.ws-footer__message {
		font-size: 1.25rem;
		line-height: 1.6;
	}

	.ws-footer__message .ws-phrase {
		display: block;
	}

	.ws-footer__lead .ws-button {
		width: 100%;
		min-height: 54px;
	}

	.ws-footer__name {
		font-size: 0.9375rem;
	}

	.ws-footer__bottom {
		padding-top: 6px;
	}

	.ws-footer__copyright {
		margin-top: 0;
		font-size: 0.6875rem;
	}
}

@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
	.ws-sticky-cta {
		transform: none;
		transition: none;
	}
}
