/**
 * Mapa São Tomé e Príncipe — estilos de frontend.
 * Todos os seletores usam o prefixo .stp-map- para evitar conflitos com o tema.
 *
 * @package Mapa_Sao_Tome
 */

.stp-map-app {
	--stp-map-height: 600px;
	--stp-accent: #0d9488;
	--stp-ink: #0f172a;
	--stp-muted: #64748b;
	--stp-line: #e2e8f0;
	--stp-surface: #ffffff;
	--stp-surface-2: #f8fafc;
	--stp-radius: 14px;
	--stp-shadow: 0 10px 30px rgba(15, 23, 42, .12);
	position: relative;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	color: var(--stp-ink);
	line-height: 1.5;
	box-sizing: border-box;
}

.stp-map-app *,
.stp-map-app *::before,
.stp-map-app *::after {
	box-sizing: border-box;
}

/* ---------- Barra de ferramentas ---------- */
.stp-map-toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 14px;
	align-items: flex-start;
	margin-bottom: 12px;
}

.stp-map-search {
	position: relative;
	flex: 1 1 260px;
	min-width: 220px;
}

.stp-map-search-input {
	width: 100%;
	padding: 11px 14px;
	border: 1px solid var(--stp-line);
	border-radius: 999px;
	font-size: 15px;
	background: var(--stp-surface);
	transition: border-color .15s ease, box-shadow .15s ease;
}

.stp-map-search-input:focus {
	outline: none;
	border-color: var(--stp-accent);
	box-shadow: 0 0 0 3px rgba(13, 148, 136, .18);
}

.stp-map-search-results {
	position: absolute;
	z-index: 1200;
	top: calc(100% + 6px);
	left: 0;
	right: 0;
	margin: 0;
	padding: 6px;
	list-style: none;
	background: var(--stp-surface);
	border: 1px solid var(--stp-line);
	border-radius: 12px;
	box-shadow: var(--stp-shadow);
	max-height: 320px;
	overflow-y: auto;
}

.stp-map-search-item {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 9px 12px;
	border-radius: 8px;
	cursor: pointer;
}

.stp-map-search-item:hover,
.stp-map-search-item:focus {
	background: var(--stp-surface-2);
	outline: none;
}

.stp-map-search-name {
	font-weight: 600;
	font-size: 14px;
}

.stp-map-search-meta,
.stp-map-search-empty {
	font-size: 12.5px;
	color: var(--stp-muted);
}

.stp-map-search-empty {
	padding: 10px 12px;
}

.stp-map-search-item.is-member {
	border-left: 3px solid var(--stp-ink);
}

/* ---------- Filtros ---------- */
.stp-map-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	flex: 1 1 100%;
}

.stp-map-filter-btn {
	--stp-chip: #334155;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 7px 13px;
	border: 1px solid var(--stp-line);
	border-radius: 999px;
	background: var(--stp-surface);
	color: var(--stp-ink);
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.stp-map-filter-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--stp-chip);
	flex: none;
}

.stp-map-filter-btn:hover {
	border-color: var(--stp-chip);
}

.stp-map-filter-btn.is-active {
	background: var(--stp-chip);
	border-color: var(--stp-chip);
	color: #fff;
}

.stp-map-filter-btn.is-active .stp-map-filter-dot {
	background: rgba(255, 255, 255, .9);
}

.stp-map-filter-btn:focus-visible {
	outline: 2px solid var(--stp-accent);
	outline-offset: 2px;
}

/* ---------- Filtro por parceiro (integrante da rede) ---------- */
.stp-map-members-filter {
	flex: 0 0 auto;
}

