/*
Theme Name: renews-theme（宅シグナル）
Theme URI: https://news.live-tech.work/
Description: 不動産業務ニュース「宅シグナル」のブロックテーマ。デザイン基本仕様 v1.0、検索・関連記事・閲覧改善 v2.1、SEO・GEO v2.2、ブランド正本 v1.0 に準拠。データ・検索・関連記事・SEO出力・公開ゲートはプラグイン renews-core が担当します。
Author: 宅シグナル編集部
Version: 0.1.0
Requires at least: 6.6
Tested up to: 6.8
Requires PHP: 8.1
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: renews-theme
Tags: block-patterns, full-site-editing, news, two-columns, accessibility-ready
*/

/*
 * 色・文字・余白は theme.json のプリセットを使う。ここではレイアウトと部品の見た目だけを定義する。
 * 画面幅の確認対象：320 / 360 / 390 / 768 / 1024 / 1440px（デザイン v1.0 §5）。
 * ページ全体の横スクロールは禁止。横スクロールは比較表など表の内部だけ。
 */

:root {
	--rt-slate: var(--wp--preset--color--deep-slate);
	--rt-slate-dark: var(--wp--preset--color--deep-slate-dark);
	--rt-teal: var(--wp--preset--color--signal-teal);
	--rt-teal-text: var(--wp--preset--color--teal-text);
	--rt-teal-tint: var(--wp--preset--color--teal-tint);
	--rt-mint: var(--wp--preset--color--mint);
	--rt-gold: var(--wp--preset--color--gold);
	--rt-gold-text: var(--wp--preset--color--gold-text);
	--rt-gold-tint: var(--wp--preset--color--gold-tint);
	--rt-muted: var(--wp--preset--color--muted);
	--rt-paper: var(--wp--preset--color--paper);
	--rt-edge: var(--wp--preset--color--edge);
	--rt-radius: var(--wp--custom--radius, 10px);
	--rt-aside: var(--wp--custom--aside-width, 300px);
}

html { scroll-behavior: smooth; }
body { overflow-wrap: break-word; line-break: strict; -webkit-text-size-adjust: 100%; }
img { max-width: 100%; height: auto; }
:where(a, button, input, select, summary, [tabindex]):focus-visible { outline: 3px solid var(--rt-gold); outline-offset: 2px; }
:where(.wp-site-blocks) > * { margin-block-start: 0; }
[id] { scroll-margin-top: 16px; }

/* 見出しは意味の切れ目で折り返す（対応ブラウザのみ） */
h1, h2, h3, .wp-block-post-title { word-break: auto-phrase; text-wrap: pretty; }

/* ==========================================================
 * ヘッダー
 * ========================================================== */
.site-topstrip { background: var(--rt-paper); border-bottom: 1px solid var(--rt-edge); font-size: 12px; color: var(--rt-muted); }
.site-topstrip__inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 32px; }
.site-topstrip__tagline { margin: 0; }
.site-topstrip__tagline strong { color: var(--rt-teal-text); letter-spacing: .08em; }
.renews-site-links--header ul { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; padding: 0; list-style: none; }
.renews-site-links--header a { color: var(--rt-muted); text-decoration: none; }
.renews-site-links--header a:hover { color: var(--rt-teal-text); text-decoration: underline; }

.site-masthead { background: var(--rt-paper); }
.site-masthead__inner { display: flex; align-items: center; gap: 24px; min-height: 96px; padding-block: 12px; }
.site-identity { display: block; flex: 0 0 auto; line-height: 0; }
.site-identity img { width: auto; height: 60px; }
.site-masthead__note { margin: 0 auto 0 0; padding-left: 20px; border-left: 1px solid var(--rt-edge); font-size: 12px; line-height: 1.7; color: var(--rt-muted); }

