/* Address suggestions and map, shared by application and person forms. */

/* Suggestions sit below their box, above the fields that follow it. */
:is(.question, .form-row, .field-address):has(.address-suggestions) { position: relative; }

.address-suggestions {
  position: absolute;
  z-index: 1000;
  inset-inline: 0;
  margin: 0;
  padding: 0.25rem;
  list-style: none;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgb(0 0 0 / 0.15);

  & li {
    padding: 0.4rem 0.5rem;
    border-radius: var(--radius-control);
    cursor: pointer;
  }

  & li:hover { background: var(--accent-soft); }
  & li[aria-selected="true"] { background: var(--accent-row); }
}

/* Grow beyond the initial single line when the browser supports it. */
textarea[data-address] { field-sizing: content; }

.address-credit {
  max-width: 32rem;
  margin: 0.2rem 0 0;
  text-align: end;
  font-size: var(--text-micro);
}

.address-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.address-map {
  flex-basis: 100%;
  order: 1;
}

/* Override the site's button display rule for hidden pin actions. */
.address-map-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;

  &:not(:has(button:not([hidden]))) { display: none; }
  & button[hidden] { display: none; }
}

.address-map-canvas {
  height: 18rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
