/**
 * Consul Directory フロントスタイル。
 * すべて .cdir-wrap でスコープ化し、SWELLのグローバルCSSと干渉させない。
 * 見出しは h2/h3 を使わず .cdir-single-h1 で代替(SWELLの
 * .post_content h2/h3 装飾との干渉回避)。
 */

.cdir-wrap,
.cdir-wrap *,
.cdir-wrap *::before,
.cdir-wrap *::after {
	box-sizing: border-box;
}

.cdir-wrap {
	margin: 0 0 2em;
	font-size: 15px;
	line-height: 1.7;
}

.cdir-empty {
	color: #777;
	padding: 1.5em 0;
	text-align: center;
}

/* ---- ボタン ---- */
.cdir-wrap .cdir-btn {
	display: inline-block;
	padding: 0.55em 1.4em;
	border: 1px solid #d0d0d0;
	border-radius: 6px;
	background: #fff;
	color: #333;
	font-size: 14px;
	cursor: pointer;
	text-decoration: none;
	transition: background 0.15s ease;
}
.cdir-wrap .cdir-btn:hover {
	background: #f5f5f5;
}
.cdir-wrap .cdir-btn-primary {
	background: #2c3e50;
	border-color: #2c3e50;
	color: #fff;
}
.cdir-wrap .cdir-btn-primary:hover {
	background: #3d5166;
	color: #fff;
}

