/* Outer block: holds the button, the heading, and the map, all sharing the
   same max-width and the same --uim-* color variables so the button visually
   matches the map's default/hover colors. */
.uim-block {
	--uim-default-fill: #4a6fa5;
	--uim-hover-fill: #e02424;
	--uim-stroke: #ffffff;
	width: 100%;
	max-width: 640px; /* overridden inline per-instance via the size/width attribute */
	margin: 0 auto;
	box-sizing: border-box;
	text-align: center;
}

/* ---- Call-to-action button ----
   inline-block + auto width so it sizes to its own text/padding instead of
   stretching across the whole map's width — that stretching is what made it
   look oversized before. Centered via the parent's text-align. */
.uim-cta-button {
	display: inline-block;
	max-width: 100%;
	box-sizing: border-box;
	margin: 0 0 16px;
	background-color: var(--uim-default-fill);
	color: #fff;
	font-weight: 700;
	line-height: 1.3;
	text-align: center;
	text-decoration: none;
	white-space: normal;
	border: none;
	cursor: pointer;
	transition: background-color 0.3s ease, filter 0.3s ease;
}

a.uim-cta-button:hover,
a.uim-cta-button:focus-visible {
	background-color: var(--uim-hover-fill);
	filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.25));
	color: #fff;
}

a.uim-cta-button:focus-visible {
	outline: 3px solid #222;
	outline-offset: 2px;
}

/* A button with no link configured yet: same look, but visibly non-interactive. */
.uim-cta-button--static {
	cursor: default;
	opacity: 0.85;
}

/* Size presets — editable in Settings (or per-shortcode via button_size). */
.uim-cta-button--small {
	padding: 8px 18px;
	font-size: 14px;
	border-radius: 5px;
}

.uim-cta-button--medium {
	padding: 12px 26px;
	font-size: 16px;
	border-radius: 6px;
}

.uim-cta-button--large {
	padding: 16px 34px;
	font-size: 19px;
	border-radius: 8px;
}

/* ---- Heading line ---- */
.uim-heading {
	margin: 0 0 16px;
	font-size: 18px;
	font-weight: 600;
	line-height: 1.4;
	color: inherit;
}

/* ---- Map ---- */
.uim-map-wrapper {
	position: relative;
	width: 100%;
	line-height: 0;
}

.uim-svg {
	display: block;
	width: 100%;
	height: auto;
	/* Reserves the correct box before the SVG paints, so the page never jumps. */
	aspect-ratio: 959 / 593;
}

.uim-state {
	fill: var(--uim-default-fill);
	stroke: var(--uim-stroke);
	stroke-width: 1.5;
	stroke-linejoin: round;
	cursor: pointer;
	transition: fill 0.3s ease, filter 0.3s ease;
	outline: none;
}

/* Fill swaps to the configured hover color on hover, keyboard focus, or
   the brief "no link set" tap flash on touch devices. */
.uim-state:hover,
.uim-state:focus-visible,
.uim-state.is-active {
	fill: var(--uim-hover-fill);
	filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.35));
}

.uim-state:focus-visible {
	stroke: #222;
	stroke-width: 2.5;
}

.uim-dc-circle {
	fill: var(--uim-default-fill);
	cursor: pointer;
	transition: fill 0.3s ease, filter 0.3s ease;
}

.uim-dc-circle:hover,
.uim-dc-circle:focus-visible {
	fill: var(--uim-hover-fill);
	filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.35));
}

.uim-tooltip {
	position: absolute;
	pointer-events: none;
	background: rgba(20, 20, 20, 0.92);
	color: #fff;
	font-size: 13px;
	line-height: 1.3;
	padding: 6px 10px;
	border-radius: 4px;
	transform: translate(-50%, -120%);
	white-space: nowrap;
	max-width: 90%;
	overflow: hidden;
	text-overflow: ellipsis;
	opacity: 0;
	transition: opacity 0.15s ease;
	z-index: 10;
}

.uim-tooltip.is-visible {
	opacity: 1;
}

/* Small phones: proportionally smaller heading/tooltip and thinner borders.
   Buttons already have discrete size presets above; on very small screens
   we still trim large/medium down a notch so they don't dominate the page. */
@media (max-width: 480px) {
	.uim-cta-button--large {
		font-size: 16px;
		padding: 13px 26px;
	}

	.uim-cta-button--medium {
		font-size: 15px;
		padding: 11px 22px;
	}

	.uim-heading {
		font-size: 15px;
	}

	.uim-tooltip {
		font-size: 11px;
		padding: 4px 7px;
	}

	.uim-state {
		stroke-width: 1;
	}
}

/* Respect users who've asked for reduced motion. */
@media (prefers-reduced-motion: reduce) {
	.uim-state,
	.uim-dc-circle,
	.uim-cta-button,
	.uim-tooltip {
		transition: none !important;
	}
}
