/* ==========================================================================
   Job Locations Map — shares the outer shell pattern with Search Jobs Block:
   purple header + white rounded body, all in a single unit.
   ========================================================================== */

.jlm-shell {
	max-width: var(--wp--style--global--wide-size, 1200px);
	margin: 0 auto;
	border-radius: 2rem;
	overflow: hidden;
}

.jlm-header {
	background-color: var(--wp--preset--color--medium-purple);
	padding: var(--wp--preset--spacing--medium);
}

.jlm-header h2 {
	color: var(--wp--preset--color--custom-white);
	font-size: 1.5rem;
	font-weight: 900;
	margin: 0;
	line-height: 1.2;
}

.jlm-body {
	padding: var(--wp--preset--spacing--medium);
	padding-bottom: 2rem;
}

.jlm-headline {
	margin: 0 0 2rem;
	font-size: var(--wp--preset--font-size--xsmall, 0.9rem);
	color: #444;
}

.jlm-headline strong {
	color: var(--wp--preset--color--dark-purple, #27136a);
}

.jlm-headline__clear {
	margin-left: 0.5rem;
	color: var(--wp--preset--color--light-purple);
	font-weight: 700;
	text-decoration: underline;
}

.jlm-container {
	display: grid;
	grid-template-columns: 320px 1fr;
	min-height: 520px;
	border-radius: 1rem;
	overflow: hidden;
	background: var(--wp--preset--color--custom-white, #fff);
	border: 1px solid #e8e8e8;
}

/* ==========================================================================
   Sidebar
   ========================================================================== */

.jlm-sidebar {
	background: var(--wp--preset--color--custom-white, #fff);
	padding: 1rem;
	overflow-y: auto;
	max-height: 520px;
	border-right: 1px solid #e8e8e8;
}

/* ==========================================================================
   Site List (grouped by physical office)
   ========================================================================== */

.jlm-site-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.jlm-site-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	width: 100%;
	gap: 0.5rem;
	padding: 0.75rem 1rem;
	border: none;
	border-radius: 0.5rem;
	background: none;
	text-decoration: none;
	text-align: left;
	color: #333;
	font-family: inherit;
	font-size: 0.9rem;
	transition: background 0.15s, color 0.15s;
	cursor: pointer;
}

.jlm-site-item:hover {
	background: var(--wp--preset--color--base, #f5f5f5);
	color: #333;
}

.jlm-site-item:focus-visible {
	outline: 3px solid var(--wp--preset--color--light-purple);
	outline-offset: 2px;
	color: #333;
}

.jlm-site-item--active,
.jlm-site-item--active:hover,
.jlm-site-item--active:focus,
.jlm-site-item--active:focus-visible,
.jlm-site-item--active:active {
	background: var(--wp--preset--color--medium-purple);
	color: white;
}

.jlm-site-item--active:focus-visible {
	outline: 3px solid white;
	outline-offset: 2px;
}

.jlm-site-item__text {
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
	min-width: 0;
}

.jlm-site-item__name {
	font-weight: 600;
}

.jlm-site-item__sub {
	font-size: 0.8rem;
	opacity: 0.7;
}

.jlm-site-item__count {
	background: rgba(0, 0, 0, 0.08);
	border-radius: 1rem;
	padding: 0.15rem 0.6rem;
	font-size: 0.8rem;
	font-weight: 700;
	min-width: 1.5rem;
	text-align: center;
	flex-shrink: 0;
}

.jlm-site-item--active .jlm-site-item__count {
	background: rgba(255, 255, 255, 0.25);
}

/* ==========================================================================
   Job List (shown when region selected)
   ========================================================================== */

.jlm-job-list {
	padding: 0.5rem 0 0;
}

.jlm-job-list__items {
	list-style: none;
	margin: 0;
	padding: 0;
}

.jlm-job-list__item {
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
	padding: 0.6rem 0.75rem;
	border-radius: 0.4rem;
	cursor: pointer;
	transition: background 0.15s;
	border-bottom: 1px solid #f0f0f0;
}

.jlm-job-list__item:last-child {
	border-bottom: none;
}

.jlm-job-list__item:hover {
	background: var(--wp--preset--color--base, #f5f5f5);
}

.jlm-job-list__item:focus-visible {
	outline: 3px solid var(--wp--preset--color--light-purple);
	outline-offset: -2px;
}

.jlm-job-list__item--active {
	background: var(--wp--preset--color--base, #f0f0f0);
	border-left: 3px solid var(--wp--preset--color--light-purple);
}

.jlm-job-list__title {
	font-weight: 700;
	font-size: 0.85rem;
	color: #333;
}

.jlm-job-list__salary {
	font-size: 0.8rem;
	font-weight: 700;
	color: var(--wp--preset--color--medium-purple);
}

.jlm-job-list__grade {
	font-size: 0.75rem;
	color: #888;
}

.jlm-job-list__empty {
	color: #888;
	font-size: 0.85rem;
	text-align: center;
	padding: 1rem;
}

/* ==========================================================================
   Google Maps Info Window overrides
   ========================================================================== */

/* Info window — close button overlays content, title runs alongside it */
.gm-style-iw.gm-style-iw-c {
	padding: 0 !important;
	border-radius: 8px !important;
	max-width: 280px !important;
}

/* Chrome row (contains close button) — overlay instead of stacking */
.gm-style-iw-chr {
	position: absolute !important;
	top: 0 !important;
	right: 0 !important;
	z-index: 1;
	height: auto !important;
}

/* Empty header label — collapse it */
.gm-style-iw-ch {
	display: none !important;
}

/* Close button — smaller, tighter to corner */
.gm-style-iw-c button.gm-ui-hover-effect {
	width: 32px !important;
	height: 32px !important;
}

.gm-style-iw-c button.gm-ui-hover-effect span {
	margin: 4px !important;
	width: 18px !important;
	height: 18px !important;
}

/* Content area — padding handles spacing, title has right margin for close btn */
.gm-style-iw-d {
	overflow: hidden !important;
	padding: 12px 14px !important;
}

/* ==========================================================================
   Map
   ========================================================================== */

.jlm-map-wrap {
	position: relative;
}

.jlm-map {
	width: 100%;
	height: 100%;
	min-height: 520px;
}

.jlm-no-key {
	padding: 2rem;
	text-align: center;
	color: #888;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 800px) {
	.jlm-container {
		grid-template-columns: 1fr;
		min-height: auto;
		border-radius: 1rem;
	}

	.jlm-sidebar {
		border-right: none;
		border-bottom: 1px solid #e8e8e8;
		max-height: 250px;
		overflow-y: auto;
	}

	.jlm-map {
		min-height: 400px;
	}
}
