/**
 * Layout: Where We Deliver (Figma 596:1297, #f5f5f7).
 *
 * Location list 520 wide, rows 80px, 14px apart (white, radius 20, soft
 * purple shadow); map 560 × 456, radius 28, 1px #e5e5ed border.
 *
 * @package GagaMuller
 */

.gm-where {
	background: var(--gm-surface-subtle);
}

.gm-where__body {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--gm-space-32);
	align-items: start;
}

@media (min-width: 1024px) {
	.gm-where__body {
		grid-template-columns: minmax(0, 32.5rem) minmax(0, 35rem); /* 520 / 560 */
		justify-content: space-between;
	}
}

/* ---- List ----------------------------------------------------------- */

.gm-where__list {
	display: grid;
	gap: var(--gm-space-14);
	margin: 0;
	padding: 0;
	list-style: none;
}

.gm-loc {
	position: relative;
	border: 1.5px solid transparent;
	border-radius: 20px;
	background: var(--gm-color-white);
	box-shadow: 0 4px 16px 0 rgb(51 26 102 / 0.06);
	transition:
		border-color 300ms var(--gm-ease),
		box-shadow 300ms var(--gm-ease);
}

.gm-loc__main {
	display: grid;
	grid-template-columns: minmax(0, 9.4rem) minmax(0, 1fr) auto;
	grid-template-areas: "name text caret";
	column-gap: var(--gm-space-20);
	align-items: center;
	box-sizing: border-box;
	width: 100%;
	min-height: 80px;
	margin: 0;
	padding: var(--gm-space-14) var(--gm-space-20) var(--gm-space-14) var(--gm-space-28);
	border: 0;
	border-radius: 18px;
	background: transparent;
	color: var(--gm-text);
	font: inherit;
	text-align: start;
	cursor: pointer;
}

.gm-loc--has-link .gm-loc__main,
.gm-loc--has-details .gm-loc__main {
	padding-inline-end: 72px; /* room for the page link / expand arrow */
}

.gm-loc__name {
	grid-area: name;
	font-family: var(--gm-font-heading);
	font-size: clamp(1.125rem, 1.07rem + 0.23vw, 1.375rem); /* 22 */
	font-weight: var(--gm-weight-bold);
	line-height: 1.2;
}

.gm-loc__text {
	grid-area: text;
	color: var(--gm-color-text-tertiary);
	font-size: var(--gm-text-sm);
	line-height: 1.38; /* 16/22 */
}

.gm-loc__caret {
	grid-area: caret;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: var(--gm-radius-round);
	background: var(--gm-color-surface-muted);
	color: var(--gm-color-purple);
	transition: background-color 300ms var(--gm-ease), color 300ms var(--gm-ease);
}

.gm-loc__caret .gm-icon,
.gm-loc__toggle .gm-icon,
.gm-loc__go .gm-icon {
	width: 18px;
	height: 18px;
}

.gm-loc__go,
.gm-loc__toggle {
	position: absolute;
	top: 40px; /* centre of the 80px row, not of the expanded card */
	inset-inline-end: var(--gm-space-20);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: var(--gm-radius-round);
	background: var(--gm-color-surface-muted);
	color: var(--gm-color-purple);
	text-decoration: none;
	transform: translateY(-50%);
	transition: background-color 300ms var(--gm-ease), color 300ms var(--gm-ease);
}

.gm-loc__toggle {
	padding: 0;
	border: 0;
	cursor: pointer;
}

.gm-loc__toggle .gm-icon {
	transition: transform 350ms var(--gm-ease);
}

.gm-loc.is-open .gm-loc__toggle {
	background: var(--gm-color-purple);
	color: var(--gm-color-white);
}

.gm-loc.is-open .gm-loc__toggle .gm-icon {
	transform: rotate(90deg);
}

/* 44px hit area for the 36px circle. */
.gm-loc__go::before,
.gm-loc__toggle::before {
	position: absolute;
	inset: -4px;
	content: "";
}

