/*
Theme Name: madoreno
Description: 先進的窓リノベ事業の登録事業者を紹介するサイト（仮称：窓リノベ業者ナビ）のオリジナルテーマ
Version: 0.1.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: madoreno
*/

/* ==============================
   色の設定（配色B：断熱のあたたかさ）
   色を変えたいときは、ここだけ書き換えれば全体に反映されます。
   ============================== */
:root {
	--color-text: #2b2118;         /* 本文の文字（こげ茶に近い黒） */
	--color-text-sub: #6b5b4e;     /* 補足の文字（日付・説明など） */
	--color-bg: #fffbf5;           /* ページの背景（クリーム） */
	--color-muted-bg: #f5ece1;     /* PR表記・フッター・画像なしの枠の背景 */
	--color-border: #eadfd2;       /* 区切り線 */
	--color-accent: #b04a12;       /* メインの色（リンク・ボタン） */
	--color-accent-dark: #7a3410;  /* 見出し・サイト名 */
	--color-accent-light: #faece7; /* 工事ラベルなどの薄い背景 */
}

/* ==============================
   基本設定（スマホ表示を基準に作成）
   ============================== */
*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif;
	font-size: 16px;
	line-height: 1.8;
	color: var(--color-text);
	background: var(--color-bg);
}

img {
	max-width: 100%;
	height: auto;
}

a {
	color: var(--color-accent);
}

/* 中身の横幅をそろえるための箱 */
.container {
	width: 100%;
	max-width: 960px;
	margin: 0 auto;
	padding: 0 16px;
}

/* ==============================
   ヘッダー
   ============================== */
.pr-notice {
	margin: 0;
	padding: 4px 16px;
	font-size: 12px;
	text-align: center;
	color: var(--color-text-sub);
	background: var(--color-muted-bg);
}

.site-header {
	border-bottom: 3px solid var(--color-accent);
}

.site-header__inner {
	padding-top: 12px;
	padding-bottom: 12px;
}

.site-title {
	margin: 0;
	font-size: 20px;
	font-weight: bold;
	line-height: 1.4;
}

.site-title a {
	color: var(--color-accent-dark);
	text-decoration: none;
}

/* グローバルメニュー（スマホでは横スクロールできる1行） */
.global-nav ul {
	display: flex;
	gap: 16px;
	margin: 8px 0 0;
	padding: 0;
	list-style: none;
	overflow-x: auto;
	white-space: nowrap;
}

.global-nav a {
	display: block;
	padding: 6px 0;
	font-size: 14px;
	text-decoration: none;
}

/* ==============================
   メイン部分
   ============================== */
.site-main {
	padding-top: 24px;
	padding-bottom: 40px;
}

.post-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.post-list__item {
	padding: 16px 0;
	border-bottom: 1px solid var(--color-border);
}

.post-list__title {
	margin: 0 0 4px;
	font-size: 18px;
	line-height: 1.5;
}

.post-list__date {
	font-size: 13px;
	color: var(--color-text-sub);
}

.pagination {
	margin-top: 24px;
	text-align: center;
}

.pagination .page-numbers {
	display: inline-block;
	padding: 4px 10px;
}

/* ==============================
   フッター
   ============================== */
.site-footer {
	padding: 24px 0;
	font-size: 14px;
	background: var(--color-muted-bg);
	border-top: 1px solid var(--color-border);
}

.footer-official-link {
	margin: 0 0 16px;
}

.footer-nav ul {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 16px;
	margin: 0 0 16px;
	padding: 0;
	list-style: none;
}

.copyright {
	margin: 0;
	font-size: 12px;
	color: var(--color-text-sub);
}

/* ==============================
   パソコンなど画面が広いとき
   ============================== */
@media (min-width: 768px) {
	.site-title {
		font-size: 24px;
	}
}

/* ==============================
   業者詳細ページ
   ============================== */
