/**
 * Historic Seattle Map — map.css
 */

/* ==========================================================================
   1. Projects Map
   ========================================================================== */

.hsm-map-section {
	position: relative;
	width: 100%;
}

#hsm-map {
	width: 100%;
	height: 560px;
	display: block;
}

#hsm-map:focus-visible {
	outline: 3px solid #005fcc;
	outline-offset: 2px;
}

/* ==========================================================================
   2. Divi integration — projects map
   ========================================================================== */

.et_pb_section:has( .hsm-map-section ) {
	padding-top: 0 !important;
	padding-bottom: 0 !important;
}

.et_pb_section:has( .hsm-map-section ) > .map-row {
	max-width: 100% !important;
	width: 100% !important;
	padding: 0 !important;
	display: flex !important;
	align-items: stretch !important;
}

.et_pb_section:has( .hsm-map-section ) > .map-row > .et_pb_column:last-child {
	padding: 0 !important;
}

.et_pb_section:has( .hsm-map-section ) .et_pb_code,
.et_pb_section:has( .hsm-map-section ) .et_pb_code_inner {
	height: 100%;
	display: flex;
	flex-direction: column;
}

.et_pb_section:has( .hsm-map-section ) .hsm-map-section {
	flex: 1;
	display: flex;
	flex-direction: column;
}

.et_pb_section:has( .hsm-map-section ) #hsm-map {
	flex: 1;
	height: auto;
	min-height: max( 480px, 65vh );
}

/* ==========================================================================
   3. Popup / Dialog
   ========================================================================== */

#hsm-popup {
	position: absolute;
	top: 50%;
	left: 62%;
	transform: translate( -50%, -50% );
	z-index: 200;

	background: #ffffff;
	border: 1px solid #d0d0d0;
	border-radius: 6px;
	box-shadow: 0 8px 32px rgba( 0, 0, 0, 0.2 );
	width: clamp( 240px, 34%, 340px );
	overflow: hidden;

	animation: hsm-popup-enter 0.18s ease-out both;
}

@keyframes hsm-popup-enter {
	from { opacity: 0; transform: translate( -50%, -47% ) scale( 0.97 ); }
	to   { opacity: 1; transform: translate( -50%, -50% ) scale( 1 ); }
}

@media ( prefers-reduced-motion: reduce ) {
	#hsm-popup { animation: none; }
}

#hsm-popup[hidden] {
	display: none;
}

.hsm-popup__close {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	padding: 0;
	background: rgba( 0, 0, 0, 0.55 );
	color: #ffffff;
	border: none;
	border-radius: 50%;
	cursor: pointer;
	font-size: 1.375rem;
	line-height: 1;
}

.hsm-popup__close::before {
	content: '';
	position: absolute;
	inset: -5px;
}

.hsm-popup__close:hover {
	background: rgba( 0, 0, 0, 0.75 );
}

.hsm-popup__close:focus-visible {
	outline: 3px solid #005fcc;
	outline-offset: 3px;
}

@media ( forced-colors: active ) {
	.hsm-popup__close {
		border: 2px solid ButtonText;
		forced-color-adjust: none;
	}
}

.hsm-popup__image-wrap {
	width: 100%;
	overflow: hidden;
}

.hsm-popup__image-wrap img {
	display: block;
	width: 100%;
	height: 185px;
	object-fit: cover;
	background: #f0ece8;
}

.hsm-popup__body {
	padding: 14px 18px 20px;
}

.hsm-popup__title {
	margin: 0 0 6px;
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.3;
}

.hsm-popup__title a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.hsm-popup__title a:hover {
	color: #C45E27;
}

.hsm-popup__title a:focus-visible {
	outline: 3px solid #005fcc;
	outline-offset: 2px;
	border-radius: 2px;
}

.hsm-popup__neighborhood {
	margin: 0;
	font-size: 0.875rem;
	color: #5a5a5a;
	line-height: 1.4;
}

/* ==========================================================================
   4. Detail Map
   ========================================================================== */

.hsm-detail-map-wrap {
	width: 100%;
	/* Fills the height of its Divi column. Set a min-height on the Divi
	   column in the builder so the map has something to stretch into. */
	height: 100%;
	min-height: 280px;
	display: flex;
	flex-direction: column;
}

#hsm-detail-map {
	flex: 1;
	width: 100%;
	min-height: 280px;
	display: block;
	border-radius: 4px;
}

#hsm-detail-map:focus-visible {
	outline: 3px solid #005fcc;
	outline-offset: 2px;
}

/* Divi integration for detail map column. */
.et_pb_column:has( .hsm-detail-map-wrap ) {
	display: flex;
	flex-direction: column;
}

.et_pb_column:has( .hsm-detail-map-wrap ) .et_pb_code,
.et_pb_column:has( .hsm-detail-map-wrap ) .et_pb_code_inner {
	flex: 1;
	display: flex;
	flex-direction: column;
}

.et_pb_column:has( .hsm-detail-map-wrap ) .hsm-detail-map-wrap {
	flex: 1;
}

/* ==========================================================================
   5. Responsive — projects map
   ========================================================================== */

@media ( max-width: 980px ) {
	#hsm-map {
		height: 420px;
		min-height: 420px;
	}

	#hsm-popup {
		left: 50%;
		width: clamp( 240px, 85vw, 340px );
	}
}

@media ( max-width: 480px ) {
	#hsm-map {
		height: 360px;
		min-height: 360px;
	}

	.hsm-popup__image-wrap img {
		height: 140px;
	}
}

/* ==========================================================================
   6. Screen-reader utility
   ========================================================================== */

.hsm-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect( 0, 0, 0, 0 );
	white-space: nowrap;
	border: 0;
}