/* ==========================================================================
   zone-police.be — interface : en-tête, carte d'accueil, annuaire
   ========================================================================== */

:root {
	--zp-navy: #1b2f6b;
	--zp-blue: #2b52a4;
	--zp-blue-soft: #e8eefb;
	--zp-ink: #1a1f2e;
	--zp-muted: #5d6679;
	--zp-line: #e3e7ef;
	--zp-bg: #f5f7fb;
	--zp-card: #ffffff;
	--zp-red: #c62828;
	--zp-radius: 12px;
	--zp-header-h: 60px;
}

/* ── En-tête ─────────────────────────────────────────────────────────────── */

.zp-header {
	position: sticky;
	top: 0;
	z-index: 1100; /* au-dessus des contrôles Leaflet (1000) */
	background: var(--zp-card);
	border-bottom: 1px solid var(--zp-line);
}
.admin-bar .zp-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .zp-header { top: 46px; } }

.zp-header__inner {
	display: flex;
	align-items: center;
	gap: 24px;
	max-width: 1440px;
	height: var(--zp-header-h);
	margin: 0 auto;
	padding: 0 20px;
}

.zp-brand {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-shrink: 0;
	color: var(--zp-navy);
	font-size: 1.05rem;
	font-weight: 800;
	letter-spacing: -.01em;
	text-decoration: none;
}
.zp-brand:hover { color: var(--zp-navy); }
.zp-brand img { width: 32px; height: 32px; }
.zp-brand__tld { color: var(--zp-blue); font-weight: 600; }

.zp-nav {
	display: flex;
	gap: 4px;
	flex: 1;
	min-width: 0;
	overflow-x: auto;
	scrollbar-width: none;
}
.zp-nav::-webkit-scrollbar { display: none; }
.zp-nav a {
	flex-shrink: 0;
	padding: 8px 12px;
	border-radius: 8px;
	color: var(--zp-muted);
	font-size: .9rem;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}
.zp-nav a:hover { background: var(--zp-bg); color: var(--zp-ink); }
.zp-nav a.is-active { background: var(--zp-blue-soft); color: var(--zp-blue); }

/* Sélecteur de langue : contrôle segmenté intégré à l'en-tête */
.zp-lang-switcher {
	display: flex;
	flex-shrink: 0;
	padding: 3px;
	border-radius: 999px;
	background: var(--zp-bg);
	border: 1px solid var(--zp-line);
}
.zp-lang-btn {
	padding: 4px 11px;
	border-radius: 999px;
	color: var(--zp-muted);
	font-size: .78rem;
	font-weight: 700;
	line-height: 1.4;
	text-decoration: none;
}
.zp-lang-btn:hover { color: var(--zp-ink); }
.zp-lang-btn.active { background: var(--zp-card); color: var(--zp-blue); box-shadow: 0 1px 3px rgba(20, 30, 60, .15); }

@media (max-width: 760px) {
	.zp-header__inner {
		flex-wrap: wrap;
		height: auto;
		gap: 0 12px;
		padding: 8px 16px 0;
	}
	.zp-brand { flex: 1; }
	.zp-nav {
		order: 3;
		flex-basis: 100%;
		margin: 6px -16px 0;
		padding: 0 12px 6px;
	}
	.zp-nav a { padding: 6px 10px; font-size: .85rem; }
}

/* ── Page d'accueil ──────────────────────────────────────────────────────── */

.zp-main-full { max-width: none; padding: 0; }

.zp-home { background: var(--zp-bg); color: var(--zp-ink); }

.zp-hero {
	padding: 40px 20px 28px;
	background: linear-gradient(180deg, var(--zp-card) 0%, var(--zp-bg) 100%);
	text-align: center;
}
.zp-hero h1 {
	margin: 0 0 8px;
	color: var(--zp-navy);
	font-size: clamp(1.6rem, 3.2vw, 2.4rem);
	font-weight: 800;
	letter-spacing: -.02em;
}
.zp-hero__lead {
	max-width: 640px;
	margin: 0 auto 22px;
	color: var(--zp-muted);
	font-size: 1.02rem;
}
.zp-hero__emergency {
	margin: 14px 0 0;
	color: var(--zp-muted);
	font-size: .88rem;
}
.zp-hero__emergency strong { color: var(--zp-red); }

