/* Core Layout */
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: 'JetBrains Mono', monospace;
  background: #f5f5f0;
  color: #1a1a1a;
  overflow: hidden;
}

#map {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.overlay,
.back-link,
.header,
.ol-popup {
  position: absolute;
}

.overlay {
  z-index: 100;
  pointer-events: none;
}

.disclaimer {
  z-index: 9999;
  position: fixed;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.8);
  width: 100%;
  height: 100%;
}

.disclaimer-popup {
  position: relative;
  width: 80%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  background: white;
  padding: 30px;
  border: 5px solid red;
  text-align: center;
}

.disclaimer-popup>h1,
.disclaimer-popup>h2 {
  color: red;
}

.disclaimer-popup>h3 {
  color: black;
  font-weight: bold;
}

.disclaimer-popup>h5 {
  color: black;
  font-weight: lighter;
}

.disclaimer-popup button {
  margin: 0;
  padding: 2.5%;
  background-color: black;
  color: white;
  cursor: pointer;
  min-width: 10rem;
}

.ol-popup {
  position: absolute;
  background-color: white;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  padding: 15px;
  border-radius: 10px;
  border: 1px solid #cccccc;
  bottom: 12px;
  left: -50px;
  min-width: 200px;
  z-index: 1000;
}

.ol-popup:after,
.ol-popup:before {
  top: 100%;
  border: solid transparent;
  content: " ";
  height: 0;
  width: 0;
  position: absolute;
  pointer-events: none;
}

.ol-popup:after {
  border-top-color: white;
  border-width: 10px;
  left: 48px;
  margin-left: -10px;
}

.ol-popup-closer {
  text-decoration: none;
  position: absolute;
  right: 8px;
  top: 2px;
}

.ol-popup-closer:after {
  content: "✖";
}

.back-link {
  top: 20px;
  left: 20px;
  z-index: 1001;
  font-size: 0.75rem;
  color: rgba(0, 0, 0, 0.5);
  text-decoration: none;
  transition: color 0.2s ease;
}

.back-link:hover {
  color: #2563eb;
}

.header {
  top: 50px;
  left: 20px;
  right: 20px;
  z-index: 600;
}

.title-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  padding: 20px 24px;
  display: inline-block;
  pointer-events: auto;
}

.title-card h1 {
  margin: 0 0 4px 0;
  font-family: 'Instrument Serif', serif;
  font-size: 1.8rem;
  font-weight: 400;
  color: #1e40af;
}

.title-card .subtitle {
  font-size: 0.75rem;
  color: rgba(0, 0, 0, 0.5);
  font-weight: 300;
}

.title-meta {
  margin-top: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.attribution,
.methods-link {
  font-size: 0.65rem;
  color: rgba(0, 0, 0, 0.4);
}

.methods-link {
  text-decoration: none;
  transition: color 0.2s ease;
}

.methods-link:hover {
  color: #1e40af;
}

.legend {
  bottom: 30px;
  left: 20px;
  z-index: 600;
}

.legend-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  padding: 16px 20px;
  pointer-events: auto;
}

.legend-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(0, 0, 0, 0.5);
  margin-bottom: 10px;
}

.legend-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.7rem;
  color: rgba(0, 0, 0, 0.7);
  cursor: pointer;
}

.legend-color {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

div.ol-zoom {
  position: absolute;
  top: auto;
  left: auto;
  bottom: 30px;
  right: 10px;
}

#copyNotification {
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 600;
  opacity: 0;
  pointer-events: none;
}

@media (orientation: portrait) {
  .back-link {
    left: 5%;
    top: 30px;
  }

  .header {
    top: 20px;
    left: 0;
    right: 0;
    width: 100%;
    display: flex;
    justify-content: center;
  }

  .title-card {
    width: 90%;
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  }

  .title-card h1 {
    font-size: 2rem;
  }

  .ol-popup {
    left: -45vw;
    bottom: 0;
    font-size: 5vw;
    width: 90vw;
  }

  .ol-popup:after {
    left: 50%;
  }

  div.ol-zoom {
    opacity: 0;
  }

  .legend-title {
    font-size: 2rem;
  }

  .legend-item {
    font-size: 2rem;
  }
}