/* ==========================================================================
   Map — Leaflet interactive map for monuments
   ========================================================================== */

/* ── Wrapper ────────────────────────────────────────────────────────────── */

.monuments-map-wrapper {
	position: relative;
	margin-bottom: 3rem;
}

/* ── Map canvas ─────────────────────────────────────────────────────────── */

#monuments-map {
	width: 100%;
	min-height: 600px;
}

/* Empty-state message shown when no monuments have valid coordinates */
.monuments-map-empty {
	padding: 3rem 1.5rem;
	text-align: center;
	color: var(--color-dark);
	font-size: 1rem;
}

/* ── Hover card overlay ─────────────────────────────────────────────────── */
/*
 * Position: bottom-left of the map wrapper.
 * Will be confirmed once the design is ready.
 * To move it, change left/right/top/bottom here.
 */

.monument-map-card {
	position: absolute;
	left:     20px;
	bottom:   20px;
	z-index:  500;             /* above tile layer (200) but below Leaflet UI (1000) */
	width:    min( 340px, calc( 100% - 40px ) );
	background: var(--color-cream, #EDE8DE);
	border:     1px solid rgba(71, 64, 52, 0.18);
	box-shadow: 0 4px 24px rgba(35, 31, 32, 0.15);
	border-radius: 4px;
	overflow: hidden;
	opacity: 1;
	transition: opacity 250ms ease;
}

.monument-map-card--hiding {
	opacity: 0;
}

.monument-map-card[hidden] {
	display: none;
}

/* ── Map card inner ─────────────────────────────────────────────────────── */

.map-card {
	display: flex;
	flex-direction: column;
}

.map-card__image {
	display: block;
	width: 100%;
	height: 180px;
	object-fit: cover;
	object-position: center;
	flex-shrink: 0;
}

.map-card__body {
	padding: 1rem 1.25rem 1.25rem;
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

.map-card__title {
	font-size: 1rem;
	font-weight: 700;
	color: var(--color-black, #231F20);
	margin: 0 0 0.25rem;
	line-height: 1.3;
}

.map-card__meta {
	font-size: 0.8125rem;
	color: var(--color-dark, #474034);
	margin: 0;
	line-height: 1.4;
}

.map-card__category {
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	font-size: 0.75rem;
	color: var(--color-accent, #F25E0D);
}

.map-card__excerpt {
	font-size: 0.8125rem;
	color: var(--color-dark, #474034);
	margin: 0.25rem 0 0;
	line-height: 1.5;
	/* Clamp to 3 lines */
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.map-card__link {
	margin-top: 0.75rem;
	align-self: flex-start;
}

/* ── Marker divIcons ────────────────────────────────────────────────────── */

/*
 * Reset Leaflet's default anchor styles so our custom dot is the icon.
 */
.monument-marker {
	background: transparent !important;
	border:     none !important;
	cursor:     pointer;
}

/* Image icon (L.icon) — scale the img, not the marker wrapper */
.monument-marker img {
	transition:      transform 0.15s ease, filter 0.15s ease;
	transform-origin: center bottom;
	display:         block;
}

.monument-marker:hover img {
	transform: scale( 1.3 );
	filter:    drop-shadow( 0 3px 6px rgba(0,0,0,0.45) );
}

/* Div icon (L.divIcon) — scale the dot span */
.monument-marker__dot {
	transition:      transform 0.15s ease, box-shadow 0.15s ease;
	transform-origin: center bottom;
}

.monument-marker__dot {
	display:     flex;
	align-items: center;
	justify-content: center;
	width:       100%;
	height:      100%;
	border-radius: 50%;
	color:       #fff;
	font-size:   14px;
	line-height: 1;
	box-shadow:  0 2px 6px rgba(0, 0, 0, 0.35);
	border:      2px solid rgba(255, 255, 255, 0.85);
	cursor:      pointer;
	transition:  transform 0.12s ease, box-shadow 0.12s ease;
	user-select: none;
}

/*
 * Highlighted state — triggered when hovering a list card
 * (marker.setIcon with active=true) or directly from JS.
 */
.monument-marker--active .monument-marker__dot {
	transform:  scale(1.2);
	box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45);
}

/* Touch devices: ensure minimum 40 px tap target */
@media (hover: none) {
	.monument-marker__dot {
		min-width:  40px;
		min-height: 40px;
	}
}

/* ── "No results" overlay ───────────────────────────────────────────────── */

.map-no-results {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 500;
	background: rgba(35, 31, 32, 0.72);
	color: #fff;
	font-family: var(--font-secondary, sans-serif);
	font-size: 1rem;
	font-weight: 600;
	padding: 14px 28px;
	border-radius: 4px;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.map-no-results--visible {
	opacity: 1;
}

/* ── Leaflet overrides ──────────────────────────────────────────────────── */

/* Inherit site font inside attribution control */
.leaflet-container {
	font-family: inherit;
}

.leaflet-control-attribution {
	font-size: 0.6875rem;
}

.leaflet-control-zoom a {
	width: 34px !important;
	height: 34px !important;
	line-height: 34px !important;
	font-size: 18px !important;
}
