/* The opening search: a round button on a black page that opens into a field, with the places found in a panel
   under it. Lime marks the letters found. */
:root {
  --page: #000000;          /* the page */
  --ink: #f5f5f7;           /* text */
  --muted: #8a8a94;
  --field: #141417;         /* the field and the panel */
  --edge: #27272d;          /* their edge */
  --pick: #222228;          /* the band on the place picked */
  --lit: #c8ff45;           /* the letters found */
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

body {
  min-height: 100svh;
  background: var(--page);
  color: var(--ink);
  font-family: 'Onest Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* held from the top: the panel grows downwards and the field does not move */
.stage {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  align-content: start;
  padding: clamp(60px, 26vh, 240px) 16px 48px;
}

.find {
  display: grid;
  justify-items: center;
  width: min(520px, 100%);
}

/* ---------------------------------------------------------------- the field: 56 pixels wide when closed */
.find__bar {
  position: relative;
  display: flex;
  align-items: center;
  width: 56px;
  height: 56px;
  border: 1px solid var(--edge);
  border-radius: 28px;
  background: var(--field);
  overflow: hidden;
}

.find__open {
  display: grid;
  flex: none;
  place-items: center;
  width: 54px;
  height: 54px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.find__open svg,
.find__close svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.find__open:focus-visible,
.find__close:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: -4px;
}

/* the focus comes back to the lens when the field closes: after a finger or the mouse, without the ring */
html[data-using='pointer'] .find__open:focus-visible {
  outline: none;
}

.find__input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 17px;
  outline: none;
  opacity: 0;
  -webkit-appearance: none;
  appearance: none;
}

.find__input::-webkit-search-cancel-button,
.find__input::-webkit-search-decoration {
  -webkit-appearance: none;
}

/* the words shown while the field is empty: they change by themselves */
.find__hint {
  position: absolute;
  left: 58px;
  right: 56px;
  top: 50%;
  height: 22px;
  margin-top: -11px;
  overflow: hidden;
  font-size: 17px;
  line-height: 22px;
  color: var(--muted);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
}

.find__hint span {
  display: block;
}

.find__close {
  display: grid;
  flex: none;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-right: 7px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #1f1f24;
  color: var(--muted);
  cursor: pointer;
  opacity: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.find__close svg {
  width: 18px;
  height: 18px;
}

/* ---------------------------------------------------------------- the panel of places */
.find__panel {
  position: relative;
  width: 100%;
  height: 0;
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 22px;
  background: var(--field);
  opacity: 0;
}

.find__panel.is-open {
  border-color: var(--edge);
}

.find__list {
  position: relative;
  margin: 0;
  padding: 6px;
  list-style: none;
}

/* the band on the place picked, moved by the script */
.find__pick {
  position: absolute;
  left: 6px;
  right: 6px;
  top: 6px;
  height: 52px;
  border-radius: 16px;
  background: var(--pick);
  opacity: 0;
}

.place {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  height: 52px;
  padding: 0 14px;
  border-radius: 16px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.place svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.place__name {
  overflow: hidden;
  font-size: 16px;
  font-weight: 540;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.place__name mark,
.place__land mark {
  background: none;
  color: var(--lit);
  font-weight: 700;
}

.place__land {
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
}

.find__none {
  margin: 0;
  padding: 18px 20px;
  font-size: 15px;
  color: var(--muted);
}

.find__none:empty {
  display: none;
}
