/*
 * インタビュー記事(single-interview.php)
 * デザイン: Figma「インタビュー記事｜PC」の修正版(幅1440 / コンテンツ幅1200 / 本文幅800)。プロフィール欄は node 68:1896。
 * SP(769px以下)は修正前の「インタビュー記事｜SP」の余白・文字の大きさをもとにしている(修正版のSP版デザインは未受領)。
 * 770〜1099px はデザインが無いため、他の社員インタビューのカードを2列にする仮の組み方。
 * 最後の Join Our Team は共通部品(template-parts/components/join-team.php / components.css)。
 *
 * デザインが平板に見えるため、デザインに無い次の装飾を足している(docs/01-decisions.md 2026-11-20):
 * 英字「INTERVIEW」と菱形の飾り / プロフィールの影 / 本文H2の番号と下線 / 質問(H3)の縦線 / 太字のマーカー / 目次の番号と矢印。
 * 紺・菱形の色はキャリア・会社を知るページと同じ。
 */

.p-interview-page {
	--interview-color-ink: #212121; /* Figma「black.main」 */
	--interview-color-sub: #474747; /* Figma「black.sub」 */
	--interview-color-gray: #7a7a7a; /* Figma「gray.main」 */
	--interview-color-line: #ebebeb; /* Figma「gray.light」 */
	--interview-color-navy: #14427a; /* キャリア・会社を知るページの英字の色 */
	--interview-color-blue: #1a6fbf; /* キャリア・会社を知るページの菱形の色 */
	--interview-color-marker: #dcebfb;

	color: var(--interview-color-ink);

	/* SP はデザインどおり左右の余白を20pxにする(Join Our Team も含めてページ全体) */
	@media (width < 770px) {
		--space-gutter: 20px;
	}
}

/* 目次の項目をクリックしたら見出しまで滑らかにスクロールする */
html {
	scroll-behavior: smooth;

	@media (prefers-reduced-motion: reduce) {
		scroll-behavior: auto;
	}
}

/*
 * 01〜03 記事(淡いグラデーションの地)
 * 追従するヘッダー(上の余白16px + 枠72px)の裏まで地を敷く。タイトルはページの上から132px(SP は 64 + 32px)
 */
