/* ==========================================================================
	Modular Layout Architecture Rules: .fmw (Find My Work Block)
   ========================================================================== */

:root {
	/* Manually declare Stackable's default detected block width */
	--theme-container-edge-spacing: 90vw;
	--theme-normal-container-max-width: 1440px;
	--theme-container-width-base: calc(
		var(--theme-container-edge-spacing, 90vw) - 0px * 2
	);
}

.fmw {
	display: flex;
	flex-wrap: wrap;
	gap: 24px;
	width: 100%;
	box-sizing: border-box;
	margin-bottom: 54px !important;
}

/* --- Layout Sub-Sections --- */

.fmw__sidebar {
	flex: 1 1 300px;
	height: 600px;
	border-radius: 0px !important;
	padding: 20px;
	background: var(--wp--preset--color--palette-color-8);
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
	box-shadow: 0 4px 6px -1px rgba(27, 38, 49, 0.05);
}

.fmw__sidebar-title {
	font-size: 25px;
	font-weight: 700;
	margin-top: 0;
	margin-bottom: 16px;
	border-bottom: 1px solid rgba(27, 38, 48, 0.11);
	padding-bottom: 10px;
	letter-spacing: normal;
}

.fmw__list-container {
	overflow-y: auto;
	flex-grow: 1;
	padding-right: 4px;
	padding-top: 4px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.fmw__map {
	flex: 3 1 550px;
	height: 600px !important;
	min-height: 500px !important;
	border-radius: 0px !important;
	position: relative;
	z-index: 1;
	box-shadow: 0 4px 6px -1px rgba(27, 38, 49, 0.05);
}

/* --- Inside Item Navigation Cards --- */

.fmw-item {
	padding: 14px;
	border: 1px solid rgba(27, 38, 48, 0.11);
	border-radius: 0px !important;
	cursor: pointer;
	box-sizing: border-box;
	transition: all 0.25s ease-in-out;
}

.fmw-item:hover {
	background: var(--wp--preset--color--palette-color-8);
	border-color: var(--wp--preset--color--palette-color-6);
	transform: translateY(-1px);
}

/* Selected Active State Control Row Modifier */
.fmw-item--active {
	background: var(--wp--preset--color--palette-color-2) !important;
	border-color: transparent !important;
}

/* --- Thumbnail Inner Structural Framing --- */
.fmw-item__wrapper {
	display: flex;
	gap: 14px;
	align-items: flex-start;
	width: 100%;
}

.fmw-item__content {
	flex-grow: 1;
}

/* --- Responsive Sidebar Image Thumbnails --- */
.fmw-item__thumb {
	width: 60px;
	height: 60px;
	object-fit: cover;
	flex-shrink: 0;
	background: var(--wp--preset--color--palette-color-1);
	/* border: 1px solid #a69f92; */
}

.fmw-item__title {
	display: block;
	font-size: 1rem;
	font-weight: 600;
	color: var(--wp--preset--color--palette-color-2);
	margin: 0;
	transition: color 0.2s ease-in-out;
}

.fmw-item__address {
	margin: 6px 0 0 0;
	font-size: 0.85rem;
	color: var(--wp--preset--color--palette-color-4);
	line-height: 1.4;
	transition: color 0.2s ease-in-out;
}

.fmw-item--active .fmw-item__title,
.fmw-item--active .fmw-item__address {
	color: var(--wp--preset--color--palette-color-1);
}

/* --- Leaflet Popup Bubble High-Quality Layout Enhancements --- */
.fmw-popup {
	padding: 6px;
	font-family: inherit;
	min-width: 200px;
	max-width: 280px;
	background: var(--wp--preset--color--palette-color-8);
}

.fmw-popup__img {
	width: 100%;
	height: 140px;
	object-fit: cover;
	margin-bottom: 10px;
	border: 1px solid var(--wp--preset--color--palette-color-5);
}

.fmw-popup__title {
	font-size: 15px;
	font-weight: 700;
	color: var(--wp--preset--color--palette-color-2);
	display: block;
	margin: 0;
	line-height: 1.3;
}

.fmw-popup__address {
	font-size: 12px;
	color: var(--wp--preset--color--palette-color-4);
	display: inline-block;
	margin-top: 6px;
	margin-bottom: 12px;
	line-height: 1.4;
}

.fmw-popup__btn {
	color: var(--wp--preset--color--palette-color-1) !important;
	text-decoration: none;
	text-align: center;
	transition: background 0.2s ease-in-out;
	width: 100%;
}

/* --- High-Visibility Leaflet Close Button Custom Layout --- */
.leaflet-popup-close-button {
	font-size: 18px !important;
	font-weight: 700 !important;
	color: var(--wp--preset--color--palette-color-2) !important;
	text-align: center !important;
	right: 4px !important;
}

.leaflet-popup-close-button:hover {
	color: var(--wp--preset--color--palette-color-3) !important;
	background: transparent !important;
	text-decoration: none !important;
}

/* --- Internal Leaflet Map Controls Overrides --- */

.geosearch.leaflet-control {
	z-index: 1000;
	margin-top: 16px;
	margin-left: 16px;
	width: 320px;
	border: none;
	box-shadow: 0 4px 12px rgba(27, 38, 49, 0.15);
}

.geosearch form input {
	height: 40px;
	padding-left: 12px;
	font-size: 14px;
	border: 1px solid var(--wp--preset--color--palette-color-5);
	background: var(--wp--preset--color--palette-color-8);
	color: #252525;
	box-sizing: border-box;
}

/* --- Media Queries (Responsive States) --- */

@media (max-width: 768px) {
	.fmw {
		gap: 16px;
	}
	.fmw__map {
		order: 1;
		height: 400px;
		flex: 1 1 100%;
	}
	.fmw__sidebar {
		order: 2;
		height: 350px;
		flex: 1 1 100%;
	}
}
