/* ════════════════════════════════════════════════════════════════════════
   apollo-mapa.css — a seção do mapa.

   COMPONENTE WORDPRESS: pele do mapa da landing. Os overrides do Leaflet
   moram separados, em apollo-leaflet.css, porque são de OUTRA biblioteca —
   no plugin um pode ser enfileirado sem o outro.

   Regras da casa que valem aqui:
   - tokens do core (nada de cor solta), sem `svh`/`dvh` — a altura vem de
     --vh, publicada em JS.
   - o mapa é FULL BLEED e encosta na seção "Entre na rede." logo abaixo.
   ════════════════════════════════════════════════════════════════════════ */

.apollo-mapa {
  position: relative;
  /* full bleed de verdade, mesmo dentro de um container centrado */
  width: 100%;
  background: var(--bg);
  /* ZERO no fundo: o mapa encosta na faixa laranja do fechamento */
  padding-bottom: 0;
  margin-bottom: 0;
}

.apollo-mapa__head {
  width: min(100% - 2 * var(--gutter), var(--wrap));
  margin-inline: auto;
  padding: var(--section-gap) 0 1.5rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 2rem;
  flex-wrap: wrap;
  border-top: var(--hair) solid var(--border);
}
.apollo-mapa__head h2 {
  margin: 0;
  font-family: var(--ff-heading);
  font-size: var(--fs-h3);
  letter-spacing: -0.055em;
  line-height: 1;
  color: var(--txt-heading);
}
.apollo-mapa__status {
  margin: 0.5rem 0 0;
  font-family: var(--ff-mono, ui-monospace, monospace);
  font-size: var(--fs-p4);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* o quadro: largura total da tela, altura proporcional sem svh/dvh */
.apollo-mapa__frame {
  position: relative;
  width: 100%;
  height: 700px !important;   /* fixo: celular e desktop */
  overflow: hidden;
  background: var(--surface);
  isolation: isolate;
}
.apollo-mapa__canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }

/* a emenda com o fechamento laranja: o mapa entrega a cor da próxima seção */
.apollo-mapa__frame::after {
  display: none;   /* substituído: o fechamento sobe pelo mapa (ksa.css · .ksa-close) */
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  /* A EMENDA EM ONDA — a luz laranja do fechamento sobe pelo mapa como uma
     paisagem: morro à esquerda, vale no meio, colina à direita (o desenho
     do Rafael). Cheia na borda de baixo, na MESMA cor da seção seguinte, e
     rarefazendo para cima. A silhueta é uma máscara SVG com borda desfocada;
     a cor é o gradiente vertical. */
  background: linear-gradient(to top, rgb(var(--rgb-hot)) 0%, rgb(var(--rgb-hot)) 12%, rgba(var(--rgb-hot), 0.72) 34%, rgba(var(--rgb-hot), 0.34) 62%, rgba(var(--rgb-hot), 0.08) 88%, rgba(var(--rgb-hot), 0) 100%);
  -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%20100%20100%27%20preserveAspectRatio%3D%27none%27%3E%3Cfilter%20id%3D%27f%27%20x%3D%27-20%25%27%20y%3D%27-20%25%27%20width%3D%27140%25%27%20height%3D%27140%25%27%3E%3CfeGaussianBlur%20stdDeviation%3D%273.2%27%2F%3E%3C%2Ffilter%3E%3Cpath%20filter%3D%27url(%23f)%27%20d%3D%27M-6%20106%20L-6%2024%20C2%202%2012%20-2%2021%2016%20C29%2034%2036%2076%2048%2079%20C58%2081%2064%2070%2070%2052%20C75%2037%2083%2025%2091%2029%20C98%2033%20106%2044%20106%2058%20L106%20106%20Z%27%2F%3E%3C%2Fsvg%3E") 0 0 / 100% 100% no-repeat;
  mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%20100%20100%27%20preserveAspectRatio%3D%27none%27%3E%3Cfilter%20id%3D%27f%27%20x%3D%27-20%25%27%20y%3D%27-20%25%27%20width%3D%27140%25%27%20height%3D%27140%25%27%3E%3CfeGaussianBlur%20stdDeviation%3D%273.2%27%2F%3E%3C%2Ffilter%3E%3Cpath%20filter%3D%27url(%23f)%27%20d%3D%27M-6%20106%20L-6%2024%20C2%202%2012%20-2%2021%2016%20C29%2034%2036%2076%2048%2079%20C58%2081%2064%2070%2070%2052%20C75%2037%2083%2025%2091%2029%20C98%2033%20106%2044%20106%2058%20L106%20106%20Z%27%2F%3E%3C%2Fsvg%3E") 0 0 / 100% 100% no-repeat;
}
/* a borda de baixo é laranja CHEIO, sem máscara: a onda borrada deixava ~3 %
   do mapa vazar no último palmo, e isso desenhava a linha da emenda */