/* Recherche avec suggestions */
.zp-search {
	position: relative;
	max-width: 620px;
	margin: 0 auto;
	text-align: left;
}
.zp-search__icon {
	position: absolute;
	top: 50%;
	left: 18px;
	width: 20px;
	height: 20px;
	color: var(--zp-muted);
	transform: translateY(-50%);
	pointer-events: none;
}
.zp-search input {
	width: 100%;
	height: 56px;
	padding: 0 48px 0 50px;
	border: 2px solid var(--zp-line);
	border-radius: 14px;
	background: var(--zp-card);
	box-shadow: 0 6px 20px rgba(27, 47, 107, .08);
	color: var(--zp-ink);
	font-size: 1.05rem;
	outline: none;
	transition: border-color .15s;
}
.zp-search input:focus { border-color: var(--zp-blue); }
.zp-search input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.zp-search__clear {
	position: absolute;
	top: 50%;
	right: 12px;
	width: 32px;
	height: 32px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--zp-muted);
	font-size: 1.3rem;
	line-height: 1;
	transform: translateY(-50%);
	cursor: pointer;
}
.zp-search__clear:hover { background: var(--zp-bg); }

.zp-suggest {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	right: 0;
	z-index: 1200;
	max-height: 360px;
	margin: 0;
	padding: 6px;
	overflow-y: auto;
	border: 1px solid var(--zp-line);
	border-radius: 12px;
	background: var(--zp-card);
	box-shadow: 0 12px 32px rgba(20, 30, 60, .16);
	list-style: none;
}
.zp-suggest li {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
	padding: 10px 12px;
	border-radius: 8px;
	cursor: pointer;
}
.zp-suggest li[aria-selected="true"], .zp-suggest li:hover { background: var(--zp-blue-soft); }
.zp-suggest__main { font-weight: 600; }
.zp-suggest__sub { color: var(--zp-muted); font-size: .85rem; white-space: nowrap; }
.zp-suggest__empty { color: var(--zp-muted); cursor: default !important; background: none !important; }

/* Explorateur : panneau + carte */
.zp-explorer {
	display: grid;
	grid-template-columns: 380px 1fr;
	gap: 16px;
	max-width: 1440px;
	height: min(78vh, 760px);
	min-height: 520px;
	margin: 0 auto;
	padding: 0 20px;
}

.zp-panel {
	display: flex;
	flex-direction: column;
	min-height: 0;
	overflow: hidden;
	border: 1px solid var(--zp-line);
	border-radius: var(--zp-radius);
	background: var(--zp-card);
}
.zp-panel__head {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 16px;
	border-bottom: 1px solid var(--zp-line);
}
.zp-panel__head select {
	flex: 1;
	min-width: 0;
	height: 38px;
	padding: 0 10px;
	border: 1px solid var(--zp-line);
	border-radius: 8px;
	background: var(--zp-bg);
	color: var(--zp-ink);
	font-size: .9rem;
}
.zp-panel__count { color: var(--zp-muted); font-size: .85rem; white-space: nowrap; }

.zp-zone-list {
	flex: 1;
	margin: 0;
	padding: 6px;
	overflow-y: auto;
	list-style: none;
}
.zp-zone-list button {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	padding: 9px 10px;
	border: 0;
	border-radius: 8px;
	background: none;
	color: var(--zp-ink);
	text-align: left;
	cursor: pointer;
}
.zp-zone-list button:hover, .zp-zone-list button.is-selected { background: var(--zp-blue-soft); }
.zp-swatch { flex-shrink: 0; width: 12px; height: 12px; border-radius: 3px; }
.zp-zone-list__name { flex: 1; min-width: 0; font-weight: 600; font-size: .93rem; }
.zp-zone-list__name small { display: block; overflow: hidden; color: var(--zp-muted); font-weight: 400; font-size: .8rem; white-space: nowrap; text-overflow: ellipsis; }
.zp-zone-list__nr { color: var(--zp-muted); font-size: .8rem; font-variant-numeric: tabular-nums; }

