/* Block: location, contacts and the area map. */

.gws-location {
	border-top: var(--gws-border);
}

.gws-location__grid {
	max-width: var(--gws-container);
	margin-inline: auto;
}

.gws-location__info {
	display: flex;
	flex-direction: column;
	padding: var(--gws-space-14) var(--gws-pad) var(--gws-space-12);
}

.gws-location__title {
	font-size: var(--gws-text-place);
	line-height: 1.08;
}

.gws-location__facts {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	margin-top: var(--gws-space-7);
	border-top: var(--gws-border);
	border-left: var(--gws-border);
}

.gws-location__fact {
	display: flex;
	flex-direction: column;
	gap: var(--gws-space-2);
	padding: var(--gws-space-4);
	border-right: var(--gws-border);
	border-bottom: var(--gws-border);
}

.gws-location__fact-value {
	font-family: var(--gws-font-display);
	font-size: var(--gws-text-lg);
	line-height: 1.05;
}

.gws-location__fact-text {
	margin: 0;
	font-size: 0.875rem;
	line-height: 1.35;
	color: var(--gws-color-muted);
}

.gws-location__contacts {
	display: flex;
	flex-direction: column;
	gap: var(--gws-space-2);
	margin-top: var(--gws-space-8);
}

.gws-location__kicker {
	font-size: var(--gws-text-xs);
	color: var(--gws-color-muted);
}

.gws-location__phone {
	font-family: var(--gws-font-display);
	font-size: 1.5rem;
	line-height: var(--gws-leading-snug);
}

.gws-location__phone:hover {
	color: var(--gws-color-accent);
}

.gws-location__email {
	align-self: flex-start;
	padding-bottom: var(--gws-space-1);
	border-bottom: 1px solid var(--gws-color-underline);
	font-size: var(--gws-text-lg);
	transition: border-color var(--gws-fast);
}

.gws-location__email:hover {
	border-color: var(--gws-color-ink);
}

.gws-location__actions {
	display: flex;
	gap: var(--gws-space-2);
	margin-top: var(--gws-space-4);
}

.gws-location__directions {
	flex: 1;
	gap: var(--gws-space-3);
	padding: 0 var(--gws-space-4);
	font-size: var(--gws-text-xs);
}

.gws-location__square {
	flex: none;
	width: var(--gws-control-lg);
	height: var(--gws-control-lg);
	border-color: var(--gws-color-ink);
}

.gws-location__square:hover {
	background: var(--gws-color-ink);
	color: var(--gws-color-on-dark);
}

/* Area map */

.gws-location__area {
	display: flex;
	flex-direction: column;
	background: var(--gws-color-surface);
}

.gws-location__bar {
	display: flex;
	flex-direction: column;
	gap: var(--gws-space-3);
	padding: var(--gws-space-5) var(--gws-pad) var(--gws-space-4);
}

.gws-location__bar[hidden],
.gws-location__fallback[hidden],
.gws-location__tip[hidden],
.gws-location__embed[hidden] {
	display: none;
}

.gws-location__filters {
	display: flex;
	gap: var(--gws-space-1);
	margin-inline: calc(var(--gws-pad) * -1);
	padding-inline: var(--gws-pad);
	overflow-x: auto;
	scrollbar-width: none;
}

.gws-location__filter {
	display: flex;
	flex: none;
	align-items: center;
	gap: var(--gws-space-2);
	height: var(--gws-space-9);
	padding: 0 var(--gws-space-3);
	border: 1px solid var(--gws-color-chip-line);
	background: var(--gws-color-bg);
	font-family: var(--gws-font-text);
	font-size: var(--gws-text-md);
	white-space: nowrap;
	cursor: pointer;
	transition: background-color var(--gws-fast), border-color var(--gws-fast), color var(--gws-fast);
}

.gws-location__count {
	font-family: var(--gws-font-display);
	font-size: 0.625rem;
	color: var(--gws-color-muted);
	transition: color var(--gws-fast);
}

.gws-location__filter[aria-pressed="true"],
.gws-location__filter.is-preview {
	border-color: var(--gws-color-ink);
	background: var(--gws-color-ink);
	color: var(--gws-color-on-dark);
}

.gws-location__filter[aria-pressed="true"] .gws-location__count,
.gws-location__filter.is-preview .gws-location__count {
	color: var(--gws-color-accent);
}

.gws-location__filters.is-off {
	visibility: hidden;
}

.gws-location__views {
	display: flex;
	flex: none;
	align-self: flex-end;
	border: 1px solid var(--gws-color-ink);
}

.gws-location__view {
	height: var(--gws-space-9);
	padding: 0 var(--gws-space-3);
	border: 0;
	background: var(--gws-color-bg);
	font-family: var(--gws-font-display);
	font-size: 0.625rem;
	letter-spacing: var(--gws-tracking-label-narrow);
	text-transform: uppercase;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color var(--gws-fast), color var(--gws-fast);
}

