/*!
 * ram-map — click-to-load Google Maps facade.
 *
 * Companion to fox-child/inc/map-embed.php and ram-map.js.
 *
 * The frame keeps a fixed aspect box so that swapping the poster for the iframe
 * does not move the rest of the page — the still and the embed occupy exactly
 * the same rectangle, which is the whole reason a facade is not a layout shift.
 */

.ram-map {
	margin: 1.75em 0;
}

.ram-map__frame {
	position: relative;
	width: 100%;
	aspect-ratio: 12 / 5;
	min-height: 240px;
	overflow: hidden;
	background: #e8e6e1; /* OSM land, so an unloaded poster is not a black hole */
	border: 1px solid #e0e0e0;
}

.ram-map__poster,
.ram-map__frame iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
}

.ram-map__poster {
	object-fit: cover;
}

.ram-map__noposter {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 1em;
	text-align: center;
	color: #555;
}

/* The button sits over the still and is the only interactive thing in the box
   until it is pressed.

   Bottom-centre, NOT centre. The poster's whole job is to show where the office
   is, and the pin is by construction in the middle of the image — a centred
   button covers the one pixel the picture exists to communicate. */
.ram-map__btn {
	position: absolute;
	bottom: 1.25rem;
	left: 50%;
	transform: translateX(-50%);
	z-index: 2;
	padding: 0.7em 1.4em;
	border: 0;
	border-radius: 2px;
	background: #027EAD;
	color: #fff;
	font: inherit;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.ram-map__btn:hover,
.ram-map__btn:focus-visible {
	background: #01678d;
}

/* Never remove the focus ring — the button is the only control here and a
   keyboard user has to be able to see where they are. */
.ram-map__btn:focus-visible {
	outline: 3px solid #FFBC39;
	outline-offset: 2px;
}

.ram-map.is-loaded .ram-map__btn {
	display: none;
}

.ram-map__caption {
	margin-top: 0.6em;
	font-size: 0.85em;
	line-height: 1.6;
	color: #666;
}

.ram-map__link {
	white-space: nowrap;
}

.ram-map__credit {
	display: block;
	font-size: 0.92em;
	color: #888;
}

@media (max-width: 600px) {
	.ram-map__frame {
		aspect-ratio: 4 / 3;
	}
}
