/* Posts map page — aligned with homepage (.site-main--homepage / .cyprus-home) */

.site-main--posts-map {
	max-width: var(--cd-site-width, 1150px);
	margin-left: auto;
	margin-right: auto;
	padding-left: 1.25rem;
	padding-right: 1.25rem;
	width: 100%;
}

.posts-map-entry {
	max-width: none;
	margin: 0;
	padding: 0;
}

.cyprus-home--posts-map {
	padding: 0 0 3rem;
}

.posts-map__header {
	text-align: center;
	padding: 2.5rem 0 1.75rem;
}

.posts-map__title {
	margin: 0 0 1.5rem;
	font-size: clamp(2rem, 5vw, 3rem);
	font-weight: 700;
	letter-spacing: -0.02em;
	color: var(--cd-accent, #0b2048);
	line-height: 1.15;
}

.posts-map__search {
	max-width: 36rem;
	margin: 0 auto 1.25rem;
	width: 100%;
}

.posts-map__intro {
	max-width: 40rem;
	margin: 0 auto 15px;
	text-align: left;
	color: var(--cd-text-secondary, #7a7a7a);
	font-size: 1.0625rem;
	line-height: 1.55;
}

.posts-map__intro > *:first-child {
	margin-top: 0;
}

.posts-map__intro > *:last-child {
	margin-bottom: 0;
}

/* Map + results: full width when idle; 25% sidebar + map when search has a query */
.posts-map__body {
	display: flex;
	flex-direction: row;
	align-items: stretch;
	margin-top: 0.25rem;
	gap: 0;
	min-width: 0;
}

.posts-map__results {
	display: none;
	flex: 0 0 25%;
	max-width: 25%;
	min-width: 0;
	flex-direction: column;
	background: var(--cd-bg-card, #fff);
	border: 1px solid rgb(11 32 72 / 12%);
	border-right: none;
	border-radius: 10px 0 0 10px;
	box-shadow: 0 8px 24px rgb(11 32 72 / 8%);
	overflow: hidden;
}

.posts-map__body--search-active .posts-map__results {
	display: flex;
	max-height: min(502px, 70vh);
	min-height: 0;
}

.posts-map__body--search-active .posts-map__map-wrap {
	border-radius: 0 10px 10px 0;
}

/* Leaflet container must match map-wrap so left edge stays square when sidebar is visible */
.posts-map__body--search-active .cd-posts-map {
	border-radius: 0 10px 10px 0;
}

.posts-map__results-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.5rem;
	padding: 0.65rem 0.85rem;
	border-bottom: 1px solid rgb(11 32 72 / 10%);
	background: rgb(11 32 72 / 4%);
	flex-shrink: 0;
}

.posts-map__results-title {
	margin: 0;
	font-family: var(--cd-font-titles, "Montserrat", sans-serif);
	font-size: 0.9375rem;
	font-weight: 700;
	color: var(--cd-accent, #0b2048);
	line-height: 1.2;
}

.posts-map__results-count {
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--cd-text-secondary, #7a7a7a);
	font-variant-numeric: tabular-nums;
}

.posts-map__results-list {
	list-style: none;
	margin: 0;
	padding: 0;
	overflow-y: auto;
	flex: 1 1 auto;
	min-height: 0;
	max-height: 100%;
	-webkit-overflow-scrolling: touch;
}

.posts-map__result {
	display: flex;
	gap: 0.55rem;
	padding: 0.65rem 0.85rem;
	border-bottom: 1px solid rgb(11 32 72 / 8%);
	cursor: pointer;
	text-align: left;
	transition: background 0.12s ease;
}

.posts-map__result:hover,
.posts-map__result:focus-within {
	background: rgb(11 32 72 / 5%);
}

.posts-map__result:active {
	background: rgb(11 32 72 / 9%);
}

.posts-map__result--empty {
	cursor: default;
	color: var(--cd-text-secondary, #7a7a7a);
	font-size: 0.875rem;
	line-height: 1.45;
}

.posts-map__result--empty:hover,
.posts-map__result--empty:focus-within {
	background: transparent;
}

.posts-map__result-thumb {
	flex: 0 0 4rem;
	width: 4rem;
	height: 4rem;
	border-radius: 6px;
	overflow: hidden;
	background: rgb(11 32 72 / 6%);
	align-self: flex-start;
	line-height: 0;
}

.posts-map__result-thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.posts-map__result-body {
	min-width: 0;
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
}

.posts-map__result-title {
	font-family: var(--cd-font-titles, "Montserrat", sans-serif);
	font-size: 0.8125rem;
	font-weight: 700;
	line-height: 1.25;
	color: var(--cd-accent, #0b2048);
}

.posts-map__result:hover .posts-map__result-title,
.posts-map__result:focus-within .posts-map__result-title {
	color: var(--cd-accent-hover, #1b4fb3);
}

.posts-map__result-excerpt {
	margin: 0;
	font-size: 0.75rem;
	line-height: 1.35;
	color: var(--cd-text-secondary, #7a7a7a);
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.posts-map__result .cd-search-highlight,
.cd-map-popup .cd-search-highlight {
	padding: 0;
}

.posts-map__map-wrap {
	flex: 1 1 0;
	min-width: 0;
	border-radius: 10px;
	overflow: hidden;
	border: 1px solid rgb(11 32 72 / 12%);
	box-shadow: 0 8px 28px rgb(11 32 72 / 12%);
	background: rgb(11 32 72 / 4%);
}

.cd-posts-map {
	width: 100%;
	height: 500px;
	min-height: 500px;
	z-index: 1;
	border-radius: 10px;
}

/* Leaflet popup: thumbnail | text */
.leaflet-popup-content {
	margin: 0 !important;
}

.leaflet-popup-content-wrapper.cd-map-popup-container,
.leaflet-popup-content-wrapper.cd-map-popup-container .leaflet-popup-content {
	padding: 0 !important;
	margin: 0 !important;
	overflow: hidden;
	border-radius: 10px;
	line-height: 1.35;
}

.leaflet-popup-content .cd-map-popup {
	display: grid;
	grid-template-columns: minmax(0, 11.5rem) minmax(0, 1fr);
	gap: 0;
	max-width: 100%;
	align-items: stretch;
	min-width: 0;
}

.leaflet-popup-content .cd-map-popup--no-thumb {
	grid-template-columns: 1fr;
}

.cd-map-popup__media {
	display: block;
	line-height: 0;
	overflow: hidden;
	min-height: 0;
	align-self: stretch;
	height: 100%;
	background: rgb(11 32 72 / 6%);
	border-radius: 10px 0 0 10px;
}

.cd-map-popup__media img {
	display: block;
	width: 100%;
	height: 100%;
	min-height: 100%;
	object-fit: cover;
	border-radius: 10px 0 0 10px;
}

.cd-map-popup__body {
	padding: 0.75rem 1rem 0.85rem;
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	min-width: 0;
}

.cd-map-popup__body > * {
	margin-block: 0;
	margin-inline: 0;
}

.cd-map-popup__title {
	font-family: var(--cd-font-titles, "Montserrat", sans-serif);
	font-size: 1.05rem;
	font-weight: 700;
	line-height: 1.2;
	color: var(--cd-accent, #0b2048);
	text-decoration: none;
	display: block;
}

.cd-map-popup__title:hover,
.cd-map-popup__title:focus-visible {
	color: var(--cd-accent-hover, #1b4fb3);
}

.cd-map-popup__excerpt {
	margin: 0 !important;
	padding: 0;
	font-size: 0.8125rem;
	line-height: 1.32;
	color: var(--cd-text-secondary, #7a7a7a);
}

.cd-map-popup__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.45rem;
	margin-top: 0.15rem;
}

.cd-map-popup__more {
	align-self: auto;
	text-decoration: none !important;
	line-height: 1.2;
}

.cd-map-popup__edit {
	text-decoration: none !important;
	line-height: 1.2;
	background: transparent !important;
	color: var(--cd-accent, #0b2048) !important;
	border: 1px solid rgb(11 32 72 / 28%) !important;
	box-shadow: none !important;
	transform: none !important;
}

.cd-map-popup__edit:hover,
.cd-map-popup__edit:focus-visible {
	background: rgb(11 32 72 / 6%) !important;
	color: var(--cd-accent-hover, #1b4fb3) !important;
	border-color: rgb(27 79 179 / 40%) !important;
}

/* Tablet: slightly wider results column so the map keeps readable width while both stay visible */
@media (max-width: 1023px) and (min-width: 768px) {
	.posts-map__body--search-active .posts-map__results {
		flex: 0 0 34%;
		max-width: 34%;
		min-width: 11.5rem;
	}
}

/*
 * Phone: stack results above map; limit list height so the map always gets viewport space
 * (avoid a tall results panel pushing the map off-screen).
 */
@media (max-width: 767px) {
	.posts-map__body--search-active {
		flex-direction: column;
	}

	.posts-map__body--search-active .posts-map__results {
		flex: 0 0 auto;
		max-width: none;
		width: 100%;
		max-height: min(30vh, 13.5rem);
		border-right: 1px solid rgb(11 32 72 / 12%);
		border-radius: 10px 10px 0 0;
	}

	.posts-map__body--search-active .posts-map__map-wrap {
		flex: 0 0 auto;
		min-height: clamp(260px, 50vh, 460px);
		border-radius: 0 0 10px 10px;
	}

	.posts-map__body--search-active .cd-posts-map {
		height: clamp(260px, 50vh, 460px);
		min-height: clamp(260px, 50vh, 460px);
		border-radius: 0 0 10px 10px;
	}
}

@media (max-width: 480px) {
	.posts-map__header {
		padding: 1.75rem 0 1.25rem;
	}
}
