/*
 * Perepaik Theme — map page ([perepaik_map]).
 * Builds on places.css (directory header).
 */

/* ---------------------------------------------------------
   Toolbar: my location, city, radius
   --------------------------------------------------------- */

.pp-map__toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 16px;
	margin-bottom: 20px;
	padding: 14px 16px;
	background: var(--pp-surface);
	border-radius: 28px;
	box-shadow: var(--pp-shadow-sm);
}

.pp-map__locate,
.pp-map__city-submit {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-height: 46px;
	padding: 0 20px;
	background: var(--pp-surface);
	border: 1px solid #ebe2d8;
	border-radius: 999px;
	box-shadow: 0 2px 6px rgba(90, 64, 40, 0.06);
	color: var(--pp-ink);
	font: 500 16px/1 var(--pp-font-body);
	cursor: pointer;
	transition: border-color 160ms ease, background-color 160ms ease;
}

.pp-map__locate:hover,
.pp-map__city-submit:hover {
	border-color: #d9cbbd;
}

.pp-map__locate .pp-icon {
	font-size: 20px;
}

.pp-map__city {
	display: flex;
	gap: 10px;
}

.pp-map__city-input {
	width: 240px;
	min-height: 46px;
	padding: 0 18px;
	background: var(--pp-surface);
	border: 1px solid #ebe2d8;
	border-radius: 999px;
	color: var(--pp-ink);
	font: 400 16px/1 var(--pp-font-body);
}

.pp-map__city-input::placeholder {
	color: var(--pp-muted);
}

.pp-map__city-input:focus {
	border-color: var(--pp-purple);
	outline: none;
	box-shadow: 0 0 0 3px var(--pp-purple-soft);
}

.pp-map__city-submit {
	background: #f7efe6;
}

.pp-map__radius {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-left: auto;
	color: var(--pp-ink-soft);
	font-size: 16px;
}

.pp-map__radius output {
	color: var(--pp-ink-soft);
}

.pp-map__radius input[type="range"] {
	width: 200px;
	accent-color: #6f55a8;
}

.pp-map__status {
	margin: -6px 0 16px;
	color: var(--pp-ink-soft);
	font-size: 14px;
}

/* ---------------------------------------------------------
   Map + results
   --------------------------------------------------------- */

.pp-map__layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 460px;
	gap: 20px;
	align-items: start;
}

.pp-map__canvas {
	position: relative;
	height: 640px;
	overflow: hidden;
	border-radius: 28px;
	background: linear-gradient(160deg, #c8f0dc 0%, #c3e9ef 55%, #c9e3fb 100%);
	box-shadow: var(--pp-shadow-sm);
}

.pp-map__map {
	position: absolute;
	inset: 0;
}

.pp-map__placeholder {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 24px;
	color: var(--pp-ink-soft);
	font-size: 16px;
	text-align: center;
}

.pp-map__placeholder p {
	margin: 0 0 6px;
}

.pp-map__placeholder-admin {
	font-size: 14px;
}

.pp-map__results {
	display: flex;
	flex-direction: column;
	height: 640px;
	padding: 20px 8px 8px 24px;
	background: var(--pp-surface);
	border-radius: 28px;
	box-shadow: var(--pp-shadow-sm);
}

.pp-map__count {
	margin: 0 0 8px;
	color: var(--pp-ink);
	font-family: var(--pp-font-body);
	font-size: 17px;
	font-weight: 500;
}

.pp-map__list {
	flex: 1;
	margin: 0;
	padding: 0 12px 0 0;
	overflow-y: auto;
	list-style: none;
	overscroll-behavior: contain;
}

.pp-map-result {
	display: flex;
	align-items: center;
	gap: 16px;
	width: 100%;
	padding: 14px 10px 14px 0;
	background: none;
	border: 0;
	border-radius: 14px;
	color: inherit;
	font: inherit;
	text-align: left;
	text-decoration: none;
	cursor: pointer;
}

.pp-map-result:hover .pp-map-result__title,
.pp-map-result.is-active .pp-map-result__title {
	color: #6f55a8;
}

.pp-map-result__dot {
	flex: none;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: var(--pp-dot, var(--pp-coral));
}

.pp-map-result__body {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.pp-map-result__title {
	color: var(--pp-ink);
	font-size: 17px;
	font-weight: 500;
	line-height: 1.3;
	transition: color 160ms ease;
}

.pp-map-result__meta,
.pp-map-result__when {
	color: var(--pp-ink-soft);
	font-size: 14px;
}

.pp-map__empty {
	padding: 24px 0;
	color: var(--pp-ink-soft);
}

.pp-map__more-item {
	padding: 12px 0 8px;
}

.pp-map__more {
	width: 100%;
}

/* Google's info window */
.pp-map-info {
	display: flex;
	flex-direction: column;
	gap: 3px;
	font-family: var(--pp-font-body);
}

.pp-map-info__type {
	color: var(--pp-muted);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.pp-map-info__title {
	color: var(--pp-ink);
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
	text-decoration: none;
}

.pp-map-info__line {
	color: var(--pp-ink-soft);
	font-size: 13px;
}

.pp-map-info__more {
	margin-top: 6px;
	color: #6f55a8;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
}

/* ---------------------------------------------------------
   Tablet & mobile
   --------------------------------------------------------- */

@media (max-width: 1100px) {
	.pp-map__layout {
		grid-template-columns: minmax(0, 1fr) 360px;
	}

	.pp-map__radius {
		margin-left: 0;
	}
}

@media (max-width: 900px) {
	.pp-map__layout {
		grid-template-columns: 1fr;
	}

	.pp-map__canvas {
		height: 60vh;
		min-height: 360px;
		max-height: 520px;
	}

	.pp-map__results {
		height: auto;
		padding: 18px 16px 8px;
	}

	.pp-map__list {
		overflow: visible;
		padding: 0;
	}
}

@media (max-width: 767px) {
	/* No wrapping: a wrapping column sizes to its widest item and overflows. */
	.pp-map__toolbar {
		flex-direction: column;
		flex-wrap: nowrap;
		align-items: stretch;
		padding: 14px;
		border-radius: 22px;
	}

	.pp-map__locate {
		justify-content: center;
	}

	.pp-map__city-input {
		flex: 1;
		width: auto;
		min-width: 0;
	}

	.pp-map__radius {
		justify-content: space-between;
		gap: 12px;
		font-size: 15px;
	}

	.pp-map__radius input[type="range"] {
		flex: 1;
		width: auto;
		min-width: 0;
		max-width: 220px;
	}

	.pp-map__canvas {
		border-radius: 22px;
	}

	.pp-map__results {
		border-radius: 22px;
	}

	.pp-map-result {
		padding: 12px 0;
	}

	.pp-map-result__title {
		font-size: 16px;
	}
}