.gyosha-detail__title {
	margin: 0 0 16px;
	font-size: 24px;
	line-height: 1.4;
}

/* 画像（横長の枠に収める） */
.gyosha-detail__image img,
.no-image {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	border-radius: 4px;
}

/* 画像がないときの代わりの枠 */
.no-image {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	font-weight: bold;
	text-align: center;
	color: var(--color-text-sub);
	background: var(--color-muted-bg);
}

.gyosha-detail__content {
	margin: 16px 0 24px;
}

/* 基本情報（スマホでは項目名と中身を縦に並べる） */
.gyosha-info {
	margin: 0 0 24px;
	border-top: 1px solid var(--color-border);
}

.gyosha-info dt {
	padding-top: 12px;
	font-size: 14px;
	font-weight: bold;
	color: var(--color-text-sub);
}

.gyosha-info dd {
	margin: 0;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--color-border);
	word-break: break-all; /* 長いURLで画面からはみ出さないようにする */
}

/* 電話番号はタップしやすい大きさにする */
.gyosha-info__tel {
	display: inline-block;
	padding: 4px 0;
	font-size: 20px;
	font-weight: bold;
}

/* エリアや工事のリンク */
.gyosha-terms {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 4px 0 0;
	padding: 0;
	list-style: none;
}

.gyosha-terms a {
	display: inline-block;
	padding: 2px 10px;
	font-size: 14px;
	text-decoration: none;
	border: 1px solid var(--color-accent);
	border-radius: 999px;
}

.gyosha-terms__empty {
	margin: 0;
	color: var(--color-text-sub);
}

/* 注意書き */
.gyosha-notice {
	padding: 12px 16px;
	font-size: 14px;
	background: #fff8e5;
	border: 1px solid #f0d58c;
	border-radius: 4px;
}

.gyosha-notice p {
	margin: 0;
}

/* 画面が広いときは、基本情報を「項目名｜中身」の横並びにする */
@media (min-width: 768px) {
	.gyosha-info {
		display: grid;
		grid-template-columns: 10em 1fr;
	}

	.gyosha-info dt,
	.gyosha-info dd {
		padding: 12px 0;
		border-bottom: 1px solid var(--color-border);
	}
}

/* ==============================
   業者一覧ページ（エリア別・工事内容別・全業者）
   ============================== */
.archive-header {
	margin-bottom: 16px;
}

.archive-title {
	margin: 0;
	font-size: 22px;
	line-height: 1.4;
}

.archive-sub {
	margin: 4px 0 0;
	font-size: 14px;
	color: var(--color-text-sub);
}

/* エリア・工事の切り替えリンク */
.term-nav {
	margin-bottom: 16px;
}

.term-nav__label {
	margin: 0 0 4px;
	font-size: 14px;
	font-weight: bold;
}

/* 今見ているエリア・工事は、色を塗って目立たせる */
.gyosha-terms a[aria-current="page"] {
	color: #fff;
	background: var(--color-accent);
}

.archive-count {
	margin: 16px 0 0;
	font-weight: bold;
}

.archive-empty {
	margin: 24px 0;
}

/* 業者カードの並び（スマホは1列、画面が広いときは2列） */
.gyosha-list {
	display: grid;
	gap: 20px;
	margin: 12px 0 0;
	padding: 0;
	list-style: none;
}

/* 業者カード1件（上に大きな画像、下に情報） */
.gyosha-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: #fff;
	border: 1px solid var(--color-border);
	border-radius: 8px;
}

.gyosha-card__image {
	display: block;
	text-decoration: none;
}

/* 画像は横長（16:9）の枠いっぱいに表示する */
.gyosha-card__image img,
.gyosha-card__image .no-image {
	display: flex;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	border-radius: 0;
}

.gyosha-card__body {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: 14px 16px 16px;
	min-width: 0; /* 長い文字で画面からはみ出さないようにする */
}

.gyosha-card__title {
	margin: 0;
	font-size: 19px;
	line-height: 1.4;
}

