/*
 * Explore map page — Red Savia.
 *
 * Two treatments ship here because the map background is still an open brand
 * decision (design.md: mockups show dark, Brand Standards v1.0 says Warm Stone).
 * Warm Stone is the default; [data-maptheme="dark"] is the mockup treatment.
 * Remove the toggle and the losing block once Zara decides.
 */

.rs-explore {
	--x-surface: var(--stone);
	--x-surface-2: var(--white);
	--x-ink: var(--charcoal);
	--x-muted: rgba(17, 17, 17, 0.62);
	--x-line: rgba(17, 17, 17, 0.14);
	--x-chip-bg: rgba(255, 255, 255, 0.88);
	--x-card-shadow: 0 10px 30px rgba(17, 17, 17, 0.12);
	--x-pin: var(--crimson);
	--x-pin-selected: var(--oxblood);

	display: grid;
	grid-template-rows: 1fr auto;
	height: calc(100vh - 96px);
	min-height: 620px;
	background: var(--x-surface);
	color: var(--x-ink);
}

.rs-explore[data-maptheme="dark"] {
	--x-surface: #150A0C;
	--x-surface-2: #1D0F11;
	--x-ink: var(--stone);
	--x-muted: rgba(242, 239, 232, 0.62);
	--x-line: rgba(242, 239, 232, 0.16);
	--x-chip-bg: rgba(29, 15, 17, 0.85);
	--x-card-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
	--x-pin-selected: var(--stone);
}

.explore-main {
	display: grid;
	grid-template-columns: 380px 1fr;
	min-height: 0;
}

/* ---------- Sidebar ---------- */

.explore-side {
	padding: 36px 32px 24px;
	overflow-y: auto;
	border-right: 1px solid var(--x-line);
	display: flex;
	flex-direction: column;
	gap: 24px;
}

.explore-side .rs-eyebrow { margin-bottom: 0; }

.explore-title {
	font-family: var(--font-serif);
	font-weight: 400;
	font-size: 40px;
	line-height: 1.08;
}

.explore-title em {
	font-style: italic;
	color: var(--crimson);
}

.explore-search {
	display: flex;
	align-items: center;
	gap: 10px;
	border: 1px solid var(--x-line);
	background: var(--x-surface-2);
	padding: 13px 16px;
}

.explore-search svg { flex: none; opacity: 0.55; }

.explore-search input {
	border: none;
	outline: none;
	background: transparent;
	font-family: var(--font-sans);
	font-size: 14px;
	color: var(--x-ink);
	width: 100%;
}

.explore-search input::placeholder { color: var(--x-muted); }

.explore-results {
	display: flex;
	flex-direction: column;
	border-top: 1px solid var(--x-line);
}

.explore-result {
	display: block;
	width: 100%;
	text-align: left;
	background: transparent;
	border: none;
	border-bottom: 1px solid var(--x-line);
	padding: 14px 2px;
	cursor: pointer;
	color: var(--x-ink);
}

.explore-result:hover .explore-result-name,
.explore-result.active .explore-result-name { color: var(--crimson); }

.explore-result-name {
	font-family: var(--font-serif);
	font-size: 20px;
	line-height: 1.2;
}

.explore-result-meta {
	font-family: var(--font-sans);
	font-size: 12px;
	color: var(--x-muted);
	margin-top: 3px;
}

.explore-empty {
	font-size: 13px;
	color: var(--x-muted);
	padding: 14px 2px;
}

/* ---------- Map ---------- */

.explore-map-wrap { position: relative; min-width: 0; }

#rs-explore-map { position: absolute; inset: 0; }
#rs-explore-map canvas { outline: none; }

