/* CASKADE Distillery Map v0.12.0 */

.cdm-wrap {
	--cdm-ink: #2b2420;
	--cdm-bg: #ffffff;
	--cdm-line: #d9d2c7;
	--cdm-accent: #4a3728; /* peated oak */
	margin: 1.5em 0;
	font-size: 15px;
	color: var(--cdm-ink);
}

/* ---------- ツールバー ---------- */
.cdm-toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
	margin-bottom: 10px;
}

.cdm-search {
	position: relative;
	flex: 1 1 260px;
	min-width: 220px;
}

.cdm-search input[type="search"] {
	width: 100%;
	padding: 8px 12px;
	border: 1px solid var(--cdm-line);
	border-radius: 6px;
	font-size: 15px;
	background: var(--cdm-bg);
	color: var(--cdm-ink);
}

.cdm-search input[type="search"]:focus {
	outline: 2px solid var(--cdm-accent);
	outline-offset: 1px;
}

.cdm-search-results {
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	right: 0;
	z-index: 30;
	background: var(--cdm-bg);
	border: 1px solid var(--cdm-line);
	border-radius: 6px;
	box-shadow: 0 6px 18px rgba(43, 36, 32, 0.18);
	max-height: 320px;
	overflow-y: auto;
}

.cdm-search-item {
	display: block;
	width: 100%;
	text-align: left;
	padding: 8px 12px;
	border: 0;
	border-bottom: 1px solid var(--cdm-line);
	background: transparent;
	font-size: 14px;
	color: var(--cdm-ink);
	cursor: pointer;
}

.cdm-search-item:last-child {
	border-bottom: 0;
}

.cdm-search-item:hover,
.cdm-search-item:focus {
	background: #f3efe8;
}

.cdm-search-meta {
	color: #7a7168;
	font-size: 12px;
}

.cdm-search-empty {
	padding: 10px 12px;
	color: #7a7168;
	font-size: 14px;
}

/* ---------- コントロール ---------- */
.cdm-controls {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}

.cdm-control-group {
	display: inline-flex;
	border: 1px solid var(--cdm-line);
	border-radius: 6px;
	overflow: hidden;
}

.cdm-mode-btn {
	padding: 7px 12px;
	border: 0;
	background: var(--cdm-bg);
	color: var(--cdm-ink);
	font-size: 13px;
	cursor: pointer;
	line-height: 1.2;
}

.cdm-mode-btn + .cdm-mode-btn {
	border-left: 1px solid var(--cdm-line);
}

.cdm-mode-btn.is-active {
	background: var(--cdm-accent);
	color: #fff;
}

.cdm-controls select {
	padding: 7px 10px;
	border: 1px solid var(--cdm-line);
	border-radius: 6px;
	background: var(--cdm-bg);
	color: var(--cdm-ink);
	font-size: 13px;
}

.cdm-region-axis {
	font-size: 13px;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	cursor: pointer;
	user-select: none;
}

/* ---------- マップ ---------- */
.cdm-map {
	width: 100%;
	height: var(--cdm-map-height, 620px);
	border: 1px solid var(--cdm-line);
	border-radius: 8px;
	overflow: hidden;
	background: #e8e4dc;
}

.cdm-error {
	padding: 2em 1em;
	text-align: center;
	color: #7a7168;
}

/* ---------- 凡例・件数 ---------- */
.cdm-footer {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 16px;
	align-items: center;
	justify-content: space-between;
	margin-top: 8px;
}

.cdm-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 14px;
}

.cdm-legend-item {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 13px;
}

.cdm-legend-dot,
.cdm-status-dot {
	display: inline-block;
	width: 11px;
	height: 11px;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, 0.9);
	box-shadow: 0 0 0 1px rgba(43, 36, 32, 0.25);
}

.cdm-status-dot {
	margin-right: 5px;
}

.cdm-count {
	font-size: 12px;
	color: #7a7168;
}

/* ---------- ポップアップ ---------- */
.cdm-wrap .maplibregl-popup-content,
.maplibregl-popup .cdm-pop {
	font-size: 13px;
	color: #2b2420;
}

.cdm-pop-title {
	margin: 0 0 6px;
	font-size: 15px;
	line-height: 1.35;
	font-weight: 700;
}

.cdm-pop-en {
	font-weight: 400;
	color: #7a7168;
	font-size: 13px;
}

.cdm-pop-table {
	border-collapse: collapse;
	width: 100%;
	margin: 0;
}

.cdm-pop-table th {
	text-align: left;
	padding: 2px 10px 2px 0;
	font-weight: 600;
	white-space: nowrap;
	vertical-align: top;
	color: #5a5148;
	background: transparent;
	border: 0;
	font-size: 12px;
}

