@charset "UTF-8";
/*
 * OCT知っ得ことば辞典（slug: dictionary / ID:161）専用スタイル
 * Figma: PC 1440 / SP 828 基準。rem = 10px（html font-size 62.5%）。
 * 命名: FLOCSS（p-dictionary*）。SP は @media (max-width:768px)。
 *
 * 構成:
 *   tokens      : ページ内で共有する色・影のみ
 *   utilities   : 汎用補助
 *   layout      : 辞典エリア / MV / 白パネル / 凡例
 *   components  : バッジ / 五十音インデックス / 用語カード / 挿絵 / 注記
 *   motion      : 挿絵アニメーション
 *   responsive  : SP: 768px 以下
 */

/* ============================================================
 * tokens
 *
 * ページ全体で複数回使う色・影だけをトークン化する。
 * Figma由来の寸法値は1回限りが多いため、無理に変数化しない。
 * ============================================================ */
:root {
	--dictionary-color-bg: #ffd7c8;
	--dictionary-color-black: #000000;
	--dictionary-color-white: #ffffff;
	--dictionary-color-muted: #828282;
	--dictionary-color-badge-k: #3778b4;
	--dictionary-color-badge-r: #e17419;
	--dictionary-shadow-toggle: 0 0.2rem 0.8rem rgba(0, 0, 0, 0.15);
}

/* ============================================================
 * utilities
 * ============================================================ */
/* 視覚的に隠す（スクリーンリーダー用テキスト） */
.u-visually-hidden {
	border: 0;
	clip: rect(0 0 0 0);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	white-space: nowrap;
	width: 1px;
}

/* ============================================================
 * components: badge
 * ============================================================ */
.p-dictionaryBadge {
	align-items: center;
	color: var(--dictionary-color-white);
	display: inline-flex;
	flex-shrink: 0;
	font-size: 1.5rem; /* Figma 15px */
	font-weight: 500; /* Figma Medium */
	height: 3.1rem;
	justify-content: center;
	letter-spacing: normal; /* 単一文字のため字間は付けない（末尾余白で左にずれるのを防ぎ左右中央に） */
	line-height: 1;
	text-indent: 0; /* 念のため：行頭インデント無し */
	width: 3.1rem;
}

.p-dictionaryBadge--k {
	background-color: var(--dictionary-color-badge-k); /* Figma K=建築 */
}

.p-dictionaryBadge--r {
	background-color: var(--dictionary-color-badge-r); /* Figma R=ロボ */
}

.p-dictionaryBadge--o {
	background-color: var(--dictionary-color-black); /* Figma O=OCT */
}

/* ============================================================
 * layout: page area / main visual
 * ============================================================ */
/* 辞典エリア（ピンク地：MV + 白パネルを内包） */
.l-dictionaryArea {
	background-color: var(--dictionary-color-bg);
	padding-top: 0.1rem; /* 子要素の margin 相殺を防ぐ */
	padding-bottom: 8rem;
}

.l-dictionaryMv {
	background-color: transparent; /* 地のピンクを見せる */
	margin-top: 0;
	overflow: hidden;
	padding-top: 10.8rem; /* Figma ピンク地上端→タイトル 108px */
}

.p-dictionaryMv__inner {
	align-items: flex-start; /* Figma タイトルとイラストは上端揃え */
	display: flex;
	gap: 4.9rem; /* Figma head→イラスト間 49px */
	justify-content: center;
	margin: 0 auto;
	max-width: 92.5rem; /* Figma KVエリア幅 925px（白パネルより内側に左右余白） */
	min-height: 40rem;
	padding-bottom: 4rem;
	padding-top: 0; /* 上余白は .l-dictionaryMv の padding-top で制御 */
}

.p-dictionaryMv__head {
	flex-shrink: 0;
}

.p-dictionaryMv__title {
	margin: 0;
}

.p-dictionaryMv__titleImg {
	display: block;
	height: 23.6rem; /* Figma タイトル文字高 236px（SVG viewBox 300pxの下余白64pxをクリップ） */
	max-width: 100%;
	object-fit: cover;
	object-position: top;
	width: 38.8rem;
}

.p-dictionaryMv__lead {
	color: var(--dictionary-color-black); /* Figma text-black */
	font-size: 2.8rem; /* Figma 28px */
	letter-spacing: 0.07em; /* Figma tracking 2px */
	line-height: 1.3; /* Figma 2行で約72px（36px/行） */
	margin-top: 5.4rem; /* Figma タイトル→リード 54px */
	white-space: nowrap; /* head幅をリード基準に確定（PC） */
}

