/* 47maps — the chrome around the map.
   One accent, one shadow, one radius; the map is the interface and this stays
   out of its way. */

:root {
  --ink: #1f1f1f;
  --ink-soft: #5f6368;
  --ink-faint: #80868b;
  --surface: #ffffff;
  --surface-hover: #f1f3f4;
  --line: #e3e5e8;
  --accent: #1a73e8;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 2px 10px rgba(60, 64, 67, 0.15);
  --gap: 12px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8eaed;
    --ink-soft: #bdc1c6;
    --ink-faint: #9aa0a6;
    --surface: #202124;
    --surface-hover: #303134;
    --line: #3c4043;
    --accent: #8ab4f8;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.6), 0 2px 10px rgba(0, 0, 0, 0.4);
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
}

#map { position: absolute; inset: 0; }

/* ---------------------------------------------------------------- panel */

.panel {
  position: absolute;
  top: var(--gap);
  left: var(--gap);
  z-index: 2;
  width: min(400px, calc(100vw - 2 * var(--gap)));
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 4px 4px 14px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.brand {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.02em;
  color: var(--ink-soft);
  text-decoration: none;
  padding-right: 10px;
  margin-right: 6px;
  border-right: 1px solid var(--line);
  flex: none;
}
.brand span { color: var(--accent); }

.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: none;
  font: inherit;
  color: inherit;
  padding: 10px 0;
}
.search input::placeholder { color: var(--ink-faint); }
.search input::-webkit-search-cancel-button { display: none; }

.icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--ink-soft);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.icon:hover { background: var(--surface-hover); }
/* An author `display` beats the UA sheet's [hidden] rule, so restore it. */
.icon[hidden] { display: none; }
.icon svg { width: 20px; height: 20px; fill: currentColor; }

/* Sits directly on the map, so it carries its own background rather than
   relying on whatever is underneath being pale. */
.hint {
  align-self: flex-start;
  margin: 0;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 12px;
  color: var(--ink-faint);
}

/* ------------------------------------------------------------- not found */

.no-match {
  margin: 0;
  padding: 13px 16px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}

/* ----------------------------------------------------------- place card */

.place {
  position: relative;
  padding: 16px 44px 16px 16px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.place .close { position: absolute; top: 6px; right: 6px; }
.place h1 { margin: 0; font-size: 20px; font-weight: 500; letter-spacing: -0.01em; }
.place .kind { margin: 2px 0 10px; font-size: 12px; color: var(--ink-faint); text-transform: capitalize; }
.place .coords { margin: 0; font-size: 12px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }

.status {
  position: absolute;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 3;
  margin: 0;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 13px;
  color: var(--ink-soft);
}

/* ------------------------------------------------------ maplibre chrome */

.maplibregl-ctrl-group {
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow) !important;
  background: var(--surface) !important;
}
.maplibregl-ctrl-group button + button { border-top: 1px solid var(--line); }
.maplibregl-ctrl-attrib { font-size: 11px; }

@media (prefers-color-scheme: dark) {
  .maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: invert(1); }
  .maplibregl-ctrl-attrib.maplibregl-compact { background: var(--surface); }
  .maplibregl-ctrl-attrib a { color: var(--ink-soft); }
}

.marker {
  width: 22px;
  height: 22px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: var(--accent);
  border: 2px solid var(--surface);
  box-shadow: var(--shadow);
}

@media (max-width: 560px) {
  .panel { width: calc(100vw - 2 * var(--gap)); }
  .hint { display: none; }
}
