/* Argus FOIA: themed dropdowns (public/js/select.js) over the native <select>.
 *
 * `.pick` wraps a select that select.js enhanced: the select stays inside it, visually
 * hidden (it still posts), beside `.pick-btn`, the combobox. The open list (`.pick-list`)
 * is laid on the page in position: fixed; select.js sets its place through the CSSOM.
 * Tokens only, square corners. The chosen option takes the section's hue (the list
 * carries the page's `.h-*` class).
 */

.pick { position: relative; display: block; width: 100%; min-width: 0; }
.pick > select {
  position: absolute !important;
  left: 0; bottom: 0;
  width: 1px !important; height: 1px !important; min-height: 0 !important;
  padding: 0 !important; margin: 0 !important; border: 0 !important;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  opacity: 0; pointer-events: none;
}

.pick-btn {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-height: var(--control-h);
  padding: 8px var(--space-3);
  font: inherit;
  line-height: 1.25;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-control);
  border-radius: 0;
  cursor: pointer;
  user-select: none;
  text-align: left;
}
.pick-btn:hover { border-color: var(--text-2); }
.pick-btn[aria-disabled="true"] { opacity: 0.6; cursor: not-allowed; }
.pick-btn[aria-disabled="true"]:hover { border-color: var(--border-control); }
.pick-btn.invalid { border-color: var(--danger); }
.pick.open .pick-btn { border-color: var(--ink, var(--focus)); }
/* The chevron: two borders of a small square, turned. */
.pick-btn::after {
  content: "";
  flex: none;
  width: 7px; height: 7px;
  margin: -4px 2px 0 auto;
  border-right: 1.5px solid var(--text-2);
  border-bottom: 1.5px solid var(--text-2);
  transform: rotate(45deg);
  transition: transform 140ms ease, margin 140ms ease;
}
.pick.open .pick-btn::after { transform: rotate(225deg); margin-top: 4px; }

/* As wide as the longest option, like a native select: every label sits in one grid
 * cell, only the chosen one visible. */
.pick-face { display: grid; flex: 1 1 auto; min-width: 0; }
.pick-cur, .pick-size {
  grid-area: 1 / 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pick-size { visibility: hidden; height: 0; }

.pick-list {
  position: fixed;
  z-index: 60;
  top: 0; left: 0;
  box-sizing: border-box;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--space-1) 0;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 0;
  box-shadow: var(--shadow);
  font-family: var(--font);
  line-height: 1.4;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 140ms ease-out, transform 140ms ease-out;
}
.pick-list.up { transform: translateY(4px); }
.pick-list.shown { opacity: 1; transform: none; }

.pick-opt {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--control-h-sm);
  padding: 6px var(--space-3);
  cursor: pointer;
  white-space: nowrap;
  border-left: 3px solid transparent;
}
.pick-opt.active { background: var(--tint, var(--raised)); }
.pick-opt[aria-selected="true"] {
  background: var(--hue, var(--accent));
  color: var(--on-hue);
  font-weight: 600;
}
/* Where the keyboard or pointer is: a tint and a bar in the hue (the chosen one is
 * already filled). */
.pick-opt.active:not([aria-selected="true"]) { border-left-color: var(--hue, var(--accent)); }
.pick-opt[aria-disabled="true"] { color: var(--text-3); cursor: not-allowed; background: none; }
.pick-group {
  padding: var(--space-2) var(--space-3) var(--space-1);
  font-size: 0.8em;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-3);
}
.pick-group ~ .pick-opt { padding-left: var(--space-4); }

/* A person's dot (`data-dots`, the assignee): `.who-dot` from app.css, a size up; Nobody
 * is an empty ring. On the chosen row (filled in the page's hue) the dot is ringed. */
.pick-btn > .who-dot, .pick-opt > .who-dot { width: 20px; height: 20px; font-size: 9.5px; }
/* No taller than the text, so the box matches a select without dots. */
.pick-btn > .who-dot { margin: -2px 0; }
.pick-btn > .who-dot.none, .pick-opt > .who-dot.none { background: none; border: 1.5px dashed var(--line-strong); }
.pick-opt[aria-selected="true"] > .who-dot { box-shadow: 0 0 0 1.5px var(--on-hue); }
.pick-opt[aria-selected="true"] > .who-dot.none { box-shadow: none; border-color: currentColor; }

/* Where a native select sat inline at its own width, so does the combobox. */
.inline-form .pick, .sortf .pick, .video-controls .pick, .report-range .pick,
.flood-actions .pick, label > .pick { display: inline-block; width: auto; vertical-align: middle; }
.req-side .inline-form .pick { flex: 1 1 8rem; width: auto; }
.req-side .inline-form .pick .pick-btn { width: 100%; }
.report-range .pick { min-width: 8rem; }
.sortf .pick-btn { font-size: 12.5px; padding: 6px 10px; min-height: var(--control-h-sm); }
.video-controls .pick-btn { min-height: var(--control-h-sm); padding: 5px 8px; }

@media (prefers-reduced-motion: reduce) {
  .pick-list, .pick-list.up, .pick-btn::after { transition: none; }
  .pick-list, .pick-list.up { transform: none; }
}

@media print {
  .pick-btn::after { display: none; }
  .pick-list { display: none; }
}
