/* The hunt map (#609): the full map's glass (site.css) under the site's header,
   with the layer chips and a unit finder on the title card and what Glassing adds
   in a second card at the foot of the column. Tokens are site.css's. */

/* The title card gives way, scrolling inside itself, before the column overruns
   a short window. */
.hunt-card {
  flex: 0 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.hunt-card .map-card-title {
  margin: 0;
  font-size: 30px;
}

.hunt-card-lede {
  margin: 8px 0 0;
  color: var(--body);
  font-size: 14px;
  line-height: 1.45;
}

.hunt-layers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--rule-strong);
}

.hunt-chip {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: 13px/1 var(--label);
  cursor: pointer;
}

.hunt-chip[aria-pressed="true"] {
  border-color: rgba(240, 236, 226, 0.5);
  background: rgba(240, 236, 226, 0.14);
  color: var(--bone);
}

.hunt-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.hunt-legend:not(:has(.hunt-key:not([hidden]))) {
  display: none;
}

.hunt-key {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hunt-key[hidden] {
  display: none;
}

/* web/app/embed/hunt-map.ts ROAD_OPEN, ROAD_SEASONAL and BURN_INK. */
.hunt-key i {
  display: inline-block;
  width: 18px;
  height: 0;
  border-top: 2px solid #f3d08e;
}

.hunt-key i.hunt-key-seasonal {
  border-top: 2px dashed #e8b04a;
}

.hunt-key i.hunt-key-burn {
  height: 10px;
  border: 1px solid #ff8c6e;
  background: rgba(255, 140, 110, 0.3);
}

/* THE FINDER. */
.hunt-finder {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--rule-strong);
}

.hunt-finder input {
  box-sizing: border-box;
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--rule-strong);
  border-radius: 10px;
  background: rgba(240, 236, 226, 0.06);
  color: var(--bone);
  font: 14px var(--sans);
}

.hunt-finder input::placeholder {
  color: var(--muted);
}

.hunt-finder input:focus {
  border-color: var(--ember);
  outline: none;
}

.hunt-picked {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.hunt-units {
  max-height: 196px;
  margin: 6px 0 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}

.hunt-units button {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 4px;
  width: 100%;
  padding: 5px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--body);
  font: 13px var(--sans);
  text-align: left;
  cursor: pointer;
}

.hunt-units button:hover,
.hunt-units button:focus-visible {
  background: rgba(240, 236, 226, 0.08);
  color: var(--bone);
  outline: none;
}

.hunt-unit-no {
  color: var(--muted);
}

.hunt-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.hunt-note a {
  color: var(--body);
}

/* MORE IN GLASSING, at the foot of the column. */
.hunt-more {
  margin-top: auto;
}

.hunt-more-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--bone);
  font: 16px var(--label);
}

.hunt-more-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 14px;
}

.hunt-more-list figure {
  margin: 0;
}

.hunt-more-list img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
}

.hunt-more-list figcaption {
  margin-top: 6px;
  color: var(--body);
  font-size: 12px;
  line-height: 1.3;
}

.hunt-more-go {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.hunt-more-go p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.hunt-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: 20px;
  background: var(--ember);
  color: var(--ground);
  font: 14px var(--label);
  text-decoration: none;
  white-space: nowrap;
}

.hunt-cta:hover {
  background: var(--tint-ember);
}

.hunt-cta svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hunt-shell .maplibregl-ctrl-scale {
  border-color: var(--muted);
  background: var(--glass);
  color: var(--bone);
}

@media (max-width: 640px) {
  .hunt-card .map-card-title {
    font-size: 23px;
  }

  .hunt-card-lede,
  .hunt-legend,
  .hunt-note {
    display: none;
  }

  .hunt-layers {
    flex-wrap: nowrap;
    margin-top: 8px;
    padding-top: 8px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .hunt-chip {
    flex: none;
  }

  .hunt-finder {
    margin-top: 8px;
    padding-top: 8px;
  }

  .hunt-finder input {
    height: 44px;
    font-size: 16px;
  }

  /* What Glassing adds, named in a line over the button: the map is the picture. */
  .hunt-more {
    padding: 12px 14px;
  }

  .hunt-more-head {
    font-size: 14px;
  }

  .hunt-more-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0 6px;
    margin: 4px 0 12px;
  }

  .hunt-more-list img {
    display: none;
  }

  .hunt-more-list figure + figure::before {
    content: "·";
    margin-right: 6px;
    color: var(--muted);
  }

  .hunt-more-list figcaption {
    display: inline;
    margin: 0;
  }

  .hunt-more-go p {
    display: none;
  }

  .hunt-cta {
    justify-content: center;
    width: 100%;
    height: 44px;
  }

  /* The corner controls and the credits, over the card at the foot. */
  .hunt-shell .maplibregl-ctrl-bottom-right {
    bottom: calc(var(--hunt-more-height, 0px) + 12px);
  }

  .hunt-shell .maplibregl-ctrl-scale {
    display: none;
  }

  .hunt-shell .map-credits {
    bottom: calc(var(--hunt-more-height, 0px) + 24px);
    max-width: calc(100% - 92px);
  }
}
