/**
 * 新着情報 カテゴリ別タブ
 *
 * 配色・サイズはテーマ（x-t9 + グローバルスタイル）が出力する CSS 変数を参照する。
 * 第2引数のフォールバック値は変数が取れなかった場合の保険であり、
 * 実際の値はサイトエディターの「スタイル」で管理される。
 *
 * @package satooya-custom
 */

.satooya-news-tabs {
	--satooya-border: var( --wp--preset--color--border-normal, rgba( 0, 0, 0, 0.1 ) );
	--satooya-text: var( --wp--preset--color--text-normal, #333 );
	--satooya-muted: var( --wp--preset--color--text-secondary, rgba( 0, 0, 0, 0.5 ) );
	--satooya-accent: var( --wp--preset--color--primary, #5e89ca );
	--satooya-new: #ff0000;

	font-size: var( --wp--preset--font-size--small, 13.91px );
	line-height: 1.6;
}

/* -------------------------------------------------- タブラベル */

.satooya-news-tabs__labels {
	display: flex;
	justify-content: center;
	gap: 0.25em;
	margin: 0 0 1.25em;
	overflow-x: auto;
	scrollbar-width: thin;
	-webkit-overflow-scrolling: touch;
}

.satooya-news-tabs__label {
	flex: 0 0 auto;
	-webkit-appearance: none;
	appearance: none;
	margin: 0;
	padding: 0.65em 1.3em;
	border: 0;
	border-bottom: 2px solid transparent;
	background: transparent;
	color: var( --satooya-muted );
	font: inherit;
	font-weight: 600;
	white-space: nowrap;
	cursor: pointer;
	transition: color 0.2s ease, border-color 0.2s ease;
}

.satooya-news-tabs__label:hover {
	color: var( --satooya-accent );
}

.satooya-news-tabs__label:focus-visible {
	outline: 2px solid var( --satooya-accent );
	outline-offset: 2px;
}

.satooya-news-tabs__label.is-active {
	color: var( --satooya-accent );
	border-bottom-color: var( --satooya-accent );
}

/* -------------------------------------------------- 投稿リスト */

.satooya-news-list {
	margin: 0;
	padding: 0;
	list-style: none;
	border-top: 1px solid var( --satooya-border );
}

.satooya-news-list__item {
	display: flex;
	align-items: center;
	gap: 0 1.5em;
	padding: 0.9em 0;
	border-bottom: 1px solid var( --satooya-border );
}

.satooya-news-list__meta {
	display: flex;
	flex: 0 0 300px;
	align-items: center;
	gap: 0 1em;
	min-width: 0;
}

.satooya-news-list__date {
	flex: 0 0 120px;
	color: var( --satooya-muted );
}

.satooya-news-list__cat {
	flex: 1 1 auto;
	min-width: 0;
	color: var( --satooya-text );
	text-decoration: none;
	overflow-wrap: anywhere;
}

.satooya-news-list__cat:hover {
	text-decoration: underline;
}

.satooya-news-list__body {
	display: flex;
	flex: 1 1 auto;
	align-items: center;
	gap: 0 0.5em;
	min-width: 0;
}

.satooya-news-list__title {
	color: var( --satooya-text );
	text-decoration: none;
	overflow-wrap: anywhere;
}

.satooya-news-list__title:hover {
	text-decoration: underline;
}

.satooya-news-list__new {
	flex: 0 0 auto;
	color: var( --satooya-new );
	font-weight: 700;
}

.satooya-news-list__empty {
	margin: 0;
	padding: 2em 0;
	border-bottom: 1px solid var( --satooya-border );
	color: var( --satooya-muted );
	text-align: center;
}

/* -------------------------------------------------- 続きを見る */

/*
 * トップページの他のボタン（コアのボタンブロック・ロゴオレンジ）と同じ見た目にする。
 * 背景 custom-logo-orange、角丸 100px、上下 1rem・左右 2.5rem、字間 1px。
 * 横幅は assets/top-buttons.css の最小幅で揃える。
 */
.satooya-news-tabs__more {
	margin-top: 2em;
	text-align: center;
}

.satooya-news-tabs__more-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 1rem 2.5rem;
	border-radius: 100px;
	background: var( --wp--preset--color--custom-logo-orange, #f29100 );
	color: #fff;
	font-family: "Noto Sans JP", sans-serif;
	font-size: 16px;
	font-weight: 500;
	line-height: 28px; /* コアのボタンと同じ（高さ 60px） */
	letter-spacing: 1px;
	text-decoration: none;
	transition: opacity 0.2s ease;
}

.satooya-news-tabs__more-link:hover {
	color: #fff;
	opacity: 0.85;
	text-decoration: none;
}

.satooya-news-tabs__more-link:focus-visible {
	outline: 2px solid var( --satooya-accent );
	outline-offset: 2px;
}

/* -------------------------------------------------- レスポンシブ */

/*
 * 現行の core/columns と同じブレークポイント（782px）で
 * 「日付＋カテゴリー」と「タイトル」を縦積みにする。
 */
@media ( max-width: 781px ) {

	.satooya-news-list__item {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.3em 0;
	}

	.satooya-news-list__meta {
		flex: 0 0 auto;
		width: 100%;
	}

	.satooya-news-list__body {
		width: 100%;
	}

	.satooya-news-tabs__labels {
		justify-content: flex-start;
	}

	.satooya-news-tabs__label {
		padding: 0.65em 1em;
	}
}

/* 動きを減らす設定を尊重する */
@media ( prefers-reduced-motion: reduce ) {

	.satooya-news-tabs__label {
		transition: none;
	}
}

/* -------------------------------------------------- 種別ラベル（「すべて」タブのみ）
 * 2026-09：タブを種類別（お知らせ／イベント／コラム）に変更。「すべて」では各行の種類を示す。
 * 色はサイトの配色から：お知らせ＝帯・フッターの青、イベント＝ボタンのオレンジ、コラム＝コラムの主色。
 */
.satooya-news-list__meta:has( .satooya-news-list__type ) {
	flex-basis: 390px;
}

.satooya-news-list__type {
	flex: 0 0 auto;
	display: inline-block;
	min-width: 5.2em;
	padding: 2px 8px;
	border-radius: 100px;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 1.6;
	text-align: center;
}

.satooya-news-list__type--notice {
	background: var( --wp--preset--color--primary, #5e89ca );
}

.satooya-news-list__type--event {
	background: var( --wp--preset--color--custom-logo-orange, #f29100 );
}

.satooya-news-list__type--column {
	background: #b8505a;
}

@media ( max-width: 767px ) {
	.satooya-news-list__meta:has( .satooya-news-list__type ) {
		flex-basis: auto;
	}
}

/* -------------------------------------------------- 地域・分類の括弧書き（タイトルの後ろ）
 * 地域カテゴリー（コラムは分類）をタイトル末尾に「（全県）」の形で添える。タイトルより少しだけ薄く。
 * 左の列は日付＋種別ラベルだけになるので幅を詰める。
 */
.satooya-news-list__area {
	margin-left: 0.25em;
	color: #7a7a7a;
	font-size: 0.92em;
}

.satooya-news-list__meta,
.satooya-news-list__meta:has( .satooya-news-list__type ) {
	flex-basis: 210px;
}

@media ( max-width: 767px ) {
	.satooya-news-list__meta,
	.satooya-news-list__meta:has( .satooya-news-list__type ) {
		flex-basis: auto;
	}
}

/* /information/ の一覧（[satooya_news_archive]）：タブはリンク、下にページ送り */
.satooya-news-archive .satooya-news-tabs__label {
	text-decoration: none;
}
.satooya-news-archive__pager {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin-top: 32px;
}
.satooya-news-archive__pager .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 12px;
	border: 1px solid var( --satooya-border );
	border-radius: 999px;
	color: inherit;
	text-decoration: none;
	font-size: 14px;
}
.satooya-news-archive__pager .page-numbers.current {
	background: var( --satooya-accent );
	border-color: var( --satooya-accent );
	color: #fff;
}
.satooya-news-archive__pager a.page-numbers:hover {
	border-color: var( --satooya-accent );
	color: var( --satooya-accent );
}
.satooya-news-archive__pager .dots {
	border: 0;
}

/* /information/ のパンくず（ホーム > 新着情報 > お知らせ） */
.satooya-news-archive__breadcrumb ol {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 0;
	margin: 0 0 24px;
	padding: 0;
	list-style: none;
	font-size: 13px;
	color: var( --wp--preset--color--text-secondary, rgba( 0, 0, 0, 0.5 ) );
}
.satooya-news-archive__breadcrumb li + li::before {
	content: "›";
	margin: 0 8px;
}
.satooya-news-archive__breadcrumb a {
	color: inherit;
	text-decoration: none;
}
.satooya-news-archive__breadcrumb a:hover {
	text-decoration: underline;
}
