/* ==========================================================================
   YFC NEWS一覧・個別NEWSページ専用CSS（/news/ 、/news/%postname%/）
   yfc-front.css（Design Tokens・Header/Footer・.yfc-container・.yfc-btn・
   .yfc-section-title 等）に依存。TOPページのNEWS component
   （template-parts/front/news.php）のVisual Languageを踏襲しつつ、
   一覧・個別ページ用に独立したレイアウトとして構成している。
   TOPページ（front-page.php）のCSSには影響しない別ファイル。
   構成:
     0. NEWSページ Sticky Footer対応
     1. NEWS一覧（/news/）
     2. 個別NEWS（/news/%postname%/）
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. NEWSページ Sticky Footer対応（V11 最終補正）
   問題: /news/ ・個別NEWSでコンテンツ量が少ない場合、header+content+footerの合計高さが
   viewportに満たず、footerの下に（html/body由来の）背景色の空白領域が残っていた。

   V10時点の実装（.yfc-news-shellにmin-height: calc(100dvh - header高さ)を直接指定）は、
   footerがmainの「外」（後）にあるため、Header + Main(viewport-Header分) + Footer の
   合計がviewport + Footer高さまで伸びてしまう不具合があった。これをV11で修正する。

   対応: home.php / single-post.php の <main> にのみ付与された .yfc-news-shell が
   body直下に存在する場合だけ、:has()でbody自体をcolumn flexにし、
   Header + Main（残り高さいっぱいに伸長） + Footer の合計が最低100dvhとなるようにする
   （Main単体ではなく、Main+Footerを合わせてviewportぴったりに収める）。
   front-page.phpの<main>には.yfc-news-shellが付与されないため、bodyがこの:has()条件に
   マッチせず、TOPページには一切影響しない。無条件のbody global変更ではない。
   header/footerのvisual CSSは変更していない。position:fixedも使用していない。
   記事が長い場合はflexの最小コンテンツサイズにより自然にページが伸びるため、
   通常のスクロール挙動を維持する。
   -------------------------------------------------------------------------- */
body:has(> .yfc-news-shell) {
	min-height: 100vh;
	min-height: 100dvh; /* 対応ブラウザではdvhで上書き（モバイルのアドレスバー変動対策） */
	display: flex;
	flex-direction: column;
}

body:has(> .yfc-news-shell) > .yfc-news-shell {
	flex: 1 0 auto;
}

/* main内部：短いコンテンツでも白背景がfooter直前まで自然に続くよう、直下Sectionを伸長させる */
.yfc-news-shell {
	display: flex;
	flex-direction: column;
}

.yfc-news-shell > .yfc-news-archive,
.yfc-news-shell > .yfc-news-single {
	flex: 1 0 auto;
}

/* --------------------------------------------------------------------------
   1. NEWS一覧（/news/）
   Desktop: 複数列グリッド / Tablet: 情報密度を落として2列 / Mobile: 1列（tap target 44px以上）
   -------------------------------------------------------------------------- */
.yfc-news-archive {
	background: var(--yfc-white);
	padding-block: 48px;
}

.yfc-news-archive__head {
	margin-bottom: 28px;
}

.yfc-news-archive__grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
}

.yfc-news-archive__card-link {
	display: block;
	color: inherit;
	text-decoration: none;
	min-height: 44px;
}

.yfc-news-archive__card-thumb {
	display: block;
	aspect-ratio: 3 / 2;
	border-radius: var(--yfc-radius-md);
	overflow: hidden;
	margin-bottom: 12px;
	background: var(--yfc-gray-100);
}
.yfc-news-archive__card-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.yfc-news-archive__placeholder {
	display: block;
	width: 100%;
	height: 100%;
	background: var(--yfc-gray-100);
}

.yfc-news-archive__card-body {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.yfc-news-archive__card-meta {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 12px;
	color: var(--yfc-gray-600);
	font-family: var(--yfc-font-jp);
}

.yfc-news-archive__card-cat {
	background: var(--yfc-gray-100);
	color: var(--yfc-green-dark);
	padding: 2px 8px;
	border-radius: 999px;
	font-weight: 700;
}

.yfc-news-archive__card-title {
	display: block;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.6;
	color: var(--yfc-text);
}

.yfc-news-archive__card-link:hover .yfc-news-archive__card-title {
	color: var(--yfc-green);
}

.yfc-news-archive__empty {
	color: var(--yfc-gray-600);
	font-size: 14px;
	padding-block: 24px;
}

/* WordPress標準 the_posts_pagination() が出力する .page-numbers 等をNEWS Visual Languageへ */
.yfc-news-archive__pagination {
	margin-top: 40px;
}
.yfc-news-archive__pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 8px;
}
.yfc-news-archive__pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	padding: 0 12px;
	border-radius: var(--yfc-radius-sm);
	border: 1px solid var(--yfc-border);
	color: var(--yfc-text);
	text-decoration: none;
	font-size: 14px;
	font-weight: 600;
}
.yfc-news-archive__pagination a.page-numbers:hover {
	border-color: var(--yfc-green);
	color: var(--yfc-green);
}
.yfc-news-archive__pagination .page-numbers.current {
	background: var(--yfc-green);
	border-color: var(--yfc-green);
	color: var(--yfc-white);
}
.yfc-news-archive__pagination .page-numbers.dots {
	border: none;
	min-width: auto;
}