.cdm-pop-table td {
	padding: 2px 0;
	border: 0;
	background: transparent;
	font-size: 13px;
}

.cdm-pop-detail {
	margin: 6px 0 0;
	padding-top: 6px;
	border-top: 1px solid #eee7db;
	color: #5a5148;
	font-size: 12px;
	line-height: 1.5;
}

.cdm-pop-note {
	color: #7a7168;
	font-size: 12px;
}

/* ---------- モバイル ---------- */
@media (max-width: 600px) {
	.cdm-toolbar {
		flex-direction: column;
		align-items: stretch;
		gap: 8px;
	}

	/* 縦並びではflex-basisが「高さ」として効くため、伸長を止めて中身の高さに合わせる */
	.cdm-search {
		flex: 0 0 auto;
		min-width: 0;
	}

	.cdm-controls {
		flex: 0 0 auto;
		justify-content: flex-start;
		gap: 6px;
	}

	.cdm-wrap {
		margin: 0.75em 0;
	}
}

/* ---------- v0.3.0 追加 ---------- */
.cdm-area-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 12px;
	margin-bottom: 8px;
	font-size: 13px;
}

.cdm-area-bar-label {
	color: #5a5148;
	font-weight: 600;
}

.cdm-area-toggles {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 4px 12px;
	align-items: center;
}

.cdm-area-toggle {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	cursor: pointer;
	user-select: none;
	font-size: 13px;
}

.cdm-area-all {
	padding: 3px 9px;
	border: 1px solid var(--cdm-line);
	border-radius: 5px;
	background: var(--cdm-bg);
	color: var(--cdm-ink);
	font-size: 12px;
	cursor: pointer;
}

.cdm-area-all:hover {
	background: #f3efe8;
}

.cdm-pop-links {
	margin: 8px 0 0;
	padding-top: 7px;
	border-top: 1px solid #eee7db;
	display: flex;
	gap: 14px;
}

.cdm-pop-links a {
	font-size: 12.5px;
	color: #1a5fb4;
	text-decoration: underline;
}

/* ---------- v0.4.0 追加: マップ+リストの2カラム ---------- */
.cdm-body {
	display: flex;
	gap: 10px;
	align-items: stretch;
}

.cdm-body .cdm-map {
	flex: 1 1 auto;
	min-width: 0;
}

.cdm-list-panel {
	flex: 0 0 280px;
	display: flex;
	flex-direction: column;
	border: 1px solid var(--cdm-line);
	border-radius: 8px;
	background: var(--cdm-bg);
	height: var(--cdm-map-height, 620px);
	overflow: hidden;
}

.cdm-list-head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 8px 10px;
	border-bottom: 1px solid var(--cdm-line);
	font-weight: 600;
	font-size: 13.5px;
	background: #f7f4ee;
}

.cdm-list-btn {
	padding: 2px 8px;
	border: 1px solid var(--cdm-line);
	border-radius: 4px;
	background: var(--cdm-bg);
	font-size: 11.5px;
	cursor: pointer;
	color: var(--cdm-ink);
}

.cdm-list-btn:hover {
	background: #f3efe8;
}

.cdm-list {
	overflow-y: auto;
	flex: 1 1 auto;
	padding: 4px 0;
}

.cdm-list-group summary {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 5px 10px;
	position: sticky;
	top: 0;
	background: #f7f4ee;
	z-index: 2;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	user-select: none;
}

.cdm-list-group summary:hover {
	background: #f7f4ee;
}

.cdm-list-items {
	padding: 2px 6px 6px 12px;
}

.cdm-list-item {
	display: flex;
	align-items: center;
	gap: 5px;
	padding: 1px 4px;
	font-size: 12.5px;
	line-height: 1.3;
}

.cdm-list-item .cdm-status-dot {
	margin-right: 0;
	flex: 0 0 auto;
	width: 9px;
	height: 9px;
}

.cdm-list-name {
	border: 0;
	background: transparent;
	padding: 0;
	font-size: 12.5px;
	color: var(--cdm-ink);
	cursor: pointer;
	text-align: left;
	line-height: 1.35;
}

.cdm-list-name:hover {
	color: #A34700;
	text-decoration: underline;
}

.cdm-list-name.is-featured {
	color: #7A2E00;
	font-weight: 600;
}

.cdm-list-unconfirmed {
	margin-top: 4px;
}

.cdm-list-unconfirmed summary {
	font-size: 11.5px;
	color: #9a9186;
	cursor: pointer;
	padding: 2px 4px;
}

.cdm-list-item.is-unconfirmed {
	color: #9a9186;
	padding-left: 14px;
}

.cdm-pop-links {
	flex-wrap: wrap;
}

/* デスクトップ: リストを広く・高く */
.cdm-list-panel {
	flex-basis: 320px;
}