.apollo-mapa__frame::before {
  display: none;   /* substituído: o fechamento sobe pelo mapa (ksa.css · .ksa-close) */
  content: ''; position: absolute; inset: auto 0 0; height: 22%; z-index: 2; pointer-events: none;
  background: linear-gradient(to top, rgb(var(--rgb-hot)) 0%, rgb(var(--rgb-hot)) 38%, rgba(var(--rgb-hot), 0) 100%);
}
.apollo-mapa__iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; z-index: 0; pointer-events: none; }
.apollo-mapa__frame.is-live .apollo-mapa__iframe { pointer-events: auto; }
.apollo-mapa__veil {
  position: absolute; inset: 0; z-index: 3; display: flex; align-items: flex-start; justify-content: flex-end;
  padding: var(--s-4) var(--gutter); background: none; border: 0; cursor: pointer;
}
.apollo-mapa__frame.is-live .apollo-mapa__veil { display: none; }
.apollo-mapa__veil-chip {
  display: inline-flex; align-items: center; gap: 0.5em;
  padding: 0.6em 0.9em 0.6em 1em; border-radius: var(--r-xs);
  background: var(--txt-heading); color: var(--bg);
  font-family: var(--ff-mono, ui-monospace, monospace); font-size: var(--fs-p4);
  letter-spacing: 0.12em; text-transform: uppercase;
  transition: background 0.3s var(--ease), transform 0.25s var(--ease);
}
.apollo-mapa__veil:hover .apollo-mapa__veil-chip, .apollo-mapa__veil:focus-visible .apollo-mapa__veil-chip { background: var(--txt-hover); transform: translateY(-1px); }

.apollo-mapa__fallback {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 1.15rem;
  padding: 1.75rem;
  background: var(--surface);
  pointer-events: auto;
}
.apollo-mapa__fallback p { max-width: 36ch; margin: 0; font-size: var(--fs-p1); color: var(--txt-color); }
.apollo-mapa__control {
  padding: 0.7em 1.4em;
  border-radius: 999px;
  font-family: var(--ff-mono, ui-monospace, monospace);
  font-size: var(--fs-p4);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--txt-heading);
  transition: background 0.42s var(--ease-snappy), color 0.42s var(--ease-snappy);
}
.apollo-mapa__control:hover { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.apollo-mapa [hidden] { display: none !important; }

/* ── marcadores ─────────────────────────────────────────────────────────
   O marcador é uma plaquinha do desenho técnico: quadrada, fio de contorno,
   cor do tema. A pilha (cluster) é um leque de plaquinhas com a contagem. */
.apollo-mapa__marker {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 7px;
  background: var(--marker-color, var(--hot));
  color: var(--ink);
}
.apollo-mapa__marker svg { width: 19px; height: 19px; display: block; }

.apollo-mapa__cluster { position: relative; width: 64px; height: 38px; }
.apollo-mapa__mini {
  position: absolute; bottom: 4px;
  display: grid; place-items: center;
  width: 24px; height: 28px;
  color: var(--ink);
  background: var(--marker-color);
  border-radius: 5px;
}
.apollo-mapa__mini svg { width: 16px; height: 16px; display: block; }
.apollo-mapa__cluster b {
  position: absolute; top: -8px; right: -2px;
  padding: 2px 5px;
  background: var(--bg);
  color: var(--txt-heading);
  border-radius: 10px;
  font-family: var(--ff-mono, ui-monospace, monospace);
  font-size: 11px; line-height: 1;
}

@media (max-width: 767px) {
  .apollo-mapa__frame { height: clamp(20rem, calc(var(--vh, 100vh) * 0.55), 32rem); }
  .apollo-mapa__head { padding-top: calc(var(--section-gap) * 0.7); }
}

/* Crédito dos azulejos. O OpenStreetMap é livre mas EXIGE crédito visível —
   por isso ele fica aqui, discreto porém presente, e não escondido. */
/* chip sólido, não sombra na letra — mesma regra do resto da casa */
.apollo-mapa__credit {
  position: absolute;
  right: 0.6rem;
  bottom: 0.5rem;
  z-index: 3;
  margin: 0;
  font-family: var(--ff-mono, ui-monospace, monospace);
  font-size: var(--fs-p4);
  letter-spacing: 0.06em;
  background: var(--ink);
  color: var(--bg);
  padding: 0.2em 0.45em;
  pointer-events: none;
}
