/* VHMB Weather — badge + forecast hovercard */

.vhmb-weather {
	position: relative;
	display: inline-block;
	line-height: 1;
	/* Match the site's Elementor primary color (nav navy); falls back if the kit var is absent. */
	color: var(--e-global-color-primary, #1B345E);
}

/* Badge (plain div; tabindex="0" keeps it keyboard-focusable when the hovercard is enabled) */
.vhmb-weather__badge {
	display: inline-flex;
	align-items: center;
	gap: 0.35em;
	cursor: default;
}

.vhmb-weather--has-forecast .vhmb-weather__badge {
	cursor: pointer;
}

.vhmb-weather__badge:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
	border-radius: 4px;
}

/* rem-based so the badge ignores the (often larger) font size of its Elementor container */
.vhmb-weather__icon {
	width: 1.25rem;
	height: 1.25rem;
	flex: none;
}

.vhmb-weather__temp {
	font-size: 1rem;
	font-weight: 700;
}

/* Hovercard */
.vhmb-weather__card {
	position: absolute;
	top: calc(100% + 10px);
	left: 50%;
	transform: translateX(-50%) translateY(4px);
	z-index: 9999;
	min-width: 240px;
	padding: 14px 16px;
	background: #fff;
	color: #1e2a32;
	border-radius: 10px;
	box-shadow: 0 6px 24px rgba(15, 35, 50, 0.18);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
	pointer-events: none;
}

/* Caret */
.vhmb-weather__card::before {
	content: "";
	position: absolute;
	top: -6px;
	left: 50%;
	transform: translateX(-50%) rotate(45deg);
	width: 12px;
	height: 12px;
	background: #fff;
}

.vhmb-weather:hover .vhmb-weather__card,
.vhmb-weather__badge:focus-visible + .vhmb-weather__card,
.vhmb-weather:focus-within .vhmb-weather__card {
	opacity: 1;
	visibility: visible;
	transform: translateX(-50%) translateY(0);
	pointer-events: auto;
}

/* Keep the hover bridge so the card doesn't flicker crossing the gap */
.vhmb-weather__card::after {
	content: "";
	position: absolute;
	top: -10px;
	left: 0;
	right: 0;
	height: 10px;
}

.vhmb-weather__now {
	margin: 0 0 10px;
	font-size: 0.85em;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	opacity: 0.7;
	text-align: center;
}

.vhmb-weather__forecast {
	display: flex;
	gap: 4px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.vhmb-weather__day {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 5px;
	flex: 1 1 0;
	margin: 0;
	padding: 4px 2px;
	font-size: 0.8em;
}

.vhmb-weather__day .vhmb-weather__icon {
	width: 1.5em;
	height: 1.5em;
}

.vhmb-weather__day-name {
	font-weight: 600;
	opacity: 0.75;
}

.vhmb-weather__hi {
	font-weight: 600;
}

.vhmb-weather__lo {
	opacity: 0.55;
}

@media (prefers-reduced-motion: reduce) {
	.vhmb-weather__card {
		transition: none;
	}
}