.site-search.wp-block-search { margin: 0; min-width: 260px; }
.wp-block-search__inside-wrapper { border: 1px solid #c3d3d9; border-radius: 7px; overflow: hidden; background: #f5f8f9; padding: 0 !important; }
.wp-block-search__input { border: 0 !important; background: transparent; min-height: 44px; padding: 8px 12px; font-size: 15px; min-width: 0; }
.wp-block-search__button { margin: 0 !important; border-radius: 0 !important; min-height: 44px; padding: 0 18px; font-size: 14px; white-space: nowrap; }

.site-mainnav { background: var(--rt-slate-dark); }
.renews-category-nav ul { display: flex; margin: 0; padding: 0; list-style: none; overflow-x: auto; scrollbar-width: none; }
.renews-category-nav ul::-webkit-scrollbar { display: none; }
.renews-category-nav a { display: flex; align-items: center; min-height: 48px; padding: 0 16px; border-bottom: 3px solid transparent; color: #e4ecf2; font-size: 14px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.renews-category-nav a:hover, .renews-category-nav a[aria-current] { color: #fff; background: #1d4560; border-bottom-color: var(--rt-mint); }

.site-audience { background: var(--rt-paper); border-bottom: 1px solid var(--rt-edge); }
.renews-business-nav { display: flex; align-items: center; gap: 10px 14px; min-height: 58px; padding-block: 8px; flex-wrap: wrap; }
.renews-business-nav__label { font-size: 13px; font-weight: 800; color: var(--rt-slate); }
.renews-business-nav__tip { margin-left: auto; font-size: 12px; color: var(--rt-muted); }

/* ==========================================================
 * 共通
 * ========================================================== */
.site-main { padding-block: 28px 56px; }
.site-main > * + * { margin-block-start: 28px; }
.renews-kicker { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 11px; letter-spacing: .12em; font-weight: 800; color: var(--rt-teal-text); }
.renews-kicker::before { content: ""; width: 16px; height: 3px; background: var(--rt-teal); }

.renews-breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 2px 0; margin: 0; padding: 0; list-style: none; font-size: 12px; color: var(--rt-muted); }
.renews-breadcrumbs li + li::before { content: "›"; margin: 0 8px; color: #9aabb6; }
.renews-breadcrumbs a { color: var(--rt-muted); }

.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 14px; padding-bottom: 10px; border-bottom: 2px solid var(--rt-slate); }
.section-title h2 { margin: 0; font-size: 21px; }
.section-title__more { margin: 0; font-size: 13px; font-weight: 700; }
.section-title__more a { text-decoration: none; }

.layout-2col { display: grid; grid-template-columns: minmax(0, 1fr) var(--rt-aside); gap: 28px; align-items: start; }
.layout-2col__main, .layout-2col__aside { min-width: 0; }
.layout-2col__main > * + * { margin-block-start: 40px; }
.layout-2col__aside { display: grid; gap: 16px; }

.sidepanel { margin: 0; padding: 18px; border: 1px solid var(--rt-edge); border-radius: 9px; background: var(--rt-paper); }
.sidepanel__title { margin: 0 0 12px; padding-bottom: 10px; border-bottom: 1px solid var(--rt-edge); font-size: 16px; }
.sidepanel--details summary { cursor: pointer; font-weight: 800; color: var(--rt-slate); min-height: 32px; }
.sidepanel--details p { margin: 8px 0 0; font-size: 13px; color: var(--rt-muted); }
.checkpoints { margin: 0; display: grid; gap: 14px; }
.checkpoints > div { padding-left: 11px; border-left: 3px solid var(--rt-gold); }
.checkpoints dt { font-size: 13px; font-weight: 800; color: var(--rt-gold-text); }
.checkpoints dd { margin: 2px 0 0; font-size: 13px; color: #4b6576; }

/* ==========================================================
 * トップ
 * ========================================================== */
.front-intro__title { margin: 6px 0 8px; font-size: clamp(24px, 2vw + 14px, 30px); }
.front-intro__lead { margin: 0; max-width: 46em; font-size: 14px; color: var(--rt-muted); }

.find-news { padding: 22px 24px; border: 1px solid #cfe5e0; border-radius: var(--rt-radius); background: linear-gradient(180deg, var(--rt-teal-tint), var(--rt-paper)); }
.find-news__title { margin: 0 0 4px; font-size: 20px; }
.find-news__lead { margin: 0 0 12px; font-size: 13px; color: var(--rt-muted); }
.find-news__search.wp-block-search { margin: 0; }
.find-news__search .wp-block-search__inside-wrapper { background: var(--rt-paper); }
.find-news__search .wp-block-search__input { min-height: 52px; font-size: 16px; }
.find-news__themes { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0 0; font-size: 13px; }
.find-news__themes strong { color: var(--rt-slate); margin-right: 4px; }
.find-news__themes a { padding: 4px 12px; border: 1px solid var(--rt-edge); border-radius: 999px; background: var(--rt-paper); text-decoration: none; font-weight: 700; }

.front-featured { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 16px; }
.front-featured:not(:has(.wp-block-post)) { display: none; }
.front-hero .wp-block-post-template, .front-stack .wp-block-post-template { margin: 0; padding: 0; list-style: none; }
.front-hero .wp-block-post { overflow: hidden; height: 100%; border: 1px solid var(--rt-edge); border-radius: var(--rt-radius); background: var(--rt-paper); }
.front-hero .wp-block-post-featured-image { margin: 0; }
.front-hero__body { padding: 20px 24px 24px; }
.front-hero__title { margin: 10px 0 8px; font-size: clamp(21px, 1.4vw + 14px, 27px); font-family: var(--wp--preset--font-family--serif); }
.front-hero__title a, .front-stack .wp-block-post-title a, .news-card__title a, .news-row__title a { color: var(--rt-slate); text-decoration: none; }
.front-hero__title a:hover, .front-stack .wp-block-post-title a:hover, .news-card__title a:hover, .news-row__title a:hover { color: var(--rt-teal-text); text-decoration: underline; }
.front-stack .wp-block-post-template { display: grid; gap: 14px; height: 100%; }
.front-stack .wp-block-post { display: grid; grid-template-columns: 42% minmax(0, 1fr); overflow: hidden; border: 1px solid var(--rt-edge); border-radius: var(--rt-radius); background: var(--rt-paper); }
.front-stack .wp-block-post-featured-image { margin: 0; height: 100%; }
.front-stack .wp-block-post-featured-image img { height: 100%; object-fit: cover; }
.front-stack__body { padding: 14px 16px; min-width: 0; }
.front-stack .wp-block-post-title { margin: 8px 0 0; font-size: 16px; }

.news-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.news-card { height: 100%; overflow: hidden; border: 1px solid var(--rt-edge); border-radius: 9px; background: var(--rt-paper); }
.news-card .wp-block-post-featured-image { margin: 0; }
.news-card__body { padding: 14px 16px 18px; }
.news-card__title { margin: 8px 0 6px; font-size: 17px; }
.news-card .wp-block-post-excerpt__excerpt, .news-row .wp-block-post-excerpt__excerpt { margin: 0; }

.guide-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.guide-card { display: flex; gap: 12px; align-items: flex-start; height: 100%; padding: 16px; border: 1px solid var(--rt-edge); border-radius: 8px; background: var(--rt-paper); color: inherit; text-decoration: none; }
a.guide-card:hover { border-color: var(--rt-mint); background: #f2fbf8; }
.guide-card__icon { flex: 0 0 32px; height: 32px; display: grid; place-items: center; border-radius: 7px; background: var(--rt-teal-tint); color: var(--rt-teal-text); font-weight: 800; }
.guide-card__text strong { display: block; color: var(--rt-slate); }
.guide-card__text span { display: block; font-size: 13px; line-height: 1.6; color: var(--rt-muted); }

/* ==========================================================
 * 一覧・検索
 * ========================================================== */
.archive-head h1, .archive-head .wp-block-query-title { margin: 0 0 6px; font-size: clamp(24px, 1.6vw + 14px, 30px); }
.archive-head .wp-block-term-description { max-width: 52em; font-size: 14px; color: var(--rt-muted); }
.archive-head .wp-block-term-description p { margin: 0; }
.news-list { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.news-row { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px; padding: 12px; border: 1px solid var(--rt-edge); border-radius: 9px; background: var(--rt-paper); }
.news-row:not(:has(.wp-block-post-featured-image)) { grid-template-columns: minmax(0, 1fr); }
.news-row .wp-block-post-featured-image { margin: 0; }
.news-row .wp-block-post-featured-image img { border-radius: 6px; }
.news-row__body { min-width: 0; padding-block: 4px; }
.news-row__title { margin: 8px 0 6px; font-size: 18px; }
.wp-block-query-pagination { margin-top: 24px; gap: 8px; font-size: 14px; }
.wp-block-query-pagination a, .wp-block-query-pagination .current { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 10px; border: 1px solid var(--rt-edge); border-radius: 6px; background: var(--rt-paper); text-decoration: none; }
.wp-block-query-pagination .current { background: var(--rt-slate); border-color: var(--rt-slate); color: #fff; }

/* ==========================================================
 * 記事詳細
 * ========================================================== */
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) var(--rt-aside); gap: 28px; align-items: start; }
.article-panel { min-width: 0; overflow: hidden; border: 1px solid var(--rt-edge); border-radius: 9px; background: var(--rt-paper); }
.article-header { padding: 28px 34px 20px; }
.article-header > * + * { margin-block-start: 12px; }
.article-title { margin: 0; font-size: var(--wp--preset--font-size--xx-large); }
.article-panel > .renews-status-banner { margin: 0 34px 16px; }
.article-photo { margin: 0; }
.article-photo img { width: 100%; }
.article-body { padding: 8px 34px 36px; }
.article-type-note { margin: 16px 0; padding: 10px 14px; border-radius: 6px; background: #f3f6f7; font-size: 13px; color: #42596a; }
.article-type-note--alert { background: var(--rt-gold-tint); color: var(--rt-gold-text); }

.renews-readable { max-width: 720px; font-size: 16px; line-height: 1.95; }
.renews-readable > * { margin-block: 0 1.25em; }
.renews-readable h2 { margin: 2.2em 0 .9em; padding-bottom: 10px; border-bottom: 1px solid var(--rt-edge); font-size: var(--wp--preset--font-size--x-large); }
.renews-readable h3 { margin: 1.8em 0 .6em; font-size: var(--wp--preset--font-size--large); }
.renews-readable ul, .renews-readable ol { padding-left: 1.4em; }
.renews-readable figure { margin-inline: 0; }
.renews-readable .wp-block-table { overflow-x: auto; }
.renews-readable .wp-block-table table { min-width: 520px; }
.renews-readable blockquote { margin-inline: 0; padding: 4px 0 4px 16px; color: #42596a; }
.article-trust { margin: 28px 0 0; padding-top: 16px; border-top: 1px solid var(--rt-edge); font-size: 13px; color: var(--rt-muted); }
.article-trust a { margin-left: 6px; }

.article-aside { display: grid; gap: 16px; min-width: 0; position: sticky; top: 16px; }
.article-aside .renews-labels { flex-direction: column; align-items: flex-start; }
.admin-bar .article-aside { top: 48px; }
.article-layout .renews-toc--mobile { display: none; }

.renews-related { padding-top: 8px; }
.renews-related__heading { font-size: 21px; }

/* ==========================================================
 * 固定ページ・フッター
 * ========================================================== */
.page-panel { padding: 28px 34px 36px; border: 1px solid var(--rt-edge); border-radius: 9px; background: var(--rt-paper); }
.page-panel .wp-block-post-title { margin-top: 0; }

.site-footer { margin-top: 0; padding-block: 40px 24px; background: var(--rt-slate-dark); color: #c9d8df; font-size: 13px; }
.site-footer a { color: #e4eef2; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer__grid { display: grid; grid-template-columns: 1.5fr 2fr; gap: 32px; }
.site-footer__logo img { width: 200px; height: auto; }
.site-footer__brand p { margin: 12px 0 0; color: #aabdc7; }
.renews-site-links--footer { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.renews-site-links__title { margin: 0 0 10px; font-size: 15px; color: #f4fbff; }
.renews-site-links--footer ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.site-footer__fine { margin: 28px 0 0; padding-top: 14px; border-top: 1px solid #345064; font-size: 12px; color: #aabdc7; }

/* ==========================================================
 * レスポンシブ
 * ========================================================== */
@media (max-width: 1100px) {
	:root { --rt-aside: 280px; }
	.site-masthead__note { display: none; }
	.front-stack .wp-block-post { grid-template-columns: 36% minmax(0, 1fr); }
}

@media (max-width: 860px) {
	.layout-2col, .article-layout { grid-template-columns: minmax(0, 1fr); }
	.article-aside { position: static; }
	.article-aside .renews-toc--aside { display: none; }
	.article-layout .renews-toc--mobile { display: block; }
	.front-featured { grid-template-columns: minmax(0, 1fr); }
	.front-stack .wp-block-post-template { grid-template-columns: 1fr 1fr; }
	.front-stack .wp-block-post { grid-template-columns: minmax(0, 1fr); }
	.guide-cards { grid-template-columns: minmax(0, 1fr); }
	.site-footer__grid { grid-template-columns: minmax(0, 1fr); }
	.renews-business-nav__tip { margin-left: 0; flex-basis: 100%; }
	.renews-business-nav .renews-chips { flex-wrap: nowrap; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
}

@media (max-width: 600px) {
	.site-topstrip__tagline { display: none; }
	.site-topstrip__inner { justify-content: flex-start; }
	.site-masthead__inner { flex-wrap: wrap; gap: 10px; min-height: 0; }
	.site-identity img { height: 46px; }
	.site-search.wp-block-search { flex: 1 1 100%; min-width: 0; }
	.news-grid { grid-template-columns: minmax(0, 1fr); }
	.front-stack .wp-block-post-template { grid-template-columns: minmax(0, 1fr); }
	.front-hero__body { padding: 16px; }
	.news-card { display: grid; grid-template-columns: 38% minmax(0, 1fr); }
	.news-card:not(:has(.wp-block-post-featured-image)) { grid-template-columns: minmax(0, 1fr); }
	.news-card .wp-block-post-featured-image img { height: 100%; object-fit: cover; }
	.news-card__body { padding: 10px 12px; }
	.news-card__title, .news-row__title { font-size: 15px; }
	.news-card .wp-block-post-excerpt, .news-row .wp-block-post-excerpt { display: none; }
	.news-row { grid-template-columns: 36% minmax(0, 1fr); gap: 10px; padding: 8px; }
	.article-header, .article-body, .page-panel { padding-inline: 16px; }
	.article-panel > .renews-status-banner { margin-inline: 16px; }
	.find-news { padding: 16px; }
	.renews-site-links--footer { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 360px) {
	.news-card, .news-row { grid-template-columns: minmax(0, 1fr); }
	.wp-block-search__button { padding: 0 12px; }
}

/* ==========================================================
 * 印刷：広告・ナビ・補助UIを出さず、本文・表・出典を読みやすく
 * ========================================================== */
@media print {
	.site-topstrip, .site-mainnav, .site-audience, .site-search, .article-aside, .renews-breadcrumbs, .site-footer__grid { display: none !important; }
	body, .article-panel, .page-panel { background: #fff !important; border: 0 !important; }
	.article-layout { display: block; }
	.article-header, .article-body { padding: 0; }
	.renews-readable { max-width: none; }
	a { color: inherit; }
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
}
