/*
 * Location Map Accordion widget. Base look mirrors the site's Nested
 * Accordion styles (title color states, 24px padding, Barlow Condensed
 * uppercase title); every value below is still overridable from the
 * widget's Style tab or added classes.
 */

.nwd-locmap {
	--nwd-locmap-duration: 250ms;
	display: grid;
	grid-template-columns: var(--nwd-locmap-list-width, 33%) minmax(0, 1fr);
	align-items: stretch;
	gap: 30px;
}

.nwd-locmap__list {
	min-width: 0;
	overflow: hidden; /* Clips items to the container's border radius. */
}

/* Heading only carries semantics; the button inside is what gets styled. */
.nwd-locmap__heading {
	margin: 0;
	padding: 0;
	font: inherit;
	color: inherit;
}

/*
 * Reset theme button styles. Selectors are scoped under .nwd-locmap so their
 * specificity beats the Kit's global "button" element style (which sets
 * background-color/color/etc. directly) but still loses to Style tab
 * settings and to classes added under Content > CSS Classes. Colors go
 * through variables that the Title color controls set per state
 * (normal / hover / open).
 */
.nwd-locmap button.nwd-locmap__trigger {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	width: 100%;
	min-height: 44px;
	margin: 0;
	padding: 24px;
	border: 0;
	border-radius: 0;
	-webkit-appearance: none;
	appearance: none;
	background: var(--nwd-locmap-trigger-bg, transparent);
	--nwd-locmap-trigger-color: var(--e-global-color-v4-color_black);
	color: var(--nwd-locmap-trigger-color, inherit);
	font: inherit;
	font-family: "Barlow Condensed", sans-serif;
	font-size: 18px;
	font-weight: 700;
	letter-spacing: 0.4px;
	text-align: start;
	text-decoration: none;
	text-transform: uppercase;
	cursor: pointer;
	transition: color var(--nwd-locmap-duration) ease, background-color var(--nwd-locmap-duration) ease;
}

/* Hello Elementor recolors buttons on hover/focus; keep the widget's own state colors instead. */
.nwd-locmap button.nwd-locmap__trigger:hover,
.nwd-locmap button.nwd-locmap__trigger:focus {
	background: var(--nwd-locmap-trigger-bg, transparent);
	--nwd-locmap-trigger-color: var(--e-global-color-v4-color_red);
	color: var(--nwd-locmap-trigger-color, inherit);
	text-decoration: none;
}

/* Open state wins over hover at equal specificity because it's declared last. */
.nwd-locmap button.nwd-locmap__trigger[aria-expanded="true"] {
	--nwd-locmap-trigger-color: var(--e-global-color-primary);
}

.nwd-locmap button.nwd-locmap__trigger:focus-visible {
	outline: var(--nwd-locmap-focus-width, 2px) solid var(--nwd-locmap-focus-color, currentColor);
	outline-offset: calc(-1 * var(--nwd-locmap-focus-width, 2px) - 2px); /* Inset so the list's overflow can't clip it. */
}

.nwd-locmap__title {
	min-width: 0;
}

.nwd-locmap__icon {
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	font-size: 30px;
	line-height: 1;
	transition: color var(--nwd-locmap-duration) ease, background-color var(--nwd-locmap-duration) ease, border-color var(--nwd-locmap-duration) ease;
}

.nwd-locmap__icon > span {
	display: inline-flex;
}

.nwd-locmap__icon svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
}

.nwd-locmap__trigger[aria-expanded="true"] .nwd-locmap__icon-expand,
.nwd-locmap__trigger[aria-expanded="false"] .nwd-locmap__icon-collapse {
	display: none;
}

/* Height animates via grid rows; visibility hides closed content from keyboard and screen readers. */
.nwd-locmap__panel {
	display: grid;
	grid-template-rows: 0fr;
	visibility: hidden;
	transition: grid-template-rows var(--nwd-locmap-duration) ease, visibility 0s linear var(--nwd-locmap-duration);
}

.nwd-locmap__item.is-open > .nwd-locmap__panel {
	grid-template-rows: 1fr;
	visibility: visible;
	transition: grid-template-rows var(--nwd-locmap-duration) ease, visibility 0s linear 0s;
}

.nwd-locmap__panel-inner {
	min-height: 0;
	overflow: hidden;
}

.nwd-locmap__content {
	display: flex;
	flex-direction: column;
	gap: 16px;
	padding: 24px;
}

.nwd-locmap__content p {
	margin: 0;
}

.nwd-locmap__content a {
	color: inherit;
}

.nwd-locmap__map {
	position: relative;
	min-width: 0;
	min-height: 320px;
	overflow: hidden;
}

.nwd-locmap__map-item,
.nwd-locmap__message--empty {
	position: absolute;
	inset: 0;
}

.nwd-locmap__map-item[hidden],
.nwd-locmap__message[hidden] {
	display: none;
}

.nwd-locmap__embed,
.nwd-locmap__image {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	border: 0;
	object-fit: cover;
}

.nwd-locmap__message {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	margin: 0;
	padding: 24px;
	text-align: center;
}

.nwd-locmap__sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

@media (prefers-reduced-motion: reduce) {
	.nwd-locmap__trigger,
	.nwd-locmap__icon,
	.nwd-locmap__panel,
	.nwd-locmap__item.is-open > .nwd-locmap__panel {
		transition: none;
	}
}
