/* sw_church_map (js/sw_church_map.js): the church map shared by the home page and the Sermons page.
   Light by default, dark under <html data-bs-theme="dark">. The dots are canvas; only live churches and popups are DOM. */
.swcm {
	--swcm-bg: #e8edf3;
	--swcm-text: #1e293b;
	--swcm-muted: #4b5563;
	--swcm-pop-bg: #ffffff;
	--swcm-pop-border: rgba(15, 23, 42, 0.12);
	--swcm-accent: #b45309;
	--swcm-btn-bg: #f59e0b;
	--swcm-btn-text: #1f1300;
	--swcm-live: #ef4444;
	position: relative;
	width: 100%;
	height: 100%;
	min-height: 220px;
	background: var(--swcm-bg);
	border-radius: inherit;
	overflow: hidden;
	z-index: 0;
}
[data-bs-theme="dark"] .swcm {
	--swcm-bg: #1b2433;
	--swcm-text: #e2e8f0;
	--swcm-muted: #94a3b8;
	--swcm-pop-bg: #111827;
	--swcm-pop-border: rgba(255, 255, 255, 0.12);
	--swcm-accent: #fbbf24;
}
.swcm.swcm--hover .leaflet-container,
.swcm.swcm--hover { cursor: pointer; }
.swcm .leaflet-container { background: var(--swcm-bg); font: inherit; }
.swcm__status {
	position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
	color: var(--swcm-muted); font-size: 0.9rem; padding: 16px; text-align: center;
}

/* live churches: a red dot with a pulsing ring */
.swcm-live { background: none; border: 0; }
.swcm-live__dot {
	position: absolute; left: 5px; top: 5px; width: 12px; height: 12px; border-radius: 50%;
	background: var(--swcm-live, #ef4444); border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
}
.swcm-live__ring {
	position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%;
	background: rgba(239, 68, 68, 0.35); animation: swcm-pulse 1.8s ease-out infinite;
}
@keyframes swcm-pulse { 0% { transform: scale(0.5); opacity: 0.9; } 100% { transform: scale(1.8); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .swcm-live__ring { animation: none; } }

/* popup */
.swcm-popup .leaflet-popup-content-wrapper {
	background: var(--swcm-pop-bg, #fff); color: var(--swcm-text, #1e293b);
	border: 1px solid var(--swcm-pop-border, rgba(15, 23, 42, 0.12)); border-radius: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}
.swcm-popup .leaflet-popup-tip { background: var(--swcm-pop-bg, #fff); }
.swcm-popup .leaflet-popup-content { margin: 12px 14px; line-height: 1.35; }
.swcm-popup a.leaflet-popup-close-button { color: var(--swcm-muted, #64748b); }
.swcm-pop { display: flex; flex-direction: column; gap: 4px; min-width: 180px; }
.swcm-pop__name { font-size: 0.95rem; font-weight: 700; padding-right: 14px; }
.swcm-pop__place, .swcm-pop__note { font-size: 0.8rem; color: var(--swcm-muted, #64748b); }
.swcm-pop__live { display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; font-weight: 700; color: var(--swcm-live, #ef4444); }
.swcm-pop__live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--swcm-live, #ef4444); }
.swcm-pop__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 6px; }
.swcm-pop__btn {
	display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 0;
	background: var(--swcm-btn-bg, #f59e0b); color: var(--swcm-btn-text, #1f1300) !important; font-weight: 700; font-size: 0.85rem;
	text-decoration: none; cursor: pointer;
}
.swcm-pop__btn--live { background: var(--swcm-live, #ef4444); color: #fff !important; }
.swcm-pop__link { font-size: 0.85rem; font-weight: 600; color: var(--swcm-accent, #b45309) !important; text-decoration: none; }
.swcm-pop__link:hover { text-decoration: underline; }
.swcm-popup .swcm-pop { --swcm-text: inherit; }
[data-bs-theme="dark"] .swcm-popup {
	--swcm-pop-bg: #111827; --swcm-text: #e2e8f0; --swcm-muted: #94a3b8; --swcm-pop-border: rgba(255, 255, 255, 0.12); --swcm-accent: #fbbf24;
}

/* the legend a page shows above the map */
.swcm-legend { display: inline-flex; flex-wrap: wrap; gap: 4px 12px; font-size: 0.78rem; color: inherit; opacity: 0.85; }
.swcm-legend__item { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.swcm-legend__dot { width: 9px; height: 9px; border-radius: 50%; background: #ea8a00; }
.swcm-legend__dot--live { background: #ef4444; }
.swcm-legend__dot--dir { width: 6px; height: 6px; background: rgba(100, 116, 139, 0.75); }

/* a map section on a site page (the Sermons page) */
.swcm-section { padding: 20px 0 8px; }
.swcm-section__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin-bottom: 10px; }
.swcm-section__title { font-size: 1.15rem; font-weight: 700; margin: 0; }
.swcm-section__box { height: 340px; border-radius: 14px; overflow: hidden; border: 1px solid rgba(15, 23, 42, 0.1); }
.swcm-section__box > div { height: 100%; }
.swcm-section__note { font-size: 0.8rem; opacity: 0.75; margin: 6px 0 0; min-height: 1em; }
@media (max-width: 640px) { .swcm-section__box { height: 240px; } }
