/*
 * Map (Contact, parts/map.php). No design: it takes the info rows' span (grid
 * column 4 to the right margin, the line of their hairlines), 16:9 (4:3 on
 * phones), the card radius, 140px before the footer. The picture is tinted to
 * the site colours when it is made (bin/seed-media.php); the pin in the
 * centre is Cooper 1 with a white ring, the name beside it in the Facts style.
 */

.map {
	margin: 0;
	padding-bottom: var(--space-140);
	color: var(--color-forest-a);
}

.map__link {
	position: relative;
	display: block;
	grid-column: 4 / -1;
	overflow: hidden;
	aspect-ratio: 16 / 9;
	border-radius: var(--radius);
	text-decoration: none;
}

.map__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: scale 0.6s cubic-bezier(0.42, 0, 0.58, 1);
}

.map__link:is(:hover, :focus-visible) .map__image {
	scale: 1.03;
}

.map__link:focus-visible {
	outline: 2px solid var(--color-forest-a);
	outline-offset: 4px;
}

/* The pin sits on the centre of the picture (the centre of the box: the picture is cropped around it). */
.map__pin {
	position: absolute;
	top: 50%;
	left: 50%;
	display: flex;
	align-items: center;
	gap: var(--space-20);
	translate: calc(var(--map-dot) / -2) -50%;
	--map-dot: clamp(16px, 1.25vw, 24px);
}

.map__dot {
	flex: none;
	width: var(--map-dot);
	height: var(--map-dot);
	border: 3px solid var(--color-white);
	border-radius: 50%;
	background: var(--color-cooper-1);
	box-shadow: 0 2px 10px rgb(0 36 30 / 0.35);
}

.map__name {
	padding: 0.35em 0.6em;
	border-radius: var(--radius);
	background: rgb(255 255 255 / 0.85);
	white-space: nowrap;
}

.map__credit {
	grid-column: 4 / -1;
	margin-top: var(--space-20);
	color: var(--color-olive);
	font-family: var(--font-sans);
	font-size: clamp(12px, 0.7292vw, 14px);
	line-height: var(--lh-sans);
}

.map__credit a {
	color: inherit;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}

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

/* Phones (plan 20): the whole width, 4:3; the name under the dot, which stays on the centre (beside it, it ran past the edge). */
@media (max-width: 767px) {
	.map__link,
	.map__credit {
		grid-column: 1 / -1;
	}

	.map__link {
		aspect-ratio: 4 / 3;
	}

	.map__pin {
		flex-direction: column;
		gap: var(--space-10);
		translate: -50% calc(var(--map-dot) / -2);
	}
}