.p-dictionaryMv__illust {
	flex-shrink: 0;
	position: relative;
	width: 36rem;
}

.p-dictionaryMv__illust img {
	animation: p-dictionaryWobble 3s ease-in-out infinite;
	display: block;
	height: auto;
	width: 100%;
}

.p-dictionaryMv__credit {
	bottom: -3.1rem;
	color: var(--dictionary-color-black); /* Figma text-black */
	font-size: 1.3rem;
	letter-spacing: 0.2em; /* Figma tracking 2px @10px */
	position: absolute;
	right: 0;
}

/* ============================================================
 * layout: legend
 * ============================================================ */
.l-dictionaryLegend {
	margin-bottom: 10.1rem; /* Figma 凡例→用語ブロック 101px */
}

.p-dictionaryLegend__list {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 1.6rem 3rem;
	justify-content: center;
}

.p-dictionaryLegend__title {
	color: var(--dictionary-color-black); /* Figma text-black */
	font-size: 2rem; /* Figma 20px */
	font-weight: 500;
	letter-spacing: 0.1em; /* Figma tracking 2px */
}

.p-dictionaryLegend__item {
	align-items: center;
	display: flex;
	gap: 0.8rem;
}

.p-dictionaryLegend__label {
	color: var(--dictionary-color-black); /* Figma text-black */
	font-size: 2rem; /* Figma 20px */
	letter-spacing: 0.1em; /* Figma tracking 2px */
}

/* ============================================================
 * layout: body panel
 * ============================================================ */
.p-dictionaryBody__inner {
	max-width: 117rem;
	position: relative;
}

.l-dictionaryBody {
	margin-top: 6.4rem; /* Figma MVボックス→白パネル 64px */
}

.p-dictionaryBody {
	background-color: var(--dictionary-color-white);
	border-radius: 8rem;
	margin: 0 auto;
	max-width: 112.8rem; /* Figma 白パネル幅 1128px（左右156pxインセット） */
	padding: 7.3rem 0 7rem; /* Figma 上 73px（パネル上端→凡例） */
}

/* ============================================================
 * components: index navigation
 * ============================================================ */
.p-dictionaryIndex {
	bottom: 0;
	pointer-events: none;
	position: absolute;
	right: 0;
	top: 0;
	z-index: 5;
}

/* 開閉トグル（円ボタン）はSP専用。PCでは使わない */
.p-dictionaryIndex__toggle {
	display: none;
}

.p-dictionaryIndex__list {
	bottom: 3rem; /* window下端から約30px に固定 */
	display: flex;
	flex-direction: column;
	gap: 0;
	list-style: none;
	margin-left: 3rem;
	pointer-events: auto;
	position: fixed;
}

/* 文字間の罫線（Figma stroke 1.5px） */
.p-dictionaryIndex__item + .p-dictionaryIndex__item {
	border-top: 1.5px solid var(--dictionary-color-muted);
}

/* アクティブ（スクロールで表示中の行）は黒（Figma）。JSで is-active を付与 */
.p-dictionaryIndex__link.is-active {
	color: var(--dictionary-color-black);
}

.p-dictionaryIndex__link {
	align-items: center;
	color: var(--dictionary-color-muted); /* Figma 非アクティブ #828282 */
	display: flex;
	font-size: 2.6rem; /* Figma 26px */
	font-weight: 500;
	height: 4.6rem; /* Figma 区切り間隔 46px */
	justify-content: center;
	letter-spacing: 0.04em; /* Figma tracking 1px */
	transition: color 0.2s;
	width: 2.6rem; /* Figma 文字幅 26px */
}

.p-dictionaryIndex__link:hover {
	color: var(--dictionary-color-black); /* Figma アクティブ text-black */
}

/* ============================================================
 * components: rows / terms
 * ============================================================ */
.p-dictionaryRows {
	margin: 0 auto;
	max-width: 90rem;
	position: relative;
}

.p-dictionaryRow {
	align-content: flex-start;
	align-items: flex-start;
	display: flex;
	flex-direction: row;
	position: relative;
	scroll-margin-top: 11rem;
}

.p-dictionaryRow + .p-dictionaryRow {
	margin-top: 13rem; /* 行ブロック間（最初の行は + セレクタで対象外） */
}

.p-dictionaryRow__label {
	align-items: baseline;
	color: var(--dictionary-color-black); /* Figma text-black */
	display: flex;
	font-weight: 500;
	gap: 0.4rem;
	letter-spacing: 0.02em;
	line-height: 1;
	margin-bottom: 1rem;
}

.p-dictionaryRow__labelMain {
	font-size: 7rem; /* Figma「あ」70px */
}

