/**
 * Sterling Across the U.S.
 *
 * Grey US map on the left, notched black-headed photo card on the right.
 * The active state is highlighted by a class on the map wrapper, so no
 * per-location map images are needed.
 */

.sterling-map {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 3rem;
	padding: 4rem 2rem;
	background-color: #ececec;
}

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

.sterling-map__map {
	flex: 1 1 420px;
	max-width: 620px;
}

.sterling-map__svg {
	display: block;
	width: 100%;
	height: auto;
}

/* The SVG ships with .state { fill:#D0D0D0 }; these rules sit above it. */
.sterling-map__map path {
	transition: fill 0.35s ease;
}

/* The source map boxes Alaska and Hawaii in with rules; the current site
   shows them without, so hide the separator. */
.sterling-map__svg .separator1 {
	display: none;
}

.sterling-map__map.is-al .al, .sterling-map__map.is-ak .ak, .sterling-map__map.is-az .az,
.sterling-map__map.is-ar .ar, .sterling-map__map.is-ca .ca, .sterling-map__map.is-co .co,
.sterling-map__map.is-ct .ct, .sterling-map__map.is-de .de, .sterling-map__map.is-dc .dc,
.sterling-map__map.is-fl .fl, .sterling-map__map.is-ga .ga, .sterling-map__map.is-hi .hi,
.sterling-map__map.is-id .id, .sterling-map__map.is-il .il, .sterling-map__map.is-in .in,
.sterling-map__map.is-ia .ia, .sterling-map__map.is-ks .ks, .sterling-map__map.is-ky .ky,
.sterling-map__map.is-la .la, .sterling-map__map.is-me .me, .sterling-map__map.is-md .md,
.sterling-map__map.is-ma .ma, .sterling-map__map.is-mi .mi, .sterling-map__map.is-mn .mn,
.sterling-map__map.is-ms .ms, .sterling-map__map.is-mo .mo, .sterling-map__map.is-mt .mt,
.sterling-map__map.is-ne .ne, .sterling-map__map.is-nv .nv, .sterling-map__map.is-nh .nh,
.sterling-map__map.is-nj .nj, .sterling-map__map.is-nm .nm, .sterling-map__map.is-ny .ny,
.sterling-map__map.is-nc .nc, .sterling-map__map.is-nd .nd, .sterling-map__map.is-oh .oh,
.sterling-map__map.is-ok .ok, .sterling-map__map.is-or .or, .sterling-map__map.is-pa .pa,
.sterling-map__map.is-ri .ri, .sterling-map__map.is-sc .sc, .sterling-map__map.is-sd .sd,
.sterling-map__map.is-tn .tn, .sterling-map__map.is-tx .tx, .sterling-map__map.is-ut .ut,
.sterling-map__map.is-vt .vt, .sterling-map__map.is-va .va, .sterling-map__map.is-wa .wa,
.sterling-map__map.is-wv .wv, .sterling-map__map.is-wi .wi, .sterling-map__map.is-wy .wy {
	fill: var(--sterling-gold, #bd9b51);
}

/* Card
   ------------------------------------------------------------------------ */

/* The card wrapper stays unclipped so the badge can overlap its corner; the
   panel inside carries the background and the cut corner. */
.sterling-map__card {
	position: relative;
	flex: 1 1 420px;
	max-width: 620px;
}

.sterling-map__panel {
	background-color: #fff;
	box-shadow: 0 2px 16px rgba(0, 0, 0, 0.12);
	/* Same cut corner as the category panels. */
	clip-path: polygon(0 0, calc(100% - 40px) 0, 100% 40px, 100% 100%, 0 100%);
}

/* Gold roundel straddling the top-left corner, as on the current site. */
.sterling-map__badge {
	position: absolute;
	top: -22px;
	left: -22px;
	z-index: 2;
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background-color: var(--sterling-gold, #bd9b51);
	background-image: url("../images/icon-keyed-padlock.svg");
	background-repeat: no-repeat;
	background-position: center;
	background-size: 26px auto;
}

.sterling-map__heading {
	margin: 0;
	padding: 1.15rem 1.5rem;
	background-color: var(--sterling-black, #0e0e0e);
	color: #fff;
	font-family: var(--sterling-display, sans-serif);
	font-size: clamp(1.125rem, 2vw, 1.5rem);
	font-weight: 700;
	text-align: center;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.sterling-map__frame {
	aspect-ratio: 800 / 570;
	background-color: #e4e4e4;
	overflow: hidden;
}

.sterling-map__photo {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0;
	transition: opacity 0.35s ease;
}

.sterling-map__photo.is-visible {
	opacity: 1;
}

.sterling-map__caption {
	margin: 0;
	padding: 1rem 1.5rem;
	color: var(--sterling-ink, #231f20);
	font-family: "Poppins", "Helvetica Neue", Arial, sans-serif;
	font-size: 1rem;
	text-align: center;
}

/* Dots
   ------------------------------------------------------------------------ */

.sterling-map__dots {
	display: flex;
	justify-content: center;
	gap: 0.5rem;
	padding: 0 1.5rem 1.5rem;
}

.sterling-map__dot {
	width: 11px;
	height: 11px;
	padding: 0;
	background-color: #c9c9c9;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	transition: background-color 0.18s ease;
}

.sterling-map__dot:hover,
.sterling-map__dot:focus-visible {
	background-color: var(--sterling-gray, #7f7f7f);
}

.sterling-map__dot.is-active {
	background-color: var(--sterling-gold, #bd9b51);
}

/* Breakpoints
   ------------------------------------------------------------------------ */

@media (max-width: 1024px) {
	.sterling-map {
		gap: 2rem;
		padding: 3rem 1.25rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.sterling-map__map path,
	.sterling-map__photo,
	.sterling-map__dot {
		transition: none;
	}
}
