/* Origin Live Map – minimal, theme-friendly styles. Designed to coexist with Elementor. */

.origin-form {
	max-width: 480px;
	margin: 0 auto;
	font-family: inherit;
}

.origin-form__title {
	margin: 0 0 1rem;
	font-size: 1.25rem;
}

.origin-form__intro {
	margin: 0 0 1.25rem;
	font-size: 1rem;
	line-height: 1.45;
	color: #333;
}

.origin-form__help {
	margin: 0.35rem 0 0;
	font-size: 0.85rem;
	color: #666;
	font-style: italic;
	line-height: 1.35;
}

.origin-form__row {
	display: flex;
	flex-direction: column;
	margin-bottom: 0.85rem;
	position: relative;
}

.origin-form__row label {
	font-size: 0.9rem;
	margin-bottom: 0.25rem;
	font-weight: 600;
}

.origin-form__row input[type="text"],
.origin-form__row input[type="email"] {
	width: 100%;
	padding: 0.6rem 0.75rem;
	font-size: 1rem;
	border: 1px solid #cfd4d8;
	border-radius: 6px;
	box-sizing: border-box;
	background: #fff;
}

.origin-form__row input:focus {
	outline: 2px solid #4f8cff;
	outline-offset: 1px;
	border-color: #4f8cff;
}

.origin-form__row--consent label {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	font-weight: 400;
}

.origin-form__suggestions {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	margin: 2px 0 0;
	padding: 0;
	list-style: none;
	background: #fff;
	border: 1px solid #cfd4d8;
	border-radius: 6px;
	box-shadow: 0 6px 20px rgba(0,0,0,0.08);
	z-index: 10;
	max-height: 240px;
	overflow-y: auto;
}

.origin-form__suggestions li {
	padding: 0.5rem 0.75rem;
	cursor: pointer;
	font-size: 0.95rem;
}

.origin-form__suggestions li:hover,
.origin-form__suggestions li:focus {
	background: #f1f5ff;
	outline: none;
}

.origin-form__actions {
	margin-top: 0.5rem;
}

.origin-form__submit {
	display: inline-block;
	padding: 0.65rem 1.25rem;
	font-size: 1rem;
	font-weight: 600;
	color: #fff;
	background: #2d6cdf;
	border: 0;
	border-radius: 6px;
	cursor: pointer;
}

.origin-form__submit[disabled] {
	opacity: 0.6;
	cursor: progress;
}

.origin-form__submit:hover:not([disabled]) {
	background: #1f56c0;
}

.origin-form__message {
	margin: 0.75rem 0 0;
	min-height: 1.25em;
	font-size: 0.95rem;
}

