/* /borderlands/: a list of places by city, with a map and filters on top once
   places.js has run. Each kind's pin is its emoji, on a disc in the page's colour
   so it stands out from the map. */

/* Filters ---------------------------------------------------------------- */

.places__filters { margin-bottom: 20px; }

.places__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 4px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--page);
  color: var(--ink);
  font: 500 15px/1.2 var(--font-slab);
  cursor: pointer;
}
.chip .emoji { margin-inline-start: -4px; }
.chip:hover { background: var(--recess); }
.chip[aria-pressed="true"] {
  border-color: var(--mark-line);
  background: var(--mark);
}
/* A tick, so a picked chip isn't told apart by colour alone. */
.chip[aria-pressed="true"]::before {
  content: "✓";
  margin-inline-start: -4px;
}

/* Map --------------------------------------------------------------------- */

.places__map {
  height: clamp(360px, 60vh, 620px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--recess);
  font: 14px/1.4 var(--font-sans);
}

.places__count {
  margin: 10px 0 0;
  font-family: var(--font-mono);
  font-size: 14px;
}

/* Tiles come as light maps only. Dark mode turns them around: colours inverted
   back to their own hue, and softened, so the map sits on the dark page. */
:root[data-theme="dark"] .places__map .leaflet-tile-pane {
  filter: invert(1) hue-rotate(180deg) brightness(0.9) contrast(0.9);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .places__map .leaflet-tile-pane {
    filter: invert(1) hue-rotate(180deg) brightness(0.9) contrast(0.9);
  }
}

/* Leaflet's controls and popups, in the page's colours. */
.places__map .leaflet-bar {
  border: 1px solid var(--line-strong);
  box-shadow: none;
}
.places__map .leaflet-bar a {
  border-color: var(--line);
  background: var(--page);
  color: var(--ink);
}
.places__map .leaflet-bar a:hover { background: var(--recess); }
.places__map .leaflet-bar a.leaflet-disabled { background: var(--recess); color: var(--ink); opacity: 1; cursor: default; }

.places__map .leaflet-control-attribution {
  background: color-mix(in srgb, var(--page) 85%, transparent);
  color: var(--ink);
}
.places__map .leaflet-control-attribution a { color: var(--ink); }

.places__map .leaflet-popup-content-wrapper,
.places__map .leaflet-popup-tip {
  background: var(--page);
  color: var(--ink);
  box-shadow: 0 4px 18px rgb(0 0 0 / 0.25);
}
.places__map .leaflet-popup-content-wrapper { border-radius: 10px; }
.places__map .leaflet-popup-content { margin: 14px 18px; }
.places__map a.leaflet-popup-close-button { color: var(--ink); }

/* Emoji, in the system's colour emoji font wherever it has one. */
.emoji {
  flex: none;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-style: normal;
  font-weight: 400;
  line-height: 1;
}

/* Pins: the emoji on a disc with an edge, so it's clear of the map in both themes. */
.places__pin {
  background: none;
  border: 0;
}
.places__pin .emoji {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  box-sizing: border-box;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: var(--page);
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.4);
  font-size: 19px;
}
.places__pin:focus-visible { outline: none; }
.places__pin:focus-visible .emoji { outline: 2px solid var(--ink); outline-offset: 2px; }

/* List ---------------------------------------------------------------------- */

.places__city h2 { margin-top: 1.6em; }

.places__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.place {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  scroll-margin-top: 72px;
}
.place:target { border-color: var(--mark-line); background: var(--mark); }

.place__info > * { margin: 0; }
.place__info > * + * { margin-top: 4px; }

.place__name {
  font-size: 1.15rem;
  margin: 0;
}

.place__meta,
.place__checked,
.place__city { font-size: 15px; }

.place__kind {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-slab);
  font-weight: 700;
  font-size: 14px;
}

.place__links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
}

.place__checked time { font-size: 14px; }

/* The review's rating, as kitchenpunk gives it: a tinted chip beside its link. */
.place__rating {
  padding: 0 8px;
  border: 1px solid var(--mark-line);
  border-radius: 999px;
  background: var(--mark);
  font: 700 14px/1.6 var(--font-slab);
  white-space: nowrap;
}

.place__show {
  align-self: flex-start;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: 500 14px/1.4 var(--font-slab);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* The popup: the same text, a little tighter. .places__map outranks Leaflet's own
   paragraph margins. */
.places__map .place__popup .place__name {
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.2;
}
.places__map .place__popup > * { margin: 0; }
.places__map .place__popup > * + * { margin-top: 6px; }
.places__map .place__popup a { color: var(--ink); }
