:root {
  --surface: rgba(255, 255, 255, 0.74);
  --surface-strong: rgba(255, 255, 255, 0.88);
  --text: #171717;
  --text-muted: #5a5a5a;
  --border: rgba(23, 23, 23, 0.18);
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.18);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html,
body,
#map {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  color: var(--text);
  font-family: "Open Sans", sans-serif;
  overflow: hidden;
}

button,
a {
  font: inherit;
}

.mapboxgl-ctrl-logo {
  display: none !important;
}

.mapboxgl-popup-content {
  padding: 8px !important;
  overflow: hidden;
  background: var(--surface-strong) !important;
  border: 1px solid var(--border);
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.mapboxgl-popup-tip {
  display: none;
}

.pin-card {
  display: grid;
  gap: 6px;
}

.pin-card__image {
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
  border-radius: 6px;
  border: 1px solid var(--border);
  cursor: zoom-in;
}

.pin-card__title {
  margin: 0;
  font-size: 15px;
  line-height: 1.15;
}

.pin-card__title a {
  color: var(--text);
  text-decoration-color: rgba(23, 23, 23, 0.3);
  text-underline-offset: 3px;
}

.pin-card__caption {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.35;
}

.legend {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1;
  min-width: 160px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14);
  backdrop-filter: blur(14px);
}

.legend__header {
  margin-bottom: 10px;
}

.legend__title {
  margin: 0;
  font-size: 16px;
  line-height: 1.1;
}

.legend__count {
  margin: 3px 0 0;
  color: var(--text-muted);
  font-size: 12px;
}

.legend__list {
  display: grid;
  gap: 7px;
  padding: 0;
  margin: 0;
  list-style: none;
  font-size: 13px;
}

.legend__item {
  display: flex;
  align-items: center;
  gap: 7px;
}

.legend__swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  background: var(--category-color);
  border: 1px solid rgba(0, 0, 0, 0.28);
  border-radius: 999px;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.76);
  backdrop-filter: blur(5px);
}

.lightbox[hidden] {
  display: none;
}

.lightbox__image {
  max-width: 90%;
  max-height: 90%;
  border-radius: var(--radius);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
}

.lightbox__close {
  position: absolute;
  top: 18px;
  right: 18px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: white;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  cursor: pointer;
}

@media (max-width: 600px) {
  .legend {
    top: 8px;
    left: 8px;
    min-width: 144px;
    padding: 10px;
  }

  .legend__title {
    font-size: 15px;
  }

  .lightbox {
    padding: 14px;
  }
}
