/*
 * 本文（ブロックエディターの内容）のスタイル。フロントの .entry-content と、編集画面の両方に適用する。
 * 編集画面では WordPress が各セレクタに .editor-styles-wrapper を付ける。
 * 旧テーマで作成した記事のクラス（column-keypoints / column-term / column-card-inline / column-sources）も表示できる。
 *
 * 長文の読みやすさを優先：本文 18px / 400 / 行高 1.9、見出しは太さと余白で階層を示し、装飾の線・色面は最小限にする。
 */

.entry-content {
	color: #252a30;
	font-size: 1.125rem;
	font-weight: 400;
	line-height: 1.9;
}

.entry-content > * + * {
	margin-top: 1.6em;
}

/* 見出しの色はトップと同じ役割分担：h2 は青（#176B91）、h3 は濃紺（#16294D） */
.entry-content h2 {
	margin-top: 2.8em;
	padding-bottom: 0.5em;
	border-bottom: 1px solid #dcdddc;
	color: #176b91;
	font-size: clamp(1.4375rem, 1.3rem + 0.6vw, 1.75rem); /* 23〜28px */
	font-weight: 700;
	line-height: 1.5;
}

/* h3：本文の太字と区別できるよう、左に青の線を添える（文字は濃紺） */
.entry-content h3 {
	margin-top: 2.4em;
	padding-left: 0.7em;
	border-left: 3px solid #176b91;
	color: #16294d;
	font-size: clamp(1.1875rem, 1.1rem + 0.4vw, 1.375rem);
	font-weight: 700;
	line-height: 1.55;
}

.entry-content h4 {
	margin-top: 2em;
	font-size: 1.125rem;
	font-weight: 600;
}

.entry-content > :first-child {
	margin-top: 0;
}

.entry-content a {
	color: #0b1530;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.22em;
}

.entry-content a.is-external::after {
	content: "↗";
	display: inline-block;
	margin-left: 0.2em;
	font-size: 0.85em;
	text-decoration: none;
}

.entry-content strong {
	font-weight: 600;
}

.entry-content ul,
.entry-content ol {
	padding-left: 1.5em;
}

.entry-content ul {
	list-style: disc;
}

.entry-content ol {
	list-style: decimal;
}

.entry-content li + li {
	margin-top: 0.5em;
}

.entry-content li > ul,
.entry-content li > ol {
	margin-top: 0.5em;
}

.entry-content li::marker {
	color: #62676d;
}

.entry-content img {
	max-width: 100%;
	height: auto;
	border-radius: 2px;
}

.entry-content figure {
	margin-inline: 0;
}

.entry-content figcaption,
.entry-content .wp-element-caption {
	margin-top: 0.7em;
	color: #62676d;
	font-size: 0.8125rem;
	line-height: 1.6;
	text-align: left;
}

.entry-content blockquote {
	margin-inline: 0;
	padding: 0.2em 0 0.2em 1.4em;
	border-left: 2px solid #84898f;
	color: #3d434a;
}

.entry-content blockquote cite {
	display: block;
	margin-top: 0.6em;
	color: #62676d;
	font-size: 0.8125rem;
	font-style: normal;
}

