/* ============================================================
   Baker Donelson - Quick and Easy Guide state selector map.

   The map scales to fit whatever box the iframe provides, so the
   embed height can never cut it off. Recommended embed:

   <iframe src="ez-guide-map-v2.html" width="95%" height="430"
           scrolling="no" frameborder="0"
           style="width:95%;aspect-ratio:1.53/1;min-height:320px;border:0"></iframe>

   aspect-ratio makes the frame track the map's own proportions at
   every screen width, which is what removes the white space and
   the clipping at the same time.
   ============================================================ */

html,
body {
	height: 100%;
	margin: 0;
	padding: 0;
	overflow: hidden;
	background: #ffffff;
}

.ez-guide {
	--ez-teal: #006983;
	--ez-teal-over: #666666;
	--ez-ink: #22272b;
	--ez-muted: #5c6670;
	--ez-rule: #d6dbdf;
	--ez-stroke: #ffffff;
	--ez-font: Arial, Helvetica, "Helvetica Neue", sans-serif;

	box-sizing: border-box;
	height: 100%;
	display: flex;
	flex-direction: column;
	font-family: var(--ez-font);
	color: var(--ez-ink);
}

.ez-guide *,
.ez-guide *::before,
.ez-guide *::after {
	box-sizing: inherit;
}

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

.ez-map-wrap {
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
}

/* width and height both 100% with preserveAspectRatio="meet" means
   the drawing always fits inside the box, letterboxing rather than
   overflowing. This is what makes any frame height safe. */
.ez-map-wrap svg {
	width: 100%;
	height: 100%;
	display: block;
	overflow: visible;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
	touch-action: manipulation;
}

.ez-state-link {
	cursor: pointer;
	outline: none;
}

.ez-state {
	fill: var(--ez-teal);
	stroke: var(--ez-stroke);
	stroke-width: 0.8;
	stroke-linejoin: round;
	transition: fill 120ms ease-in-out;
}

.ez-state-link:hover .ez-state,
.ez-state-link:focus .ez-state {
	fill: var(--ez-teal-over);
}

/* Focus ring drawn on the shape, since a browser's own outline box
   around an SVG anchor is unreliable. */
.ez-state-link:focus-visible .ez-state {
	stroke: #ffd400;
	stroke-width: 2.4;
}

.ez-label {
	fill: #ffffff;
	font-family: var(--ez-font);
	font-size: 10px;
	font-weight: bold;
	text-anchor: middle;
	dominant-baseline: middle;
	pointer-events: none;
}

/* ---------- State picker ---------- */

/* On a desktop the map itself is the interface, and hiding the
   picker keeps the frame a pure aspect-ratio box. */
.ez-picker {
	display: none;
	flex: 0 0 auto;
	padding: 8px 8px 0;
}

.ez-picker label {
	display: block;
	font-size: 12px;
	font-weight: bold;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--ez-muted);
	margin-bottom: 4px;
}

.ez-picker select {
	width: 100%;
	font-family: var(--ez-font);
	/* 16px stops iOS Safari zooming the frame on focus */
	font-size: 16px;
	color: var(--ez-ink);
	padding: 10px;
	border: 1px solid var(--ez-rule);
	background: #fff;
	border-radius: 0;
}

.ez-picker select:focus-visible {
	outline: 2px solid var(--ez-teal);
	outline-offset: 1px;
}

/* ---------- Small screens ---------- */

@media (max-width: 860px) {
	/* Below this width the small-state chips fall under a usable tap
	   target, so the dropdown becomes the primary way in and the map
	   stays as orientation. */
	.ez-picker {
		display: block;
	}

	.ez-map-wrap {
		padding: 8px;
	}
}

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

@media print {
	html,
	body,
	.ez-guide {
		height: auto;
		overflow: visible;
	}

	.ez-picker {
		display: none;
	}
}
