/* Palette and fonts follow the app's Material 3 theme (res/values/colors.xml, res/font). */
@font-face {
  font-family: 'Fraunces';
  src: url('fonts/fraunces_variable.ttf') format('truetype');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Public Sans';
  src: url('fonts/public_sans_variable.ttf') format('truetype');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --surface: #FDFBF6;
  --on-surface: #201B12;
  --on-surface-variant: #6B6155;
  --surface-container: #F8ECDE;
  --outline-variant: #E2D9C9;
  --primary: #1B6D24;
  --feature: #B5623C;
  --selected: #1B6D24;
  --inverse-surface: #353026;
  --on-inverse-surface: #FAEFE0;
}
@media (prefers-color-scheme: dark) {
  :root {
    --surface: #17130A;
    --on-surface: #ECE1D2;
    --on-surface-variant: #CFC5B7;
    --surface-container: #2F2920;
    --outline-variant: #3B342A;
    --primary: #87D982;
    --feature: #FFB59F;
    --selected: #87D982;
    --inverse-surface: #ECE1D2;
    --on-inverse-surface: #353026;
    }
}

html, body { margin: 0; height: 100%; font-family: 'Public Sans', system-ui, sans-serif; background: var(--surface); color: var(--on-surface); }
#map { position: absolute; inset: 0; height: 100dvh; }

#header {
  position: absolute; z-index: 2; top: 0; left: 0; right: 0;
  display: flex; align-items: center; gap: 12px; pointer-events: none;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
}
#logo { pointer-events: auto; flex: none; }
#logo img { display: block; width: 56px; height: 56px; }
#title {
  background: color-mix(in srgb, var(--surface) 92%, transparent); color: var(--on-surface);
  border-radius: 12px; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  padding: 8px 16px; font: 600 1.1em 'Fraunces', serif; font-variation-settings: 'opsz' 24, 'SOFT' 40, 'WONK' 1;
  min-width: 0; overflow-wrap: anywhere;
}
#title:empty { display: none; }

#message {
  position: absolute; z-index: 3; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--inverse-surface); color: var(--on-inverse-surface); padding: 10px 18px; border-radius: 8px; max-width: 90%; text-align: center;
}

.maplibregl-popup-content {
  max-width: 280px; max-height: 50dvh; overflow-y: auto; padding: 10px 12px; border-radius: 12px;
  background: var(--surface-container); color: var(--on-surface); font-family: 'Public Sans', system-ui, sans-serif;
}
.maplibregl-popup-close-button { color: var(--on-surface-variant); }
.maplibregl-popup-anchor-top .maplibregl-popup-tip, .maplibregl-popup-anchor-top-left .maplibregl-popup-tip, .maplibregl-popup-anchor-top-right .maplibregl-popup-tip { border-bottom-color: var(--surface-container); }
.maplibregl-popup-anchor-bottom .maplibregl-popup-tip, .maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip, .maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip { border-top-color: var(--surface-container); }
.maplibregl-popup-anchor-left .maplibregl-popup-tip { border-right-color: var(--surface-container); }
.maplibregl-popup-anchor-right .maplibregl-popup-tip { border-left-color: var(--surface-container); }

.place { display: flex; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--outline-variant); cursor: pointer; }
.place:last-child { border-bottom: 0; }
.place.selected .place-name { color: var(--primary); }
.place img { flex: none; width: 48px; height: 48px; object-fit: cover; border-radius: 8px; }
.place-name { font: 600 1em 'Fraunces', serif; font-variation-settings: 'opsz' 24, 'SOFT' 40, 'WONK' 1; }
.place-links { font-size: 0.85em; }
.place-links a { margin-right: 10px; color: var(--primary); }

.maplibregl-ctrl-group { background: var(--surface-container); }
.maplibregl-ctrl-group button + button { border-top-color: var(--outline-variant); }
.maplibregl-ctrl-attrib { background: color-mix(in srgb, var(--surface) 80%, transparent); color: var(--on-surface-variant); }
.maplibregl-ctrl-attrib a { color: var(--on-surface-variant); }
@media (prefers-color-scheme: dark) {
  .maplibregl-ctrl button .maplibregl-ctrl-icon { filter: invert(1); }
}

@media (max-width: 600px) {
  #logo img { width: 44px; height: 44px; }
  #title { font-size: 1em; padding: 6px 12px; }
}

.maplibregl-user-location-dot, .maplibregl-user-location-dot:before { background-color: var(--primary); }
.maplibregl-user-location-dot:after { border-color: var(--surface); }
.maplibregl-user-location-accuracy-circle { background-color: color-mix(in srgb, var(--primary) 20%, transparent); }