.p-dictionaryRow__labelSub {
	font-size: 5rem; /* Figma「行」50px */
}

/* 用語カード列（挿絵は左ガターへ float） */
.p-dictionaryRow__list {
	margin-left: 18rem;
}

.p-dictionaryTerm {
	padding: 2.4rem 0;
}

/* 各行ブロックの最初の用語は上paddingなし（ラベルと頭を揃える・下は通常） */
.p-dictionaryRow__list .p-dictionaryTerm:first-child {
	padding: 0 0 2.4rem;
}

.p-dictionaryTerm__head {
	align-items: center;
	display: flex;
	gap: 1.2rem;
	margin-left: -1.5em; /* Webフォントの【のサイドベアリング分を行頭から外へ出す */
}

.p-dictionaryTerm__name {
	color: var(--dictionary-color-black); /* Figma text-black */
	display: inline-block;
	font-feature-settings: "chws" 1, "palt" 1; /* Zen Kaku Gothic New(Google Fonts)はpalt非搭載のためchws(文脈依存ハーフ幅詰め)で約物を詰める */
	font-size: 2.8rem; /* Figma 28px */
	font-weight: 500; /* Figma Medium */
	hanging-punctuation: first;
	letter-spacing: 0.07em; /* Figma tracking 2px */
	line-height: 1.4; /* Figma leading 40px */
	text-spacing-trim: trim-start; /* 行頭約物【のアキを詰める（Chrome/Edge・補助） */
}

.p-dictionaryTerm__cats {
	display: inline-flex;
	gap: 0.6rem;
}

.p-dictionaryTerm__yomi {
	color: var(--dictionary-color-black); /* Figma text-black */
	font-size: 1.4rem;
	letter-spacing: 0.06em;
	margin-top: 0.6rem;
}

.p-dictionaryTerm__def {
	color: var(--dictionary-color-black); /* Figma text-black */
	font-feature-settings: "chws" 1, "palt" 1; /* Zen Kaku Gothic New(Google Fonts)はpalt非搭載のためchws(文脈依存ハーフ幅詰め)で約物を詰める */
	font-size: 1.8rem; /* Figma 18px */
	letter-spacing: 0.02em;
	line-height: 1.9; /* Figma leading 34px */
	margin-top: 0.8rem;
	text-align: justify;
	text-spacing-trim: trim-start; /* 行頭約物のアキを詰める（Chrome/Edge・補助） */
}

/* ============================================================
 * components: illustrations
 * 用語カードの並びの中に置き、負のマージンで左ガター（margin-left:32rem の
 * 空き領域）へ引き出す。該当用語の縦位置から下方に挿絵が並ぶ。
 * 1行に複数あっても DOM 順に縦位置がずれるため重ならない。
 * ============================================================ */
.p-dictionaryRow__illust {
	float: left;
	margin-bottom: 2rem;
	margin-left: -34rem;
	margin-top: 0.5rem;
	shape-outside: content-box;
	width: 27rem;
}

.p-dictionaryRow__illust img {
	animation: p-dictionaryWobble 3s ease-in-out infinite;
	display: block;
	height: auto;
	width: 100%;
}

.p-dictionaryRow__illust--sp {
	display: none;
}

/* ============================================================
 * motion
 * ============================================================ */
/* 挿絵のコミカルな揺れ（左右に小さく＋軽い回転）。速度・開始はJSでランダム付与 */
@keyframes p-dictionaryWobble {
	0%,
	100% {
		transform: translateX(0) rotate(0deg);
	}
	30% {
		transform: translateX(-0.5rem) rotate(-3deg);
	}
	65% {
		transform: translateX(0.5rem) rotate(3deg);
	}
}

/* 視差・動きの軽減設定を尊重 */
@media (prefers-reduced-motion: reduce) {
	.p-dictionaryRow__illust img,
	.p-dictionaryMv__illust img {
		animation: none;
	}
}

/* ============================================================
 * components: note
 * ============================================================ */
.p-dictionaryBody__note {
	color: var(--dictionary-color-muted); /* Figma 注記 #828282 */
	font-feature-settings: "chws" 1, "palt" 1; /* Zen Kaku Gothic New(Google Fonts)はpalt非搭載のためchws(文脈依存ハーフ幅詰め)で約物を詰める */
	font-size: 1.4rem;
	line-height: 1.8;
	margin: 10rem auto 5rem;
	max-width: 100rem;
	text-align: center;
}

/* ============================================================
 * responsive
 * ============================================================ */