/* 表：本文幅を超える場合は表の枠内だけ横スクロール */
.entry-content .wp-block-table {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

/* 表（旧サイトの体裁を踏襲）：上に濃い線、見出し行は薄い面＋太字、セルに左右の余白、行は細い線で区切り、1列目は濃紺 */
.entry-content table {
	width: 100%;
	min-width: 520px;
	border-collapse: collapse;
	border-top: 2px solid #0b1530;
	border-bottom: 1px solid #c9cdd2;
	font-size: 0.9375rem;
	line-height: 1.75;
}

.entry-content th,
.entry-content td {
	padding: 0.8em 1em;
	border: 0;
	border-bottom: 1px solid #dcdddc;
	text-align: left;
	vertical-align: top;
}

.entry-content thead th {
	background: #eef1f5;
	border-bottom: 1px solid #c9cdd2;
	color: #0b1530;
	font-size: 0.9375rem;
	font-weight: 700;
}

.entry-content tbody th,
.entry-content tbody td:first-child {
	color: #16294d;
	font-weight: 600;
}

.entry-content tbody tr:last-child > * {
	border-bottom: 0;
}

.entry-content .wp-block-table figcaption {
	margin-top: 8px;
	color: #62676d;
	font-size: 0.8125rem;
	text-align: left;
}

.entry-content hr {
	border: 0;
	border-top: 1px solid #dcdddc;
	margin-block: 2.8em;
}

.entry-content code {
	padding: 0.1em 0.4em;
	background: #f6f5f2;
	font-size: 0.9em;
}

.entry-content .wp-block-embed iframe {
	max-width: 100%;
}

/* ---- 要点枠（パターン「この記事の要点」／記事の入力欄「要点」） ---- */
.column-keypoints {
	margin-bottom: 2.2em;
	padding: 1.4em 1.6em 1.5em;
	background: #f6f5f2;
	font-size: 1rem;
	line-height: 1.8;
}

.column-keypoints__title {
	margin: 0 0 0.7em;
	color: #0b1530;
	font-size: 0.9375rem;
	font-weight: 600;
	letter-spacing: 0.04em;
}

.column-keypoints ul {
	margin: 0;
	padding-left: 1.3em;
	list-style: disc;
}

.column-keypoints li + li {
	margin-top: 0.45em;
}

.column-keypoints > * + * {
	margin-top: 0.6em;
}

/* ---- 注記（パターン「注記」） ---- */
.cy-note {
	padding: 1.1em 1.4em;
	border-left: 2px solid #0b1530;
	background: #f6f5f2;
	font-size: 0.9375rem;
	line-height: 1.8;
}

.cy-note > * + * {
	margin-top: 0.4em;
}

.cy-note__title {
	margin: 0;
	font-weight: 600;
}

/* ---- サービス案内（パターン「サービス案内（記事中）」） ---- */
.cy-service-callout {
	padding: 1.5em 0 1.4em;
	border-block: 1px solid #252a30;
	font-size: 1rem;
	line-height: 1.8;
}

.cy-service-callout > * + * {
	margin-top: 0.5em;
}

.cy-service-callout__label {
	margin: 0;
	color: #62676d;
	font-size: 0.8125rem;
	font-weight: 500;
}

.cy-service-callout__title {
	margin: 0;
	color: #0b1530;
	font-size: 1.25rem;
	font-weight: 600;
	line-height: 1.5;
}

.cy-service-callout__link a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	font-weight: 600;
}

/* ---- 用語メモ（[term] ショートコード） ---- */
.column-term {
	padding: 1.1em 1.4em;
	border: 1px solid #dcdddc;
	font-size: 0.9375rem;
	line-height: 1.8;
}

.column-term__label {
	margin: 0 0 0.4em;
	color: #62676d;
	font-size: 0.8125rem;
	font-weight: 500;
}

.column-term__name {
	color: #252a30;
	font-size: 1rem;
	font-weight: 600;
}

.column-term__en {
	margin-left: 0.6em;
	font-weight: 400;
}

.column-term__body p {
	margin: 0;
}

.column-term__body p + p {
	margin-top: 0.6em;
}

.column-term__more {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	margin-top: 0.2em;
}