.explore-chips {
	position: absolute;
	top: 20px;
	left: 22px;
	right: 180px;
	z-index: 10;
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.explore-chip {
	font-family: var(--font-sans);
	font-weight: 500;
	font-size: 12px;
	letter-spacing: 0.06em;
	padding: 8px 16px;
	cursor: pointer;
	border: 1px solid var(--x-line);
	background: var(--x-chip-bg);
	color: var(--x-ink);
	backdrop-filter: blur(6px);
}

.explore-chip.active {
	background: var(--crimson);
	border-color: var(--crimson);
	color: var(--white);
}

/* practices with no live listings yet: shown for completeness, not clickable */
.explore-chip.is-empty {
	opacity: 0.4;
	cursor: default;
	border-style: dashed;
}

.explore-theme-toggle {
	position: absolute;
	top: 20px;
	right: 22px;
	z-index: 10;
	display: flex;
	border: 1px solid var(--x-line);
	background: var(--x-chip-bg);
	backdrop-filter: blur(6px);
}

.explore-theme-toggle button {
	font-family: var(--font-sans);
	font-weight: 500;
	font-size: 11px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	padding: 8px 14px;
	border: none;
	background: transparent;
	color: var(--x-muted);
	cursor: pointer;
}

.explore-theme-toggle button.active {
	background: var(--crimson);
	color: var(--white);
}

/* ---------- Pins ---------- */

.explore-pin { cursor: pointer; }

.explore-pin-head {
	width: 36px;
	height: 36px;
	background: var(--x-pin);
	border-radius: 50% 50% 50% 0;
	transform: rotate(-45deg);
	display: grid;
	place-items: center;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
	transition: transform 0.15s;
}

.explore-pin:hover .explore-pin-head { transform: rotate(-45deg) scale(1.12); }

.explore-pin-mark {
	width: 20px;
	height: 20px;
	transform: rotate(45deg);
	background: var(--white);
	-webkit-mask: url('../img/mark.png') center / contain no-repeat;
	        mask: url('../img/mark.png') center / contain no-repeat;
}

.explore-pin.selected .explore-pin-head {
	background: var(--x-pin-selected);
	transform: rotate(-45deg) scale(1.3);
	box-shadow: 0 0 0 3px var(--x-surface), 0 0 0 5px var(--x-pin-selected), 0 6px 18px rgba(0, 0, 0, 0.4);
}

.rs-explore[data-maptheme="dark"] .explore-pin.selected .explore-pin-mark { background: var(--crimson); }

/* ---------- Preview card ---------- */

.explore-preview {
	position: absolute;
	top: 72px;
	right: 22px;
	z-index: 11;
	width: 330px;
	max-height: calc(100% - 96px);
	overflow-y: auto;
	background: var(--x-surface-2);
	box-shadow: var(--x-card-shadow);
	border: 1px solid var(--x-line);
	display: none;
	flex-direction: column;
}

.explore-preview.open { display: flex; }

.explore-preview-banner {
	height: 104px;
	position: relative;
	overflow: hidden;
	flex: none;
	background: linear-gradient(120deg, var(--oxblood), var(--crimson));
}

.explore-preview-banner .wm {
	position: absolute;
	right: -30px;
	top: -24px;
	width: 160px;
	height: 160px;
	background: var(--white);
	opacity: 0.14;
	-webkit-mask: url('../img/mark.png') center / contain no-repeat;
	        mask: url('../img/mark.png') center / contain no-repeat;
}

.explore-preview-close {
	position: absolute;
	top: 10px;
	right: 10px;
	width: 28px;
	height: 28px;
	border: none;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.35);
	color: var(--white);
	font-size: 14px;
	line-height: 1;
	cursor: pointer;
}

.explore-preview-body {
	padding: 18px 20px 20px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.explore-preview-cat {
	font-family: var(--font-sans);
	font-weight: 500;
	font-size: 10.5px;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--crimson);
}

.explore-preview-name {
	font-family: var(--font-serif);
	font-weight: 400;
	font-size: 26px;
	line-height: 1.12;
}

.explore-preview-meta,
.explore-preview-addr {
	font-size: 12.5px;
	color: var(--x-muted);
}

.explore-preview-meta .star { color: var(--crimson); }