@media (max-width: 800px) {
	.cdm-body {
		flex-direction: column;
	}

	/* マップは従来の約60%の高さにして、下のリストを見えやすくする */
	.cdm-map {
		height: calc(var(--cdm-map-height, 620px) * 0.6);
		min-height: 300px;
	}

	.cdm-list-panel {
		flex: 1 1 auto;
		height: auto;
		max-height: none;
	}

	.cdm-list {
		max-height: 46vh;
	}

	/* 折りたたみバーは2行に収める */
	.cdm-area-bar {
		font-size: 12.5px;
		gap: 4px 10px;
	}
}

/* ---------- v0.6.0 追加: 名所・自然 ---------- */
.cdm-pop-cat {
	margin: 0 0 6px;
	font-size: 12.5px;
	color: #5a5148;
	display: flex;
	align-items: center;
}

.cdm-pop-approx {
	margin-left: 8px;
	padding: 1px 6px;
	border: 1px solid var(--cdm-line);
	border-radius: 3px;
	font-size: 11px;
	color: #9a9186;
}


/* ---------- v0.8.0: DOMマーカー（外部フォントに依存しない描画） ---------- */
.cdm-marker {
	position: relative;
	width: 0;
	height: 0;
	cursor: pointer;
}

.cdm-marker-dot {
	position: absolute;
	left: 50%;
	top: 50%;
	width: 13px;
	height: 13px;
	margin: -6.5px 0 0 -6.5px;
	border-radius: 50%;
	border: 1.5px solid #fff;
	box-shadow: 0 0 0 1px rgba(43, 36, 32, 0.35);
	background: #666;
}

.cdm-marker.is-featured .cdm-marker-dot {
	width: 19px;
	height: 19px;
	margin: -9.5px 0 0 -9.5px;
	border: 2.5px solid #D9A441;
	box-shadow: 0 0 0 1px rgba(43, 36, 32, 0.45);
}

.cdm-marker-label {
	position: absolute;
	left: 50%;
	top: 9px;
	transform: translateX(-50%);
	white-space: nowrap;
	font-size: 12px;
	line-height: 1.25;
	color: #A34700;
	font-weight: 600;
	text-shadow:
		 1px  1px 2px rgba(255,255,255,0.95),
		-1px  1px 2px rgba(255,255,255,0.95),
		 1px -1px 2px rgba(255,255,255,0.95),
		-1px -1px 2px rgba(255,255,255,0.95);
	pointer-events: none;
}

.cdm-marker.is-featured .cdm-marker-label {
	top: 13px;
	font-size: 13.5px;
	color: #7A2E00;
	font-weight: 700;
}

.cdm-marker-label.is-hidden {
	display: none;
}

.cdm-marker-dot.is-landmark {
	width: 11px;
	height: 11px;
	margin: -5.5px 0 0 -5.5px;
	opacity: 0.92;
}

.cdm-marker-label.is-landmark {
	color: #3a4756;
	font-weight: 500;
	font-size: 11.5px;
	top: 8px;
}

.cdm-cluster {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	height: 38px;
	padding: 0 6px;
	border-radius: 19px;
	background: rgba(74, 55, 40, 0.9);
	color: #fff;
	font-size: 12.5px;
	font-weight: 700;
	border: 2px solid #fff;
	cursor: pointer;
	box-shadow: 0 1px 4px rgba(43, 36, 32, 0.3);
}


/* ---------- v0.9.0: SNSシェア ---------- */
.cdm-share {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 8px;
	margin-top: 10px;
	padding: 8px 10px;
	border: 1px solid var(--cdm-line);
	border-radius: 8px;
	background: #faf8f4;
}

.cdm-share-label {
	font-size: 13px;
	font-weight: 600;
	color: #5a5148;
}

.cdm-share-btn {
	padding: 5px 11px;
	border: 1px solid var(--cdm-line);
	border-radius: 5px;
	background: var(--cdm-bg);
	color: var(--cdm-ink);
	font-size: 12.5px;
	cursor: pointer;
	line-height: 1.3;
}

.cdm-share-btn:hover {
	background: #f0ebe2;
}

.cdm-share-btn.is-done {
	background: #2E8B57;
	border-color: #2E8B57;
	color: #fff;
}

.cdm-share-url {
	flex: 1 1 220px;
	min-width: 140px;
	padding: 5px 8px;
	border: 1px solid var(--cdm-line);
	border-radius: 5px;
	background: #fff;
	font-size: 11.5px;
	color: #7a7168;
}

.cdm-pop-share {
	cursor: pointer;
}

@media (max-width: 600px) {
	.cdm-share {
		gap: 5px 6px;
		padding: 7px 8px;
	}

	.cdm-share-url {
		flex: 1 1 100%;
		order: 10;
	}
}

