/*
Theme Name: 人財ラボ 2026
Theme URI: https://example.com/
Description: 人財ラボ コーポレートサイト用オリジナルテーマ(Claude Designから変換)
Author: HIROCODE
Version: 1.1.2
Requires PHP: 7.4
Text Domain: jinzai-lab_2026
*/

/* ページ固有のCSSは css/pages/*.css を functions.php で条件読み込み */

/* ===== サイト共通スタイル ===== */

/* ページ内アンカーのスムーススクロール */
html {
	scroll-behavior: smooth;
	/* 読み込んでいない太さを、ブラウザが太字に加工して作らない（Zen Kaku Gothic New の 700 は 500 で表示する） */
	font-synthesis: none;
	/* ページの地色。theme-color を使わないブラウザ（新しい iOS Safari など）は、上部の色をこの背景から決める */
	background: #f5f5f5;
}
@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
}

/* ヘッダーのお問い合わせボタン: hover時にメールアイコンを動かさない */
.hd .hd-cta:hover > svg:last-child {
	transform: none;
}

/* グローバルナビのドロップダウン (企業情報/事業内容) */
.gnav-item {
	position: relative;
	display: flex;
}
.gnav-dd {
	position: absolute;
	top: calc(100% + 10px);
	left: 50%;
	transform: translateX(-50%) translateY(6px);
	display: flex;
	flex-direction: column;
	gap: 1px;
	min-width: max-content;
	padding: 8px 8px;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 12px 32px rgba(0, 0, 0, .14);
	opacity: 0;
	visibility: hidden;
	transition: opacity .2s, transform .2s, visibility .2s;
	z-index: 20;
}
/* アイテムとボックスの隙間でhoverが切れないようにする橋 */
.gnav-dd::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: -12px;
	height: 12px;
}
.gnav-item:hover > .gnav-dd,
.gnav-item:focus-within > .gnav-dd {
	opacity: 1;
	visibility: visible;
	transform: translateX(-50%) translateY(0);
}
.gnav-dd a {
	display: flex;
	align-items: center;
	padding: 7px 18px 7px 12px;
	border-radius: 7px;
	font-size: 12px;
	letter-spacing: .1em;
	color: #333;
}
.gnav-dd a:hover {
	background: #eef4ec;
}
.gnav-dd a.gnav-dd-sub {
	padding-left: 26px;
	font-size: 11px;
	color: #555;
}

/* 人材紹介CTAの濃緑ボタン: hoverでも白文字を維持し、軽く浮かせる */
#contact a.rc-cta-btn:hover {
	color: #fff !important;
	filter: brightness(1.12);
	transform: translateY(-2px);
}

/* 法人企業様向けFV: 画像列をコンテナ内に収める (モバイルは左右20px) */
@media (max-width: 760px) {
	.rcfv-grid {
		padding-right: 20px !important;
	}
	.rcfv-cap {
		padding-right: 0 !important;
	}
}

/* 人材紹介FV: 中間幅(761-1180px)でも2カラムを維持し、画像の段落ちを防ぐ */
@media (min-width: 761px) and (max-width: 1180px) {
	.rcfv .rcfv-grid {
		grid-template-columns: minmax(0, 46fr) minmax(0, 54fr) !important;
		row-gap: 0 !important;
		min-height: 0 !important;
	}
	.rcfv .rcfv-media {
		max-width: none !important;
		justify-self: stretch !important;
		padding-right: 0 !important;
	}
	.rcfv .rcfv-head {
		white-space: normal !important;
		font-size: clamp(20px, 3vw, 32px) !important;
	}
}

/* 人材紹介の相談ボタン: スマホではコンパクトに (FV / 下部CTA共通) */
@media (max-width: 760px) {
	.rcfv .rcfv-cta {
		width: 100%;
		height: 60px !important;
		padding: 0 28px !important;
		gap: 16px !important;
		font-size: 14px !important;
	}
	#contact a.rc-cta-btn {
		width: 100%;
		height: 56px;
		padding: 0 28px;
		font-size: 14px;
	}
	/* 帯内の相互リンク(法人/転職者向け)はスマホでは非表示 */
	.rc-band a {
		display: none !important;
	}
	/* パンくずをコンパクトに (全ページ共通) */
	nav[aria-label="パンくずリスト"] {
		gap: 4px 8px !important;
		font-size: 10px !important;
	}
	.rc-bc {
		padding-top: 12px !important;
		padding-bottom: 12px !important;
	}
}

