/*
Theme Name: WH News
Theme URI: https://www.e-linez.com/
Author: E-Stream
Description: ニュースポータルテーマ。バナー掲載可能。
Version: 0.27.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: wh-news
*/

/* =========================================================
 * デザイントークン（ここを変えると全体の印象が変わります）
 * ========================================================= */
:root {
	--paper:       #faf8f4;   /* 地（温かみのある紙色） */
	--ink:         #1c1b19;   /* 文字（濃） */
	--ink-2:       #6f6a62;   /* 文字（淡） */
	--muted:       #9a958c;   /* 日付など */
	--line:        #e4dfd5;   /* 細罫 */
	--line-strong: #1c1b19;   /* 強い罫（見出し下・マストヘッド） */
	--accent:      #9b1c1c;   /* アクセント（新聞レッド／kickerのみ） */
	--shade:       #ece9e2;   /* 画像プレースホルダ */
	--serif: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP", serif;
	--sans:  -apple-system, "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
	--wrap: 1100px;
	/* サムネイル枠の比率。アイキャッチ画像の実サイズ（1024x538）に合わせてある。
	   ここと違う比率の画像は、枠を埋めるために はみ出た分が切り取られる（object-fit: cover）。
	   画像の作り方を変えたら、この1行だけ直せば一覧・トップの全サムネイルに反映される。 */
	--thumb-ratio: 1024 / 538;
}

/* =========================================================
 * ベース
 * ========================================================= */
