body {
  font-family: sans-serif;
  line-height: 1.6;
  margin: 0;
  container-type: inline-size;
}

header,
main {
  max-width: 800px;
  margin: 2em auto;
  padding: 0 20px;
}

header {
  margin-bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin-top: 1em;
  margin-bottom: 0.5em;
}

a {
  color: #0066cc;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

header h1 {
  margin-top: 0;
  margin-bottom: 0.2em;
}

header h1 a {
  color: inherit;
}

header p {
  margin-top: 0;
  font-style: italic;
}

nav {
  display: flex;
  gap: 1em;
}

nav a {
  color: black;
  /* text-transform: uppercase; */
  /* font-size: 0.9em; */
  /* letter-spacing: 0.1em; */
}

.logo {
  color: black;
  font-weight: bold;
  font-size: 1.2em;
}

code {
  background: #f2f2f2;
  padding: 2px 4px;
  border-radius: 3px;
}

pre {
  background: #f2f2f2;
  padding: 15px;
  overflow-x: auto;
  border-radius: 3px;
}

pre code {
  background: none;
  padding: 0;
}

/* Map styles */
.map-wrapper {
  /* Fallback for browsers without container query support */
  display: flex;
  gap: 2em;
  align-items: flex-start;
  margin: 1em 0;
  box-sizing: border-box;
  padding: 0 1em;
  justify-content: center;
}

/* Container query approach for modern browsers */
@supports (width: 1cqw) {
  .map-wrapper {
    position: relative;
    width: 100cqw;
    left: calc(-50cqw + 50%);
  }
}

#map {
  height: 620px;
  flex: 1;
  position: relative;
  max-width: 1200px;
}

.map-panel {
  position: absolute;
  background: rgba(0, 11, 22, 0.95);
  color: white;
  padding: 10px;
  border-radius: 6px;
  font-size: 12px;
  z-index: 1000;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.6),
    0 4px 16px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.feature-info {
  top: 10px;
  right: 10px;
  bottom: 10px;
  width: 300px;
  display: none;
  font-family: monospace;
  overflow-y: auto;
}

.legend {
  font-size: 0.7em;
}

.legend h6 {
  font-size: 1rem;
  margin: 0;
}

.legend ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.legend li {
  display: flex;
  align-items: center;
}

.legend label {
  display: flex;
  align-items: center;
  cursor: pointer;
  width: 100%;
}

.legend input[type="checkbox"] {
  margin-right: 8px;
  flex-shrink: 0;
  margin: 0 0.5em;
}

/* Dark theme for MapLibre controls to match the dark map */
.maplibregl-ctrl {
  filter: invert(1) hue-rotate(180deg);
}

/* Feature info panel styles */
.feature-info {
  font-family: monospace;
}

.feature-info p {
  margin: 0;
}

.feature-info a {
  color: #6db6ff;
}

.feature-info button.close {
  position: absolute;
  top: 0;
  right: 0;
  background: none;
  border: none;
  padding: 0;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  width: 2em;
  height: 2em;
  text-align: center;
}

.feature-info hr {
  margin: 8px 0;
  border: none;
  border-top: 1px solid rgba(255,255,255,0.2);
}

.feature-info .layer-header {
  display: flex;
  align-items: center;
}

.feature-info .layer-swatch {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  margin-right: 8px;
  flex-shrink: 0;
}

.feature-info table {
  line-height: 1.25;
}

.feature-info table td {
  padding: 0;
  vertical-align: top;
  white-space: pre;
}

.maplibregl-ctrl-attrib a {
  color: #0055bb !important;
}