/* SPメニュー: 項目間の罫線をなくす */
.spm-l1,
.spm-acc,
.spm-acc > .spm-l1,
.spm-grid a {
	border-bottom: 0 !important;
}
.spm-grid a:nth-child(odd)::after {
	content: none !important;
}

/* ナビのシェブロン(企業情報/事業内容の▼): hoverで右ではなく下に動かす */
.gnav .gnav-item > a:hover > svg:last-child {
	transform: translateY(3px);
}

/* 対象者別カードの白ボタン: hoverで薄緑に */
#entry .entry-card a.entry-btn-white:hover {
	color: #1f2e22 !important;
	background: #eef4ec !important;
}

/* 人材紹介ハブ: 事業部長の写真は縦並び(〜760px)で小さく */
@media (max-width: 760px) {
	.msg > div:first-child {
		width: 200px !important;
	}
}

/* 事業ページFV: モバイルの見出しサイズを引き上げ (参考: 2026-11-11指示) */
@media (max-width: 760px) {
	.fv-row {
		position: relative;
	}
	.fv-row h1 {
		font-size: clamp(30px, 8.2vw, 42px) !important;
		line-height: 1.35 !important;
	}
	/* アイコンはフローから外して右上に (h1の幅を奪わない) */
	.fv-row .fv-icon {
		position: absolute;
		right: 0;
		top: 0;
		width: 56px !important;
		height: 56px !important;
		margin: 0 !important;
	}
	.fv-lead > p:first-child {
		font-size: clamp(19px, 4.8vw, 24px) !important;
		line-height: 1.55 !important;
	}
	/* リード右側の緑見出し(長文)はモバイルでは控えめに */
	.fv-lead h2 {
		font-size: clamp(16px, 3.8vw, 19px) !important;
		line-height: 1.75 !important;
	}
	.anchor a {
		font-size: 15px !important;
	}
	.fv-row {
		padding-top: 28px !important;
	}
	/* パンくず周りの余白を詰める */
	div[style*="padding: 22px 48px"] {
		padding-top: 8px !important;
		padding-bottom: 8px !important;
	}
	section[style*="padding: 32px 48px 0"] {
		padding-top: 8px !important;
	}
	.fv-lead {
		padding-top: 36px !important;
		min-height: 0 !important;
		row-gap: 22px !important;
	}
	.anchor {
		margin-top: 40px !important;
	}
	/* ステップ表示(01,02…)はモバイル最小幅でも2列を維持 */
	ol.fl4, ol.fl5 {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
		grid-template-rows: none !important;
		row-gap: 48px !important;
		column-gap: 24px !important;
	}
	/* 各ステップはデスクトップと同じ縦積み(番号+矢印/アイコン/見出し/本文) */
	ol.fl4 .fl-item, ol.fl5 .fl-item {
		display: block !important;
		grid-row: auto !important;
		padding-right: 0 !important;
	}
	ol.fl4 .fl-item .fl-conn, ol.fl5 .fl-item .fl-conn {
		display: flex !important;
		visibility: visible !important;
	}
	ol.fl4 .fl-item > div:nth-child(2), ol.fl5 .fl-item > div:nth-child(2) {
		margin-top: 18px !important;
	}
	ol.fl4 .fl-item > div:first-child > span:first-child,
	ol.fl5 .fl-item > div:first-child > span:first-child {
		font-size: 36px !important;
	}
	ol.fl4 .fl-item > div:nth-child(2) svg,
	ol.fl5 .fl-item > div:nth-child(2) svg {
		width: 42px !important;
		height: 42px !important;
	}
	ol.fl4 .fl-item h3, ol.fl5 .fl-item h3 {
		margin-top: 12px !important;
		font-size: 17px !important;
	}
	ol.fl4 .fl-item h3 br, ol.fl5 .fl-item h3 br {
		display: none !important;
	}
	ol.fl4 .fl-item p, ol.fl5 .fl-item p {
		margin-top: 8px !important;
		font-size: 13px !important;
	}
	/* セクションの上下余白をモバイル用に縮小 (デスクトップは140-150px) */
	section[style*="padding: 140px"],
	section[style*="padding: 150px"],
	section[style*="padding: 120px 48px"] {
		padding-top: 72px !important;
	}
	section[style*="padding: 150px 48px 140px"] {
		padding-bottom: 72px !important;
	}
}

/* フッター人材紹介カードの直後の©バー: ページCSSのclamp(110px)を詰める */
footer > aside#ft-rc-note + div {
	margin-top: 36px !important;
}

/* トレンド記事内CTAボタン: hoverで緑に (文字は白のまま) */
.nd-card .nd-body a.trend-cta:hover {
	background: #1f9c10 !important;
	color: #fff !important;
}