@media (max-width: 1023px) {
	.yfc-news-archive {
		padding-block: 36px;
	}
	.yfc-news-archive__grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 20px;
	}
}

@media (max-width: 767px) {
	.yfc-news-archive {
		padding-block: 28px;
	}
	.yfc-news-archive__grid {
		grid-template-columns: 1fr;
		gap: 0;
	}
	.yfc-news-archive__card {
		border-bottom: 1px solid var(--yfc-border);
	}
	.yfc-news-archive__card-link {
		display: flex;
		align-items: center;
		gap: 14px;
		padding-block: 14px;
	}
	.yfc-news-archive__card-thumb {
		width: 100px;
		flex-shrink: 0;
		margin-bottom: 0;
	}
	.yfc-news-archive__card-title {
		font-size: 14px;
	}
}

/* --------------------------------------------------------------------------
   2. 個別NEWS（/news/%postname%/）
   本文可読性優先。containerを必要以上に横長にしない。
   -------------------------------------------------------------------------- */
.yfc-news-single {
	background: var(--yfc-white);
	padding-block: 40px 64px;
}

.yfc-news-single__container {
	max-width: 760px;
}

.yfc-news-single__back {
	margin: 0 0 20px;
}
.yfc-news-single__back--bottom {
	margin: 40px 0 0;
}

.yfc-news-single__back-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	font-weight: 600;
	color: var(--yfc-gray-600);
	text-decoration: none;
	min-height: 44px;
}
.yfc-news-single__back-link:hover {
	color: var(--yfc-green);
}

.yfc-news-single__head {
	margin-bottom: 24px;
}

.yfc-news-single__meta {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 13px;
	color: var(--yfc-gray-600);
	margin-bottom: 10px;
}

.yfc-news-single__cat {
	background: var(--yfc-gray-100);
	color: var(--yfc-green-dark);
	padding: 2px 10px;
	border-radius: 999px;
	font-weight: 700;
}

.yfc-news-single__title {
	font-family: var(--yfc-font-jp);
	font-weight: 800;
	font-size: clamp(24px, 3vw, 32px);
	line-height: 1.4;
	color: var(--yfc-green-deep);
	margin: 0;
}

.yfc-news-single__thumb {
	aspect-ratio: 16 / 9;
	border-radius: var(--yfc-radius-md);
	overflow: hidden;
	background: var(--yfc-gray-100);
	margin-bottom: 28px;
}
.yfc-news-single__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* the_content() が出力するBlock Editorの標準要素向けTypography */
.yfc-news-single__content {
	font-size: 16px;
	line-height: 1.9;
	color: var(--yfc-text);
}
.yfc-news-single__content > * + * {
	margin-top: 1.4em;
}
.yfc-news-single__content h2 {
	font-size: 22px;
	font-weight: 800;
	color: var(--yfc-green-deep);
	line-height: 1.5;
}
.yfc-news-single__content h3 {
	font-size: 18px;
	font-weight: 700;
	color: var(--yfc-green-deep);
	line-height: 1.5;
}
.yfc-news-single__content a {
	color: var(--yfc-green);
	text-decoration: underline;
}
.yfc-news-single__content img {
	max-width: 100%;
	border-radius: var(--yfc-radius-sm);
	display: block;
}
.yfc-news-single__content ul,
.yfc-news-single__content ol {
	padding-left: 1.4em;
}
.yfc-news-single__content li + li {
	margin-top: 0.5em;
}
.yfc-news-single__content blockquote {
	border-left: 3px solid var(--yfc-green);
	padding-left: 16px;
	color: var(--yfc-gray-600);
}

@media (max-width: 767px) {
	.yfc-news-single {
		padding-block: 28px 48px;
	}
	.yfc-news-single__title {
		font-size: 22px;
	}
	.yfc-news-single__content {
		font-size: 15px;
	}
}
