/* DanceGrove — typeahead / autocomplete combobox.
   Terracotta Atelier skin: reuses --dg-* design tokens from grove.css.
   Attaches visually to any [data-dg-autocomplete] input via a positioned panel. */

.dg-ac-wrap {
  position: relative;
  display: inline-block;
  width: 100%;
}

.dg-ac-panel {
  position: absolute;
  z-index: 60;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--dg-paper, #fbf6ee);
  border: 1px solid var(--dg-line, #e3d8c7);
  border-radius: 14px;
  box-shadow: 0 14px 40px -16px rgba(40, 26, 18, 0.45);
  max-height: 60vh;
  overflow-y: auto;
  display: none;
}

.dg-ac-panel.dg-ac-open {
  display: block;
}

.dg-ac-group-label {
  font-family: var(--dg-font-heading, inherit);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dg-ink-soft, #8a7861);
  padding: 8px 10px 4px;
  margin: 0;
}

.dg-ac-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  color: var(--dg-ink, #2c2018);
  text-decoration: none;
  line-height: 1.25;
}

.dg-ac-item:hover,
.dg-ac-item.dg-ac-active {
  background: var(--dg-linen-2, #f1e7d6);
}

.dg-ac-item.dg-ac-active {
  outline: 2px solid var(--dg-brass-2, #b08a4f);
  outline-offset: -2px;
}

.dg-ac-item-label {
  font-weight: 600;
  font-size: 0.95rem;
}

.dg-ac-item-sub {
  font-size: 0.8rem;
  color: var(--dg-ink-soft, #8a7861);
}

.dg-ac-empty,
.dg-ac-busy {
  padding: 12px 12px;
  color: var(--dg-ink-soft, #8a7861);
  font-size: 0.88rem;
}

.dg-ac-busy::after {
  content: "";
  display: inline-block;
  width: 0.7em;
  height: 0.7em;
  margin-left: 0.45em;
  border: 2px solid var(--dg-line-2, #d8c9b3);
  border-top-color: var(--dg-clay, #b5542b);
  border-radius: 50%;
  vertical-align: middle;
  animation: dg-ac-spin 0.7s linear infinite;
}

@keyframes dg-ac-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .dg-ac-busy::after { animation: none; }
}

/* Visually-hidden live region for screen-reader status announcements. */
.dg-ac-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