/* =====================================================================
   FV 背景写真（トップ・事業ページ・法人企業様向け）
   セクションの先頭に <div class="fv-bg"><img></div> を置くと、画面幅いっぱいに
   写真を敷き、上に白い幕をかける（写真は控えめに見せる）。トリミング位置は
   --fv-pos でページごとに変える。写真は最初から幕がかかった状態で表示する（アニメーションなし）。
   写真の左上と右下の角に、fv-icon の形（曲線の三角形）を三角格子に並べた白い模様を重ねる（角ほど密、内側ほどまばら）。
   模様は footer.php の JS が .fv-bg の大きさに合わせて SVG（.fv-shapes）で作る。表示時に緑から白へ変わり、そのあと光沢のように透過度が揺らぐ（JS が動かないときは模様なし）
   ===================================================================== */
body { overflow-x: clip; }
/* 写真の高さは画面の高さ（100dvh）。固定はせず、ページと一緒にスクロールする */
:root { --hd-h: 100px; } /* ヘッダーの高さ（写真をページ上端から敷くため） */
@media (max-width: 760px) { :root { --hd-h: 64px; } .home { --hd-h: 68px; } }
body > div:has(.fv-bg) { isolation: isolate; } /* 写真を #f5f5f5 の地の上・本文の下に置く（FV の外にはみ出しても本文の下） */
.fv-bg {
	position: absolute;
	z-index: -1;
	top: var(--fv-top, calc(-1 * var(--hd-h))); /* ヘッダーの裏（ページ上端）から */
	height: 100vh;
	height: 100dvh; /* ちょうど 1 画面分 */
	left: calc(50% - 50vw);
	width: 100vw;
	overflow: clip;
	pointer-events: none;
	/* 写真と幕がくっきり切れないよう、上から 720px までで徐々に消して背景になじませる（--fv-fade でページごとに変えられる） */
	-webkit-mask-image: var(--fv-fade, linear-gradient(rgb(0, 0, 0) 0%, transparent 720px));
	mask-image: var(--fv-fade, linear-gradient(rgb(0, 0, 0) 0%, transparent 720px));
}
/* 模様ができるまで写真を出さない（JS が動かなくても 4 秒で表示。ta-wait は functions.php の head 出力） */
html.ta-wait .fv-bg { visibility: hidden; }
.fv-bg img,
.fv-bg::after {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
}
.fv-bg img {
	display: block;
	max-height: var(--fv-img-h, 740px); /* ページごとに --fv-img-h で変えられる */
	object-fit: cover;
	object-position: var(--fv-pos, 50% 50%);
}
.fv-bg::after {
	content: "";
	background: rgba(255,255,255,.8);
}
/* 幕の上に白い三角形の模様（<svg class="fv-shapes"> は footer.php の JS が入れる）。
   ページごとに幕（::after）を変えても模様は変わらないよう、別の層にする */
