/* ── Job Map block ────────────────────────────────────────────────────────── */
.wcb-job-map-block {
	border-radius: var( --wcb-radius-xl, 12px );
	overflow: hidden;
	border: 1px solid var(--wcb-border, #e2e8f0 );
	font-family: inherit;
}

.wcb-job-map-canvas {
	width: 100%;
	display: block;
}

/* ── Location search toolbar ─────────────────────────────────────────────── */
.wcb-jm-toolbar {
	display: flex;
	gap: var( --wcb-space-sm, 8px );
	align-items: center;
	padding: var( --wcb-space-md, 12px );
	background: var( --wcb-base, #ffffff );
	border-bottom: 1px solid var(--wcb-border, #e2e8f0 );
	flex-wrap: wrap;
}

/* Scoped to the block so a theme's input rule (Reign's rounded 6px) can't
 * override the corner and border the controls beside it use. */
.wp-block-wcb-job-map .wcb-jm-location-input {
	flex: 1;
	min-width: 180px;
	padding: var( --wcb-space-sm, 8px ) var( --wcb-space-md, 12px );
	border: 1px solid var(--wcb-border, #e2e8f0 );
	border-radius: var( --wcb-radius-md, 8px );
	font-size: var( --wcb-text-base, 14px );
	font-family: inherit;
	color: var(--wcb-contrast, #0f172a );
}

.wcb-jm-location-input:focus {
	border-color: var(--wcb-primary, #2563eb );
	box-shadow: var( --wcb-shadow-focus, 0 0 0 3px rgba( 37, 99, 235, 0.12 ) );
}

.wcb-jm-location-input:focus-visible {
	outline: 2px solid var(--wcb-primary, #2563eb );
	outline-offset: 2px;
	border-color: var(--wcb-primary, #2563eb );
	box-shadow: var( --wcb-shadow-focus, 0 0 0 3px rgba( 37, 99, 235, 0.12 ) );
}

.wcb-jm-radius-select {
	padding: var( --wcb-space-sm, 8px ) var( --wcb-space-md );
	border: 1px solid var(--wcb-border, #e2e8f0 );
	border-radius: var( --wcb-radius-md, 8px );
	font-size: var( --wcb-text-base, 14px );
	font-family: inherit;
	color: var(--wcb-contrast, #0f172a );
	background: var( --wcb-base, #ffffff );
}

/* Plain `:focus` keeps the browser-default outline as a graceful
 * fallback; `:focus-visible` below adds the explicit keyboard ring. */
.wcb-jm-radius-select:focus {
	border-color: var(--wcb-primary, #2563eb );
	box-shadow: var( --wcb-shadow-focus, 0 0 0 3px rgba( 37, 99, 235, 0.12 ) );
}

.wcb-jm-radius-select:focus-visible {
	outline: 2px solid var(--wcb-primary, #2563eb );
	outline-offset: 2px;
	border-color: var(--wcb-primary, #2563eb );
	box-shadow: var( --wcb-shadow-focus, 0 0 0 3px rgba( 37, 99, 235, 0.12 ) );
}

.wcb-jm-radius-select:focus-visible {
	outline: 2px solid var(--wcb-primary, #2563eb );
	outline-offset: 2px;
	border-color: var(--wcb-primary, #2563eb );
	box-shadow: var( --wcb-shadow-focus, 0 0 0 3px rgba( 37, 99, 235, 0.12 ) );
}

/* `--wcb-primary` is the canonical token defined in
 * frontend-tokens.css and inheritable through theme overrides
 * (Reign sets it to its red accent). The earlier
 * `--wp--preset--color--wcb-primary` chain only resolves when the
 * active theme registers a matching palette entry, which most
 * non-Wbcom themes don't, so the button silently fell back to the
 * hardcoded blue. */
.wcb-jm-location-btn {
	padding: var( --wcb-space-sm, 8px ) var( --wcb-space-lg, 16px );
	background: var(--wcb-primary-strong);
	color: var( --wcb-on-primary, #ffffff );
	border: none;
	border-radius: var( --wcb-radius-md, 8px );
	font-size: var( --wcb-text-base, 14px );
	font-family: inherit;
	font-weight: var( --wcb-font-semibold, 600 );
	cursor: pointer;
	transition: background var( --wcb-transition-fast, 0.12s );
}

/* color/border restated at every state, not just rest: a theme's own
 * generic button styling can otherwise win just that one property on
 * hover/focus/active even when the fill correctly darkens, which reads
 * as the label going dark or the button gaining a border it didn't have
 * at rest (Basecamp 10345889841). */
.wcb-jm-location-btn:hover:not( :disabled ) {
	background: var( --wcb-primary-dark, #1d4ed8 );
	color: var( --wcb-on-primary, #ffffff );
	border: none;
}

/* Same ring every other filled WCB control uses (.wcb-btn, the search bar) —
   this button had none of its own, so it fell back to the browser's default
   outline instead. */
.wcb-jm-location-btn:focus-visible {
	outline: 2px solid transparent !important;
	box-shadow: var( --wcb-shadow-focus, 0 0 0 3px rgba( 37, 99, 235, 0.12 ) );
	color: var( --wcb-on-primary, #ffffff );
	border: none;
}

.wcb-jm-location-btn:active:not( :disabled ) {
	background: var( --wcb-primary-dark, #1d4ed8 );
	color: var( --wcb-on-primary, #ffffff );
	border: none;
	transform: scale( 0.97 );
}

.wcb-jm-location-btn:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

.wcb-jm-myloc-btn {
	padding: var( --wcb-space-sm, 8px ) var( --wcb-space-md, 12px );
	/* Set explicitly: a theme's button text colour would make the icon vanish on this light surface. */
	color: var( --wcb-contrast, #0f172a );
	background: var(--wcb-surface, #f1f5f9 );
	border: 1px solid var(--wcb-border, #e2e8f0 );
	border-radius: var( --wcb-radius-md, 8px );
	font-size: var( --wcb-text-lg );
	cursor: pointer;
	line-height: 1;
	transition: background var( --wcb-transition-fast, 0.12s );
}

.wcb-jm-myloc-btn:hover:not( :disabled ) {
	background: var( --wcb-bg-hover, #f1f5f9 );
	border-color: var( --wcb-text-tertiary, #9ca3af );
}

.wcb-jm-myloc-btn:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

/* ── Status / error live region ──────────────────────────────────────────── */
/* Written by view.js (state.statusMessage) when a place search fails. Ships
 * `hidden` from render.php and stays hidden until there is something to say. */
.wcb-jm-status {
	margin: 0;
	padding: var(--wcb-space-sm, 8px) var(--wcb-space-md, 12px);
	background: var(--wcb-surface, #f1f5f9);
	border-bottom: 1px solid var(--wcb-border, #e2e8f0);
	color: var(--wcb-contrast, #0f172a);
	font-size: var(--wcb-text-base, 14px);
}

.wcb-jm-status[hidden] {
	display: none;
}

/* Leaflet's +/- are 30px; the contract is a 40px tap target on touch and
 * phones. leaflet.css's own `.leaflet-touch .leaflet-bar a` is the same
 * specificity as the plain wrapper-scoped selector below and loads after it,
 * so it was winning outright. Leaflet adds `.leaflet-touch` to the map
 * container on any touch-capable device — matching that ancestor too (as
 * leaflet.css's own rule does) outranks it regardless of source order. */
@media (pointer: coarse), (max-width: 640px) {
	[class*="wp-block-wcb-"] .leaflet-bar a,
	[class*="wp-block-wp-career-board"] .leaflet-bar a,
	[class*="wp-block-wcb-"] .leaflet-touch .leaflet-bar a,
	[class*="wp-block-wp-career-board"] .leaflet-touch .leaflet-bar a {
		width: 2.5rem;
		height: 2.5rem;
		line-height: 2.5rem;
	}
}

.wcb-jm-location-input,
.wcb-jm-radius-select,
.wcb-jm-location-btn,
.wcb-jm-myloc-btn {
	min-height: var(--wcb-control-h, 2.75rem);
}