.explore-preview-tags { display: flex; gap: 6px; flex-wrap: wrap; }

.explore-preview-tags span {
	font-size: 11px;
	padding: 4px 10px;
	border: 1px solid var(--x-line);
	color: var(--x-muted);
}

.explore-preview-lede {
	font-size: 13px;
	line-height: 1.55;
	color: var(--x-muted);
}

.explore-preview-hours { font-size: 12.5px; color: var(--x-muted); }
.explore-preview-hours b { font-weight: 500; color: var(--x-ink); }

.explore-preview .btn { justify-content: center; width: 100%; margin-top: 4px; }

/* ---------- Stat strip ---------- */

.explore-statbar {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	border-top: 1px solid var(--x-line);
	background: var(--x-surface);
}

.explore-stat {
	padding: 20px 28px;
	border-right: 1px solid var(--x-line);
}

.explore-stat:last-child { border-right: none; }

.explore-stat-h {
	font-family: var(--font-sans);
	font-weight: 500;
	font-size: 12px;
	letter-spacing: 0.18em;
	text-transform: uppercase;
}

.explore-stat-p {
	font-size: 12px;
	color: var(--x-muted);
	margin-top: 4px;
	line-height: 1.5;
}

.explore-stat a {
	font-family: var(--font-sans);
	font-weight: 500;
	font-size: 11px;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--crimson);
	text-decoration: none;
	margin-top: 8px;
	display: inline-block;
}

/* ---------- View toggle (Map / List) + sidebar filter bar ---------- */

.explore-side-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

.explore-viewtoggle {
	display: flex;
	border: 1px solid var(--x-line);
	flex: none;
}

.explore-viewtoggle button {
	display: grid;
	place-items: center;
	padding: 7px 11px;
	border: none;
	background: transparent;
	color: var(--x-muted);
	cursor: pointer;
}

.explore-viewtoggle button.active {
	background: var(--crimson);
	color: var(--white);
}

.explore-filterbar {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

/* result rows become richer with a cover thumbnail */
.explore-result {
	display: flex;
	gap: 12px;
	align-items: center;
	text-decoration: none;
}

.explore-result-thumb {
	flex: none;
	width: 54px;
	height: 54px;
	overflow: hidden;
	background: linear-gradient(120deg, var(--oxblood), var(--crimson));
}

.explore-result-thumb img { width: 100%; height: 100%; object-fit: cover; }
.explore-result-text { display: flex; flex-direction: column; min-width: 0; }

/* ---------- List view ---------- */

.rs-explore[data-view="list"] { height: auto; min-height: 0; }
.rs-explore[data-view="list"] .explore-map-wrap { display: none; }
.rs-explore[data-view="list"] .explore-main { grid-template-columns: 1fr; }
.rs-explore[data-view="list"] .explore-side { overflow: visible; border-right: none; }

.rs-explore[data-view="list"] .explore-results {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 20px;
	border-top: none;
}

.rs-explore[data-view="list"] .explore-result {
	flex-direction: column;
	align-items: stretch;
	gap: 0;
	border: 1px solid var(--x-line);
	border-bottom: 1px solid var(--x-line);
	transition: border-color 0.2s ease;
}

.rs-explore[data-view="list"] .explore-result:hover { border-color: var(--crimson); }
.rs-explore[data-view="list"] .explore-result-thumb { width: 100%; height: 150px; }
.rs-explore[data-view="list"] .explore-result-text { padding: 14px 16px 16px; }

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
	.rs-explore { height: auto; }
	.explore-main { grid-template-columns: 1fr; }
	.explore-side { border-right: none; border-bottom: 1px solid var(--x-line); }
	.explore-map-wrap { height: 70vh; }
	.explore-statbar { grid-template-columns: 1fr 1fr; }
	.explore-stat { border-bottom: 1px solid var(--x-line); }
	.explore-chips { right: 22px; }
	.explore-theme-toggle { top: auto; bottom: 20px; }
	.explore-preview { left: 22px; width: auto; }
}
