/* ==========================================================
   害獣・害虫駆除業者ディレクトリ - スタイル
   ※ 色などはSWELLのデザインに合わせて自由に調整してください
   ========================================================== */

.spd-directory { max-width: 1100px; margin: 0 auto; }

/* --- 業者の詳細ページではSWELLのサイドバーを非表示にし、本文を全幅にする ---
   SWELLは #body_wrap に "single-pest_company" 等のbody classを付与し、
   #content(l-content) の中に本文と #sidebar(l-sidebar) を横並びで配置している。 */
#body_wrap.single-pest_company #sidebar {
	display: none !important;
}
#body_wrap.single-pest_company #content.l-content {
	display: block !important;
}

/* --- 絞り込みフォーム --- */
.spd-filter-form {
	background: #f7f8fa;
	border: 1px solid #e3e6ea;
	border-radius: 8px;
	padding: 20px;
	margin-bottom: 24px;
}
.spd-filter-row {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	margin-bottom: 12px;
}
.spd-filter-group { flex: 1 1 220px; margin-bottom: 12px; }
.spd-filter-group label,
.spd-filter-label { display: block; font-weight: bold; font-size: 13px; margin-bottom: 4px; }
.spd-filter-hint { font-weight: normal; color: #888; font-size: 11px; }
.spd-filter-group input[type="text"],
.spd-filter-group select {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid #ccc;
	border-radius: 4px;
	box-sizing: border-box;
}
.spd-checkbox { font-weight: normal; display: inline-flex; align-items: center; gap: 4px; font-size: 14px; }
.spd-filter-actions { display: flex; gap: 10px; margin-top: 8px; }

/* 分類ごとのチェックボックス欄（対応エリア／駆除対象／こだわり条件） */
.spd-filter-taxonomy { margin-bottom: 18px; }
.spd-checkbox-group {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 6px 0;
	border-top: 1px dashed #dde1e6;
}
.spd-checkbox-group:first-of-type { border-top: 0; }
.spd-group-name {
	flex: 0 0 104px;
	box-sizing: border-box;
	padding: 3px 8px;
	border-radius: 3px;
	background: #e8f0f3;
	color: #04384c;
	font-size: 12px;
	font-weight: bold;
	text-align: center;
}
.spd-checkbox-items { display: flex; flex-wrap: wrap; gap: 6px 16px; flex: 1; min-width: 0; }

/* --- ボタン --- */
.spd-btn {
	display: inline-block;
	padding: 10px 20px;
	border-radius: 4px;
	font-size: 14px;
	font-weight: bold;
	text-decoration: none;
	cursor: pointer;
	border: 1px solid transparent;
	transition: opacity .15s;
}
.spd-btn:hover { opacity: .85; }
.spd-btn-primary { background: #2271b1; color: #fff !important; }
.spd-btn-outline { background: #fff; border-color: #2271b1; color: #2271b1 !important; }

/* --- 件数表示 --- */
.spd-result-count { margin-bottom: 12px; font-size: 14px; color: #555; }

/* --- グリッド --- */
.spd-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 20px;
}
.spd-card {
	border: 1px solid #e3e6ea;
	border-radius: 8px;
	overflow: hidden;
	background: #fff;
	display: flex;
	flex-direction: column;
}
.spd-card-thumb img { width: 100%; height: 150px; object-fit: cover; display: block; }
.spd-no-thumb {
	height: 150px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #f0f2f5;
	color: #888;
	font-weight: bold;
	text-align: center;
	padding: 10px;
}
.spd-card-body { padding: 14px 16px; display: flex; flex-direction: column; flex: 1; }
.spd-card-title { font-size: 16px; margin: 0 0 6px; }
.spd-card-title a { text-decoration: none; color: #222; }
.spd-card-rating { font-size: 13px; color: #555; margin-bottom: 4px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.spd-card-rating-users { margin-bottom: 8px; }
.spd-rating-label { font-size: 11px; font-weight: bold; color: #888; background: #f0f2f5; padding: 1px 6px; border-radius: 3px; }
.spd-stars { color: #f5a623; letter-spacing: 1px; }
.spd-card-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.spd-badge { font-size: 11px; padding: 2px 8px; border-radius: 12px; background: #eef3f8; color: #2271b1; }
.spd-badge-target { background: #e8f3e8; color: #2e6b2e; }
.spd-badge-feature { background: #fff3df; color: #8a5a00; }
.spd-badge-area { background: #eef3f8; color: #2271b1; }

/* カードの情報欄（対応エリア／調査・見積／運営会社） */
.spd-card-info { list-style: none; margin: 0 0 8px; padding: 0; font-size: 12px; color: #444; }
.spd-card-info li { display: flex; gap: 8px; margin: 0 0 2px; padding: 0; }
.spd-info-label { flex: 0 0 64px; color: #888; }
.spd-info-value { flex: 1; min-width: 0; }

/* 現地調査・見積の表示色 */
.spd-survey { font-weight: bold; }
.spd-survey-free { color: #2e7d32; }
.spd-survey-partial { color: #b26a00; }
.spd-survey-paid { color: #d9534f; }
.spd-survey-none { color: #888; font-weight: normal; }

.spd-card-excerpt { font-size: 13px; color: #555; flex: 1; margin: 0 0 12px; }
.spd-card-footer { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.spd-card-price { font-size: 13px; }
.spd-card-price strong { color: #d9534f; font-size: 16px; }
.spd-price-caption { font-size: 11px; color: #888; margin-right: 4px; }
.spd-price-line { display: block; line-height: 1.5; }
.spd-price-target { color: #555; margin-right: 6px; }
.spd-price-more { display: block; font-size: 11px; color: #888; }

.spd-no-results { padding: 40px; text-align: center; color: #888; }

/* --- ページネーション --- */
.spd-pagination { display: flex; justify-content: center; gap: 6px; margin-top: 24px; flex-wrap: wrap; }
.spd-pagination button {
	padding: 6px 12px;
	border: 1px solid #ccc;
	background: #fff;
	border-radius: 4px;
	cursor: pointer;
}
.spd-pagination button.is-current { background: #2271b1; color: #fff; border-color: #2271b1; }

/* --- 業者の詳細ページ --- */
.spd-single-wrap { max-width: 900px; margin: 0 auto; padding: 20px 0; }
.spd-single-header { display: flex; gap: 20px; margin-bottom: 20px; flex-wrap: wrap; }
.spd-single-thumb img { width: 160px; border-radius: 8px; }
.spd-single-title { margin: 0 0 8px; }
.spd-single-rating { margin-bottom: 8px; font-size: 14px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.spd-spec-table { width: 100%; border-collapse: collapse; margin-bottom: 24px; }
.spd-spec-table th, .spd-spec-table td { border: 1px solid #e3e6ea; padding: 10px 14px; text-align: left; }
.spd-spec-table th { background: #f7f8fa; width: 160px; }
/* 最初の表の見出し行（「駆除対象ごとの最低料金」「基本情報」）と、グループ見出し行（「害獣」「害虫」など） */
.spd-spec-table .spd-spec-heading th { background: #04384c; color: #fff; width: auto; }
.spd-spec-table .spd-spec-subheading th { background: #eef3f5; width: auto; font-size: 13px; }
.spd-price-table td { font-weight: bold; }
.spd-feature-table td { display: flex; flex-wrap: wrap; gap: 6px; }

/* --- レビュー --- */
.spd-reviews-section { margin-top: 40px; border-top: 2px solid #eee; padding-top: 24px; }

/* レビュー投稿フォームの下に出す長めの記事（本文の「続きを読む」以降） */
.spd-single-article { margin-top: 48px; border-top: 2px solid #eee; padding-top: 32px; }
.spd-single-article > :first-child { margin-top: 0; }
.spd-reviews-summary { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; font-size: 15px; }
.spd-avg-rating { font-size: 28px; font-weight: bold; color: #f5a623; }
.spd-review-item { border-bottom: 1px solid #eee; padding: 16px 0; }
.spd-review-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.spd-review-title { font-size: 15px; }
.spd-review-meta { font-size: 12px; color: #888; margin-bottom: 6px; display: flex; gap: 10px; }
.spd-review-body { font-size: 14px; line-height: 1.7; white-space: pre-wrap; }
.spd-no-reviews { color: #888; }

/* --- レビューは最初の2件だけ表示し、残りは「レビューを全部見る」を開くと表示 --- */
.spd-reviews-more { margin-top: 8px; }
.spd-reviews-more > summary {
	list-style: none;
	cursor: pointer;
	text-align: center;
	padding: 10px 16px;
	border: 1px solid #2271b1;
	border-radius: 4px;
	background: #fff;
	color: #2271b1;
	font-size: 14px;
	font-weight: bold;
}
.spd-reviews-more > summary::-webkit-details-marker { display: none; }
.spd-reviews-more > summary:hover { background: #f0f6fc; }
.spd-reviews-more .spd-more-close { display: none; }
.spd-reviews-more[open] .spd-more-open { display: none; }
.spd-reviews-more[open] .spd-more-close { display: inline; }
.spd-reviews-more[open] > summary { margin-bottom: 8px; }

/* --- 要約文（本文の「続きを読む」より前）：強調した枠＋太字 --- */
.spd-summary {
	margin: 0 0 24px;
	padding: 16px 20px;
	background: #f2f7f9;
	border: 2px solid #04384c;
	border-radius: 8px;
	line-height: 1.8;
}
.spd-summary,
.spd-summary * { font-weight: 700; }
.spd-summary > :first-child { margin-top: 0; }
.spd-summary > :last-child { margin-bottom: 0; }
.spd-summary p { margin: 0 0 0.8em; }

/* --- レビュー投稿フォーム --- */
.spd-review-form { margin-top: 30px; background: #f7f8fa; padding: 20px; border-radius: 8px; }
.spd-field { margin-bottom: 14px; }
.spd-field label { display: block; font-weight: bold; font-size: 13px; margin-bottom: 4px; }
.spd-required { color: #d9534f; font-size: 11px; margin-left: 6px; }
.spd-field input[type="text"],
.spd-field input[type="email"],
.spd-field textarea {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid #ccc;
	border-radius: 4px;
	box-sizing: border-box;
	font-family: inherit;
}
.spd-honeypot { position: absolute; left: -9999px; opacity: 0; }

/* 星評価の入力（ラジオボタンをCSSだけで星に見せる） */
.spd-star-input { display: inline-flex; flex-direction: row-reverse; gap: 2px; }
.spd-star-input input { display: none; }
.spd-star-input label {
	font-size: 26px;
	color: #ddd;
	cursor: pointer;
	display: inline-block !important;
	margin: 0 !important;
}
.spd-star-input input:checked ~ label,
.spd-star-input label:hover,
.spd-star-input label:hover ~ label { color: #f5a623; }

.spd-review-note { font-size: 12px; color: #888; }
.spd-review-message { margin-top: 10px; font-size: 14px; font-weight: bold; }
.spd-review-message.is-success { color: #2e7d32; }
.spd-review-message.is-error { color: #d9534f; }

@media (max-width: 600px) {
	.spd-filter-form {
		padding: 12px;      /* PC版は20px → スマホは詰める */
		margin-bottom: 16px;
	}
	.spd-filter-row {
		flex-direction: column;
		gap: 10px;          /* PC版は16px → スマホは少し詰める */
		margin-bottom: 6px;
	}
	.spd-filter-group {
		/* PC版の "flex: 1 1 220px" は横並び用の最小幅指定だが、
		   縦並び(column)に切り替わると220pxが「高さ」として扱われてしまい、
		   各項目が縦に間延びする原因になるため、ここで無効化する。 */
		flex: none;
		width: 100%;
		margin-bottom: 0;   /* 項目間の余白は上の gap でまとめて管理 */
	}
	.spd-filter-group label,
	.spd-filter-row .spd-filter-label {
		margin: 0 0 4px;    /* ラベルと入力欄の間に少し余白 */
		font-size: 12px;
		line-height: 1.4;
	}
	.spd-filter-group input[type="text"],
	.spd-filter-group select {
		margin: 0;          /* iOS等が入力欄に付ける既定の余白を除去 */
		padding: 6px 8px;   /* PC版は8px 10px → スマホは少し薄く */
		font-size: 13px;
		line-height: 1.4;
	}
	.spd-filter-taxonomy { margin-bottom: 14px; }
	.spd-checkbox-group { flex-direction: column; gap: 4px; }
	.spd-group-name { flex: none; text-align: left; }
	.spd-checkbox-items { gap: 4px 10px; }
	.spd-filter-actions { margin-top: 2px; gap: 6px; }
	.spd-single-header { flex-direction: column; }
	.spd-spec-table th { width: 110px; }
	.spd-spec-table th, .spd-spec-table td { padding: 8px 10px; }
}
