/*
 * ニュース (第二弾) 用 CSS。pages.css の後に読み込む (archive.php / single.php)。
 *
 * Figma: andfactoryHPデザイン_2026 > NEWS (5161-67310)
 *   NEWS一覧: 年のプルダウン / NewsList / Pagination
 *   NEWS詳細: パンくず / 日付・タイトル・タグ / アイキャッチ / 本文 / Share
 */

/* ------------------------------------------------------------------
 * 一覧
 * ---------------------------------------------------------------- */
.news-list__inner {
	display: flex;
	flex-direction: column;
	gap: var(--af-content-gap);
}

/* タグ・日付のアーカイブ名 (旧テーマと同じく一覧の上に出す) */
.news-list__title {
	margin: 0;
	font-size: var(--af-fs-26);
	font-weight: 700;
	line-height: var(--af-lh-36);
	color: var(--af-fg);
}

.news-rows {
	display: flex;
	flex-direction: column;
}

.news-row + .news-row {
	border-top: 1px solid var(--af-border-sub);
}

.news-row__link {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 24px 0;
	color: inherit;
	text-decoration: none;
}

/* サムネイル: 横幅 410px 固定、縦は元画像の比率 (Figma の注記) */
.news-row__thumb {
	flex: none;
	width: 410px;
	overflow: hidden;
	border: 1px solid var(--af-border-sub);
	border-radius: 8px;
	background: var(--af-bg-inset);
}

.news-row__thumb img {
	display: block;
	width: 100%;
	height: auto;
	transition: transform 0.4s;
}

/* アイキャッチの無い記事 (16:9 の空き枠) */
.news-row__noimage {
	display: block;
	aspect-ratio: 16 / 9;
}

.news-row__link:hover .news-row__thumb img {
	transform: scale(1.03);
}

.news-row__link:hover .news-row__title {
	color: var(--af-fg-accent);
}

/* 日付・タイトルを上、タグを下に寄せる */
.news-row__body {
	flex: 1 1 0;
	min-width: 0;
	align-self: stretch;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 8px;
}

.news-row__main {
	display: flex;
	flex-direction: column;
}

.news-row__date {
	font-size: 14px;
	font-weight: 500;
	line-height: 28px;
	color: var(--af-fg-sub);
}

.news-row__title {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	overflow: hidden;
	font-size: 21px;
	font-weight: 700;
	line-height: 28px;
	color: var(--af-fg);
	word-break: break-word;
	transition: color 0.2s;
}

/* タグ (Figma: assets/NewsLabel) */
.news-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin: 0;
}

.news-tag {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 56px;
	min-height: 24px;
	padding: 0 8px;
	border-radius: 999px;
	background: var(--af-bg-accent);
	font-size: 12px;
	font-weight: 500;
	line-height: 24px;
	color: var(--af-cat-blue);
	white-space: nowrap;
}

/* ------------------------------------------------------------------
 * ページ送り (Figma: Pagination + 前後の矢印)
 * ---------------------------------------------------------------- */
.pager {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 40px;
}

.pager__pages {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 8px;
}

.pager__page {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	border: 1px solid var(--af-border-sub);
	border-radius: 8px;
	background: var(--af-bg);
	font-size: 14px;
	font-weight: 500;
	line-height: 20px;
	color: var(--af-fg);
	text-decoration: none;
	transition: background-color 0.2s;
}

a.pager__page:hover {
	background: var(--af-bg-inset);
}

.pager__page.is-current {
	border-color: var(--af-bg-accent-emphasis);
	background: var(--af-bg-accent-emphasis);
	color: #fff;
}

.pager__dots {
	display: flex;
	align-items: center;
	height: 32px;
	font-size: 12px;
	line-height: 24px;
	color: var(--af-fg);
}

.pager__arrow {
	flex: none;
	display: grid;
	place-items: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
}

.pager__arrow:hover {
	background: var(--af-bg-inset);
}

/* 1 ページ目の「前へ」は場所だけ取って見せない (Figma: opacity 0) */
.pager__arrow.is-hidden {
	visibility: hidden;
}

/* ------------------------------------------------------------------
 * 詳細
 * ---------------------------------------------------------------- */
/* 大見出しを出さずパンくずだけ (Figma: LowerHeader 非表示) */
.page-head--crumbs-only .breadcrumbs__item:last-child {
	min-width: 0;
	max-width: 100%;
}

.news-article__inner {
	max-width: 800px;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	gap: 64px;
}

.news-article__head {
	display: flex;
	flex-direction: column;
	gap: 16px;
	padding-bottom: 64px;
	border-bottom: 1px solid var(--af-border-sub);
	margin-bottom: 0;
}