.gws-location__view + .gws-location__view {
	border-left: 1px solid var(--gws-color-ink);
}

.gws-location__view[aria-pressed="true"] {
	background: var(--gws-color-ink);
	color: var(--gws-color-on-dark);
}

.gws-location__fallback {
	display: inline-flex;
	align-items: center;
	gap: var(--gws-space-2);
	align-self: flex-start;
	margin: var(--gws-space-5) var(--gws-pad) var(--gws-space-4);
	font-family: var(--gws-font-display);
	font-size: var(--gws-text-xs);
	letter-spacing: var(--gws-tracking-label-narrow);
	text-transform: uppercase;
}

.gws-location__map {
	position: relative;
	aspect-ratio: 1375 / 1200;
	overflow: hidden;
	border-top: var(--gws-border);
	background: var(--gws-color-map);
}

/* Scoped twice: the MapLibre stylesheet sets position: relative on the container. */
.gws-location__map .gws-location__live {
	position: absolute;
	inset: 0;
	z-index: 1;
	width: 100%;
	height: 100%;
}

.gws-location__map.has-live .gws-location__base,
.gws-location__pin.is-out {
	visibility: hidden;
}

.gws-location__base {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	user-select: none;
}

.gws-location__gateway {
	position: absolute;
	inset: 0;
	z-index: 5;
	pointer-events: none;
	--gws-stem: 10.2;
	--gws-badge: 19.2;
}

.gws-location__stem {
	position: absolute;
	top: calc((var(--gws-y) - var(--gws-stem)) * 1%);
	left: calc(var(--gws-x) * 1%);
	width: 2px;
	height: calc(var(--gws-stem) * 1%);
	margin-left: -1px;
	background: var(--gws-color-accent);
}

.gws-location__badge {
	position: absolute;
	top: calc((var(--gws-y) - var(--gws-badge)) * 1%);
	left: calc(var(--gws-x) * 1%);
	width: 26%;
	padding: var(--gws-space-1) var(--gws-space-1) 0;
	background: var(--gws-color-accent);
	box-shadow: var(--gws-shadow-pin);
	transform: translate(-50%, -50%);
}

.gws-location__thumb {
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

.gws-location__badge-label {
	display: flex;
	align-items: center;
	height: var(--gws-space-5);
	padding: 0 var(--gws-space-1);
	font-family: var(--gws-font-display);
	font-size: 0.5rem;
	letter-spacing: var(--gws-tracking-label);
	text-transform: uppercase;
}

.gws-location__dot {
	position: absolute;
	top: calc(var(--gws-y) * 1%);
	left: calc(var(--gws-x) * 1%);
	width: var(--gws-space-3);
	height: var(--gws-space-3);
	margin: calc(var(--gws-space-3) / -2) 0 0 calc(var(--gws-space-3) / -2);
	border-radius: 50%;
	background: var(--gws-color-accent);
	box-shadow: 0 0 0 3px var(--gws-color-bg);
}

.gws-location__pulse {
	position: absolute;
	inset: -10px;
	border: 2px solid var(--gws-color-accent);
	border-radius: 50%;
	animation: gws-pulse 1.8s ease-out infinite;
}

.gws-location__pin {
	position: absolute;
	top: calc(var(--gws-y) * 1%);
	left: calc(var(--gws-x) * 1%);
	z-index: 2;
	width: 22px;
	height: 22px;
	margin: -11px 0 0 -11px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--gws-color-ink);
	box-shadow: 0 0 0 2px var(--gws-color-pin-ring);
	color: var(--gws-color-on-dark);
	font-family: var(--gws-font-display);
	font-size: var(--gws-text-2xs);
	line-height: 22px;
	text-align: center;
	cursor: pointer;
	transform: scale(var(--gws-scale, 1));
	transition: transform var(--gws-fast) ease, background-color var(--gws-fast), color var(--gws-fast);
}

.gws-location__pin.is-in {
	z-index: 3;
	background: var(--gws-color-accent);
	color: var(--gws-color-ink);
	--gws-scale: 1.15;
}

.gws-location__pin.is-dim {
	background: var(--gws-color-pin-dim);
	color: var(--gws-color-pin-dim-ink);
}

.gws-location__pin:hover,
.gws-location__pin:focus-visible,
.gws-location__pin.is-hot {
	z-index: 4;
	background: var(--gws-color-accent);
	color: var(--gws-color-ink);
	--gws-scale: 1.25;
}

.gws-location__tip {
	position: absolute;
	top: calc(var(--gws-y) * 1%);
	left: calc(var(--gws-x) * 1%);
	z-index: 6;
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: var(--gws-space-2) var(--gws-space-3);
	background: var(--gws-color-ink);
	color: var(--gws-color-on-dark);
	font-size: var(--gws-text-sm);
	line-height: 1.3;
	white-space: nowrap;
	pointer-events: none;
	transform: translate(var(--gws-tx, -50%), calc(-100% - var(--gws-space-4)));
}

