/**
 * Portal-style select field — STRUCTURAL STYLING ONLY.
 *
 * No colors are declared anywhere in this file (no text, background, border,
 * shadow, hover, or active colors). The project's own theme supplies them:
 * wire hsl(var(--border)), hsl(var(--muted)), hsl(var(--accent)), etc. into
 * the hook rules at the bottom when ready.
 */

.option-group {
  border: 1px solid;              /* color intentionally unset */
  border-radius: 0.5rem;
  padding: 0.25rem 0.75rem 0.75rem;
  position: relative;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.option-label {
  position: absolute;
  top: -0.625rem;
  left: 0.5rem;
  padding: 0 0.25rem;
  font-size: 0.75rem;
  max-width: calc(100% - 2rem);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  /* Give this a background matching the surface behind it,
     otherwise the border line shows through the label. */
}

.select-wrap {
  position: relative;
  margin-top: 0.25rem;
  min-width: 0;
}

.select-field {
  display: block;
  width: 100%;
  padding: 0.5rem 2rem 0.5rem 0.75rem;  /* right padding reserves room for the chevron */
  border: 1px solid;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-family: inherit;
  text-align: left;
  box-sizing: border-box;
  cursor: pointer;
  outline: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  min-width: 0;
  overflow: hidden;
}

.select-field-text {
  display: block;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.select-chevron {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0.875rem;
  height: 0.875rem;
  opacity: 0.5;
  pointer-events: none;
}

.dropdown-menu {
  position: fixed;              /* portal to <body>: ancestors can't clip it */
  z-index: 1000;
  max-height: 16rem;
  overflow-y: auto;
  border: 1px solid;
  border-radius: 0.5rem;
  padding: 0.25rem;
  box-sizing: border-box;
}

.dropdown-item {
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Style .dropdown-item:hover and .dropdown-item-active (selected item)
   with the project's theme.  Structural hooks only — no colors here.
   e.g. background-color: hsl(var(--muted)); */
.dropdown-item:hover {
  cursor: pointer;
}

.dropdown-item-active {
  cursor: pointer;
}