* { box-sizing: border-box; }
body {
	margin: 0;
	font-family: var(--sans);
	color: var(--ink);
	background: var(--paper);
	line-height: 1.75;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

/* =========================================================
 * マストヘッド（新聞の題字）
 * ========================================================= */
.masthead__inner { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.masthead__top { padding: 0; text-align: center; }
.masthead__top .masthead__inner { padding: 0; }   /* バナーはコンテンツ幅、余った左右は背景色 */
.masthead__brand {
	margin: 0;
	font-family: var(--serif);
	font-size: 34px;
	font-weight: 600;
	letter-spacing: .06em;
}
/* 題字を画像にした場合：コンテンツ幅のバナー。左右の端を背景色へフェードさせて境目をなじませる */
.masthead__brand .custom-logo-link { display: block; line-height: 0; }
.masthead__brand img {
	display: block;
	width: 100%;
	height: auto;
	-webkit-mask-image: linear-gradient(to right, transparent 0, #000 130px, #000 calc(100% - 130px), transparent 100%);
	        mask-image: linear-gradient(to right, transparent 0, #000 130px, #000 calc(100% - 130px), transparent 100%);
}
.masthead__tag { margin: 7px 0 0; font-size: 12px; color: var(--ink-2); letter-spacing: .04em; }

.masthead { border-bottom: 1px solid var(--line-strong); }

/* =========================================================
 * グローバルなカテゴリーバー（題字下・全ページ共通）
 *   PC   … 横帯ナビ（トップを含む全ページで表示）
 *   スマホ … 横スクロールのチップバー（全ページで表示）
 *   現在地（表示中のカテゴリー／トップ）は is-active で色を付ける
 * ========================================================= */
.gnav { background: var(--paper); border-bottom: 1px solid var(--line-strong); }
.gnav__inner { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.gnav__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
}
.gnav__link {
	display: block;
	padding: 13px 16px;
	font-family: var(--sans);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: .04em;
	color: var(--ink);
	white-space: nowrap;
	transition: color .15s ease;
}
.gnav__link:hover { color: var(--accent); }
.gnav__item--home .gnav__link { color: var(--ink-2); }
/* 現在地（表示中のカテゴリー／トップ）のハイライト */
.gnav__link.is-active { color: var(--accent); font-weight: 700; }

/* 「もっと ▾」あふれメニュー（PC：1段に入りきらないカテゴリーを格納）
 * gnav.js が幅を測り、はみ出した項目だけを下のメニューへ移す。 */
.gnav__inner { position: relative; }          /* ドロップダウンの位置基準 */
.gnav__item--more { margin-left: auto; }       /* 「もっと」を行の右端へ寄せる */
.gnav__more-btn { background: none; border: 0; cursor: pointer; }
.gnav__more-caret { margin-left: 4px; font-size: 11px; }
.gnav__more-menu {
	position: absolute;
	top: 100%;
	right: 24px;                                /* .gnav__inner の左右パディングに合わせる */
	min-width: 200px;
	margin: 0;
	padding: 6px 0;
	list-style: none;
	background: var(--paper);
	border: 1px solid var(--line-strong);
	box-shadow: 0 10px 28px rgba(0,0,0,.14);
	z-index: 50;
	display: none;
}
.gnav__item--more.is-open .gnav__more-menu { display: block; }
.gnav__more-menu .gnav__item { display: block; margin: 0; }
.gnav__more-menu .gnav__link { padding: 9px 18px; white-space: nowrap; }

/* =========================================================
 * 本文の器 / 2カラム
 * ========================================================= */
.site-main { max-width: var(--wrap); margin: 0 auto; padding: 38px 24px 64px; }
.portal { display: grid; grid-template-columns: 1fr 300px; gap: 48px; align-items: start; }
.portal__main { min-width: 0; }
.portal__aside { min-width: 0; }

/* ---- 共通ラベル ---- */
.sec-label {
	font-family: var(--sans);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .14em;
	color: var(--ink);
	margin: 0 0 14px;
	padding-bottom: 9px;
	border-bottom: 2px solid var(--line-strong);
}
/* カテゴリの肩見出し（kicker） */
.cat-label {
	display: inline-block;
	font-family: var(--sans);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .1em;
	color: var(--accent);
	margin-bottom: 6px;
}
.meta-date {
	display: block;
	font-family: var(--sans);
	font-size: 12px;
	color: var(--muted);
	margin-top: 10px;
	letter-spacing: .03em;
}
.ph { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; background: var(--shade); color: #b3ada3; font-size: 12px; letter-spacing: .08em; }

/* =========================================================
 * リード（画像付き上位5件）
 * ========================================================= */
.hero { margin-bottom: 36px; }
.hero__thumb { display: block; aspect-ratio: var(--thumb-ratio); overflow: hidden; background: var(--shade); }
.hero__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.hero:hover .hero__thumb img { transform: scale(1.025); }
.hero__body { padding-top: 18px; max-width: 92%; }
.hero__title {
	font-family: var(--serif);
	font-size: 30px;
	line-height: 1.5;
	font-weight: 600;
	margin: 4px 0 12px;
	letter-spacing: .01em;
}
.hero__excerpt { font-size: 14.5px; color: var(--ink-2); margin: 0; line-height: 1.9; }

.lead__grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 32px 32px;
	margin-bottom: 54px;
	padding-top: 32px;
	border-top: 1px solid var(--line);
}
.lcard__thumb { display: block; aspect-ratio: var(--thumb-ratio); overflow: hidden; background: var(--shade); margin-bottom: 13px; }
.lcard__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.lcard:hover .lcard__thumb img { transform: scale(1.025); }
.lcard__title { font-family: var(--serif); font-size: 17px; line-height: 1.6; font-weight: 600; margin: 0; }

/* 見出しリンクの下線アニメーション */
.hero__title a, .lcard__title a {
	background-image: linear-gradient(currentColor, currentColor);
	background-size: 0 1px;
	background-position: 0 100%;
	background-repeat: no-repeat;
	transition: background-size .35s ease, color .2s ease;
}
.hero__title a:hover, .lcard__title a:hover { background-size: 100% 1px; color: var(--accent); }

/* =========================================================
 * レスポンシブ
 * ========================================================= */
@media (max-width: 860px) {
	.portal { grid-template-columns: 1fr; gap: 34px; }
	.masthead__brand { font-size: 27px; }
	.hero__title { font-size: 24px; }
	.hero__body { max-width: none; }

	/* カテゴリーバー：スマホは横スクロール表示にする */
	.gnav__inner { padding: 0; }
	.gnav__list {
		flex-wrap: nowrap;
		justify-content: flex-start;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;            /* Firefox：スクロールバーを隠す */
	}
	.gnav__list::-webkit-scrollbar { display: none; }   /* Chrome/Safari：同上 */
	.gnav__item { flex: 0 0 auto; }
	.gnav__link { padding: 12px 14px; }
}
@media (max-width: 560px) {
	.lead__grid { grid-template-columns: 1fr; gap: 28px; }
}

/* =========================================================
 * 個別記事（single.php）2段組み
 * ========================================================= */
.single-layout { display: grid; grid-template-columns: 1fr 300px; gap: 48px; align-items: start; }
.single-main { min-width: 0; }

/* 記事本文 */
.article__head { margin-bottom: 24px; }
.article__kicker { display: inline-block; font-family: var(--sans); font-size: 12px; font-weight: 700; letter-spacing: .1em; color: var(--accent); margin-bottom: 12px; }
.article__title { font-family: var(--serif); font-size: 30px; line-height: 1.5; font-weight: 600; margin: 0 0 16px; letter-spacing: .01em; }
.article__meta { font-family: var(--sans); font-size: 13px; color: var(--muted); padding-bottom: 18px; border-bottom: 2px solid var(--line-strong); }
.article__figure { margin: 26px 0 30px; }
.article__figure img { width: 100%; height: auto; display: block; }
.article__body { font-size: 16.5px; line-height: 2; color: #2a2a28; overflow-wrap: break-word; word-break: break-word; }
.article__body p { margin: 0 0 1.5em; }
.article__body h2 { font-family: var(--serif); font-size: 23px; line-height: 1.5; margin: 2em 0 .7em; padding-bottom: .35em; border-bottom: 1px solid var(--line); }
.article__body h3 { font-size: 18px; margin: 1.7em 0 .6em; }
.article__body img { max-width: 100%; height: auto; }
.article__body a { color: var(--accent); text-decoration: underline; }
.article__body ul, .article__body ol { margin: 0 0 1.5em; padding-left: 1.5em; }
.article__body li { margin-bottom: .4em; }
.article__body blockquote { margin: 1.6em 0; padding: .6em 1.3em; border-left: 3px solid var(--accent); color: var(--ink-2); background: #fbfaf7; }

/* パンくず */
.crumbs { font-size: 12px; color: var(--muted); margin-bottom: 18px; }
.crumbs a { color: var(--ink-2); }
.crumbs a:hover { color: var(--accent); }
.crumbs__sep { margin: 0 8px; color: #cfc8bb; }

/* タグ（装飾チップ） */
.article__tags { margin-top: 36px; padding-top: 22px; border-top: 1px solid var(--line); }
.article__tags-label { display: block; font-size: 11px; font-weight: 700; letter-spacing: .12em; color: var(--ink); margin-bottom: 12px; }
.tag-chips { display: flex; flex-wrap: wrap; gap: 9px; }
.tag-chip { font-size: 12.5px; color: var(--ink-2); border: 1px solid var(--line); padding: 6px 14px; border-radius: 999px; transition: color .15s, background .15s, border-color .15s; }
.tag-chip:hover { color: #fff; background: var(--accent); border-color: var(--accent); }

/* シェアボタン */
.share { margin-top: 28px; }
.share__label { display: block; font-size: 11px; font-weight: 700; letter-spacing: .12em; color: var(--ink); margin-bottom: 12px; }
.share__btns { display: flex; flex-wrap: wrap; gap: 10px; }
.share__btn { font-size: 13px; font-weight: 600; color: #fff; padding: 10px 18px; border-radius: 4px; line-height: 1; transition: opacity .15s; }
.share__btn:hover { opacity: .85; }
.share__btn--x { background: #111111; }
.share__btn--fb { background: #1877f2; }
.share__btn--line { background: #06c755; }

/* 前後ナビ */
.post-nav { display: flex; margin: 40px 0 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.post-nav a { flex: 1; padding: 18px 6px; min-width: 0; }
.post-nav__next { text-align: right; border-left: 1px solid var(--line); }
.post-nav a span { display: block; font-size: 11px; color: var(--accent); font-weight: 700; letter-spacing: .06em; margin-bottom: 6px; }
.post-nav a b { display: block; font-family: var(--serif); font-size: 15px; font-weight: 600; line-height: 1.5; color: var(--ink); }
.post-nav a:hover b { color: var(--accent); }

/* バナー広告（PC=サイド / スマホ=本文内 で出し分け） */
.ad-banner { margin-bottom: 28px; }
.ad-banner a { display: block; }
.ad-banner img { display: block; width: 100%; height: auto; }
.ad-banner__ph { display: flex; align-items: center; justify-content: center; aspect-ratio: 6 / 5; background: var(--shade); border: 1px dashed #cdc6b9; color: #b3ada3; font-size: 12px; letter-spacing: .12em; }

/* スマホ用：本文内インライン広告。PC ではサイド広告を使うので隠す */
.ad-banner--inline { display: none; }
/* 広告だと分かるよう小さく「PR」ラベルを付ける */
.ad-banner--inline::before {
	content: "PR";
	display: block;
	font-family: var(--sans);
	font-size: 10px;
	font-weight: 700;
	letter-spacing: .14em;
	color: var(--muted);
	margin-bottom: 6px;
}

/* サイドの記事リスト（テキストのみ。トップは show_cat でカテゴリ名つき） */
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-item { border-bottom: 1px solid var(--line); }
.mini-item a { display: block; padding: 11px 0; }
.mini-item__cat { display: block; font-family: var(--sans); font-size: 10.5px; font-weight: 700; letter-spacing: .06em; color: var(--accent); margin-top: 5px; }
.mini-item__title { display: block; font-size: 13.5px; line-height: 1.55; color: var(--ink); }
.mini-item a:hover .mini-item__title { color: var(--accent); }
.mini-item__date { display: block; font-size: 11px; color: var(--muted); margin-top: 4px; }

.single__back { margin: 40px 0 0; font-size: 14px; }
.single__back a { color: var(--accent); }

/* レスポンシブ：1カラムに */
@media (max-width: 860px) {
	.single-layout { grid-template-columns: 1fr; gap: 36px; }
	/* スマホでは aside が最下部に落ちるので、サイド広告は隠して本文側(inline)に出す（トップ・記事 共通） */
	.ad-banner--side { display: none; }
	.ad-banner--inline { display: block; margin: 34px 0; }
}

/* =========================================================
 * 一覧ページの見出し（カテゴリ / 検索など）
 * ========================================================= */
.page-head { margin-bottom: 28px; padding-bottom: 14px; border-bottom: 2px solid var(--line-strong); }
.page-head__title { font-family: var(--serif); font-size: 24px; font-weight: 600; margin: 0; }

/* =========================================================
 * カードグリッド（アーカイブ / index.php 用）
 * ========================================================= */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
@media (max-width: 720px) { .card-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .card-grid { grid-template-columns: 1fr; } }
.card { background: transparent; border: 0; }
.card__thumb { aspect-ratio: var(--thumb-ratio); background: var(--shade); overflow: hidden; margin-bottom: 11px; }
.card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.card__body { padding: 0; }
.card__title { font-family: var(--serif); font-size: 16px; font-weight: 600; line-height: 1.6; margin: 0 0 6px; }
.card__date { font-size: 12px; color: var(--muted); }

/* =========================================================
 * ページ送り（トップ2ページ目以降・カテゴリ等の一覧 共通）
 * ========================================================= */
/* WordPress標準の「読み上げ専用テキスト」を見た目だけ隠す */
.screen-reader-text {
	position: absolute;
	width: 1px; height: 1px;
	margin: -1px; padding: 0;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	word-wrap: normal;
	border: 0;
}

.pagination { margin-top: 44px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.pagination .page-numbers {
	display: inline-block;
	min-width: 40px;
	padding: 9px 11px;
	text-align: center;
	font-family: var(--sans);
	font-size: 13.5px;
	line-height: 1;
	border: 1px solid var(--line);
	background: #fff;
	color: var(--ink);
}
.pagination a.page-numbers:hover { border-color: var(--ink-2); }
.pagination .page-numbers.current { background: var(--line-strong); border-color: var(--line-strong); color: #fff; }
.pagination .page-numbers.dots { border: 0; background: transparent; color: var(--muted); }

/* トップ1ページ目の「もっと見る」（2ページ目＝全記事一覧へ） */
.more-link { margin: 36px 0 0; text-align: center; }
.more-link a {
	display: inline-block;
	padding: 12px 56px;
	border: 1px solid var(--line-strong);
	font-family: var(--sans);
	font-size: 13.5px;
	font-weight: 600;
	letter-spacing: .12em;
	color: var(--ink);
}
.more-link a:hover { background: var(--line-strong); color: var(--paper); }

/* =========================================================
 * 404（ページが見つからない）
 * ========================================================= */
.notfound__lead { font-size: 15px; color: var(--ink-2); line-height: 1.9; margin: 0 0 24px; }
.notfound__search { max-width: 480px; margin: 0 0 44px; }
.notfound__search .search-form { display: flex; gap: 8px; }
.notfound__search .search-field { flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); font: inherit; background: #fff; }
.notfound__search .search-submit { flex: 0 0 auto; padding: 10px 18px; border: 0; background: var(--ink); color: #fff; font-weight: 600; cursor: pointer; }
.notfound__search .search-submit:hover { background: var(--accent); }
.notfound__back { margin: 40px 0 0; font-size: 14px; }
.notfound__back a { color: var(--accent); }

/* =========================================================
 * フッター
 * ========================================================= */
.site-footer { background: var(--paper); border-top: 1px solid var(--line-strong); margin-top: 44px; }
.site-footer__inner { max-width: var(--wrap); margin: 0 auto; padding: 28px 24px; font-size: 12.5px; color: var(--muted); }
