/* ============================================================
   ETCH MAPS — FRONTEND STYLES
   ============================================================ */

.etch-maps-wrap {
	position: relative;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 4px 24px rgba(0,0,0,.12);
	margin: 1.5em 0;
}

.etch-maps-container {
	width: 100%;
	display: block;
}

/* ---- PIN MARKERS ---- */
.etch-pin-marker {
	background: none !important;
	border: none !important;
}
.etch-pin-marker svg {
	filter: drop-shadow(0 3px 8px rgba(0,0,0,.4));
	transition: transform .15s cubic-bezier(.34,1.56,.64,1);
}
.etch-pin-marker:hover svg,
.etch-pin-marker.active svg {
	transform: scale(1.2) translateY(-3px);
}
.etch-custom-pin-icon {
	background: none !important;
	border: none !important;
	object-fit: contain !important;
}

/* ---- POPUP BASE ---- */
.etch-popup-wrap .leaflet-popup-content-wrapper {
	padding: 0;
	border-radius: 14px;
	overflow: hidden;
	box-shadow:
		0 4px 6px rgba(0,0,0,.06),
		0 12px 40px rgba(0,0,0,.18);
	border: none;
	min-width: 240px;
	max-width: 340px;
	animation: etch-popup-appear .22s cubic-bezier(.34,1.36,.64,1);
}

@keyframes etch-popup-appear {
	from {
		opacity: 0;
		transform: translateY(10px) scale(.94);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

.etch-popup-wrap .leaflet-popup-content {
	margin: 0;
	line-height: 1;
}

.etch-popup-wrap .leaflet-popup-tip-container {
	width: 30px;
	height: 15px;
	margin: 0 auto;
}

.etch-popup-wrap .leaflet-popup-tip {
	background: #fff;
	box-shadow: none;
}

.etch-popup-wrap .leaflet-popup-close-button {
	display: none;
}

/* ---- POPUP INNER ---- */
.etch-popup {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.etch-popup-header {
	padding: 14px 16px 12px;
	background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
	position: relative;
}

.etch-popup-title {
	font-size: 15px;
	font-weight: 700;
	color: #fff;
	margin: 0;
	padding-right: 28px;
	line-height: 1.3;
	text-shadow: 0 1px 2px rgba(0,0,0,.2);
}

.etch-popup-close {
	position: absolute;
	top: 10px;
	right: 10px;
	width: 24px;
	height: 24px;
	background: rgba(255,255,255,.2);
	border: none;
	border-radius: 50%;
	color: #fff;
	font-size: 15px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	transition: background .15s;
	padding: 0;
}
.etch-popup-close:hover { background: rgba(255,255,255,.35); }

.etch-popup-body {
	padding: 14px 16px 16px;
	background: #fff;
	font-size: 14px;
	line-height: 1.6;
	color: #374151;
	max-height: 220px;
	overflow-y: auto;
}

.etch-popup-body::-webkit-scrollbar { width: 4px; }
.etch-popup-body::-webkit-scrollbar-track { background: transparent; }
.etch-popup-body::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 2px; }

.etch-popup-body p:first-child { margin-top: 0; }
.etch-popup-body p:last-child  { margin-bottom: 0; }
.etch-popup-body a { color: #4f46e5; text-decoration: none; }
.etch-popup-body a:hover { text-decoration: underline; }
.etch-popup-body img { max-width: 100%; border-radius: 6px; }
.etch-popup-body h1, .etch-popup-body h2, .etch-popup-body h3 { font-size: 14px; margin: .5em 0; color: #1e293b; }

/* ---- NO-CONTENT POPUP ---- */
.etch-popup-body:empty::after {
	content: 'No description.';
	color: #94a3b8;
	font-style: italic;
}

/* ---- ERROR STATE ---- */
.etch-map-error {
	padding: 12px 16px;
	background: #fee2e2;
	color: #991b1b;
	border-radius: 8px;
	font-size: 14px;
}

/* ================================================================
   PIN GRID
   ================================================================ */

.etch-pin-grid {
	display: grid;
	grid-template-columns: repeat(var(--etch-cols, 3), 1fr);
	gap: 20px;
	margin-top: 24px;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

@media (max-width: 900px) {
	.etch-pin-grid { grid-template-columns: repeat(min(2, var(--etch-cols, 3)), 1fr); }
}
@media (max-width: 560px) {
	.etch-pin-grid { grid-template-columns: 1fr; gap: 14px; }
}

/* ---- CARD ---- */
.etch-pin-card {
	background: #fff;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 1px 3px rgba(0,0,0,.07), 0 4px 14px rgba(0,0,0,.07);
	cursor: pointer;
	transition: transform .18s cubic-bezier(.34,1.36,.64,1), box-shadow .18s ease;
	outline: none;
	display: flex;
	flex-direction: column;
}
.etch-pin-card:hover,
.etch-pin-card:focus {
	transform: translateY(-4px);
	box-shadow: 0 6px 20px rgba(0,0,0,.12), 0 2px 6px rgba(0,0,0,.08);
}
.etch-pin-card:active {
	transform: translateY(-1px);
}
.etch-pin-card.etch-card-active {
	box-shadow: 0 0 0 3px var(--pin-color), 0 6px 20px rgba(0,0,0,.12);
	transform: translateY(-4px);
}

/* Coloured top accent stripe */
.etch-pin-card-accent {
	height: 5px;
	background: var(--pin-color, #4f46e5);
	flex-shrink: 0;
}

.etch-pin-card-body {
	padding: 16px 18px 18px;
	flex: 1;
}

.etch-pin-card-title {
	font-size: 15px;
	font-weight: 700;
	color: #1e293b;
	margin: 0 0 8px;
	line-height: 1.3;
}

.etch-pin-card-content {
	font-size: 13px;
	line-height: 1.65;
	color: #475569;
}
.etch-pin-card-content p:first-child { margin-top: 0; }
.etch-pin-card-content p:last-child  { margin-bottom: 0; }
.etch-pin-card-content a { color: #4f46e5; }
.etch-pin-card-content img { max-width: 100%; border-radius: 6px; margin-top: 8px; }
.etch-pin-card-content h1,
.etch-pin-card-content h2,
.etch-pin-card-content h3 { font-size: 14px; margin: .5em 0; color: #1e293b; }