/* ---- 「コンサルタントを探す」CTAボタン ---- */
.cdir-cta {
	text-align: center;
}
.cdir-wrap .cdir-btn-cta {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	padding: 0.9em 2.4em;
	font-size: 16px;
	font-weight: 700;
	border-radius: 999px;
	box-shadow: 0 4px 14px rgba(44, 62, 80, 0.25);
	transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.cdir-wrap .cdir-btn-cta:hover {
	transform: translateY(-1px);
	box-shadow: 0 6px 18px rgba(44, 62, 80, 0.3);
}
.cdir-cta-arrow {
	font-size: 1.2em;
	line-height: 1;
}
@media (max-width: 480px) {
	.cdir-wrap .cdir-btn-cta {
		display: flex;
		justify-content: center;
		width: 100%;
	}
}

/* ---- カード ---- */
.cdir-card-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
	gap: 16px;
}
.cdir-card {
	display: block;
	border: 1px solid #e5e5e5;
	border-radius: 10px;
	overflow: hidden;
	text-decoration: none;
	color: inherit;
	background: #fff;
	transition: box-shadow 0.15s ease;
}
.cdir-card:hover {
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}
.cdir-card-img {
	display: block;
	aspect-ratio: 16 / 9;
	background: #f0f0f0;
	overflow: hidden;
}
.cdir-card-img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.cdir-card-img-none {
	background: linear-gradient(135deg, #eef2f5, #dde5ec);
}
.cdir-card-body {
	display: block;
	padding: 10px 12px 14px;
}
.cdir-card-title {
	display: block;
	font-weight: 700;
	font-size: 15px;
	color: #222;
	line-height: 1.4;
}
.cdir-card-owner {
	display: block;
	font-size: 12.5px;
	color: #555;
	margin-top: 3px;
}
.cdir-card-cats {
	display: block;
	font-size: 12px;
	color: #888;
	margin-top: 4px;
}
.cdir-card-comment {
	display: block;
	font-size: 12.5px;
	color: #666;
	margin-top: 6px;
	line-height: 1.5;
}

/* ---- ランキング ---- */
.cdir-ranking {
	list-style: none;
	margin: 0;
	padding: 0;
}
.cdir-ranking-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 11px 0;
	border-bottom: 1px solid #eee;
}
.cdir-rank-num {
	flex: 0 0 34px;
	height: 34px;
	border-radius: 50%;
	background: #2c3e50;
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 14px;
}
.cdir-ranking-item:nth-child(1) .cdir-rank-num { background: #d4a017; }
.cdir-ranking-item:nth-child(2) .cdir-rank-num { background: #8e9aa6; }
.cdir-ranking-item:nth-child(3) .cdir-rank-num { background: #a9764b; }
.cdir-rank-main {
	flex: 1;
	min-width: 0;
}
.cdir-rank-link {
	display: block;
	color: #222;
	text-decoration: none;
	font-weight: 600;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.cdir-rank-link:hover {
	text-decoration: underline;
}
.cdir-rank-owner {
	display: block;
	font-size: 12px;
	color: #888;
}
.cdir-rank-count {
	font-size: 12.5px;
	color: #888;
	flex-shrink: 0;
}

/* ---- 検索フォーム ---- */
.cdir-search-form {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 1.5em;
}
.cdir-wrap .cdir-input,
.cdir-wrap .cdir-select {
	padding: 0.5em 0.8em;
	border: 1px solid #ccc;
	border-radius: 6px;
	font-size: 14px;
	background: #fff;
	color: #333;
}
.cdir-search-form .cdir-input {
	flex: 1 1 180px;
}

/* ---- 探すトップ:ヒーロー検索 ---- */
.cdir-hero {
	background: #fff;
	border: 1px solid #e8e8e8;
	border-radius: 14px;
	box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
	padding: 1.8em 1.5em;
	text-align: center;
	margin-bottom: 2em;
}
.cdir-hero-title {
	font-size: 18px;
	font-weight: 700;
	margin: 0 0 0.9em;
}
.cdir-hero-form {
	max-width: 480px;
	margin: 0 auto;
	margin-bottom: 0;
}
.cdir-hero-form .cdir-input {
	border-radius: 999px;
	padding-left: 1.2em;
}
.cdir-hero-form .cdir-btn {
	border-radius: 999px;
}

/* ---- 検索結果ページ:コンパクト版ヒーローカード(トップページと同じテイストで統一) ---- */
.cdir-hero-compact {
	padding: 1.4em 1.5em;
	margin-bottom: 1.6em;
}
.cdir-hero-compact .cdir-hero-title {
	font-size: 14.5px;
	font-weight: 600;
	color: #777;
	margin: 0 0 0.9em;
}
.cdir-hero-compact .cdir-search-form {
	justify-content: center;
	margin-bottom: 0;
}
.cdir-hero-compact .cdir-input,
.cdir-hero-compact .cdir-select {
	border-radius: 999px;
	padding-left: 1.1em;
}
.cdir-hero-compact .cdir-btn {
	border-radius: 999px;
}

/* ---- 探すトップ:セクション見出し ---- */
.cdir-browse-h1 {
	font-size: 16px;
	font-weight: 700;
	margin: 1.8em 0 0.8em;
	padding-left: 0.6em;
	border-left: 4px solid #2c3e50;
	line-height: 1.4;
}

/* ---- 探すトップ:カテゴリブロック ---- */
.cdir-cat-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 14px;
}
/* スクロールヒント(スマホ横スクロール時のみ表示) */
.cdir-cat-scroll-hint {
	display: none;
}

/* スマホ: 縦積みをやめて横スクロールのカルーセル表示にする */
@media (max-width: 599px) {
	.cdir-cat-scroll-hint {
		display: flex;
		align-items: center;
		gap: 6px;
		color: #888;
		font-size: 12px;
		margin: 0 0 8px;
	}
	.cdir-cat-scroll-hint-arrow {
		font-size: 14px;
		color: #2c3e50;
	}
	.cdir-cat-grid {
		display: flex;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		scroll-snap-type: x mandatory;
		gap: 10px;
		/* 右端のカードを少し見切れさせて「続きがある」ことを示す */
		padding: 2px 2px 12px;
		scroll-padding-left: 2px;
	}
	.cdir-cat-grid .cdir-cat-block {
		flex: 0 0 76%;
		max-width: 76%;
		scroll-snap-align: start;
	}
	/* スクロールバーを常時見せて横スクロール可能なことを示す */
	.cdir-cat-grid::-webkit-scrollbar {
		height: 5px;
	}
	.cdir-cat-grid::-webkit-scrollbar-track {
		background: #eceff2;
		border-radius: 3px;
	}
	.cdir-cat-grid::-webkit-scrollbar-thumb {
		background: #b9c4cd;
		border-radius: 3px;
	}
	.cdir-cat-grid {
		scrollbar-width: thin;
		scrollbar-color: #b9c4cd #eceff2;
	}
}
.cdir-cat-block {
	background: #fff;
	border: 1px solid #e8e8e8;
	border-radius: 10px;
	overflow: hidden;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.cdir-cat-block-title {
	display: block;
	text-align: center;
	font-weight: 700;
	font-size: 15px;
	color: #222;
	padding: 12px 10px;
	text-decoration: none;
}
.cdir-cat-block-title:hover {
	color: #2c3e50;
	text-decoration: underline;
}
.cdir-cat-block-list {
	list-style: none;
	margin: 0;
	padding: 0 8px 10px;
}
.cdir-cat-block-list li {
	margin: 0 0 4px;
}
.cdir-cat-block-list a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: #f4f6f8;
	border-radius: 6px;
	padding: 8px 12px;
	color: #333;
	font-size: 13.5px;
	text-decoration: none;
	transition: background 0.15s ease;
}
.cdir-cat-block-list a:hover {
	background: #e8edf2;
}
.cdir-cat-arrow {
	color: #a8b4bf;
	font-size: 15px;
}
.cdir-cat-block-count {
	text-align: center;
	color: #888;
	font-size: 12.5px;
	margin: 0;
	padding: 0 10px 12px;
}

/* ---- 探すトップ:タグクラウド ---- */
.cdir-tag-cloud {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

/* ---- 検索結果 ---- */
.cdir-back {
	margin: 0 0 0.8em;
	font-size: 13.5px;
}
.cdir-back a {
	color: #666;
	text-decoration: none;
}
.cdir-back a:hover {
	text-decoration: underline;
}
.cdir-result-summary {
	font-size: 14px;
	color: #555;
	margin: 0 0 1.2em;
}

/* ---- ページネーション ---- */
.cdir-pagination {
	display: flex;
	gap: 6px;
	justify-content: center;
	margin-top: 1.5em;
	flex-wrap: wrap;
}
.cdir-page-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 34px;
	height: 34px;
	border: 1px solid #ddd;
	border-radius: 6px;
	color: #333;
	text-decoration: none;
	font-size: 14px;
}
.cdir-page-link.cdir-page-current {
	background: #2c3e50;
	border-color: #2c3e50;
	color: #fff;
	pointer-events: none;
}
.cdir-page-link.cdir-page-prev,
.cdir-page-link.cdir-page-next {
	padding: 0 12px;
}
.cdir-page-gap {
	display: inline-flex;
	align-items: flex-end;
	color: #999;
	padding: 0 2px;
	line-height: 34px;
}

/* ---- 詳細ページ ---- */
.cdir-single-h1 {
	font-size: 17px;
	font-weight: 700;
	margin: 1.8em 0 0.6em;
	padding-left: 0.6em;
	border-left: 4px solid #2c3e50;
	line-height: 1.4;
}
.cdir-info-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14.5px;
}
.cdir-info-table th {
	text-align: left;
	width: 130px;
	padding: 10px 12px;
	background: #f7f8f9;
	border: 1px solid #e8e8e8;
	font-weight: 600;
	vertical-align: top;
	white-space: nowrap;
}
.cdir-info-table td {
	padding: 10px 12px;
	border: 1px solid #e8e8e8;
	word-break: break-all;
}
.cdir-tag-link {
	display: inline-block;
	font-size: 12.5px;
	color: #555;
	background: #f0f2f4;
	border-radius: 999px;
	padding: 2px 10px;
	margin: 2px 4px 2px 0;
	text-decoration: none;
}
.cdir-comment-box {
	background: #f9f9f7;
	border: 1px solid #ececec;
	border-radius: 8px;
	padding: 1em 1.2em;
}
.cdir-rec-list {
	list-style: none;
	margin: 0;
	padding: 0;
}
.cdir-rec-list li {
	padding: 9px 0;
	border-bottom: 1px solid #eee;
}
.cdir-rec-list a {
	font-weight: 600;
	color: #2c3e50;
}
.cdir-rec-url {
	display: block;
	font-size: 12px;
	color: #999;
	word-break: break-all;
}
.cdir-actions {
	margin-top: 1.6em;
	text-align: center;
}

@media (max-width: 480px) {
	.cdir-info-table th {
		width: 96px;
	}
	.cdir-card-grid {
		grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	}
}