.gyosha-card__title a {
	color: var(--color-accent-dark);
	text-decoration: none;
}

.gyosha-card__catch {
	margin: 4px 0 0;
	font-weight: bold;
	color: var(--color-accent);
}

/* 対応工事の小さなラベル */
.gyosha-card__koji {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin: 10px 0 0;
	padding: 0;
	list-style: none;
}

.gyosha-card__koji li {
	padding: 0 8px;
	font-size: 12px;
	color: var(--color-accent-dark);
	background: var(--color-accent-light);
	border-radius: 4px;
}

/* 主な情報（項目名｜中身 の横並び） */
.gyosha-card__info {
	display: grid;
	grid-template-columns: max-content minmax(0, 1fr); /* 項目名の幅は、いちばん長い項目名に合わせる */
	gap: 2px 8px;
	margin: 10px 0 0;
	font-size: 14px;
}

.gyosha-card__info dt {
	font-weight: bold;
	color: var(--color-text-sub);
}

.gyosha-card__info dd {
	margin: 0;
	min-width: 0;
}

.gyosha-card__summary {
	margin: 10px 0 0;
	font-size: 14px;
	color: var(--color-text-sub);
}

/* ボタン（カードのいちばん下にそろえる） */
.gyosha-card__buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: auto;
	padding-top: 14px;
}

.gyosha-card__buttons .button {
	flex: 1 1 auto;
}

/* ボタンの共通の見た目 */
.button {
	display: inline-block;
	padding: 10px 14px;
	font-size: 14px;
	font-weight: bold;
	line-height: 1.4;
	text-align: center;
	text-decoration: none;
	color: var(--color-accent);
	background: #fff;
	border: 1px solid var(--color-accent);
	border-radius: 6px;
}

.button--primary {
	color: #fff;
	background: var(--color-accent);
}

/* コラム一覧の「画像なし」の小さな枠 */
.no-image--small {
	width: 80px;
	height: 80px;
	padding: 0;
	font-size: 12px;
	font-weight: normal;
	aspect-ratio: auto;
	border-radius: 4px;
}

@media (min-width: 768px) {
	.gyosha-list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* ==============================
   トップページ
   ============================== */
.front-intro__title {
	margin: 0 0 12px;
	font-size: 24px;
	line-height: 1.4;
}

/* 使い方の3ステップ */
.front-steps {
	margin: 16px 0;
	padding: 0;
	list-style: none;
}

.front-steps li {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 8px;
	font-weight: bold;
}

.front-steps__num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 28px;
	height: 28px;
	font-size: 14px;
	color: #fff;
	background: var(--color-accent);
	border-radius: 50%;
}

/* 各ブロック（エリア・工事・コラム） */
.front-section {
	margin-top: 40px;
}

.front-section__title {
	margin: 0 0 16px;
	padding-bottom: 8px;
	font-size: 20px;
	border-bottom: 2px solid var(--color-accent);
}

.front-section__more {
	margin: 12px 0 0;
	font-size: 14px;
	color: var(--color-text-sub);
}

/* エリア */
.front-area__pref {
	margin: 0 0 8px;
	font-size: 17px;
}

/* 市区町村のボタン（スマホで押しやすい大きさ、2列並び） */
.front-buttons {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.front-buttons a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px;
	font-weight: bold;
	text-decoration: none;
	border: 1px solid var(--color-accent);
	border-radius: 4px;
}

.front-buttons__count {
	font-size: 12px;
	font-weight: normal;
	color: var(--color-text-sub);
}

/* 工事内容（名前と短い説明を縦に並べる） */
.front-koji {
	margin: 0;
	padding: 0;
	list-style: none;
}

.front-koji li + li {
	margin-top: 8px;
}

.front-koji a {
	display: block;
	padding: 12px;
	text-decoration: none;
	border: 1px solid var(--color-border);
	border-radius: 4px;
}

.front-koji__name {
	display: block;
	font-weight: bold;
}

