/* Overview map: toggle button, panel, draggable divider, focused-section
   toolbar, and Leaflet tooltip theming — see assets/js/sections-overview-map.js.
   Uses this theme's existing custom properties throughout (see
   evq-sections-theme.css) so dark mode is automatic, no separate dark-mode
   rules needed here. */

.evq-overview-map-toolbar {
	display: flex;
	margin-bottom: 10px;
}

/* all:unset first, then !important throughout — same defense as
   .evq-admin-edit-toggle's own identical rule a little further down this
   stylesheet: this site's theme (Elementor/Hello Elementor) styles bare
   <button> elements aggressively enough to otherwise win over a plain class
   selector regardless of source order. */
.evq-overview-map-toggle-btn {
	all: unset;
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	border: 1px solid var( --evq-border ) !important;
	border-radius: 999px !important;
	padding: 7px 14px !important;
	font-family: inherit !important;
	font-size: 13px !important;
	font-weight: 600 !important;
	background: var( --evq-bg ) !important;
	color: var( --evq-text ) !important;
	cursor: pointer;
	line-height: 1.2;
}

.evq-overview-map-toggle-btn:hover {
	border-color: var( --evq-accent ) !important;
	color: var( --evq-accent ) !important;
}

.evq-overview-map-toggle-btn[aria-pressed="true"] {
	background: var( --evq-accent ) !important;
	border-color: var( --evq-accent ) !important;
	color: #fff !important;
}

.evq-overview-map-toggle-icon {
	font-size: 14px;
	line-height: 1;
}

/* Height driven by --evq-overview-map-height (set in JS by the divider drag
   and restored from localStorage — see restoreSavedHeight()), defaulting to
   50vh per this feature's "about half the table's usual space" brief. A
   plain block sibling stacked above .evq-sections-table-wrap's own content
   in normal flow — never a position:fixed/absolute overlay — so "hiding the
   table" and "pulling it back up" both fall naturally out of the height
   split with no separate show/hide logic for the table itself. */
.evq-overview-map-panel {
	position: relative;
	/* Contains Leaflet's own internal z-index stack (its zoom controls sit at
	   1000, popups at 700 — see leaflet.css) to this element instead of the
	   page's root stacking context. Without an explicit z-index here,
	   position:relative alone does NOT create a new stacking context, so
	   those values compete directly against the site's sticky header (a much
	   lower z-index) and paint over it once the page scrolls the map under
	   it. Any explicit integer does the job; 0 keeps the panel itself at the
	   same layer it would've painted at anyway. */
	z-index: 0;
	height: var( --evq-overview-map-height, 50vh );
	min-height: 200px;
	max-height: 85vh;
	margin-bottom: 2px;
	border: 1px solid var( --evq-border );
	border-radius: var( --evq-radius );
	overflow: hidden;
	background: var( --evq-bg-subtle );
}

.evq-overview-map-wrap {
	position: relative;
	width: 100%;
	height: 100%;
}

.evq-overview-leaflet-map {
	width: 100%;
	height: 100%;
}

/* Same widened-with-a-faint-background treatment as .evq-details-resizer
   (section-details.css) for the same reason — a bare 1-2px line doesn't read
   as draggable at rest. row-resize cursor and a horizontal bar instead of
   that one's vertical one/col-resize, since this divider moves the panel up
   and down, not side to side. */
.evq-overview-map-resizer {
	height: 8px;
	margin: 6px 0;
	border-radius: 4px;
	cursor: row-resize;
	background: var( --evq-border );
	opacity: 0.5;
	touch-action: none;
}

.evq-overview-map-resizer:hover,
.evq-overview-map-resizer.evq-overview-map-resizing {
	opacity: 1;
}

/* Set on <body> for the duration of a drag (see sections-overview-map.js) —
   stops the map and the table beneath it from stealing pointer events mid-
   drag, same convention as body.evq-fullmap-resizing (section-fullmap.css). */
body.evq-overview-map-resizing {
	cursor: row-resize;
	user-select: none;
}

body.evq-overview-map-resizing .evq-overview-map-wrap,
body.evq-overview-map-resizing .evq-sections-table-wrap {
	pointer-events: none;
}

/* Floating "<section name> [Suggérer une modification]" overlay shown once a
   section is focused (see showFocusedToolbar() in sections-overview-map.js)
   — the button is disabled, an inert placeholder for a future geometry-
   editing feature, not functional yet. */
.evq-overview-focused-toolbar {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 1000;
	display: flex;
	align-items: center;
	gap: 10px;
	max-width: calc( 100% - 20px );
	padding: 8px 12px;
	border: 1px solid var( --evq-border );
	border-radius: var( --evq-radius );
	background: var( --evq-bg );
	box-shadow: 0 2px 8px var( --evq-shadow );
	font-size: 13px;
	color: var( --evq-text );
}

.evq-overview-focused-toolbar strong {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.evq-overview-suggest-edit-btn {
	all: unset;
	box-sizing: border-box;
	flex-shrink: 0;
	padding: 4px 10px !important;
	border: 1px solid var( --evq-border ) !important;
	border-radius: 999px !important;
	font-size: 12px !important;
	color: var( --evq-muted ) !important;
	background: var( --evq-bg-subtle ) !important;
	cursor: not-allowed;
	white-space: nowrap;
}

/* Leaflet's own .leaflet-tooltip, themed to match the rest of this plugin
   instead of Leaflet's stock white-on-white default — the first hover-
   tooltip in this codebase (every other map interaction elsewhere is
   click-to-open-popup only, see sections-overview-map.js's own top doc
   comment for why this map introduces the pattern). */
.evq-overview-tooltip {
	background: var( --evq-bg ) !important;
	color: var( --evq-text ) !important;
	border: 1px solid var( --evq-border ) !important;
	border-radius: 6px !important;
	padding: 4px 8px !important;
	font-size: 12px !important;
	box-shadow: 0 2px 8px var( --evq-shadow ) !important;
}

/* Leaflet gives every interactive vector layer (a river silhouette, a
   section line) tabindex="0" for keyboard accessibility, which means a
   click also gives it the browser's own default focus ring — on an SVG
   <path> that renders as a plain black rectangle around the element's
   bounding box, not around its actual (thin, curved) shape, which reads as
   a stray "square" appearing on click (reported live). Suppressed here
   since sections-overview-map.js already draws its own deliberate
   highlight (the orange focus color, in both focusSection() and
   focusRiver()) — that's the real, intentional focus indicator; the
   browser's bounding-box one on top of it was never wanted. */
#evq-overview-map .leaflet-interactive:focus {
	outline: none;
}