.stp-map-members-select {
	appearance: none;
	padding: 9px 32px 9px 14px;
	border: 1px solid var(--stp-line);
	border-radius: 999px;
	background: var(--stp-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2364748b'%3E%3Cpath d='M5.5 7.5l4.5 4.5 4.5-4.5' stroke='%2364748b' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 10px center;
	background-size: 14px;
	font-size: 13px;
	font-weight: 500;
	color: var(--stp-ink);
	cursor: pointer;
	max-width: 220px;
}

.stp-map-members-select:focus-visible {
	outline: 2px solid var(--stp-accent);
	outline-offset: 2px;
}

/* ---------- Palco (lista + mapa) ---------- */
.stp-map-stage {
	position: relative;
	display: flex;
	gap: 14px;
	height: var(--stp-map-height);
	border-radius: var(--stp-radius);
	overflow: hidden;
}

.stp-map-list {
	flex: 0 0 300px;
	display: flex;
	flex-direction: column;
	background: var(--stp-surface);
	border: 1px solid var(--stp-line);
	border-radius: var(--stp-radius);
	overflow: hidden;
}

.stp-map-list-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	padding: 14px 16px;
	border-bottom: 1px solid var(--stp-line);
}

.stp-map-list-title {
	font-weight: 700;
	font-size: 15px;
}

.stp-map-list-count {
	font-size: 12.5px;
	color: var(--stp-muted);
}

.stp-map-list-items {
	list-style: none;
	margin: 0;
	padding: 6px;
	overflow-y: auto;
	flex: 1;
}

.stp-map-list-btn {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	width: 100%;
	padding: 10px 12px;
	border: 0;
	border-radius: 10px;
	background: transparent;
	text-align: left;
	cursor: pointer;
	font: inherit;
	color: inherit;
}

.stp-map-list-btn:hover {
	background: var(--stp-surface-2);
}

.stp-map-list-btn:focus-visible {
	outline: 2px solid var(--stp-accent);
	outline-offset: -2px;
}

.stp-map-list-dot {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	margin-top: 3px;
	flex: none;
}

.stp-map-list-text {
	display: flex;
	flex-direction: column;
	gap: 2px;
	flex: 1;
}

.stp-map-list-name {
	font-weight: 600;
	font-size: 14px;
}

.stp-map-list-meta {
	font-size: 12px;
	color: var(--stp-muted);
}

.stp-map-list-badge {
	color: var(--stp-accent);
	font-size: 14px;
}

.stp-map-list-btn.is-member {
	background: var(--stp-surface-2);
	border-left: 3px solid var(--stp-ink);
	padding-left: 9px;
}

.stp-map-list-btn.is-member:hover {
	background: #eef1f5;
}

/* ---------- Tela do mapa ---------- */
.stp-map-canvas-wrap {
	position: relative;
	flex: 1;
	border-radius: var(--stp-radius);
	overflow: hidden;
	border: 1px solid var(--stp-line);
}

.stp-map-canvas {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	background: #dfe7ee;
}

.stp-map-loading {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--stp-surface-2);
	color: var(--stp-muted);
	font-size: 14px;
	z-index: 500;
}

/* ---------- Marcadores ---------- */
.stp-map-pin-wrap {
	background: transparent;
	border: 0;
}

.stp-map-pin {
	--stp-pin: #2563eb;
	position: relative;
	display: block;
	width: 32px;
	height: 42px;
	filter: drop-shadow(0 3px 4px rgba(15, 23, 42, .3));
}

.stp-map-pin-body {
	position: absolute;
	inset: 0;
	width: 32px;
	height: 42px;
	fill: var(--stp-pin);
}

.stp-map-pin-glyph {
	position: absolute;
	top: 6px;
	left: 7px;
	width: 18px;
	height: 18px;
	fill: #fff;
}

.stp-map-pin.is-featured::after {
	content: "";
	position: absolute;
	top: -3px;
	right: -3px;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: #facc15;
	border: 2px solid #fff;
}

/* Marcador institucional de um parceiro/integrante da rede: anel branco e
   forma ligeiramente maior para se distinguir sempre dos pontos de interesse. */
.stp-map-pin.is-member {
	width: 34px;
	height: 44px;
}