.front-koji__desc {
	display: block;
	font-size: 14px;
	color: var(--color-text-sub);
}

@media (min-width: 768px) {
	.front-buttons {
		grid-template-columns: repeat(4, 1fr);
	}

	.front-koji {
		display: grid;
		grid-template-columns: repeat(2, 1fr);
		gap: 8px;
	}

	.front-koji li + li {
		margin-top: 0;
	}
}

/* ==============================
   コラム一覧・コラム詳細・固定ページ
   ============================== */
.column-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

/* コラムカード（左に画像、右にタイトルと日付） */
.column-card {
	border-bottom: 1px solid var(--color-border);
}

.column-card__link {
	display: flex;
	gap: 12px;
	padding: 16px 0;
	text-decoration: none;
	color: inherit;
}

.column-card__image {
	flex-shrink: 0;
}

.column-card__image img {
	display: block;
	width: 80px;
	height: 80px;
	object-fit: cover;
	border-radius: 4px;
}

.column-card__title {
	display: block;
	font-weight: bold;
	line-height: 1.5;
	color: var(--color-accent);
}

.column-card__date {
	font-size: 13px;
	color: var(--color-text-sub);
}

/* コラム詳細・固定ページの見出し */
.column-detail__title,
.page-detail__title {
	margin: 0 0 8px;
	font-size: 24px;
	line-height: 1.4;
}

.column-detail__dates {
	margin: 0 0 16px;
	font-size: 13px;
	color: var(--color-text-sub);
}

.column-detail__modified {
	margin-left: 12px;
}

.column-detail__image img {
	display: block;
	width: 100%;
	border-radius: 4px;
}

/* 本文の読みやすさ */
.entry-content h2 {
	margin: 32px 0 12px;
	padding-left: 10px;
	font-size: 20px;
	line-height: 1.4;
	border-left: 4px solid var(--color-accent);
}

.entry-content h3 {
	margin: 24px 0 8px;
	font-size: 18px;
}

.entry-content table {
	width: 100%;
	border-collapse: collapse;
}

.entry-content th,
.entry-content td {
	padding: 8px;
	border: 1px solid var(--color-border);
}

/* コラムの最後の「業者を探す」案内 */
.column-cta {
	margin-top: 32px;
	padding: 16px;
	background: var(--color-accent-light);
	border-radius: 4px;
}

.column-cta__title {
	margin: 0 0 8px;
	font-weight: bold;
}

.column-cta__links {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.column-cta__links a {
	display: block;
	padding: 10px;
	font-weight: bold;
	text-align: center;
	text-decoration: none;
	color: #fff;
	background: var(--color-accent);
	border-radius: 4px;
}

.back-link {
	margin-top: 24px;
}

/* ==============================
   Googleフォームの埋め込み
   ============================== */
.google-form iframe {
	display: block;
	width: 100%;
	border: 0;
}

.google-form__fallback {
	font-size: 14px;
}

.google-form-error {
	padding: 12px;
	color: #a00;
	background: #fdeaea;
	border: 1px solid #e5a5a5;
	border-radius: 4px;
}

/* ==============================
   見出しの色（配色Bに合わせる）
   ============================== */
.archive-title,
.gyosha-detail__title,
.front-intro__title,
.column-detail__title,
.page-detail__title,
.front-section__title,
.front-area__pref a {
	color: var(--color-accent-dark);
}

/* 白い背景のほうが読みやすい部分（カード・情報欄） */
.front-buttons a,
.front-koji a,
.gyosha-terms a {
	background: #fff;
}

/* ==============================
   工事アイコン（トップページの「工事内容から探す」）
   ============================== */
.front-koji a {
	display: flex;
	align-items: center;
	gap: 12px;
}

/* アイコンを、うすいオレンジの丸の中に置く */
.front-koji__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 56px;
	height: 56px;
	color: var(--color-accent);
	background: var(--color-accent-light);
	border-radius: 50%;
}