.origin-form__message.is-success { color: #1c7a3f; }
.origin-form__message.is-error   { color: #b3261e; }

/* Map: 16:9 widescreen container, capped at the world tile width (1024px) at
   zoom 2 so the world fills the frame horizontally. Vertical 9:16 of square
   trims off Antarctica and the polar caps where almost no participants live.
   Combined with the default centerLat ~20°, this shows roughly 75°N to 55°S. */
.origin-map {
	display: block;
	border-radius: 6px;
	overflow: hidden;
	background: #eaeef2;
	height: auto !important;
	aspect-ratio: 16 / 9;
	max-width: 1024px;
	margin-left: auto;
	margin-right: auto;
}

/* Phones: fill the viewport width, square aspect so the whole world fits. */
@media (max-width: 768px) {
	.origin-map {
		aspect-ratio: 1 / 1;
		max-width: 100% !important;
		max-height: 80vh !important;
	}
}

/* Match container bg to tile theme to avoid load flash */
.origin-map--dark { background: #131516; }
.origin-map--dark-gray { background: #2c2f33; }
.origin-map--midnight-blue { background: #0e1a2e; }
.origin-map--positron { background: #f7f8f9; }
.origin-map--osm { background: #eaeef2; }

/* Midnight Blue: tint the gray tiles with a navy cast.
   sepia adds warmth, hue-rotate flips warmth to blue, saturate intensifies. */
.origin-map--midnight-blue .leaflet-tile-pane {
	filter: sepia(0.55) hue-rotate(180deg) saturate(2.2) brightness(0.95);
}

/* Dark-mode all Leaflet UI chrome (popups, attribution, zoom buttons) on the
   dark map styles. !important is needed because Leaflet's own CSS has high
   specificity (.leaflet-container .leaflet-bar a etc.). */

/* Popups */
.origin-map--dark .leaflet-popup-content-wrapper,
.origin-map--dark .leaflet-popup-tip,
.origin-map--dark-gray .leaflet-popup-content-wrapper,
.origin-map--dark-gray .leaflet-popup-tip,
.origin-map--midnight-blue .leaflet-popup-content-wrapper,
.origin-map--midnight-blue .leaflet-popup-tip {
	background: #1d2024 !important;
	color: #f5f5f5 !important;
}
.origin-map--dark .leaflet-popup-content-wrapper a,
.origin-map--dark-gray .leaflet-popup-content-wrapper a,
.origin-map--midnight-blue .leaflet-popup-content-wrapper a { color: #7ab7ff !important; }

/* Attribution credit (bottom-right "Leaflet | Tiles © Esri" bar) */
.origin-map--dark .leaflet-control-attribution,
.origin-map--dark-gray .leaflet-control-attribution,
.origin-map--midnight-blue .leaflet-control-attribution {
	background: rgba(20, 22, 24, 0.85) !important;
	color: #c8ccd0 !important;
}
.origin-map--dark .leaflet-control-attribution a,
.origin-map--dark-gray .leaflet-control-attribution a,
.origin-map--midnight-blue .leaflet-control-attribution a { color: #9bc8ff !important; }

/* Zoom +/- buttons (top-left) */
.origin-map--dark .leaflet-bar a,
.origin-map--dark-gray .leaflet-bar a,
.origin-map--midnight-blue .leaflet-bar a {
	background-color: #1d2024 !important;
	color: #f5f5f5 !important;
	border-bottom-color: #3a3f44 !important;
}
.origin-map--dark .leaflet-bar a:hover,
.origin-map--dark-gray .leaflet-bar a:hover,
.origin-map--midnight-blue .leaflet-bar a:hover {
	background-color: #2a2f34 !important;
	color: #ffffff !important;
}
.origin-map--dark .leaflet-bar a.leaflet-disabled,
.origin-map--dark-gray .leaflet-bar a.leaflet-disabled,
.origin-map--midnight-blue .leaflet-bar a.leaflet-disabled {
	background-color: #15171a !important;
	color: #555 !important;
}
.origin-map--dark .leaflet-bar,
.origin-map--dark-gray .leaflet-bar,
.origin-map--midnight-blue .leaflet-bar {
	border: 1px solid rgba(0,0,0,0.4) !important;
}

/* Wrapper */
.origin-wrap {
	text-align: center;
}

/* Image trigger button */
.origin-trigger {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	gap: 0.5rem;
	padding: 0;
	background: transparent;
	border: 0;
	cursor: pointer;
	font: inherit;
	color: inherit;
	transition: transform 0.15s ease;
}

.origin-trigger:hover,
.origin-trigger:focus-visible {
	transform: scale(1.04);
	outline: none;
}

.origin-trigger:focus-visible .origin-trigger__img {
	box-shadow: 0 0 0 4px rgba(79, 140, 255, 0.6);
	border-radius: 50%;
}

.origin-trigger__img {
	display: block;
	width: 100%;
	height: auto;
	user-select: none;
	-webkit-user-drag: none;
}

.origin-trigger__label {
	font-weight: 600;
	font-size: 1rem;
}

/* Panel base */
.origin-panel[hidden] { display: none; }
.origin-panel__inner {
	position: relative;
	background: #fff;
	border-radius: 10px;
	padding: 1.5rem 1.25rem 1.25rem;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

.origin-panel__close {
	position: absolute;
	top: 0.4rem;
	right: 0.5rem;
	width: 2rem;
	height: 2rem;
	line-height: 1.8rem;
	font-size: 1.4rem;
	color: #555;
	background: transparent;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
}

.origin-panel__close:hover { background: #f1f1f1; }

/* Modal */
.origin-wrap--modal .origin-panel {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}

.origin-wrap--modal .origin-panel__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	backdrop-filter: blur(2px);
}

.origin-wrap--modal .origin-panel__inner {
	position: relative;
	width: 100%;
	max-width: 480px;
	max-height: calc(100vh - 2rem);
	overflow-y: auto;
}

body.origin-modal-open { overflow: hidden; }

/* Accordion */
.origin-wrap--accordion .origin-panel {
	max-width: 480px;
	margin: 1rem auto 0;
}

.origin-wrap--accordion .origin-panel__inner {
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}
