/**
 * Castelluccio Map POI — frontend styles.
 * Inherits castelluccio-theme CSS variables when present, with safe fallbacks.
 *
 * @since 1.2.0
 */

.cls-poi-map-wrap {
	--cls-bg:      var(--bg, #f5f1e8);
	--cls-ink:     var(--ink, #1a1714);
	--cls-accent:  var(--accent, #c8321e);
	--cls-radius:  12px;
	--cls-font:    var(--font-body, "Inter", system-ui, -apple-system, "Segoe UI", sans-serif);
	--cls-head:    var(--font-head, "Playfair Display", Georgia, serif);
	margin: 1.5rem 0;
	font-family: var(--cls-font);
	color: var(--cls-ink);
}

/* ── Filter bar ───────────────────────────────────────────────────────── */
.cls-poi-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 12px;
}
.cls-poi-filter {
	--cls-cat-color: #888;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 6px 13px;
	border: 1.5px solid rgba(26, 23, 20, 0.16);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.6);
	color: var(--cls-ink);
	font: inherit;
	font-size: 0.86rem;
	line-height: 1.2;
	cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease, opacity 0.15s ease;
	opacity: 0.55;
}
.cls-poi-filter .cls-poi-dot {
	width: 11px;
	height: 11px;
	border-radius: 50%;
	background: var(--cls-cat-color);
	flex: 0 0 auto;
}
.cls-poi-filter:hover { border-color: var(--cls-cat-color); opacity: 0.85; }
.cls-poi-filter.is-active {
	opacity: 1;
	border-color: var(--cls-cat-color);
	background: color-mix(in srgb, var(--cls-cat-color) 14%, #fff);
}
.cls-poi-filter[data-cat="*"] .cls-poi-dot { display: none; }
.cls-poi-filter[data-cat="*"].is-active {
	border-color: var(--cls-ink);
	background: color-mix(in srgb, var(--cls-ink) 10%, #fff);
}

/* ── Map container ────────────────────────────────────────────────────── */
.cls-poi-map {
	width: 100%;
	min-height: 70vh;
	border-radius: var(--cls-radius);
	overflow: hidden;
	background: #e8e6df;
	box-shadow: 0 2px 14px rgba(26, 23, 20, 0.12);
	position: relative;
	z-index: 0;
}
.cls-poi-map-loading {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	text-align: center;
	color: rgba(26, 23, 20, 0.6);
	font-size: 0.95rem;
}

/* ── Custom pins ──────────────────────────────────────────────────────── */
.cls-poi-pin-wrap { background: transparent; border: 0; }
.cls-poi-pin {
	display: block;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	border: 2.5px solid #fff;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
	transition: transform 0.12s ease;
}
.cls-poi-pin-wrap:hover .cls-poi-pin { transform: scale(1.25); }

.cls-poi-locate a {
	font-size: 18px;
	font-weight: 700;
	line-height: 26px;
	text-align: center;
	color: var(--accent, #c8321e);
}

/* ── Popup ────────────────────────────────────────────────────────────── */
.leaflet-popup-content-wrapper {
	border-radius: var(--cls-radius);
	box-shadow: 0 4px 20px rgba(26, 23, 20, 0.22);
}
.leaflet-popup-content { margin: 0; width: auto !important; }
.cls-poi-popup { font-family: var(--cls-font, "Inter", sans-serif); }
.cls-poi-popup-thumb img {
	display: block;
	width: 100%;
	height: 130px;
	object-fit: cover;
	border-radius: var(--cls-radius) var(--cls-radius) 0 0;
}
.cls-poi-popup-body { padding: 12px 14px 14px; }
.cls-poi-popup-cat {
	display: inline-block;
	padding: 2px 9px;
	border-radius: 999px;
	color: #fff;
	font-size: 0.68rem;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	margin-bottom: 7px;
}
.cls-poi-popup-title {
	font-family: var(--cls-head, "Playfair Display", serif);
	font-size: 1.15rem;
	line-height: 1.2;
	margin: 0 0 6px;
	color: var(--cls-ink);
}
.cls-poi-popup-meta {
	font-size: 0.8rem;
	color: rgba(26, 23, 20, 0.6);
	margin: 0 0 6px;
}
.cls-poi-popup-excerpt {
	font-size: 0.88rem;
	line-height: 1.45;
	margin: 0 0 12px;
	color: rgba(26, 23, 20, 0.85);
}
.cls-poi-popup-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cls-poi-btn {
	display: inline-block;
	padding: 7px 14px;
	border-radius: 8px;
	font-size: 0.82rem;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	transition: opacity 0.15s ease;
}
.cls-poi-btn-primary { background: var(--cls-accent); color: #fff; }
.cls-poi-btn-ghost {
	background: transparent;
	color: var(--cls-ink);
	border: 1.5px solid rgba(26, 23, 20, 0.25);
}
.cls-poi-btn:hover { opacity: 0.85; }

/* ── Mobile ───────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
	.cls-poi-map { min-height: 70vh; height: auto !important; }
	.cls-poi-filter { font-size: 0.8rem; padding: 5px 11px; }
	.cls-poi-popup-title { font-size: 1.05rem; }
}

/* Fallback for browsers without color-mix(): keep active chips legible. */
@supports not (background: color-mix(in srgb, red 10%, white)) {
	.cls-poi-filter.is-active { background: rgba(255, 255, 255, 0.95); }
}