/* ---- 関連記事カード（[column_card] ショートコード・サイト内URLの埋め込み） ---- */
/* 旧サイトの体裁を踏襲：細い枠＋左に太い線の箱。ラベル → タイトル → 抜粋2行 → 記事カテゴリーと「記事を読む →」 */
.column-card-inline a {
	display: grid;
	gap: 0.45em;
	padding: 1.2em 1.5em 1.1em 1.6em;
	background: #fff;
	border: 1px solid #c9cdd2;
	border-left: 4px solid #176b91;
	border-radius: 2px;
	font-weight: 400;
	text-decoration: none;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.column-card-inline a:hover {
	border-color: #176b91;
	box-shadow: 0 6px 20px rgb(11 21 48 / 8%);
}

.entry-content .column-card-inline a::after {
	content: none;
}

.column-card-inline__label {
	color: #176b91;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.08em;
}

.column-card-inline__label::before {
	content: "▶";
	margin-right: 6px;
	font-size: 0.5625rem;
	vertical-align: 1px;
}

.column-card-inline__title {
	color: #0b1530;
	font-size: 1.0625rem;
	font-weight: 600;
	line-height: 1.55;
}

.column-card-inline a:hover .column-card-inline__title {
	text-decoration: underline;
}

.column-card-inline__excerpt {
	display: -webkit-box;
	overflow: hidden;
	color: #4a5058;
	font-size: 0.875rem;
	line-height: 1.75;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

/* 記事カテゴリー（左）と「記事を読む →」（右） */
.column-card-inline__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 6px 16px;
	margin-top: 0.3em;
	font-size: 0.8125rem;
}

.column-card-inline__tag {
	padding: 1px 10px 2px;
	border: 1px solid #9fc3d3;
	border-radius: 999px;
	color: #176b91;
}

.column-card-inline__cta {
	margin-left: auto;
	color: #176b91;
	font-weight: 700;
}

.column-card-inline__cta::after {
	content: " →";
}

/* ---- 出典リスト ---- */
/* 参考文献：[1] [2] … の番号を自動で付ける（本文の [1] などの注番号と対応）。2行目以降は番号の右で揃える */
.column-sources,
.entry-content .column-sources {
	padding-left: 0;
	list-style: none;
	counter-reset: sources;
	color: #62676d;
	font-size: 0.875rem;
	line-height: 1.75;
	overflow-wrap: anywhere;
}

.column-sources li,
.entry-content .column-sources li {
	position: relative;
	padding-left: 2.6em;
	list-style: none;
	counter-increment: sources;
}

.column-sources li::before {
	content: "[" counter(sources) "]";
	position: absolute;
	left: 0;
	color: #176b91;
	font-variant-numeric: tabular-nums;
}

.column-sources li + li {
	margin-top: 0.5em;
}

/* ---------- 固定ページの本文で使うブロック（ボタン・開閉・カラム）。/cases/ などで使用 ---------- */

/* ボタンブロック：サイトの主ボタンと同じ見た目（濃紺＋白文字） */
.entry-content .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	min-height: 56px;
	padding: 8px 28px;
	border-radius: var(--radius-button);
	background: var(--c-navy);
	color: #fff;
	font-size: 1rem;
	font-weight: var(--w-semi);
	letter-spacing: 0.02em;
	text-decoration: none;
}

.entry-content .wp-block-button__link:hover {
	background: #1c2f5c;
}

/* 開閉ブロック（よくある質問）：罫線で区切り、質問は太字 */
.entry-content .wp-block-details {
	margin-top: 0;
	padding: 18px 0;
	border-bottom: 1px solid #dfe3ea;
}

/* 見出し（h2）の下線と重ならないよう、最初の質問の上には線を引かない */
.entry-content h2 + .wp-block-details {
	margin-top: 0.4em;
}

.entry-content .wp-block-details summary {
	color: #16294d;
	font-weight: 600;
	cursor: pointer;
}

.entry-content .wp-block-details > :not(summary) {
	margin-top: 12px;
}

/* カラム内：小さなラベルと見出しの間を詰める */
.entry-content .wp-block-column > * + * {
	margin-top: 0.8em;
}

.entry-content .wp-block-column h3 {
	margin-top: 0.6em;
	font-size: 1.125rem;
}

.entry-content .wp-block-column .has-small-font-size {
	color: #176b91;
	font-weight: 600;
}

/* ---------- 動画のポップアップ（本文中の YouTube へのリンクを、ページを離れずに再生する。assets/js/main.js） ----------
   構成：上の帯（閉じるボタン）→ 動画の領域 → 下の帯（題名・YouTubeで開く）。
   ・表示中の画面の高さ（100dvh。Safari のアドレスバーの表示・収納に追従）を上限にし、閉じるボタンを動画の外に置く（YouTube の操作と重ねない）。
   ・動画は縦横比を保ったまま、動画の領域に収まる最大の大きさにする（切り取らない）。領域の大きさはコンテナクエリの単位で測る。
   ・スマートフォンは画面全体を使う。横向きのスマートフォンでは、閉じるボタンと題名を右側の列に回して、動画の高さを確保する。 */

.c-video-modal {
	position: fixed;
	z-index: 100000;
	top: 0;
	left: 0;
	width: 100%;
	height: 100vh;
	height: 100dvh;
	padding:
		max(16px, env(safe-area-inset-top))
		max(16px, env(safe-area-inset-right))
		max(16px, env(safe-area-inset-bottom))
		max(16px, env(safe-area-inset-left));
	overscroll-behavior: contain;
}

.c-video-modal[hidden] {
	display: none;
}

.c-video-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(5, 14, 30, 0.88);
}

.c-video-modal__dialog {
	position: relative;
	z-index: 1;
	display: grid;
	grid-template-areas: "bar" "stage" "info";
	grid-template-rows: auto minmax(0, 1fr) auto;
	width: 100%;
	max-width: 1040px;
	height: 100%;
	margin-inline: auto;
	pointer-events: none; /* 余白のクリックは背景（閉じる）へ通す */
}

.c-video-modal__dialog > * {
	pointer-events: auto;
}