.gm-loc:hover,
.gm-loc:has(.gm-loc__main[aria-pressed="true"]),
.gm-loc.is-open {
	border-color: rgb(114 21 244 / 0.45);
	box-shadow: 0 8px 24px 0 rgb(114 21 244 / 0.14);
}

.gm-loc__main[aria-pressed="true"] .gm-loc__caret,
.gm-loc__main:hover .gm-loc__caret,
.gm-loc__go:hover,
.gm-loc__go:focus-visible,
.gm-loc__toggle:hover,
.gm-loc__toggle:focus-visible {
	background: var(--gm-color-purple);
	color: var(--gm-color-white);
}

.gm-loc__main:focus-visible,
.gm-loc__go:focus-visible,
.gm-loc__toggle:focus-visible {
	outline: var(--gm-focus-width) solid var(--gm-focus-color);
	outline-offset: var(--gm-focus-offset);
}

/* Expanded card: office photo left, address right (one panel per location). */
.gm-loc__panel {
	display: grid;
	grid-template-rows: 0fr;
	visibility: hidden;
	transition:
		grid-template-rows 400ms var(--gm-ease),
		visibility 0s linear 400ms;
}

.gm-loc.is-open .gm-loc__panel {
	grid-template-rows: 1fr;
	visibility: visible;
	transition-delay: 0s;
}

.gm-loc__panel-inner {
	min-height: 0;
	overflow: hidden;
}

.gm-loc__details {
	display: grid;
	gap: var(--gm-space-20);
	align-items: center;
	padding: var(--gm-space-4) var(--gm-space-24) var(--gm-space-24);
	border-top: 0;
}

.gm-loc__details.has-image {
	grid-template-columns: minmax(0, 0.42fr) minmax(0, 0.58fr);
}

.gm-loc__photo {
	aspect-ratio: 4 / 3;
	overflow: hidden;
	border-radius: 14px;
	background: var(--gm-color-surface-muted);
}

.gm-loc__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.gm-loc__address {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	gap: var(--gm-space-12);
	align-items: start;
	margin: 0;
	color: var(--gm-text);
	font-size: var(--gm-text-sm);
	font-style: normal;
	line-height: 1.5;
}

.gm-loc__address .gm-icon {
	width: 22px;
	height: 22px;
	margin-top: 1px;
	color: var(--gm-color-purple);
}