.fv-shapes {
	position: absolute;
	z-index: 1;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
}
/* スマホは文字と重なるので、模様全体を薄くする */
@media (max-width: 760px) {
	.fv-shapes { opacity: .45; }
}
/* 表示（.is-tint）: 薄い緑（#1f9c10 を明るくした #bfe3b8）から #fff に変わりながら現れる */
@keyframes fv-shape-in {
	from { opacity: 0; fill: #bfe3b8; }
	45%  { opacity: 1; fill: #bfe3b8; }
	to   { opacity: 1; fill: #fff; }
}
/* 表示（変色しない三角形）: 白のまま現れる */
@keyframes fv-shape-fade {
	from { opacity: 0; }
	to   { opacity: 1; }
}
/* 光沢: 透過度がゆっくり変わる（三角形ごとに周期と開始がばらばら） */
@keyframes fv-shape-glint {
	from { opacity: 1; }
	to   { opacity: .35; }
}
.fv-shapes use {
	fill: #fff;
	animation:
		fv-shape-fade .6s ease-out var(--d, 0s) both,
		fv-shape-glint var(--t, 3s) ease-in-out var(--g, 2s) infinite alternate;
}
/* 3 割ほどの三角形（footer.php の JS がランダムに .is-tint を付ける）は、薄い緑から白に変わる */
.fv-shapes use.is-tint {
	animation:
		fv-shape-in 1.4s cubic-bezier(.45,0,.55,1) var(--d, 0s) both,
		fv-shape-glint var(--t, 3s) ease-in-out var(--g, 2s) infinite alternate;
}
.fv-bg.is-shown .fv-shapes use,
.fv-bg.is-shown .fv-shapes use.is-tint {
	animation: fv-shape-glint var(--t, 3s) ease-in-out calc(var(--g, 2s) - var(--d, 0s) - 1.2s) infinite alternate;
}
@media (prefers-reduced-motion: reduce) {
	.fv-shapes use { animation: none !important; }
}
@media (max-width: 760px) {
	/* スマホは写真を高さ合わせで表示するので、見せたい部分が下にある写真は --fv-shift-sp で上にずらす */
	.fv-bg img {
		max-height: var(--fv-img-h-sp, 480px); /* スマホの写真の高さ。PC の --fv-img-h（人材紹介事業は 580px）は使わない */
		top: var(--fv-shift-sp, 0);
		/* ずらした写真の下端がくっきり切れないよう、写真自体の下もぼかす */
		-webkit-mask-image: linear-gradient(180deg, #000 75%, transparent 100%);
		mask-image: linear-gradient(180deg, #000 75%, transparent 100%);
	}
}
/* 事業詳細ページ（.fv-bg--fade-x）: 写真の左右をグラデーションで透過する */
.fv-bg--fade-x img {
	-webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 20%, #000 80%, transparent 100%);
	mask-image: linear-gradient(90deg, transparent 0%, #000 20%, #000 80%, transparent 100%);
}
@media (max-width: 760px) {
	/* スマホは下端のぼかしと重ねる（両方で残る部分だけ見せる） */
	.fv-bg--fade-x img {
		-webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 20%, #000 80%, transparent 100%), linear-gradient(180deg, #000 75%, transparent 100%);
		mask-image: linear-gradient(90deg, transparent 0%, #000 20%, #000 80%, transparent 100%), linear-gradient(180deg, #000 75%, transparent 100%);
		-webkit-mask-composite: source-in;
		mask-composite: intersect;
	}
}
/* =====================================================================
   FV テキストのアニメーション（footer.php の JS が文字・行を分けてクラスを付ける）
   ページを開いてすぐ（約 0.3s）から、上から順に出す
   ・英字の小見出し／ラベル : 緑の帯が走り抜けたあとに文字が残る（.ta-B）
   ・大見出し               : 一文字ずつ下からせり上がる（.ta-A）
   ・キャッチ／リード       : 行ごとに下からせり上がる（.ta-E）
   --d: 要素ごとの開始時間、--i: 文字・行の番号
   ===================================================================== */
/* JS が準備するまで対象の文字を隠す（JS が動かなくても 4 秒で表示。functions.php の head 出力） */
html.ta-wait .has-fv-bg :is(.fv-row p, .fv-row h1, .fv-h1, .rcfv-text > div > p, .rcfv-head, .fv-lead > p:first-child, p.fv-lead, .rcfv-lead) { opacity: 0; }

.ta-ln { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .1em; margin-bottom: -.1em; }
@keyframes ta-rise { from { transform: translateY(110%); } to { transform: none; } }
.ta-A .ta-ch { display: inline-block; animation: ta-rise .8s cubic-bezier(.22,1,.36,1) calc(var(--d) + var(--i) * 40ms) both; }
.ta-E .ta-in { display: inline-block; animation: ta-rise 1s cubic-bezier(.22,1,.36,1) calc(var(--d) + var(--i) * 140ms) both; }

.ta-B .ta-bar { position: relative; display: inline-block; }
.ta-B .ta-bar::after {
	content: "";
	position: absolute;
	inset: 0 -.15em;
	background: #1f9c10;
	transform: scaleX(0);
	animation: ta-bar .9s cubic-bezier(.77,0,.18,1) var(--d) both;
}
@keyframes ta-bar {
	0%     { transform: scaleX(0); transform-origin: 0 50%; }
	50%    { transform: scaleX(1); transform-origin: 0 50%; }
	50.01% { transform: scaleX(1); transform-origin: 100% 50%; }
	100%   { transform: scaleX(0); transform-origin: 100% 50%; }
}
@keyframes ta-show { from { opacity: 0; } to { opacity: 1; } }
.ta-B .ta-bt { animation: ta-show .01s linear calc(var(--d) + .45s) both; }

/* =====================================================================
   事業ページFV（コンサル・研修・ラーニング・人材紹介 共通）
   英字ラベル｜事業名 を1行に並べ、その下にキャッチを大きく出す
   ・キャッチの文字サイズは元の大見出しと同じ（最大約52px）。長いキャッチは
     左ブロックの幅に収まるよう自動で縮む（--catch-em = 最長行の文字数×1.06+0.2）
   ・縦線は2つが横並びのときだけ見える（折り返すと左端の外に出て clip される）
   ===================================================================== */
.fv-main { container-type: inline-size; }
.fv-label { clip-path: inset(-50px -50px -50px -4px); }
.fv-name { position: relative; }
.fv-name::before {
	content: "";
	position: absolute;
	left: -17px;
	top: 50%;
	width: 1px;
	height: 14px;
	background: #b5c4bf;
	transform: translateY(-50%);
}
/* 縦線は事業名の文字と同じタイミングで出す（footer.php の .ta-A / --d） */
.fv-name.ta-A::before { animation: ta-show .4s ease var(--d) both; }
.fv-catch {
	font-size: min(clamp(28px, calc(2.284vw + 19.09px), 51.98px), calc(100cqi / var(--catch-em, 9.8)));
}
@media (max-width: 760px) {
	.fv-row h1.fv-name {
		font-size: 16px !important;
		line-height: 1.5 !important;
		letter-spacing: .08em !important;
	}
	.fv-label > p {
		padding-right: 72px;
		font-size: 17px !important;
	}
	.fv-row .fv-catch {
		margin-top: 24px !important;
		font-size: min(clamp(30px, 8.2vw, 42px), calc(100cqi / var(--catch-em, 9.8))) !important;
	}
	.fv-lead {
		padding-top: 72px !important;
	}
}
@media (max-width: 480px) {
	.fv-label > p { padding-right: 56px; }
}

/* =====================================================================
   ページ内リンク（nav.anchor）スマホ
   文字が折り返す前に項目ごと次の行へ送る（項目の中では改行しない）。1 行に 2 つまで 50% ずつ、入らない項目は 1 行で全幅。
   区切り線は、項目のすき間（1px）から nav の背景色を見せて引く（行数が変わっても線が揃う）
   ページ別 CSS（css/pages/*.css）の .anchor より優先させるため、セレクタを強くして !important にしている
   ===================================================================== */
@media (max-width: 760px) {
	html body nav.anchor {
		display: flex !important;
		flex-wrap: wrap;
		gap: 1px;
		background: #d6e4d3;
	}
	html body nav.anchor > a {
		/* 1 行に 2 つまで、きっちり 50% ずつ（区切り線を中央に揃える）。50% に収まらない項目は 1 行に 1 つで全幅 */
		flex: 1 0 calc(50% - .5px);
		min-width: max-content;
		box-sizing: border-box;
		justify-content: center !important;
		gap: 8px !important;
		height: 50px !important;
		padding: 0 14px;
		border: 0 !important;
		background: #f5f5f5;
		white-space: nowrap;
		font-size: 13px !important;
		letter-spacing: .04em !important;
	}
	html body nav.anchor > a:hover { background: #eaf1e8; }
	html body nav.anchor > a svg { flex: none; }
}

/* TOP お知らせ欄（#news）: 1 件だけのときは下線と下の余白をなくす（「お知らせ一覧」も出ないため、下だけ広く見える） */
html body #news .nw-items > a:only-child {
	padding-bottom: 0 !important;
	border-bottom: 0 !important;
}
html body #news .nw-items:has(> a:only-child) {
	margin-bottom: 0 !important;
}
@media (max-width: 760px) {
	/* スマホは枠の上の余白が小さいので、上下が同じ（16px）になるようにする */
	html body #news .nw-items > a:only-child { padding-top: 10px !important; }
}

/* 会社概要 03 ミッション・ビジョン・バリュー（スマホ）
   セクションの区切り線と同じ線で 3 つを区切ると情報の境目が分かりにくいので、線をやめてカードにする
   （ミッション＝緑のカード、ビジョン・バリュー＝白のカード。カードの間はすき間で区切る） */
@media (max-width: 760px) {
	html body .mvv .mv-row + .mv-row {
		margin-top: 16px !important;
		border-top: 0 !important;
		border-radius: 6px;
		background: #fff;
	}
}

/* スマホメニュー: お問い合わせボタンは文字の幅にして中央に置く。下のリンクが 1 件だけのときは 1 列にする */
@media (max-width: 760px) {
	html body .spm-cta {
		max-width: fit-content;
		margin-inline: auto;
	}
	html body .spm-grid:has(> a:only-child) {
		grid-template-columns: repeat(1, minmax(0, 1fr));
	}
	html body .spm-grid > a:only-child { padding-right: 6px; }
	html body .spm-grid > a:only-child::after { display: none; } /* 2 列のときの縦の区切り線 */
}

/* スマホだけで改行する <br class="sp-br">（ページ別 CSS の「br を消す」指定より優先） */
.sp-br { display: none !important; }
@media (max-width: 760px) { .sp-br { display: inline !important; } }