.stp-map-pin.is-member .stp-map-pin-body {
	width: 34px;
	height: 44px;
	stroke: #fff;
	stroke-width: 1.5px;
	filter: drop-shadow(0 2px 3px rgba(15, 23, 42, .4));
}

.stp-map-pin.is-member .stp-map-pin-glyph {
	top: 7px;
	left: 8px;
}

.stp-map-cluster {
	background: transparent;
	border: 0;
}

.stp-map-cluster-ico {
	background: var(--stp-accent);
	color: #fff;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 13px;
	box-shadow: 0 0 0 6px rgba(13, 148, 136, .25);
}

/* ---------- Cartão / painel ---------- */
.stp-map-card {
	position: absolute;
	z-index: 1300;
	top: 14px;
	right: 14px;
	width: 360px;
	max-width: calc(100% - 28px);
	max-height: calc(var(--stp-map-height) - 28px);
	display: flex;
	flex-direction: column;
	background: var(--stp-surface);
	border-radius: var(--stp-radius);
	box-shadow: var(--stp-shadow);
	overflow: hidden;
	opacity: 0;
	transform: translateY(8px);
	transition: opacity .18s ease, transform .18s ease;
}

.stp-map-card.is-open {
	opacity: 1;
	transform: none;
}

.stp-map-card[hidden] {
	display: none;
}

.stp-map-card-close {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 2;
	width: 32px;
	height: 32px;
	border: 0;
	border-radius: 50%;
	background: rgba(15, 23, 42, .55);
	color: #fff;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
}

.stp-map-card-close:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.stp-map-card-body {
	overflow-y: auto;
}

.stp-map-card-media {
	aspect-ratio: 16 / 10;
	background: var(--stp-surface-2);
}

.stp-map-card-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.stp-map-card-main {
	padding: 16px 18px 18px;
}

.stp-map-card-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 8px;
}

.stp-map-card-cat {
	--stp-chip: #2563eb;
	display: inline-block;
	padding: 3px 10px;
	border-radius: 999px;
	background: #eef2ff;
	background: color-mix(in srgb, var(--stp-chip) 14%, #fff);
	color: var(--stp-chip);
	font-size: 12px;
	font-weight: 600;
	border: 1px solid var(--stp-chip);
}

.stp-map-card-resp {
	padding: 3px 10px;
	border-radius: 999px;
	background: rgba(13, 148, 136, .12);
	color: var(--stp-accent);
	font-size: 12px;
	font-weight: 600;
}

.stp-map-card-featured {
	padding: 3px 10px;
	border-radius: 999px;
	background: rgba(250, 204, 21, .2);
	color: #a16207;
	font-size: 12px;
	font-weight: 600;
}

.stp-map-card-demo {
	padding: 3px 10px;
	border-radius: 999px;
	background: #f1f5f9;
	color: var(--stp-muted);
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .04em;
}

.stp-map-card-member {
	padding: 3px 10px;
	border-radius: 999px;
	background: rgba(13, 148, 136, .12);
	color: var(--stp-accent);
	font-size: 12px;
	font-weight: 700;
}

.stp-map-card-media--logo {
	aspect-ratio: auto;
	height: 140px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--stp-surface);
	padding: 18px;
}

.stp-map-card-media--logo img {
	width: auto;
	height: 100%;
	max-width: 70%;
	object-fit: contain;
}

.stp-map-card-member-link {
	margin: 0 0 14px;
}

.stp-map-card-link-btn {
	padding: 8px 14px;
	border: 1px solid var(--stp-ink);
	border-radius: 999px;
	background: transparent;
	color: var(--stp-ink);
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
}

.stp-map-card-link-btn:hover {
	background: var(--stp-ink);
	color: #fff;
}

.stp-map-card-link-btn:focus-visible {
	outline: 2px solid var(--stp-accent);
	outline-offset: 2px;
}

