/**
 * Embedded map — responsive frame (US-005).
 *
 * Enqueued on the contact/location page only (see franchesco_scripts() in
 * functions.php). style.css already forces every map iframe to width: 100%;
 * this sheet owns the frame around it — the aspect ratio, the rounded card and
 * the actions row underneath.
 *
 * The frame is sized with aspect-ratio rather than a fixed pixel height, so at
 * 320px it is 288px wide and ~216px tall instead of the 600x450 the embed
 * ships with. Nothing in here uses a fixed px width, which is what would put a
 * horizontal scrollbar on the page.
 *
 * Shared breakpoints only — 1024px / 768px / 480px (see style.css).
 */

.franchesco-map {
	display: grid;
	gap: var(--space-6);
}

.franchesco-map__frame {
	position: relative;
	/* The two rules that keep the embed inside the page at any width. */
	width: 100%;
	max-width: 100%;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border-radius: var(--radius-lg);
	border: 1px solid var(--color-neutral-200);
	box-shadow: var(--shadow-md);
	background-color: var(--color-neutral-100);
}

/* The iframe fills the frame; style.css sets width: 100% on it site-wide, the
   height is what makes it track the aspect-ratio box rather than its own
   450px height attribute. */
.franchesco-map__embed {
	width: 100%;
	height: 100%;
	border: 0;
}

.franchesco-map__caption {
	margin: 0;
	font-size: var(--text-sm);
	color: var(--color-neutral-600);
}

.franchesco-map__actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-3);
}

.franchesco-map__actions a {
	/* 44px floor even above the tablet breakpoint: these are the two controls
	   a visitor standing outside on a phone actually uses. */
	min-height: 44px;
}

/* ---------- Tablet (max-width: 1024px) ---------- */

@media (max-width: 1024px) {
	.franchesco-map {
		gap: var(--space-5);
	}
}

/* ---------- Large phone (max-width: 768px) ----------
   AC: the embed resizes to the full container width and cannot overflow. */

@media (max-width: 768px) {
	.franchesco-map__frame {
		/* A 16:9 strip is too shallow to be useful once it is only ~340px
		   wide; a squarer box shows more of the surrounding streets. */
		aspect-ratio: 4 / 3;
		border-radius: var(--radius-md);
	}

	.franchesco-map__actions {
		flex-direction: column;
		align-items: stretch;
	}

	.franchesco-map__actions a {
		width: 100%;
	}
}

/* ---------- Phone (max-width: 480px) ---------- */

@media (max-width: 480px) {
	.franchesco-map__frame {
		aspect-ratio: 1 / 1;
	}
}
