/*
 * コーポレートサイトのヘッダー・フッターに合わせた共通UI。
 * サービスサイト側の本文・ナレッジ用デザイントークンは維持する。
 */
:root {
	--mw-header-height: 72px;
	--mw-header-gutter: 32px;
	--mw-motion: 160ms ease;
}
body { padding-top: var(--mw-header-height); }
.mw-icon {
	display: block;
	width: var(--wp-icon-size-action);
	height: var(--wp-icon-size-action);
	flex: 0 0 var(--wp-icon-size-action);
	fill: none;
	stroke: currentColor;
	stroke-width: 1.5;
}
.mw-external-link-icon {
	display: inline-block;
	width: var(--wp-icon-size-indicator);
	height: var(--wp-icon-size-indicator);
	margin-left: .35em;
	flex: 0 0 var(--wp-icon-size-indicator);
	fill: currentColor;
	vertical-align: -.06em;
}
.mw-header {
	position: fixed;
	z-index: 100;
	inset: 0 0 auto;
	background: #fff;
	color: #161616;
}
.admin-bar .mw-header { top: 32px; }
.mw-header__inner {
	display: flex;
	align-items: center;
	min-height: var(--mw-header-height);
	max-width: 1600px;
	margin-inline: auto;
	padding-left: var(--mw-header-gutter);
}
.mw-header__brand {
	display: flex;
	align-items: center;
	margin-right: auto;
}
.mw-header__logo {
	display: inline-flex;
	align-items: center;
	flex: 0 0 auto;
	gap: 6px;
}
.mw-header__logo img {
	display: block;
	width: 176px;
	height: auto;
	flex: 0 0 auto;
}
/* IBM Plexの文字組み・Carbon Blueで統一する共通サービスラベル。 */
.mw-service-label {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	min-height: 32px;
	padding: 6px 14px;
	border-radius: 0;
	background: #0f62fe;
	color: #fff;
	font-size: .8125rem;
	font-weight: 500;
	line-height: 1.25;
	letter-spacing: 0;
	white-space: nowrap;
}
.mw-header__nav {
	display: flex;
	align-items: stretch;
	align-self: stretch;
	margin-left: 24px;
}
.mw-header__nav > a {
	display: flex;
	align-items: center;
	padding-inline: 13px;
	font-size: .8125rem;
	font-weight: 400;
	line-height: 1.5;
	text-decoration: none;
	white-space: nowrap;
}
/* スマホ用お問い合わせはデスクトップの汎用リンク指定より高い詳細度で非表示にする。 */
.mw-header__nav > a > .mw-icon,
.mw-header__nav > a.mw-header__mobile-contact { display: none; }
.mw-header__nav > a:hover,
.mw-header__nav > a[aria-current] {
	background: #f4f4f4;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 8px;
}
.mw-header__contact {
	display: flex;
	align-items: center;
	justify-content: space-between;
	align-self: stretch;
	gap: 32px;
	min-width: 158px;
	padding: 16px 24px;
	background: #0f62fe;
	color: #fff;
	font-size: .875rem;
	line-height: 1.5;
	text-decoration: none;
	white-space: nowrap;
	transition: background var(--mw-motion);
}
.mw-header__contact:hover { background: #0043ce; }
.mw-header__contact:focus-visible { outline-color: #fff; outline-offset: -6px; }
.mw-header__toggle {
	display: none;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	width: 54px;
	height: 48px;
	padding: 5px;
	border: 0;
	background: #fff;
	font: inherit;
	cursor: pointer;
}
.mw-header__toggle > span {
	display: block;
	width: 22px;
	height: 2px;
	margin: 2px auto;
	background: #161616;
	transition: transform var(--mw-motion), opacity var(--mw-motion);
}
.mw-header__toggle[aria-expanded="true"] > span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.mw-header__toggle[aria-expanded="true"] > span:nth-child(2) { opacity: 0; }
.mw-header__toggle[aria-expanded="true"] > span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.mw-header [hidden] { display: none !important; }

/* フッター：ロゴ＋専門サイト導線、最下部に法人・プライバシーの外部リンク。 */
.mw-footer {
	background: #161616;
	color: #c6c6c6;
	padding: 48px 0 24px;
	font-size: .875rem;
	line-height: 1.9;
}
.mw-footer__main {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 48px;
}
.mw-footer__brand { min-width: 0; }
.mw-footer__logo { display: inline-flex; align-items: center; }
.mw-footer__logo img { display: block; width: 176px; height: auto; }
.mw-footer__service-name {
	margin: 12px 0;
	font-size: .875rem;
	font-weight: 500;
	letter-spacing: .02em;
	color: #fff;
}
.mw-footer__brand > p:last-child { margin: 0; }
.mw-footer__nav {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: clamp(24px, 3vw, 48px);
	align-content: start;
}
.mw-footer__nav-group { min-width: 0; }
.mw-footer__nav-title {
	margin: 0 0 16px;
	padding-bottom: 12px;
	border-bottom: 1px solid #525252;
	color: #fff;
	font-size: .875rem;
	font-weight: 500;
	line-height: 1.5;
}
.mw-footer__nav-links {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 10px;
}
.mw-footer__nav-links > a {
	max-width: 100%;
	line-height: 1.65;
}
.mw-footer a { color: inherit; text-decoration: none; }
.mw-footer a:hover {
	color: #fff;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 4px;
}
.mw-footer a:focus-visible { outline-color: #fff; }
.mw-footer__bottom {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	margin-top: 48px;
	padding-top: 16px;
	border-top: 1px solid #525252;
	font-size: .75rem;
	line-height: 1.5;
}
.mw-footer__bottom small { font-size: inherit; }
.mw-footer__bottom nav { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; }
.mw-footer__bottom nav a { display: inline-flex; align-items: center; min-height: 44px; }
.mw-footer__bottom .mw-external-link-icon { align-self: center; }

/* ナビゲーションの幅を確保するため、狭めのPCはロゴを縮小する。 */
@media (min-width: 1280px) and (max-width: 1439px) {
	.mw-header__logo img { width: 152px; }
	.mw-header__nav > a { padding-inline: 10px; }
}

/* 中間幅ではロゴとリンクを上下に分け、長いリンク名の折り返しを防ぐ。 */
@media (max-width: 980px) {
	.mw-footer__main { grid-template-columns: minmax(0, 1fr); gap: 36px; }
}

@media (max-width: 1279px) {
	:root { --mw-header-gutter: 24px; }
	.mw-header__inner { flex-wrap: wrap; }
	.mw-header__logo img { width: 152px; }
	.mw-header__toggle:not([hidden]) { display: flex; order: 2; margin-left: 12px; }
	.mw-header__nav {
		order: 5;
		flex-basis: 100%;
		flex-direction: column;
		margin: 0;
		padding: 16px 24px;
		background: #fff;
		border-top: 1px solid #e0e0e0;
	}
	.mw-header__nav > a { min-height: 56px; padding-inline: 12px; }
	.mw-header.is-enhanced .mw-header__nav {
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		max-height: calc(100dvh - var(--mw-header-height) - 48px);
		overflow-y: auto;
		border-bottom: 1px solid #e0e0e0;
	}
	.mw-header__contact { order: 1; min-width: 0; padding-inline: 16px; gap: 16px; }
}
@media (max-width: 782px) {
	.admin-bar .mw-header { top: 46px; }
}
@media (max-width: 600px) {
	.admin-bar .mw-header { position: absolute; }
}
@media (max-width: 671px) {
	:root { --mw-header-gutter: 16px; --mw-header-height: 64px; }
	body.mw-menu-open { overflow: hidden; }
	/* 64pxヘッダー内にロゴ・ラベル・メニューボタンを並べる。 */
	.mw-header__brand { min-width: 0; }
	.mw-header__logo { gap: 4px; }
	.mw-header__logo img { width: 136px; }
	.mw-service-label { min-height: 28px; padding: 5px 9px; font-size: .6875rem; }
	.mw-header__contact { display: none; }
	.mw-header__toggle:not([hidden]) { order: 3; margin: 0 12px 0 auto; padding: 5px; }
	.mw-header__toggle::after {
		margin-top: 5px;
		content: "メニュー";
		font-size: .4375rem;
		font-weight: 600;
		line-height: 1;
		white-space: nowrap;
	}
	.mw-header__toggle[aria-expanded="true"]::after { content: "閉じる"; }
	.mw-header.is-enhanced .mw-header__nav {
		position: fixed;
		top: var(--mw-header-height);
		left: 0;
		right: 0;
		bottom: 0;
		display: flex;
		max-height: none;
		padding: 16px var(--mw-header-gutter) 48px;
		border-bottom: 0;
		overflow-y: auto;
		opacity: 0;
		visibility: hidden;
		pointer-events: none;
		transform: translateY(-12px);
		transition: opacity 240ms ease, transform 240ms ease, visibility 0s linear 240ms;
	}
	.mw-header.is-enhanced .mw-header__nav.is-open {
		opacity: 1;
		visibility: visible;
		pointer-events: auto;
		transform: translateY(0);
		transition: opacity 240ms ease, transform 240ms ease, visibility 0s;
	}
	.admin-bar .mw-header.is-enhanced .mw-header__nav { top: calc(var(--mw-header-height) + 46px); }
	.mw-header__nav > a {
		min-height: 64px;
		padding-inline: 0;
		border-bottom: 1px solid #e0e0e0;
		font-size: var(--font-size-body);
		white-space: normal;
	}
	.mw-header__nav > a > .mw-icon { display: block; flex-shrink: 0; margin-left: auto; }
	.mw-header__nav > a:hover, .mw-header__nav > a[aria-current] { background: transparent; text-underline-offset: 5px; }
	.mw-header__nav > a.mw-header__mobile-contact { display: flex; }
	.mw-footer { padding-block: 32px 20px; }
	.mw-footer__main { grid-template-columns: minmax(0, 1fr); gap: 32px; }
	.mw-footer__brand { text-align: center; }
	.mw-footer__logo { justify-content: center; width: 100%; }
	.mw-footer__nav { grid-template-columns: minmax(0, 1fr); gap: 28px; }
	.mw-footer__bottom {
		flex-direction: column-reverse;
		align-items: stretch;
		gap: 12px;
		margin-top: 32px;
		padding-top: 16px;
	}
	.mw-footer__bottom nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
	.mw-footer__bottom nav a { font-size: .6875rem; min-height: 36px; }
	.mw-footer__bottom small { text-align: center; font-size: .625rem; }
}
@media (max-width: 360px) {
	.mw-header__logo { gap: 2px; }
	.mw-header__logo img { width: 116px; }
	.mw-service-label { min-height: 26px; padding: 4px 7px; font-size: .625rem; }
	.mw-header__toggle:not([hidden]) { margin: 0 8px 0 auto; }
}
@media (prefers-reduced-motion: reduce) {
	.mw-header__toggle > span,
	.mw-header__contact,
	.mw-header.is-enhanced .mw-header__nav {
		transition: none;
	}
}
