/* ==========================================================================
   Escometer — térkép oldal specifikus stílusok
   ========================================================================== */

:root {
  /* A térkép saját, "rendes" hőtérkép-palettája (kék → türkiz → zöld → sárga → narancs → piros).
     Csak ezen az oldalon használjuk — a többi felület (admin, Helyek lista) marad a
     márkakönyv piros/bézs hőskáláján, csak a térkép hőfoltja + pinek igazodnak a
     valósághűbb, "textbook" hőtérkép-hatáshoz. */
  --map-h0: #2E6FF2;
  --map-h1: #17A6B0;
  --map-h2: #3FAE49;
  --map-h3: #E8C93A;
  --map-h4: #E8792E;
  --map-h5: #C81E3A;
}

#map {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--ink);
}

/* Mapbox saját vezérlőinek (zoom +/-, attribution) a lebegő navsáv alá kerülnek */
.mapboxgl-ctrl-top-right { top: calc(var(--nav-inset) + var(--nav-h) + 12px); right: 14px; }
.mapboxgl-ctrl-group {
  background: var(--ink) !important;
  border: 1px solid var(--hairline-inverse) !important;
  box-shadow: 0 6px 20px rgba(27,19,16,0.35) !important;
}
.mapboxgl-ctrl-group button { filter: invert(1) brightness(1.6); }
.mapboxgl-ctrl-attrib { font-size: 10px; }

/* ---------- Saját pozíció gomb — alul középen ---------- */
.locate-btn-wrap {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
}
.locate-btn-wrap .icon-btn svg { width: 20px; height: 20px; }
.locate-btn-wrap .icon-btn.loading svg { animation: esc-spin 1s linear infinite; }
@keyframes esc-spin { to { transform: rotate(360deg); } }

/* ---------- Hőskála jelmagyarázat — bal felül ---------- */
.legend {
  position: fixed;
  top: calc(var(--nav-inset) + var(--nav-h) + 12px);
  left: var(--nav-inset);
  z-index: 40;
  background: var(--ink);
  border: 1px solid var(--hairline-inverse);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: 0 6px 20px rgba(27,19,16,0.35);
  max-width: 220px;
}
.legend .eyebrow { color: rgba(244,234,217,0.65); margin-bottom: 8px; }
.legend .bar {
  height: 8px;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--map-h0), var(--map-h1), var(--map-h2), var(--map-h3), var(--map-h4), var(--map-h5));
  margin-bottom: 6px;
}
.legend .ends {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 8.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(244,234,217,0.55);
  white-space: nowrap;
}

/* ---------- Egyedi helyszín-marker (HTML marker a térképen) ----------
   Szándékosan kicsi és visszafogott — a hangsúly a hőtérkép-folton legyen,
   a pin csak egy kattintható jelölő rajta, nem a fő vizuális elem. */
.esc-marker {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid rgba(27,19,16,0.55);
  cursor: pointer;
  transition: transform .15s ease;
}
.esc-marker:hover { transform: scale(1.15); }
.esc-marker svg { width: 9px; height: 9px; color: var(--beige); }

/* A háttérszínt (0-100-as folytonos hőfok alapján) és a doboz-árnyékot
   JS állítja be inline style-ként (lásd js/map.js escBuildMarkerEl) —
   a .dark-icon osztályt is JS adja hozzá, ha a háttér elég világos ahhoz,
   hogy sötét ikon kelljen bézs helyett (pl. a sárga tartományban). */
.esc-marker.dark-icon svg { color: var(--ink); }

/* ---------- Saját pozíció pont ---------- */
.esc-you-marker {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #3B82F6;
  border: 3px solid #F4EAD9;
  box-shadow: 0 0 0 6px rgba(59,130,246,0.28);
}

/* ---------- Részletkártya — alulról felcsúszó panel ---------- */
.detail-sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 55;
  background: var(--beige);
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  border: 1px solid var(--hairline);
  box-shadow: 0 -10px 30px rgba(27,19,16,0.3);
  padding: 20px 22px 26px;
  max-width: 480px;
  margin: 0 auto;
  transform: translateY(105%);
  transition: transform .25s ease;
}
.detail-sheet.open { transform: translateY(0); }
.detail-sheet .close-x {
  position: absolute;
  top: 14px; right: 14px;
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--beige-2);
  color: var(--ink-mid);
  border: 1px solid var(--hairline);
}
.detail-sheet .close-x svg { width: 14px; height: 14px; }
.detail-sheet .top-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding-right: 36px;
}
.detail-sheet h2 {
  font-family: 'EB Garamond', Georgia, serif;
  font-weight: 600;
  font-size: 22px;
  margin: 4px 0 6px;
  color: var(--ink);
}
.detail-sheet .address {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--ink-mid);
  margin-bottom: 10px;
}
.detail-sheet .desc {
  font-style: italic;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink-mid);
}

@media (max-width: 640px) {
  .legend { max-width: 200px; padding: 10px 12px; }
}