.gws-location__tip--start {
	--gws-tx: 0;
}

.gws-location__tip--end {
	--gws-tx: -100%;
}

.gws-location__tip-cat {
	font-family: var(--gws-font-display);
	font-size: var(--gws-text-2xs);
	letter-spacing: var(--gws-tracking-label-narrow);
	text-transform: uppercase;
	color: var(--gws-color-accent);
}

.gws-location__embed {
	position: absolute;
	inset: 0;
	z-index: 7;
	width: 100%;
	height: 100%;
	border: 0;
}

@media (prefers-reduced-motion: reduce) {
	.gws-location__pulse {
		animation: none;
	}
}

@media (min-width: 62em) {
	/* The line runs under the filters, not above them. */
	.gws-location {
		border-top: 0;
	}

	.gws-location__grid {
		display: grid;
		grid-template-columns: 28.75rem minmax(0, 1fr);
	}

	.gws-location__info {
		position: relative;
		z-index: 1;
		grid-column: 1;
		grid-row: 2;
		padding: var(--gws-space-12) var(--gws-space-12) var(--gws-space-12) var(--gws-pad);
		border-top: var(--gws-border);
		border-right: var(--gws-border);
	}

	.gws-location__title {
		line-height: 1.06;
	}

	.gws-location__facts {
		margin-top: var(--gws-space-8);
	}

	.gws-location__fact {
		padding: var(--gws-space-4) var(--gws-space-5) var(--gws-space-5);
	}

	.gws-location__fact-value {
		font-size: 1.375rem;
	}

	.gws-location__fact-text {
		font-size: var(--gws-text-base);
		line-height: 1.4;
	}

	.gws-location__contacts {
		margin-top: auto;
		padding-top: var(--gws-space-12);
	}

	.gws-location__kicker {
		font-size: var(--gws-text-label);
	}

	.gws-location__phone {
		font-size: 1.75rem;
	}

	.gws-location__actions {
		margin-top: var(--gws-space-5);
	}

	.gws-location__directions {
		font-size: var(--gws-text-label);
	}

	.gws-location__directions:hover {
		background: var(--gws-color-ink);
		color: var(--gws-color-accent);
	}

	.gws-location__bar {
		flex-direction: row;
		align-items: flex-start;
		justify-content: space-between;
		gap: var(--gws-space-6);
		grid-column: 1 / -1;
		grid-row: 1;
		padding: var(--gws-space-6) var(--gws-pad);
		background: var(--gws-color-bg);
	}

	/* Filters sit above the map, outside the grey area; info lines up with the map. */
	.gws-location__area {
		display: grid;
		grid-column: 1 / -1;
		grid-row: 1 / span 2;
		grid-template-columns: subgrid;
		grid-template-rows: subgrid;
		background: none;
	}

	/* The map takes the height of the info column. */
	.gws-location__map {
		grid-column: 2;
		grid-row: 2;
		aspect-ratio: auto;
		min-height: var(--gws-location-map-min);
	}

	.gws-location__filters {
		flex: 1;
		flex-wrap: wrap;
		min-width: 0;
		margin-inline: 0;
		padding-inline: 0;
		overflow: visible;
	}

	.gws-location__count,
	.gws-location__view {
		font-size: var(--gws-text-xs);
	}

	.gws-location__view {
		padding: 0 var(--gws-space-4);
	}

	.gws-location__views {
		align-self: flex-start;
	}

	.gws-location__fallback {
		grid-column: 2;
		grid-row: 1;
		margin: var(--gws-space-8) var(--gws-space-10) var(--gws-space-5);
	}

	.gws-location__gateway {
		--gws-stem: 14.2;
		--gws-badge: 20.2;
	}

	.gws-location__badge {
		width: 16%;
	}

	.gws-location__badge-label {
		height: var(--gws-space-7);
		padding: 0 var(--gws-space-2);
		font-size: var(--gws-text-xs);
	}

	.gws-location__dot {
		width: 14px;
		height: 14px;
		margin: -7px 0 0 -7px;
	}

	.gws-location__pulse {
		inset: -12px;
	}

	.gws-location__pin {
		width: 26px;
		height: 26px;
		margin: -13px 0 0 -13px;
		box-shadow: 0 0 0 3px var(--gws-color-pin-ring);
		font-size: var(--gws-text-xs);
		line-height: 26px;
	}

	.gws-location__tip {
		font-size: var(--gws-text-base);
		transform: translate(var(--gws-tx, -50%), calc(-100% - var(--gws-space-5)));
	}

	.gws-location__tip-cat {
		font-size: 0.625rem;
	}
}