/* Fiche de la zone sélectionnée */
.zp-detail { padding: 18px; overflow-y: auto; }
.zp-detail[hidden] { display: none; }
.zp-detail__back {
	margin: -4px 0 12px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--zp-blue);
	font-size: .88rem;
	font-weight: 600;
	cursor: pointer;
}
.zp-detail__kicker { margin: 0 0 4px; color: var(--zp-muted); font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.zp-detail h2 { margin: 0 0 14px; color: var(--zp-navy); font-size: 1.35rem; font-weight: 800; }
.zp-detail dl { margin: 0 0 16px; }
.zp-detail dt { color: var(--zp-muted); font-size: .8rem; font-weight: 600; }
.zp-detail dd { margin: 2px 0 12px; font-size: .93rem; }
.zp-detail__cta {
	display: block;
	padding: 12px;
	border-radius: 10px;
	background: var(--zp-blue);
	color: #fff;
	font-weight: 700;
	text-align: center;
	text-decoration: none;
}
.zp-detail__cta:hover { background: var(--zp-navy); color: #fff; }

.zp-mapwrap { position: relative; min-height: 0; }
#zp-map {
	width: 100%;
	height: 100%;
	border: 1px solid var(--zp-line);
	border-radius: var(--zp-radius);
	background: #dfe6ee;
}
.zp-map-status {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 500;
	padding: 10px 16px;
	border-radius: 999px;
	background: rgba(255, 255, 255, .95);
	box-shadow: 0 2px 10px rgba(0, 0, 0, .12);
	color: var(--zp-muted);
	font-size: .9rem;
	transform: translate(-50%, -50%);
}
.zp-map-status[hidden] { display: none; }
.leaflet-tooltip.zp-tip { padding: 4px 8px; font-weight: 600; }

@media (max-width: 900px) {
	.zp-hero { padding: 24px 16px 20px; }
	.zp-search input { height: 52px; padding: 0 40px 0 44px; font-size: 1rem; }
	.zp-search__icon { left: 15px; }
	.zp-explorer {
		grid-template-columns: 1fr;
		height: auto;
		padding: 0 16px;
	}
	.zp-mapwrap { order: -1; height: 58vh; min-height: 340px; }
	.zp-panel { max-height: 70vh; }
}

/* ── Annuaire ────────────────────────────────────────────────────────────── */

.zp-directory { max-width: 1440px; margin: 0 auto; padding: 56px 20px 24px; }
.zp-directory__head { max-width: 760px; margin-bottom: 20px; }
.zp-directory__head h2 { margin: 0 0 6px; color: var(--zp-navy); font-size: 1.6rem; font-weight: 800; }
.zp-directory__head p { margin: 0; color: var(--zp-muted); }

.zp-jump {
	position: sticky;
	top: var(--zp-header-h);
	z-index: 10;
	display: flex;
	gap: 6px;
	margin: 0 -20px 8px;
	padding: 10px 20px;
	overflow-x: auto;
	background: var(--zp-bg);
	scrollbar-width: thin;
}
.zp-jump a {
	flex-shrink: 0;
	padding: 6px 12px;
	border: 1px solid var(--zp-line);
	border-radius: 999px;
	background: var(--zp-card);
	color: var(--zp-ink);
	font-size: .85rem;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}
.zp-jump a:hover { border-color: var(--zp-blue); color: var(--zp-blue); }

.zp-region { margin-top: 28px; }
.zp-region__title {
	margin: 0 0 4px;
	padding-bottom: 8px;
	border-bottom: 2px solid var(--zp-navy);
	color: var(--zp-navy);
	font-size: 1.25rem;
	font-weight: 800;
}

.zp-province { padding-top: 18px; scroll-margin-top: calc(var(--zp-header-h) + 60px); }
.zp-province__title {
	display: flex;
	align-items: baseline;
	gap: 10px;
	margin: 0 0 10px;
	font-size: 1.05rem;
	font-weight: 700;
}
.zp-province__title span { color: var(--zp-muted); font-size: .85rem; font-weight: 500; }

.zp-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.zp-grid a {
	display: block;
	height: 100%;
	padding: 10px 12px;
	border: 1px solid var(--zp-line);
	border-radius: 10px;
	background: var(--zp-card);
	color: var(--zp-ink);
	text-decoration: none;
	transition: border-color .12s, box-shadow .12s;
}
.zp-grid a:hover { border-color: var(--zp-blue); box-shadow: 0 2px 8px rgba(43, 82, 164, .12); }
.zp-grid__top { display: flex; justify-content: space-between; gap: 8px; }
.zp-grid__name { font-weight: 700; font-size: .93rem; }
.zp-grid__nr { color: var(--zp-muted); font-size: .78rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.zp-grid__communes {
	display: -webkit-box;
	margin-top: 2px;
	overflow: hidden;
	color: var(--zp-muted);
	font-size: .8rem;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}
.zp-directory__updated { margin-top: 28px; color: var(--zp-muted); font-size: .82rem; }

@media (max-width: 760px) {
	.zp-directory { padding: 40px 16px 16px; }
	.zp-jump { top: 88px; margin: 0 -16px 8px; padding: 10px 16px; }
}

/* ── Annuaire : logos (page /zones/) ─────────────────────────────────────── */

.zp-grid a.has-logo { display: flex; gap: 12px; align-items: flex-start; }
.zp-grid__logo { flex-shrink: 0; width: 40px; height: 40px; object-fit: contain; border-radius: 6px; background: #fff; }
.zp-grid__body { display: block; flex: 1; min-width: 0; }

/* ── Page /zones/ ────────────────────────────────────────────────────────── */

.zp-archive { padding: 20px 0 8px; }
.zp-crumbs { display: flex; gap: 8px; margin-bottom: 14px; color: var(--zp-muted); font-size: .85rem; }
.zp-crumbs a { color: var(--zp-blue); text-decoration: none; }
.zp-archive__head h1 { margin: 0 0 6px; color: var(--zp-navy); font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 800; letter-spacing: -.02em; }
.zp-archive__head p { max-width: 720px; margin: 0 0 18px; color: var(--zp-muted); }
.zp-archive__tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 8px; }
.zp-search--compact { flex: 1 1 320px; max-width: 460px; margin: 0; }
.zp-search--compact input { height: 46px; padding: 0 16px 0 44px; border-radius: 10px; box-shadow: none; font-size: .98rem; }
.zp-search--compact .zp-search__icon { left: 14px; width: 18px; height: 18px; }
.zp-archive__tools select { height: 46px; padding: 0 12px; border: 2px solid var(--zp-line); border-radius: 10px; background: var(--zp-card); color: var(--zp-ink); }
.zp-archive__pow { margin-left: auto; color: var(--zp-blue); font-size: .88rem; font-weight: 600; text-decoration: none; }
.zp-directory--archive { max-width: none; padding: 0; }
.zp-directory--archive .zp-jump { margin: 0 0 8px; padding: 10px 0; }
.zp-archive__none { margin: 32px 0; color: var(--zp-muted); text-align: center; }
[hidden] { display: none !important; }
@media (max-width: 760px) { .zp-archive__pow { margin-left: 0; } }

/* ── Fiche de zone : zones voisines, sources ─────────────────────────────── */

.zp-neighbors { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0; padding: 0; list-style: none; }
.zp-neighbors a { font-weight: 600; text-decoration: none; }
.zp-sources { margin: 2rem 0 1rem; padding: 1rem 1.25rem; border: 1px solid var(--zp-line); border-radius: var(--zp-radius); background: var(--zp-bg); }
.zp-sources ul { padding-left: 1.1rem; }

/* ── Accueil : guide pratique ────────────────────────────────────────────── */

.zp-guide { max-width: 1440px; margin: 0 auto; padding: 48px 20px 0; }
.zp-guide h2 { margin: 0 0 16px; color: var(--zp-navy); font-size: 1.6rem; font-weight: 800; }
.zp-guide__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.zp-guide__card { padding: 18px; border: 1px solid var(--zp-line); border-radius: var(--zp-radius); background: var(--zp-card); }
.zp-guide__card h3 { margin: 0 0 6px; font-size: 1.05rem; font-weight: 700; }
.zp-guide__card p { margin: 0 0 8px; color: var(--zp-muted); font-size: .93rem; line-height: 1.55; }
.zp-guide__card a { font-weight: 600; text-decoration: none; }
.zp-guide__card--urgent { border-color: #f1c0c0; background: #fff7f7; }
.zp-guide__card--urgent strong { color: var(--zp-red); }
.zp-guide__note { margin: 14px 0 0; color: var(--zp-muted); font-size: .82rem; }
@media (max-width: 760px) { .zp-guide { padding: 36px 16px 0; } }