.gm-loc__more {
	grid-column: 1 / -1;
	justify-self: start;
	color: var(--gm-color-purple);
	font-size: var(--gm-text-sm);
	font-weight: var(--gm-weight-bold);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.gm-loc__more:focus-visible {
	outline: var(--gm-focus-width) solid var(--gm-focus-color);
	outline-offset: 3px;
}

/* Without JavaScript the details are simply visible. */
.no-js .gm-loc__panel {
	grid-template-rows: 1fr;
	visibility: visible;
}

.no-js .gm-loc__toggle {
	display: none;
}

@media (max-width: 599px) {
	.gm-loc__details.has-image {
		grid-template-columns: minmax(0, 1fr);
	}

	.gm-loc__photo {
		aspect-ratio: 16 / 9;
	}
}

@media (max-width: 599px) {
	.gm-loc__main {
		grid-template-columns: minmax(0, 1fr) auto;
		grid-template-areas:
			"name caret"
			"text caret";
		row-gap: 2px;
	}

	.gm-loc--has-link .gm-loc__main {
		grid-template-columns: minmax(0, 1fr);
		grid-template-areas:
			"name"
			"text";
	}
}

/* ---- Map ------------------------------------------------------------ */

.gm-where__map {
	position: relative;
	min-height: 22rem;
	overflow: hidden;
	border: 1px solid #e5e5ed;
	border-radius: 28px;
	background: var(--gm-color-white);
	box-shadow: 0 8px 24px 0 rgb(77 26 153 / 0.06);
	isolation: isolate;
}

.gm-where__canvas {
	position: absolute;
	inset: 0;
	background: #eef0f6;
}

@media (min-width: 1024px) {
	.gm-where__map {
		height: 100%;
		min-height: 456px;
	}
}

.gm-where__status {
	position: absolute;
	z-index: 500;
	inset-inline: var(--gm-space-16);
	bottom: var(--gm-space-16);
	margin: 0;
	padding: var(--gm-space-10) var(--gm-space-14);
	border-radius: var(--gm-radius-panel);
	background: var(--gm-color-white);
	box-shadow: 0 4px 14px 0 rgb(77 26 153 / 0.15);
	color: var(--gm-color-text-tertiary);
	font-size: var(--gm-text-legal);
}

.gm-where__fallback {
	position: absolute;
	inset: 0;
	z-index: 500;
	display: grid;
	margin: 0;
	padding: var(--gm-space-24);
	background: var(--gm-color-white);
	place-items: center;
	text-align: center;
}

/* Brand look for the OSM base map: quiet greys, so the purple pins lead. */
.gm-where__map .leaflet-tile-pane {
	filter: grayscale(1) contrast(0.92) brightness(1.04);
}

.gm-where__map .leaflet-container {
	font-family: var(--gm-font-body);
}

.gm-where__map .leaflet-control-attribution {
	font-size: 11px;
}

.gm-where__map .leaflet-control-attribution a {
	color: var(--gm-color-purple);
}

.gm-where__map .leaflet-bar a {
	width: var(--gm-touch-target);
	height: var(--gm-touch-target);
	color: var(--gm-color-black);
	line-height: var(--gm-touch-target);
}

.gm-where__map .leaflet-touch .leaflet-bar a {
	width: var(--gm-touch-target);
	height: var(--gm-touch-target);
	line-height: var(--gm-touch-target);
}

/* Pins: plain purple dot, white ring, soft glow (Figma). */
.gm-pin {
	position: relative;
	background: none;
	border: 0;
}

.gm-pin__dot {
	position: absolute;
	inset: 0;
	border: 3px solid var(--gm-color-white);
	border-radius: var(--gm-radius-round);
	background: var(--gm-color-purple);
	box-shadow: 0 2px 8px rgb(77 26 153 / 0.45);
	transition: transform 300ms var(--gm-ease);
}

.gm-pin__glow {
	position: absolute;
	inset: -20px;
	border-radius: var(--gm-radius-round);
	background: radial-gradient(circle, rgb(114 21 244 / 0.28) 0%, rgb(114 21 244 / 0) 70%);
	pointer-events: none;
}

.gm-pin.is-active .gm-pin__dot,
.gm-pin:hover .gm-pin__dot {
	transform: scale(1.25);
}

.gm-pin:focus-visible {
	outline: var(--gm-focus-width) solid var(--gm-focus-color);
	outline-offset: 6px;
	border-radius: var(--gm-radius-round);
}

.gm-where__map .gm-pin-label {
	padding: 7px 14px;
	border: 0;
	border-radius: 10px;
	box-shadow: 0 4px 14px 0 rgb(77 26 153 / 0.15);
	color: #1c1740;
	font-family: var(--gm-font-heading);
	font-size: 0.875rem; /* 14 */
	font-weight: var(--gm-weight-bold);
}

.gm-where__map .gm-pin-label::before {
	display: none;
}

.gm-where__reset {
	position: absolute;
	z-index: 500;
	top: var(--gm-space-12);
	inset-inline-start: calc(var(--gm-touch-target) + var(--gm-space-24)); /* clear of the zoom buttons */
	min-height: var(--gm-touch-target);
	padding: 0 var(--gm-space-16);
	border: 0;
	border-radius: var(--gm-radius-pill);
	background: var(--gm-color-white);
	box-shadow: 0 4px 14px 0 rgb(77 26 153 / 0.15);
	color: var(--gm-color-purple);
	font: inherit;
	font-size: var(--gm-text-legal);
	font-weight: var(--gm-weight-bold);
	cursor: pointer;
}

.gm-where__reset:focus-visible {
	outline: var(--gm-focus-width) solid var(--gm-focus-color);
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	.gm-loc__main,
	.gm-loc__caret,
	.gm-loc,
	.gm-loc__go,
	.gm-loc__toggle,
	.gm-loc__toggle .gm-icon,
	.gm-loc__panel,
	.gm-pin__dot {
		transition: none;
	}
}