.stp-map-card-member-points {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.stp-map-card-member-point {
	width: 100%;
	text-align: left;
	padding: 8px 10px;
	border: 0;
	border-radius: 8px;
	background: var(--stp-surface-2);
	font: inherit;
	font-size: 13px;
	font-weight: 500;
	color: var(--stp-ink);
	cursor: pointer;
}

.stp-map-card-member-point:hover {
	background: #eef1f5;
}

.stp-map-card-member-point:focus-visible {
	outline: 2px solid var(--stp-accent);
	outline-offset: -2px;
}

.stp-map-card-title {
	margin: 0 0 8px;
	font-size: 19px;
	line-height: 1.3;
	font-weight: 700;
}

.stp-map-card-desc {
	margin: 0 0 12px;
	font-size: 14px;
	color: #334155;
}

.stp-map-card-desc p {
	margin: 0 0 8px;
}

.stp-map-card-rows {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 4px 12px;
	margin: 0 0 12px;
	font-size: 13px;
}

.stp-map-card-rows dt {
	color: var(--stp-muted);
	font-weight: 600;
}

.stp-map-card-rows dd {
	margin: 0;
}

.stp-map-card-contacts {
	margin: 0 0 14px;
	font-size: 13px;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}

.stp-map-card-contacts a {
	color: var(--stp-accent);
	text-decoration: none;
	font-weight: 600;
}

.stp-map-card-contacts a:hover {
	text-decoration: underline;
}

.stp-map-sep {
	color: var(--stp-line);
}

.stp-map-card-nav {
	border-top: 1px solid var(--stp-line);
	padding-top: 12px;
}

.stp-map-card-nav-label {
	display: block;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .05em;
	color: var(--stp-muted);
	margin-bottom: 8px;
}

.stp-map-card-nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.stp-map-nav-btn {
	flex: 1 1 auto;
	text-align: center;
	padding: 9px 12px;
	border-radius: 10px;
	background: var(--stp-ink);
	color: #fff !important;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
	min-width: 96px;
}

.stp-map-nav-btn:hover {
	background: var(--stp-accent);
}

.stp-map-nav-btn:focus-visible {
	outline: 2px solid var(--stp-accent);
	outline-offset: 2px;
}

/* ---------- Atribuição Leaflet sempre legível ---------- */
.stp-map-app .leaflet-container {
	font: inherit;
}

.stp-map-app .leaflet-control-attribution {
	font-size: 11px;
	background: rgba(255, 255, 255, .85);
}

/* ---------- Responsivo ---------- */
@media (max-width: 900px) {
	.stp-map-list {
		display: none;
	}
}

@media (max-width: 680px) {
	.stp-map-app {
		--stp-map-height: 78vh;
	}

	.stp-map-stage {
		border-radius: 12px;
	}

	/* Cartão como painel inferior (bottom sheet). */
	.stp-map-card {
		top: auto;
		right: 0;
		left: 0;
		bottom: 0;
		width: 100%;
		max-width: 100%;
		max-height: 76%;
		border-radius: 18px 18px 0 0;
		transform: translateY(100%);
	}

	.stp-map-card.is-open {
		transform: none;
	}

	.stp-map-card::before {
		content: "";
		position: absolute;
		top: 7px;
		left: 50%;
		transform: translateX(-50%);
		width: 44px;
		height: 5px;
		border-radius: 999px;
		background: var(--stp-line);
		z-index: 3;
	}

	.stp-map-card-close {
		top: 10px;
	}

	.stp-map-nav-btn {
		flex: 1 1 100%;
		padding: 12px;
		font-size: 15px;
	}

	.stp-map-filter-btn {
		padding: 9px 14px;
		font-size: 13.5px;
	}

	.stp-map-members-filter {
		flex: 1 1 100%;
	}

	.stp-map-members-select {
		width: 100%;
		max-width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.stp-map-card {
		transition: none;
	}
}