.p-interview {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	margin-top: -88px;
	padding-block: 132px 64px;
	background:
		linear-gradient(98.74deg, #f5fcfe 26.03%, #e8f3fc 60.4%),
		linear-gradient(-3.45deg, #f3f2ff 0.83%, #fffbf5 49.96%, #f3f6f8 99.1%);

	@media (width < 770px) {
		margin-top: -64px;
		padding-block: 96px 56px;
	}
}

/* 飾りの菱形(正方形を45度回したもの)。タイトルの右側、ヘッダーの裏から置く */
.p-interview__deco {
	position: absolute;
	z-index: -1;
	width: var(--size);
	height: var(--size);
	background: var(--interview-color-blue);
	opacity: var(--opacity);
	rotate: 45deg;
	pointer-events: none;

	&:nth-of-type(1) {
		--size: 220px;
		--opacity: 0.1;
		top: -40px;
		right: 120px;
	}

	&:nth-of-type(2) {
		--size: 90px;
		--opacity: 0.12;
		top: 150px;
		right: 320px;
	}

	&:nth-of-type(3) {
		--size: 60px;
		--opacity: 0.16;
		top: 190px;
		right: 40px;
	}

	@media (width < 770px) {
		&:nth-of-type(1) {
			--size: 160px;
			right: -60px;
		}

		&:nth-of-type(2) {
			--size: 60px;
			top: 110px;
			right: 110px;
		}

		&:nth-of-type(3) {
			--size: 40px;
			top: 150px;
			right: 16px;
		}
	}
}

.p-interview__inner {
	display: flex;
	flex-direction: column;
	gap: 40px;

	@media (width < 770px) {
		gap: 28px;
	}
}

/* 01 タイトル・リード文 */
.p-interview__header {
	display: grid;
	gap: var(--space-lg);
}

/* 英字の小見出し(キャリア・会社を知るページの見出しの英字と同じ) */
.p-interview__en {
	margin: 0 0 -12px; /* タイトルとの間を12pxにする */
	color: var(--interview-color-navy);
	font-family: var(--font-family-en);
	font-size: 0.8125rem;
	font-weight: 700;
	line-height: 23.4px;
	letter-spacing: 0.16em;
}

.p-interview__title {
	margin: 0;
	font-size: 2.25rem;
	font-weight: 700;
	line-height: 1.55;

	@media (width < 770px) {
		font-size: 1.5rem;
		line-height: 1.5;
	}
}

.p-interview__lead {
	margin: 0;
	font-size: 1.125rem;
	font-weight: 700;
	line-height: 32px;

	@media (width < 770px) {
		line-height: 1.8;
	}
}

/*
 * 02 プロフィール(Figma node 68:1896)。幅1200pxの白い箱(内側の余白24px)の左に社員写真285×200、右に
 * 「名前 / 職種 / 役職」・入社区分と年次・キャリアのタグ。角丸と薄い影はデザインに無い装飾(docs/01-decisions.md 2026-11-20)。
 * SP は写真を上に幅いっぱい(3:2)で置き、その下に文字を並べる
 */
.p-interview__profile {
	display: flex;
	align-items: flex-start;
	gap: var(--space-lg);
	padding: var(--space-lg);
	border-radius: var(--radius-sm);
	background: var(--color-bg);
	box-shadow: 0 8px 24px rgb(20 66 122 / 0.08);

	@media (width < 770px) {
		flex-direction: column;
		align-items: stretch;
		gap: 20px;
		padding: 20px;
	}
}

.p-interview__photo-frame {
	flex-shrink: 0;
	width: 285px;
	margin: 0;

	@media (width < 770px) {
		width: 100%;
	}
}

.p-interview__photo {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 285 / 200;
	border-radius: var(--radius-sm);
	object-fit: cover;
	object-position: center 30%; /* 顔が切れにくいよう少し上寄りを残す */

	@media (width < 770px) {
		aspect-ratio: 3 / 2;
	}
}

.p-interview__profile-body {
	display: grid;
	flex: 1;
	gap: 18px;
	min-width: 0;

	@media (width < 770px) {
		gap: 12px;
	}
}

/* 名前 / 職種 / 役職(事業責任者インタビューの話し手の名前もこのクラス) */
.p-interview__name {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0 12px;
	margin: 0;
	color: var(--interview-color-ink);
	font-size: 1.375rem;
	font-weight: 700;
	line-height: 1.6;

	@media (width < 770px) {
		font-size: 1.1875rem;
	}
}

.p-interview__name-en {
	color: var(--interview-color-gray);
	font-family: var(--font-family-en);
	font-size: 0.8125rem;
	font-weight: 500;
	letter-spacing: 0.06em;
}

/* 英字の小見出し(事業責任者インタビューのプロフィール) */
.p-interview__profile-en {
	margin: 0;
	color: var(--interview-color-navy);
	font-family: var(--font-family-en);
	font-size: 0.75rem;
	font-weight: 700;
	line-height: 1.6;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

/* 入社区分と年次(例: 新卒3年目) */
.p-interview__join {
	margin: 0;
	color: var(--interview-color-sub);
	font-size: 0.875rem;
	line-height: 1.7;
}

/* キャリアのタグ。濃い灰色の地に白い文字 */
.p-interview__career {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.p-interview__career-tag {
	padding: 4px 12px;
	border-radius: 6px;
	background: var(--interview-color-sub);
	color: var(--color-text-inverse);
	font-size: 0.75rem;
	font-weight: 700;
	line-height: 18px;
	letter-spacing: 0.04em;
}

/*
 * 02 事業責任者インタビュー(2人の対談)のプロフィール(template-parts/interview/speakers.php)。
 * 話し手を横に2人並べ、間に縦の線を引く(SP は縦に並べ、横の線で区切る)。名前の色は本文の名札の色とそろえる
 */
.p-interview__speakers {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	margin: 0;
	padding: 0;
	list-style: none;

	@media (width < 770px) {
		grid-template-columns: minmax(0, 1fr);
	}
}

.p-interview__speaker-card {
	--speaker-color: var(--interview-color-navy);

	display: grid;
	align-content: start;
	gap: 8px;
	padding-inline: 32px;
	border-left: 1px solid var(--interview-color-line);

	&:first-child {
		padding-left: 0;
		border-left: 0;
	}

	&:last-child {
		padding-right: 0;
	}

	@media (width < 770px) {
		padding: 20px 0 0;
		border-top: 1px solid var(--interview-color-line);
		border-left: 0;

		&:first-child {
			padding-top: 0;
			border-top: 0;
		}

		& + & {
			margin-top: 20px;
		}
	}
}

.p-interview__speaker-card--2 {
	--speaker-color: var(--interview-color-blue);
}

.p-interview__speaker-position {
	margin: 0;
	color: var(--speaker-color);
	font-size: 0.875rem;
	font-weight: 700;
	line-height: 1.7;
}

.p-interview__speaker-career {
	margin: 4px 0 0;
	color: var(--interview-color-sub);
	font-size: 0.875rem;
	line-height: 1.9;
}

/*
 * 03 目次・本文。白い地はプロフィール欄と同じ幅1200px(コンテンツ幅いっぱい)にし、
 * 中の文字はデザインの本文幅800pxで中央に置く
 */
.p-interview__toc {
	display: grid;
	grid-template-columns: minmax(0, 800px);
	justify-content: center;
	gap: var(--space-sm);
	padding: var(--space-lg);
	border: 1px solid var(--interview-color-line);
	border-radius: var(--radius-sm);
	background: var(--color-bg);

	@media (width < 770px) {
		padding: var(--space-lg) 20px;
	}
}

.p-interview__toc-title {
	margin: 0;
	font-size: 1.5rem;
	font-weight: 700;
	line-height: 1.45;

	@media (width < 770px) {
		font-size: 1.25rem;
		line-height: 1.5;
	}
}

/* 項目の間に細い線、左に紺の番号、右に下向きの矢印(押すと本文の見出しへ移動する) */
.p-interview__toc-list {
	margin: 0;
	padding: 0;
	color: var(--interview-color-sub);
	line-height: 28px;
	list-style: none;

	& li + li {
		border-top: 1px solid var(--interview-color-line);
	}

	& a {
		display: flex;
		align-items: flex-start;
		gap: var(--space-md);
		padding-block: 10px;
		color: inherit;
		text-decoration: none;

		/* 下向きの矢印(線2本の山形) */
		&::after {
			flex-shrink: 0;
			width: 7px;
			height: 7px;
			margin: 8px 4px 0 auto;
			border-right: 1.5px solid currentcolor;
			border-bottom: 1.5px solid currentcolor;
			rotate: 45deg;
			content: "";
		}

		&:hover {
			color: var(--interview-color-navy);

			& .p-interview__toc-text {
				text-decoration: underline;
			}
		}
	}
}

.p-interview__toc-num {
	flex-shrink: 0;
	color: var(--interview-color-navy);
	font-family: var(--font-family-en);
	font-weight: 700;
	letter-spacing: 0.08em;
}

/*
 * 03 本文(ブロックエディタで入稿)。幅1200pxの白地の中央に本文幅800pxで組む。
 * デザインでは小見出しごとに白い箱が48px空けて並ぶが、箱の間も白いため、1つの白地にして見出しの上の余白で表す。
 */
.p-interview__body {
	counter-reset: interview-section;
	/*
	 * 左右の余白は、文字の幅が800pxになるように取る。padding の % は親(.p-interview__inner)の幅が基準のため、
	 * 幅1200pxでは200px、それが32px未満になる狭い画面では32px
	 */
	padding: var(--space-xl) max(var(--space-xl), calc((100% - 800px) / 2));
	border-radius: var(--radius-sm);
	background: var(--color-bg);

	@media (width < 770px) {
		padding: var(--space-lg) 20px;
	}

	& > :first-child {
		margin-top: 0;
	}

	& > :last-child {
		margin-bottom: 0;
	}

	/* 前の段落との間は、デザインの「箱の下の余白32px + 箱の間48px + 箱の上の余白32px」(SP は 24 + 24 + 24px) */
	/* 上に目次と同じ番号、下に短い紺の線 */
	& h2 {
		counter-increment: interview-section;
		margin: 112px 0 var(--space-lg);
		padding-bottom: var(--space-md);
		background: linear-gradient(var(--interview-color-navy), var(--interview-color-navy)) left bottom / 40px 3px no-repeat;
		scroll-margin-top: 112px; /* 追従するヘッダー(88px)に隠れないようにする */
		font-size: 1.75rem;
		font-weight: 700;
		line-height: 1.6;

		@media (width < 770px) {
			margin-top: 72px;
			scroll-margin-top: 88px;
			font-size: 1.5rem;
			line-height: 1.5;
		}

		&::before {
			display: block;
			margin-bottom: 4px;
			color: var(--interview-color-navy);
			font-family: var(--font-family-en);
			font-size: 0.875rem;
			letter-spacing: 0.16em;
			line-height: 24px;
			content: counter(interview-section, decimal-leading-zero);
		}
	}

	/* 質問(原稿の「—— 〜？」)。左の紺の縦線で答えとの境目を示す */
	& h3 {
		margin: var(--space-2xl) 0 var(--space-md);
		padding-left: 14px;
		border-left: 3px solid var(--interview-color-navy);
		font-size: 1.125rem;
		font-weight: 700;
		line-height: 1.6;
	}

	/* 太字(原稿の要点の一文)は薄い青のマーカーを引く。行をまたいでも各行に引く */
	& strong {
		background: linear-gradient(transparent 60%, var(--interview-color-marker) 60%);
		color: var(--interview-color-ink);
		box-decoration-break: clone;
	}

	& p {
		margin: 0 0 var(--space-lg);
		color: var(--interview-color-sub);
		line-height: 28px;
	}

	& figure {
		margin: var(--space-xl) 0;
	}

	& img {
		display: block;
		border-radius: var(--radius-sm);
	}

	& figcaption {
		margin: 8px 0 0;
		color: var(--interview-color-gray);
		font-size: 0.8125rem;
		line-height: 1.6;
	}

	/*
	 * 事業責任者インタビューの話し手の名札(本文の「鈴木：」を inc/interview.php で置き換えたもの)。
	 * 話し手①は紺、②は青の地に白い文字(プロフィールの名前の色とそろえる)
	 */
	& .p-interview__speaker {
		display: inline-block;
		margin-right: 10px;
		padding: 0 10px;
		border-radius: var(--radius-pill);
		background: var(--interview-color-navy);
		color: #fff;
		font-size: 0.8125rem;
		font-weight: 700;
		line-height: 24px;
		vertical-align: 1px;
	}

	& .p-interview__speaker--2 {
		background: var(--interview-color-blue);
	}
}

/* 04 他の社員インタビュー */
.p-interview-related {
	padding-block: 88px;
	background: var(--color-bg);

	@media (width < 770px) {
		padding-block: 56px;
	}

	& .c-section-heading__en {
		color: var(--interview-color-gray);
		line-height: 32px;

		/* SP のセクション見出しの英字は18px(採用情報ページのSPは16px) */
		@media (width < 770px) {
			font-size: 1.125rem;
			line-height: 1.8;
		}
	}

	& .c-section-heading__title {
		line-height: 1.45;
	}
}

/*
 * 件数に合わせて横に均等に並べる(3件なら3列、4件なら4列。最大4件は single-interview.php で取得)。
 * 1100px未満は1枚が狭くなり「インタビューを読む」が収まらないため、2列にする
 */
.p-interview-related__list {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: var(--space-lg);
	margin: 40px 0 0;
	padding: 0;
	list-style: none;

	&:has(> li:nth-child(4)) {
		grid-template-columns: repeat(4, 1fr);
	}

	@media (width < 1100px) {
		&,
		&:has(> li:nth-child(4)) {
			grid-template-columns: repeat(2, 1fr);
		}
	}

	@media (width < 770px) {
		margin-top: 28px;

		&,
		&:has(> li:nth-child(4)) {
			grid-template-columns: 1fr;
		}
	}

	& > li {
		display: flex;
	}

	/* SP はカードの写真を幅335 x 高さ230の比率、見出しの行の高さを1.8にする */
	& .c-interview-card__image {
		@media (width < 770px) {
			aspect-ratio: 335 / 230;
		}
	}

	& .c-interview-card__title {
		@media (width < 770px) {
			line-height: 1.8;
		}
	}
}

/* ---------- 動き ---------- */
/*
 * 共通の動き(up / fade / children / left)と仕組みは components.css の「動き(共通)」、
 * どの要素をどう動かすかは assets/js/motion.js のインタビュー記事の設定を参照。トップページと同じく控えめにする。
 * 読みものの本文(.p-interview__body)は動かさない(段落ごとに出てくると読む邪魔になるため)。
 * メインビジュアルの動きは、<html> の is-motion(inc/enqueue.php が <head> で付ける)があるときだけ動かす
 */

/* メインビジュアル: 菱形 → 英字 → タイトル → リード文の順に出る(プロフィール欄は motion.js でスクロール時に出る) */
.is-motion {
	& .p-interview__deco {
		animation: c-motion-deco 1.4s var(--motion-ease-out) backwards;

		&:nth-of-type(2) {
			animation-delay: 0.1s;
		}

		&:nth-of-type(3) {
			animation-delay: 0.2s;
		}
	}

	& .p-interview__en {
		animation: c-motion-left 0.8s var(--motion-ease-out) 0.2s backwards;
	}

	& .p-interview__title {
		animation: c-motion-up 0.9s var(--motion-ease-out) 0.3s backwards;
	}

	& .p-interview__lead {
		animation: c-motion-up 0.9s var(--motion-ease-out) 0.4s backwards;
	}
}