/* PC・タブレット（縦向き）：縦長の動画では、ダイアログの幅を動画の幅の目安に合わせ、閉じるボタンを動画の右上の近くに置く */
@media (min-width: 768px) and (min-height: 541px) {
	.c-video-modal__dialog:has(.c-video-modal__frame--portrait) {
		max-width: max(320px, calc((100dvh - 190px) * 9 / 16));
	}
}

.c-video-modal__bar {
	grid-area: bar;
	display: flex;
	justify-content: flex-end;
	padding-bottom: 10px;
}

.c-video-modal__stage {
	grid-area: stage;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 0;
	container-type: size;
	pointer-events: none;
}

.c-video-modal__frame {
	overflow: hidden;
	border-radius: 14px;
	background: #000;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
	pointer-events: auto;
}

/* 縦長（ショート動画）：1行目はコンテナクエリ非対応のブラウザ用の目安 */
.c-video-modal__frame--portrait {
	width: min(92vw, calc((100vh - 190px) * 9 / 16));
	width: min(100cqw, 100cqh * 9 / 16);
	aspect-ratio: 9 / 16;
}

/* 横長（通常の動画） */
.c-video-modal__frame--landscape {
	width: min(92vw, 960px, calc((100vh - 190px) * 16 / 9));
	width: min(100cqw, 100cqh * 16 / 9);
	aspect-ratio: 16 / 9;
}

.c-video-modal__frame iframe {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
}

.c-video-modal__info {
	grid-area: info;
	justify-self: center;
	max-width: 480px;
	padding-top: 12px;
	text-align: center;
}

.c-video-modal__title {
	margin: 0;
	color: #fff;
	font-size: 0.875rem;
	font-weight: 500;
	line-height: 1.5;
}

.c-video-modal__link {
	margin: 4px 0 0;
	font-size: 0.75rem;
	line-height: 1.5;
}

.c-video-modal__link a {
	display: inline-block;
	padding-block: 4px;
	color: rgba(255, 255, 255, 0.78);
}

.c-video-modal__close {
	position: relative;
	flex: none;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
	cursor: pointer;
}

.c-video-modal__close::before,
.c-video-modal__close::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 18px;
	height: 2px;
	background: #0b1530;
	transform: translate(-50%, -50%) rotate(45deg);
}

.c-video-modal__close::after {
	transform: translate(-50%, -50%) rotate(-45deg);
}

html.is-video-modal-open,
body.is-video-modal-open {
	overflow: hidden;
}

/* スマートフォン（縦向き）：画面全体を使い、余白を詰める。題名は2行まで（動画の領域を圧迫しない） */
@media (max-width: 767.98px) {
	.c-video-modal {
		padding:
			max(8px, env(safe-area-inset-top))
			max(8px, env(safe-area-inset-right))
			max(8px, env(safe-area-inset-bottom))
			max(8px, env(safe-area-inset-left));
	}

	.c-video-modal__backdrop {
		background: rgba(5, 14, 30, 0.96);
	}

	.c-video-modal__bar {
		padding-bottom: 8px;
	}

	.c-video-modal__frame {
		border-radius: 10px;
	}

	.c-video-modal__info {
		padding-top: 8px;
	}

	.c-video-modal__title {
		display: -webkit-box;
		overflow: hidden;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 2;
	}
}

/* 横向きのスマートフォン（高さが低い画面）：動画を左、閉じるボタンと題名を右の列に置く */
@media (orientation: landscape) and (max-height: 540px) {
	.c-video-modal {
		padding:
			max(8px, env(safe-area-inset-top))
			max(12px, env(safe-area-inset-right))
			max(8px, env(safe-area-inset-bottom))
			max(12px, env(safe-area-inset-left));
	}

	.c-video-modal__backdrop {
		background: rgba(5, 14, 30, 0.96);
	}

	.c-video-modal__dialog {
		grid-template-areas: "stage bar" "stage info";
		grid-template-rows: auto minmax(0, 1fr);
		grid-template-columns: minmax(0, 1fr) minmax(120px, 200px);
		column-gap: 12px;
		max-width: none;
	}

	.c-video-modal__bar {
		padding-bottom: 0;
	}

	.c-video-modal__info {
		align-self: end;
		justify-self: stretch;
		padding-top: 0;
		text-align: left;
	}

	.c-video-modal__title {
		display: -webkit-box;
		overflow: hidden;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 4;
	}

	.c-video-modal__frame {
		border-radius: 8px;
	}
}