.news-article__date {
	font-size: var(--af-fs-16);
	font-weight: 500;
	line-height: var(--af-lh-28);
	color: var(--af-fg-sub);
}

.news-article__title {
	margin: 0;
	font-size: var(--af-fs-26);
	font-weight: 700;
	line-height: var(--af-lh-36);
	color: var(--af-fg);
	word-break: break-word;
}

.news-article__eyecatch img {
	display: block;
	width: 100%;
	height: auto;
}

/* 本文 (ブロックエディタ / 旧エディタの HTML) */
.news-content {
	font-size: var(--af-fs-16);
	font-weight: 500;
	line-height: var(--af-lh-28);
	color: var(--af-fg);
	overflow-wrap: anywhere;
}

.news-content > * {
	margin-top: 0;
	margin-bottom: 0;
}

.news-content > * + * {
	margin-top: 32px;
}

.news-content p {
	margin-bottom: 0;
}

.news-content h2,
.news-content h3,
.news-content h4 {
	font-size: 21px;
	font-weight: 700;
	line-height: 28px;
	color: var(--af-fg);
}

.news-content h2 strong,
.news-content h3 strong {
	font-weight: inherit;
}

/* 区切り線 (Figma: 段落のまとまりの間の divider。上下 48px) */
.news-content hr,
.news-content .wp-block-separator {
	height: 0;
	margin: 48px 0;
	border: 0;
	border-top: 1px solid var(--af-border-sub);
	opacity: 1;
}

.news-content hr + * {
	margin-top: 0;
}

/* 「ドット」の区切り (エディタの区切りブロックのスタイル「ドット」)。
 * 上の線の指定 (高さ 0) が WordPress 標準の点の表示より強く、点が隠れていたので、線を消して点を出す (2026-11-11) */
.news-content .wp-block-separator.is-style-dots {
	height: auto;
	overflow: visible;
	border: 0;
	background: none;
	line-height: 1;
	text-align: center;
	color: var(--af-fg-sub);
}

.news-content .wp-block-separator.is-style-dots::before {
	content: "···";
	font-family: serif;
	font-size: 1.5em;
	letter-spacing: 2em;
	padding-left: 2em;
	color: currentColor;
}

.news-content ul,
.news-content ol {
	padding-left: 24px;
}

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

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

.news-content a {
	color: var(--af-fg-accent);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.news-content a:hover {
	text-decoration: none;
}

/* 画像: PC は幅 600px まで、SP は親の幅に合わせる。縦は元画像の比率 (Figma の注記) */
.news-content img {
	display: block;
	max-width: min(100%, 600px);
	height: auto;
	margin: 0 auto;
}

.news-content figure {
	margin-right: 0;
	margin-left: 0;
}

.news-content figcaption {
	margin-top: 8px;
	font-size: 12px;
	line-height: 24px;
	color: var(--af-fg-sub);
	text-align: center;
}

.news-content iframe {
	display: block;
	max-width: 100%;
	margin: 0 auto;
}

.news-content table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}

.news-content th,
.news-content td {
	padding: 8px 12px;
	border: 1px solid var(--af-border-sub);
	text-align: left;
}

/* シェア (Figma: Share。32px のアイコンを 16px 間隔) */
.news-share {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
}

.news-share a {
	display: block;
	transition: opacity 0.2s;
}

.news-share a:hover {
	opacity: 0.7;
}

.news-share img {
	display: block;
	width: 32px;
	height: 32px;
}

/* ------------------------------------------------------------------
 * <= 768px: SP
 * ---------------------------------------------------------------- */
@media (max-width: 768px) {
	/* 行はサムネイルを上に (Figma SP: 上下の区切りは 24px ずつ) */
	.news-row__link {
		flex-direction: column;
		align-items: stretch;
		gap: 8px;
		padding: 24px 0;
	}

	.news-row__thumb {
		width: 100%;
	}

	.news-row__body {
		gap: 16px;
	}

	.news-tags {
		gap: 8px;
	}

	/* ページ送りは番号を 3 つ + 先頭・末尾に減らし、ボタンを詰める */
	.pager {
		gap: 8px;
	}

	.pager__far {
		display: none;
	}

	.news-article__inner {
		gap: 40px;
	}

	.news-article__head {
		padding-bottom: 40px;
	}

	.news-content hr,
	.news-content .wp-block-separator {
		margin: 40px 0;
	}
}

@media (max-width: 360px) {
	.pager__pages {
		gap: 4px;
	}

	.pager__page {
		width: 36px;
		height: 36px;
	}
}