.front-koji__text {
	min-width: 0;
}

/* ==============================
   トップページの写真
   ============================== */
.front-hero {
	margin: -8px 0 20px;
}

.front-hero img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 8px;
}

/* ==============================
   業者詳細：キャッチコピー・地図
   ============================== */
.gyosha-detail__catch {
	margin: -8px 0 16px;
	font-weight: bold;
	color: var(--color-accent);
}

.gyosha-map iframe {
	display: block;
	width: 100%;
	height: 300px;
	border: 0;
	border-radius: 8px;
}

.gyosha-map__link {
	margin: 12px 0 4px;
}

.gyosha-map__link .button {
	display: block;
}

.gyosha-map__note {
	margin: 0 0 24px;
	font-size: 12px;
	color: var(--color-text-sub);
}

/* ==============================
   広告掲載の業者（PRラベル・枠の色）
   ============================== */
.pr-label {
	display: inline-block;
	margin-right: 6px;
	padding: 0 6px;
	font-size: 11px;
	font-weight: bold;
	line-height: 1.6;
	vertical-align: 0.2em;
	color: var(--color-text-sub);
	background: #fff;
	border: 1px solid var(--color-text-sub);
	border-radius: 3px;
}

/* 広告掲載の業者は、カードの枠を少し目立たせる */
.gyosha-card--ad {
	border-color: var(--color-accent);
}

/* 業者詳細：画像がない業者は、見出しのすぐ下に紹介文が来るので間を空ける */
.gyosha-detail__content {
	margin-top: 8px;
}

/* 一覧の並び順の説明 */
.archive-order-note {
	margin: 4px 0 0;
	font-size: 12px;
	color: var(--color-text-sub);
}

/* ==============================
   パンくずリスト（ホーム ＞ 東京都 ＞ 足立区）
   ============================== */
.breadcrumbs {
	margin: -12px 0 16px;
	font-size: 12px;
	color: var(--color-text-sub);
}

.breadcrumbs ol {
	display: flex;
	flex-wrap: wrap;
	margin: 0;
	padding: 0;
	list-style: none;
}

.breadcrumbs li + li::before {
	content: "＞";
	margin: 0 6px;
}

.breadcrumbs a {
	color: var(--color-text-sub);
}

/* ==============================
   一覧ページの紹介文・エリア別のポイント
   ============================== */
.archive-lead {
	margin: 8px 0 0;
	font-size: 14px;
}

.area-guide {
	margin-top: 40px;
	padding: 20px 16px;
	background: #fff;
	border: 1px solid var(--color-border);
	border-radius: 8px;
}

.area-guide__title {
	margin: 0 0 8px;
	font-size: 20px;
	line-height: 1.4;
	color: var(--color-accent-dark);
}

.area-guide h3 {
	margin: 24px 0 8px;
	padding-left: 8px;
	font-size: 17px;
	border-left: 4px solid var(--color-accent);
}

.area-guide__list {
	margin: 0;
	padding-left: 1.2em;
}

.area-guide__list li + li {
	margin-top: 12px;
}

.area-guide__checked {
	font-size: 12px;
	color: var(--color-text-sub);
}

/* 工事ごとの業者数 */
.area-guide__koji {
	margin: 0;
	padding: 0;
	list-style: none;
	border-top: 1px solid var(--color-border);
}

.area-guide__koji li {
	display: flex;
	justify-content: space-between;
	gap: 8px;
	padding: 10px 0;
	border-bottom: 1px solid var(--color-border);
}

.area-guide__note {
	margin: 8px 0 0;
	font-size: 12px;
	color: var(--color-text-sub);
}

/* 記事の表：スマホでは文字を少し小さくして、列が細くなりすぎないようにする */
.entry-content table {
	font-size: 14px;
	line-height: 1.6;
}

.entry-content th {
	white-space: nowrap;
	background: var(--color-muted-bg);
}