@media (max-width: 768px) {
	/* バッジ（Figma SP 40px角・文字25px ×0.5・角丸なし） */
	.p-dictionaryBadge {
		font-size: 1.25rem;
		height: 2rem;
		width: 2rem;
	}

	/* 辞典エリア（ピンク地） */
	.l-dictionaryArea {
		padding-bottom: 4rem;
	}

	/* タイトル */
	.l-dictionaryMv {
		margin-top: 0;
		padding-top: 3rem;
	}

	/* Figma SP: タイトル+リードのまとまりは左右中央、テキストは左揃え。イラストも中央 */
	.p-dictionaryMv__inner {
		align-items: center;
		flex-direction: column;
		gap: 2rem;
		min-height: 0;
		padding-bottom: 3rem;
		padding-top: 1rem;
		text-align: center;
	}

	/* タイトル+リードを中央寄せ（ブロックは中央・中の文字は左揃え） */
	.p-dictionaryMv__head {
		text-align: center;
	}

	.p-dictionaryMv__titleImg {
		height: 15.8rem; /* SP 260px幅時の文字高（下余白クリップ） */
		margin: 0 auto; /* 中央寄せ */
		width: 26rem;
	}

	.p-dictionaryMv__lead {
		display: inline-block; /* 中央寄せの塊の中でテキストは左揃え（Figma） */
		font-size: 1.5rem; /* Figma SP リード ≒ 30px×0.5 */
		line-height: 1.5;
		margin-top: 1.6rem;
		text-align: left;
		white-space: normal; /* SPは折り返し許可 */
	}

	.p-dictionaryMv__illust {
		margin: 0 auto; /* Figma SP イラストは中央（71/71） */
		width: 27.2rem; /* Figma 545px×0.5 */
	}

	/* クレジット：Figma SP はイラスト下に左右中央・24px×0.5=12px */
	.p-dictionaryMv__credit {
		bottom: auto;
		display: block;
		font-size: 1.2rem;
		margin-top: 1.5rem;
		position: static;
		right: auto;
		text-align: center;
	}

	/* ヒーロー→白パネルの余白（Figma SP ≒ 25px。PCの6.4remは過大なのでSPで詰める） */
	.l-dictionaryBody {
		margin-top: 0;
	}

	/* 凡例（Figma SP: パネル上端→用語凡例はpadding-topで確保。凡例→あ行は約55px） */
	.l-dictionaryLegend {
		margin-top: 0;
		margin-bottom: 5.5rem;
	}

	.p-dictionaryLegend__list {
		gap: 1.2rem 2rem;
	}

	.p-dictionaryLegend__title,
	.p-dictionaryLegend__label {
		font-size: 1.7rem;
	}

	.p-dictionaryLegend__title {
		flex-basis: 100%;
		text-align: center;
	}

	/* 本体（白パネル）：Figma SP 角丸80px・左右余白31px（×0.5） */
	.p-dictionaryBody {
		border-radius: 4rem;
		margin: 0 1.6rem;
		padding: 3.5rem 0 4.5rem;
	}

	.p-dictionaryBody__inner {
		padding-left: 1.6rem;
		padding-right: 1.6rem;
	}

	/* 五十音インデックス：Figma SP は開閉式。既定＝円ボタン「五十音から選ぶ」、タップで あ〜ら ピルを開く */
	.p-dictionaryIndex {
		right: 0.6rem;
	}

	/* 閉状態の円ボタン（Figma CL：110px円=55px・「五十音/から選ぶ」20px=10px・2行中央） */
	.p-dictionaryIndex__toggle {
		align-items: center;
		background-color: var(--dictionary-color-bg);
		border: 0;
		border-radius: 50%;
		bottom: 7rem;
		box-shadow: var(--dictionary-shadow-toggle);
		color: var(--dictionary-color-black);
		cursor: pointer;
		display: flex;
		font-size: 1rem; /* Figma 20px ×0.5 */
		font-weight: 500;
		height: 5.5rem; /* Figma 110px ×0.5 */
		justify-content: center;
		letter-spacing: 0.05em;
		line-height: 1.3;
		opacity: 0; /* ヒーローでは非表示。is-shown で表示 */
		pointer-events: auto;
		position: fixed;
		right: 2.8rem; /* Figma SP 右端から約59px×0.5≒29 */
		text-align: center;
		transition: opacity 0.3s ease, visibility 0.3s ease;
		visibility: hidden;
		width: 5.5rem;
		z-index: 6;
	}

	/* 用語ブロック（あ行〜）に入ったら円ボタンを表示（閉状態） */
	.p-dictionaryIndex.is-shown .p-dictionaryIndex__toggle {
		opacity: 1;
		visibility: visible;
	}

	/* 開いたら円ボタンは隠す（ピルに置き換わる） */
	.p-dictionaryIndex.is-open .p-dictionaryIndex__toggle {
		opacity: 0;
		visibility: hidden;
	}

	.p-dictionaryIndex__list {
		align-items: center;
		background-color: var(--dictionary-color-bg); /* Figma ピル #ffd7c8 */
		border-radius: 5rem;
		bottom: 7rem; /* 円ボタンと同じ下端に揃える（下部CVバーを避ける） */
		box-sizing: border-box;
		gap: 0.6rem;
		margin-left: 0;
		opacity: 0; /* 既定は非表示。開いたときだけ表示 */
		padding: 1.4rem 0.7rem;
		right: 2.8rem; /* Figma SP 右端から約59px×0.5≒29（円ボタンと同じ右位置） */
		top: auto; /* PCの fixed bottom 固定を継承（topを解除） */
		width: 5.5rem; /* 円トグル（5.5rem）と幅を揃える */
		transition: opacity 0.3s ease, visibility 0.3s ease;
		visibility: hidden;
	}

	/* 表示中（あ行〜）かつ開いているときだけ あ〜ら ピルを表示 */
	.p-dictionaryIndex.is-shown.is-open .p-dictionaryIndex__list {
		opacity: 1;
		visibility: visible;
	}

	/* SP は文字間の罫線を出さない（Figma・base の 1.5px solid を上書き） */
	.p-dictionaryIndex__item + .p-dictionaryIndex__item {
		border-top: none;
	}

	.p-dictionaryIndex__link {
		border-radius: 50%;
		font-size: 1.6rem; /* Figma SP 32px ×0.5 */
		height: 3.4rem; /* Figma アクティブ丸 71px ×0.5 ≒ 35 */
		width: 3.4rem;
	}

	/* アクティブ（表示中の行）：グレー丸＋白文字（Figma） */
	.p-dictionaryIndex__link.is-active {
		background-color: var(--dictionary-color-muted);
		color: var(--dictionary-color-white);
	}

	/* 行ブロック：1カラム（挿絵はインライン中央）。
	   右端の追従インデックスに本文が潜らないよう右側を空ける。 */
	.p-dictionaryRows {
		max-width: 100%;
	}

	/* SP: 行見出しを上、用語カードを下に全幅で配置（Figma） */
	.p-dictionaryRow {
		flex-direction: column;
		scroll-margin-top: 9rem;
	}

	.p-dictionaryRow + .p-dictionaryRow {
		margin-top: 6rem; /* Figma SP 行ブロック間 ≒ 130px ×0.5 */
	}

	.p-dictionaryRow__label {
		letter-spacing: 0.02em;
		margin-bottom: 2rem; /* Figma SP 見出し→最初のカード */
	}

	.p-dictionaryRow__labelMain {
		font-size: 4.6rem; /* Figma SP「あ」94px ×0.5 */
	}

	.p-dictionaryRow__labelSub {
		font-size: 3.2rem; /* Figma SP「行」64px ×0.5 */
	}

	/* SP: 用語カードと挿絵をDOM順に縦積みし、関連する用語の直後へ配置 */
	.p-dictionaryRow__list {
		display: flex;
		flex-direction: column;
		margin-left: 0;
	}

	/* 行内の最初の用語は見出し直下に詰める（上paddingなし・下は他カードと揃える） */
	.p-dictionaryRow__list .p-dictionaryTerm:first-child {
		padding: 0 0 1.5rem;
	}

	.p-dictionaryTerm {
		padding: 1.5rem 0;
	}

	.p-dictionaryTerm__name {
		font-size: 2rem; /* Figma SP 40px ×0.5 */
		line-height: 1.4;
	}

	.p-dictionaryTerm__yomi {
		font-size: 1.2rem; /* Figma SP 24px ×0.5 */
		margin-top: 0.4rem;
	}

	.p-dictionaryTerm__def {
		font-size: 1.6rem; /* Figma SP 32px ×0.5 */
		line-height: 1.75; /* Figma leading 56/32 */
	}

	.p-dictionaryRow__illust--pc {
		display: none;
	}

	.p-dictionaryRow__illust--sp {
		display: block;
	}

	/* 挿絵：SPは該当用語の直後へ中央配置 */
	.p-dictionaryRow__illust {
		align-self: center;
		float: none;
		margin: 1.2rem auto 2.2rem;
		position: static;
		width: 22rem;
	}

	/* 注記 */
	.p-dictionaryBody__note {
		font-size: 1.3rem;
		max-width: 100%;
		padding-left: 0;
	}
}
