/* ==========================================================================
   header-footer2026 — 新ヘッダー／フッター（2026 リニューアル）
   header-2026.php / footer-2026.php 用。すべて .hf- で名前空間化。
   既存 style.css の a / a:hover / a:hover img は :where() で同じ詳細度にして後勝ちで上書きする
   （.hf-xxx:hover などの部品側の指定が負けないように、土台の指定は詳細度を上げない）。
   読み込み順: design-tokens.css → このファイル。配色は --mmi-*。
     白地の金文字 … --mmi-gold-ink（純白の上だけ）
     紺地の金文字・飾りの線・金の地（文字は紺） … --mmi-gold
   ブレークポイント: 1200 / 940 / 768 / 568。無条件がデスクトップ、@media not all and (min-width: N) で狭い側。
   ========================================================================== */

:root {
	--hf-header-h: 5.5rem;
	--hf-admin-h: 0px;
}
html:has(> body.admin-bar) { --hf-admin-h: var(--wp-admin--admin-bar--height, 32px); }
html:has(.hf-header) { scroll-padding-top: calc(var(--hf-admin-h) + var(--hf-header-h) + 16px); }
html.hf-menu-open { overflow: hidden; }

.hf-header,
.hf-footer {
	/* 値は design-tokens.css と同じ。未転送でも背景が透明（＝白）にならないためのフォールバック。正本はトークン側 */
	--hf-navy: var(--mmi-navy, #092545);
	--hf-ink: var(--mmi-ink, #333333);
	--hf-gold: var(--mmi-gold, #C8AD37);
	--hf-gold-ink: var(--mmi-gold-ink, #887625);
	--hf-white: var(--mmi-white, #FFFFFF);
	--hf-ink-invert: var(--mmi-ink-invert, #FFFFFF);
	--hf-muted-invert: var(--mmi-muted-invert, #C7D2E0);
	--hf-line: rgba(9, 37, 69, 0.14);
	--hf-line-invert: var(--hf-muted-invert);
	--hf-line-invert-soft: var(--mmi-border-invert, #5B7194);
	--hf-serif: "Zen Old Mincho", "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", serif;
	--hf-sans: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;

	font-family: var(--hf-sans);
	font-size: 1rem;
	line-height: 1.7;
}
:where(.hf-header, .hf-footer) *,
:where(.hf-header, .hf-footer) *::before,
:where(.hf-header, .hf-footer) *::after { box-sizing: border-box; }
:where(.hf-header, .hf-footer) :where(h2, p, ul, li, small) { margin: 0; padding: 0; }
:where(.hf-header, .hf-footer) :where(ul) { list-style: none; }
:where(.hf-header, .hf-footer) :where(h2, p) { word-break: auto-phrase; }
:where(.hf-header, .hf-footer) :where(img) { display: block; max-width: 100%; height: auto; }
:where(.hf-header, .hf-footer) :where(small) { font-size: inherit; }
:where(.hf-header, .hf-footer) :where(button) { font: inherit; color: inherit; margin: 0; padding: 0; background: none; border: 0; cursor: pointer; }
:where(.hf-header, .hf-footer) a { color: inherit; text-decoration: none; }
:where(.hf-header, .hf-footer) a:hover { color: inherit; text-decoration: none; }
:where(.hf-header, .hf-footer) a:hover img { opacity: 1; }

.hf-icon { display: block; flex: none; width: 1em; height: 1em; }

.hf-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* フォーカス: 白地は紺、紺地は金 */
.hf-header :focus-visible,
.hf-group :focus-visible { outline: 3px solid var(--hf-navy); outline-offset: 3px; }
.hf-ftop :focus-visible,
.hf-base :focus-visible { outline: 3px solid var(--hf-gold); outline-offset: 3px; }

.hf-inner { width: min(1240px, 100% - 48px); margin-inline: auto; }

/* ==========================================================================
   ヘッダー
   ========================================================================== */
.hf-header {
	position: sticky;
	top: var(--hf-admin-h);
	z-index: 1000;
	background: var(--hf-white);
	border-bottom: 1px solid var(--hf-line);
	color: var(--hf-navy);
	transition: box-shadow .25s ease;
}
.hf-header.is-scrolled { box-shadow: 0 6px 20px rgba(9, 37, 69, 0.08); }

.hf-header__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0 16px;
	max-width: 1680px;
	min-height: var(--hf-header-h);
	margin-inline: auto;
	padding-inline: clamp(16px, 4vw, 72px);
}

.hf-logo { flex: 0 1 auto; display: block; width: 11rem; min-width: 0; }
.hf-logo img { width: 100%; }

/* お問い合わせボタン（ヘッダー内・白地） */
.hf-btn-contact {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 3.25rem;
	padding: 0 2.25rem;
	border: 2px solid var(--hf-gold);
	border-radius: 6px;
	background: var(--hf-white);
	font-family: var(--hf-serif);
	font-weight: 700;
	font-size: 1.125rem;
	letter-spacing: .06em;
	line-height: 1.2;
	color: var(--hf-gold-ink);
	white-space: nowrap;
	transition: background-color .2s ease, color .2s ease;
}
.hf-btn-contact:hover,
.hf-btn-contact[aria-current] { background: var(--hf-gold); color: var(--hf-navy); }

/* SP 用（940px 未満だけ出す） */
.hf-header__cta { display: none; }
.hf-menu-btn { display: none; }

/* グローバルナビ（PC） */
.hf-gnav { margin-left: auto; }
.hf-gnav__list { display: flex; align-items: center; gap: 0 clamp(1.5rem, 3.4vw, 3.5rem); }
.hf-gnav__link {
	display: inline-flex;
	align-items: center;
	gap: .625rem;
	padding-block: .5rem;
	font-family: var(--hf-serif);
	font-weight: 700;
	font-size: 1.1875rem;
	letter-spacing: .02em;
	line-height: 1.3;
	color: var(--hf-navy);
	white-space: nowrap;
	text-decoration: underline;
	text-decoration-color: transparent;
	text-decoration-thickness: 2px;
	text-underline-offset: .45em;
	transition: text-decoration-color .2s ease;
}
.hf-gnav__link:hover,
.hf-gnav__link[aria-current] { color: var(--hf-navy); text-decoration: underline; text-decoration-color: var(--hf-gold); text-decoration-thickness: 2px; }
.hf-gnav__icon { font-size: 1.375rem; }

.hf-gnav__item--contact { margin-left: clamp(0rem, 1vw, .75rem); }

/* SP メニュー下段（NEWS 等）は PC では出さない */
.hf-gnav__sub { display: none; }

@media not all and (min-width: 1200px) {
	.hf-logo { width: 9.5rem; }
	.hf-gnav__link { font-size: 1rem; }
	.hf-btn-contact { padding: 0 1.5rem; font-size: 1rem; min-height: 3rem; }
}

@media not all and (min-width: 940px) {
	:root { --hf-header-h: 4rem; }

	.hf-logo { width: 8.5rem; }

	.hf-header__cta { display: inline-flex; margin-left: auto; min-height: 2.5rem; padding: 0 1rem; font-size: .9375rem; border-radius: 4px; }

	/* JS が無いときはメニューをヘッダーの下に並べるだけ */
	.hf-gnav { flex-basis: 100%; margin-left: 0; padding-bottom: 12px; }
	.hf-gnav__list { flex-wrap: wrap; gap: 0 1.25rem; }
	.hf-gnav__item--contact { display: none; }

	/* JS があるときはハンバーガー＋全面パネル */
	.hf-js .hf-header__inner { flex-wrap: nowrap; }
	.hf-js .hf-menu-btn {
		display: inline-flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 4px;
		width: 3.5rem;
		height: 3rem;
		margin-right: -8px;
		color: var(--hf-navy);
	}
	.hf-menu-btn__bars { position: relative; display: block; width: 26px; height: 18px; }
	.hf-menu-btn__bars::before,
	.hf-menu-btn__bars::after,
	.hf-menu-btn__bars span {
		content: "";
		position: absolute;
		left: 0;
		width: 100%;
		height: 2px;
		border-radius: 1px;
		background: currentColor;
		transition: transform .25s ease, opacity .2s ease;
	}
	.hf-menu-btn__bars::before { top: 0; }
	.hf-menu-btn__bars span { top: 8px; }
	.hf-menu-btn__bars::after { top: 16px; }
	.hf-menu-btn__label { font-weight: 700; font-size: .75rem; line-height: 1; letter-spacing: 0; white-space: nowrap; }
	.hf-header.is-open .hf-menu-btn__bars::before { transform: translateY(8px) rotate(45deg); }
	.hf-header.is-open .hf-menu-btn__bars span { opacity: 0; }
	.hf-header.is-open .hf-menu-btn__bars::after { transform: translateY(-8px) rotate(-45deg); }

	.hf-js .hf-gnav {
		display: none;
		position: fixed;
		inset: calc(var(--hf-admin-h) + var(--hf-header-h)) 0 0 0;
		overflow-y: auto;
		overscroll-behavior: contain;
		padding: 8px clamp(16px, 4vw, 40px) 48px;
		background: var(--hf-white);
		border-top: 1px solid var(--hf-line);
	}
	.hf-js .hf-header.is-open .hf-gnav { display: block; animation: hf-fade .2s ease; }

	.hf-js .hf-gnav__list { display: block; }
	.hf-js .hf-gnav__item { border-bottom: 1px solid var(--hf-line); }
	.hf-js .hf-gnav__link {
		display: flex;
		justify-content: flex-start;
		width: 100%;
		min-height: 3.75rem;
		padding: .75rem .25rem;
		font-size: 1.125rem;
	}

	.hf-js .hf-gnav__sub { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 28px; }
	.hf-gnav__sublink {
		display: flex;
		flex-direction: column;
		gap: 2px;
		height: 100%;
		padding: 12px 16px;
		border: 1px solid var(--hf-line);
		border-radius: 6px;
		background: var(--hf-white);
		transition: border-color .2s ease;
	}
	.hf-gnav__sublink:hover,
	.hf-gnav__sublink[aria-current] { border-color: var(--hf-gold); }
	.hf-gnav__en { font-family: var(--hf-serif); font-weight: 700; font-size: 1rem; letter-spacing: .04em; line-height: 1.3; color: var(--hf-gold-ink); }
	.hf-gnav__ja { font-weight: 500; font-size: .8125rem; line-height: 1.5; letter-spacing: 0; word-break: auto-phrase; color: var(--hf-ink); }
}

@media not all and (min-width: 568px) {
	.hf-header__inner { gap: 0 10px; }
	.hf-logo { width: 7.5rem; }
	.hf-header__cta { flex: none; padding: 0 .625rem; font-size: .8125rem; letter-spacing: .02em; }
}

@keyframes hf-fade {
	from { opacity: 0; transform: translateY(-6px); }
	to { opacity: 1; transform: none; }
}

/* ==========================================================================
   フッター
   ========================================================================== */
.hf-footer { color: var(--hf-ink-invert); }

/* ---------- 上段: NEWS / COLUMN / PARTNER / RECRUIT ＋ SNS（紺地） ---------- */
.hf-ftop { padding: 3rem 0 2.5rem; background: var(--hf-navy); }

.hf-ftop__list {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	padding-bottom: 1.75rem;
	border-bottom: 1px solid var(--hf-line-invert);
}
.hf-ftop__item { padding-left: clamp(1.5rem, 5.5vw, 6rem); }
.hf-ftop__item:first-child { padding-left: .75rem; }
.hf-ftop__item + .hf-ftop__item { border-left: 1px solid var(--hf-line-invert); }

.hf-ftop__link { display: inline-flex; flex-direction: column; gap: .375rem; color: var(--hf-ink-invert); }
.hf-ftop__en { font-family: var(--hf-serif); font-weight: 700; font-size: 1.625rem; letter-spacing: .03em; line-height: 1.2; color: var(--hf-gold); }
.hf-ftop__ja { display: inline-flex; align-items: center; gap: .875rem; font-family: var(--hf-serif); font-weight: 700; font-size: 1.25rem; letter-spacing: .04em; line-height: 1.4; }
.hf-ftop__ja > span { text-decoration: underline; text-decoration-color: transparent; text-decoration-thickness: 1px; text-underline-offset: .3em; transition: text-decoration-color .2s ease; }
.hf-ftop__arrow { font-size: 1.25rem; transition: transform .2s ease; }
.hf-ftop__link:hover { color: var(--hf-ink-invert); }
.hf-ftop__link:hover .hf-ftop__ja > span,
.hf-ftop__link[aria-current] .hf-ftop__ja > span { text-decoration-color: currentColor; }
.hf-ftop__link:hover .hf-ftop__arrow { transform: translateX(4px); }

.hf-sns { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.25rem 2rem; padding: 1.5rem .75rem 0; }
.hf-sns__title { font-family: var(--hf-serif); font-weight: 700; font-size: 1.625rem; letter-spacing: .04em; line-height: 1.3; }
.hf-sns__lead { margin-top: .25rem; font-weight: 500; font-size: 1rem; letter-spacing: .04em; }

.hf-sns__list { display: flex; gap: clamp(1rem, 4.4vw, 4.5rem); padding-right: clamp(0rem, 6vw, 8rem); }
.hf-sns__link {
	display: grid;
	place-items: center;
	width: 3.5rem;
	height: 3.5rem;
	border: 2px solid var(--hf-ink-invert);
	border-radius: 50%;
	transition: border-color .2s ease, transform .2s ease;
}
.hf-sns__link img { width: 1.625rem; }
.hf-sns__link--x img { width: 1.375rem; }
.hf-sns__link--facebook img { width: 1.75rem; }
.hf-sns__link--youtube img { width: 1.75rem; }
.hf-sns__link:hover { border-color: var(--hf-gold); transform: translateY(-2px); }

/* ---------- 中段: GROUP COMPANIES（白地） ---------- */
.hf-group { padding: 3rem 0 3.25rem; background: var(--hf-white); color: var(--hf-navy); text-align: center; }
.hf-group__title { font-family: var(--hf-serif); font-weight: 700; font-size: 2rem; letter-spacing: .06em; line-height: 1.2; }
.hf-group__lead { margin-top: .375rem; font-family: var(--hf-serif); font-weight: 700; font-size: 1.25rem; letter-spacing: .12em; line-height: 1.5; }

/* ロゴの実寸幅を比にして横一列に並べ、狭いときは同じ比で縮める */
.hf-group__list {
	display: grid;
	grid-template-columns: 120fr 208fr 339fr 183fr 170fr 94fr;
	align-items: stretch;
	gap: 1.5rem clamp(1rem, 3.4vw, 3rem);
	margin-top: 2rem;
}
.hf-group__link { display: flex; flex-direction: column; align-items: center; gap: .625rem; height: 100%; }
.hf-group__logo { display: flex; flex: 1; align-items: center; justify-content: center; width: 100%; min-height: 2.75rem; transition: opacity .2s ease; }
.hf-group__logo img { width: auto; max-width: 100%; }
.hf-group__ext { font-size: 1.25rem; color: var(--hf-navy); }
.hf-group__link:hover .hf-group__logo { opacity: .7; }

/* ---------- 下段: ロゴ・メニュー・会社情報（紺地） ---------- */
.hf-base { padding: 2.25rem 0 2.5rem; background: var(--hf-navy); }
.hf-base__inner { display: flex; align-items: center; gap: 2rem clamp(2rem, 4.4vw, 4.5rem); }

.hf-base__logo { flex: none; display: block; width: 12.5rem; padding: 1.25rem 1.375rem; border-radius: 8px; background: var(--hf-white); }

.hf-base__body { flex: 1; min-width: 0; display: grid; gap: .875rem; }

.hf-base__nav { display: flex; flex-wrap: wrap; gap: .5rem clamp(1.5rem, 4.4vw, 4.5rem); font-weight: 500; font-size: 1.0625rem; letter-spacing: .04em; line-height: 1.5; }
.hf-base__nav a,
.hf-base__legal a { text-decoration: underline; text-decoration-color: transparent; text-underline-offset: .3em; transition: text-decoration-color .2s ease; }
.hf-base__nav a:hover,
.hf-base__nav a[aria-current],
.hf-base__legal a:hover { text-decoration: underline; text-decoration-color: currentColor; }

.hf-base__info { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem clamp(1.25rem, 2.8vw, 3rem); font-weight: 500; font-size: 1rem; letter-spacing: .02em; line-height: 1.6; }
.hf-base__legal {
	display: flex;
	flex-wrap: wrap;
	gap: .25rem 2rem;
	margin-top: .25rem;
	padding-top: .875rem;
	border-top: 1px solid var(--hf-line-invert-soft);
	font-size: .8125rem;
	line-height: 1.6;
	color: var(--hf-muted-invert);
}
.hf-base__legal a { color: var(--hf-ink-invert); }
.hf-base__legal a:hover { color: var(--hf-ink-invert); }
.hf-base__copy { margin-left: auto; font-size: .875rem; letter-spacing: .01em; color: var(--hf-ink-invert); }

/* ---------- フッター: 狭い側 ---------- */
@media not all and (min-width: 1200px) {
	.hf-ftop__en { font-size: 1.375rem; }
	.hf-ftop__ja { font-size: 1.0625rem; gap: .625rem; }
}

@media not all and (min-width: 940px) {
	.hf-ftop__list { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-bottom: 0; }
	.hf-ftop__item,
	.hf-ftop__item:first-child { padding: 1.25rem .75rem; }
	.hf-ftop__item + .hf-ftop__item { border-left: 0; }
	.hf-ftop__item:nth-child(even) { border-left: 1px solid var(--hf-line-invert); padding-left: 1.5rem; }
	.hf-ftop__item:nth-child(n+3) { border-top: 1px solid var(--hf-line-invert); }
	.hf-ftop { padding-top: 1.75rem; }

	.hf-sns__list { padding-right: 0; }

	.hf-group__list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem 2.5rem; }
	.hf-group__logo img { max-height: 2.625rem; }

	.hf-base__inner { flex-direction: column; align-items: flex-start; }
	.hf-base__body { flex: none; width: 100%; }
	.hf-base__copy { flex-basis: 100%; margin: .5rem 0 0; }
}

@media not all and (min-width: 768px) {
	.hf-sns { flex-direction: column; align-items: flex-start; }
	.hf-sns__list { gap: 1.25rem; }

	.hf-group__title { font-size: 1.625rem; }
	.hf-group__lead { font-size: 1.0625rem; letter-spacing: .08em; }

	.hf-base__nav { gap: .5rem 1.75rem; font-size: 1rem; }
	.hf-base__info { flex-direction: column; align-items: flex-start; gap: .125rem; font-size: .9375rem; }
}

@media not all and (min-width: 568px) {
	.hf-ftop__list { grid-template-columns: minmax(0, 1fr); }
	.hf-ftop__item:nth-child(even) { border-left: 0; padding-left: .75rem; }
	.hf-ftop__item:nth-child(n+2) { border-top: 1px solid var(--hf-line-invert); }
	.hf-ftop__item,
	.hf-ftop__item:first-child { padding-block: 1rem; }
	.hf-ftop__link { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 0 1rem; width: 100%; }
	.hf-ftop__en { font-size: 1.25rem; min-width: 6.5rem; }
	.hf-ftop__ja { justify-content: space-between; font-size: 1rem; }

	.hf-sns__title { font-size: 1.375rem; }
	.hf-sns__lead { font-size: .9375rem; }
	.hf-sns__link { width: 3.25rem; height: 3.25rem; }

	.hf-group { padding: 2.5rem 0 2.75rem; }
	.hf-group__list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.75rem 1.5rem; }
	.hf-group__logo img { max-height: 2.25rem; }

	.hf-base__logo { width: 10.5rem; padding: 1rem 1.125rem; }
}

/* ---------- 動きを減らす設定 ---------- */
@media (prefers-reduced-motion: reduce) {
	.hf-header,
	.hf-header *,
	.hf-header *::before,
	.hf-header *::after,
	.hf-footer * { transition: none !important; animation: none !important; }
	.hf-ftop__link:hover .hf-ftop__arrow,
	.hf-sns__link:hover { transform: none; }
}
