/* =============================================================
   apollo-filters.css — shared FilterBar primitive
   ============================================================= */

.fb-panel {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 1px 2px rgba(15, 26, 48, 0.04);
}

.fb-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px dashed #f0f2f5;
}
.fb-row:last-child { border-bottom: 0; }
.fb-row-controls {
  padding-top: 0.75rem;
  align-items: center;
}

.fb-field { flex: 1 1 220px; min-width: 220px; }
.fb-field-narrow { flex: 0 1 180px; min-width: 180px; }
.fb-field-inline {
  display: inline-flex; align-items: center; gap: 0.4rem;
  margin-right: 1rem; flex-shrink: 0;
}
.fb-pull-right { margin-left: auto; }

.fb-label {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b7280;
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.fb-label-inline {
  font-size: 0.78rem; color: #4b5563; font-weight: 500;
}

/* ── Chips ─────────────────────────────────────────────────── */
.fb-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.fb-chip {
  background: #ffffff;
  border: 1px solid #d1d5db;
  color: #4b5563;
  font-size: 0.8rem;
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.12s;
  font-weight: 500;
}
.fb-chip:hover  { border-color: #1a2744; color: #1a2744; }
.fb-chip:focus  { outline: 2px solid #c9a84c; outline-offset: 1px; }

/* T13: Active chips — navy fill + white text + a left-edge gold pip
   so the selected state is unambiguous even when the user's eye scans
   only the inner-text area (Hick-Hyman: pre-attentive cue first,
   chrome second). The pip gives a non-colour signal alongside the
   fill swap. */
.fb-chip.active {
  background: #1a2744;
  color: #ffffff;
  border-color: #1a2744;
  font-weight: 600;
  padding-left: 1.4rem;
  position: relative;
  box-shadow: 0 1px 3px rgba(15, 26, 48, 0.18);
}
.fb-chip.active::before {
  content: "";
  position: absolute;
  left: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #c9a84c;
}
.fb-chip.active:hover { background: #0f1a30; border-color: #0f1a30; }

/* ── Multi-search select ───────────────────────────────────── */
.fb-multi { position: relative; }
.fb-multi-selected {
  min-height: 28px;
  padding: 0.2rem 0;
  display: flex; flex-wrap: wrap; gap: 0.25rem;
  font-size: 0.85rem;
}
.fb-muted { color: #6b7280; font-style: italic; } /* Phase 6: bumped from #9ca3af for WCAG AA contrast (4.6:1 vs ~3.5:1). */
.fb-multi-tag {
  display: inline-flex; align-items: center; gap: 4px;
  background: #eef1f6; color: #1a2744;
  padding: 2px 6px 2px 8px;
  border-radius: 3px;
  font-size: 0.8rem;
}
.fb-multi-x {
  background: transparent; border: 0; color: #4b5563;
  cursor: pointer; font-size: 1rem; line-height: 1;
  padding: 0 2px;
}
.fb-multi-x:hover { color: #c94c4c; }

.fb-multi-input {
  width: 100%;
  padding: 0.4rem 0.55rem;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 0.85rem;
  background: #ffffff;
}
.fb-multi-input:focus { outline: 2px solid #c9a84c; outline-offset: 0; border-color: #1a2744; }

.fb-multi-dropdown {
  position: absolute;
  top: 100%; left: 0; right: 0;
  z-index: 50;
  max-height: 260px; overflow-y: auto;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  box-shadow: 0 4px 14px rgba(15, 26, 48, 0.12);
  margin-top: 2px;
}
.fb-multi-opt {
  padding: 0.4rem 0.6rem;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex; align-items: center; gap: 0.4rem;
}
.fb-multi-opt:hover  { background: #eef1f6; }
.fb-multi-opt.active { background: #fff9e6; color: #5f471a; }

/* ── Range inputs (T14) ────────────────────────────────────── */
.fb-range { display: inline-flex; align-items: center; gap: 0.3rem; }
.fb-range-input-wrap {
  display: inline-flex;
  align-items: center;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: #ffffff;
  overflow: hidden;
}
.fb-range-input:focus { outline: 2px solid #c9a84c; outline-offset: 0; border-color: #1a2744; }
/* Was #9ca3af — 3.4:1 on #ffffff fails WCAG AA. Bumped to #6b7280 (4.6:1, AA-pass). */
.fb-range-sep { color: #6b7280; font-size: 0.8rem; }

/* ── Date inputs / presets ─────────────────────────────────── */
.fb-preset-group { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.fb-preset {
  background: #ffffff;
  border: 1px solid #d1d5db;
  color: #36405b;
  font-size: 0.76rem;
  padding: 0.32rem 0.6rem;
  border-radius: 3px;
  cursor: pointer;
  font-weight: 500;
  font-family: inherit;
}
.fb-preset:hover  { border-color: #1a2744; color: #1a2744; }
.fb-preset:focus  { outline: 2px solid #c9a84c; outline-offset: 1px; }
.fb-preset.active { background: #1a2744; color: #ffffff; border-color: #1a2744; }

.fb-date-range { display: inline-flex; align-items: center; gap: 0.3rem; margin-top: 0.4rem; }
.fb-date-input {
  padding: 0.32rem 0.45rem;
  border: 1px solid #d1d5db;
  border-radius: 3px;
  font-size: 0.82rem;
  background: #ffffff;
  font-family: inherit;
}
.fb-date-input:focus { outline: 2px solid #c9a84c; outline-offset: 0; border-color: #1a2744; }

/* ── Select ────────────────────────────────────────────────── */
.fb-select {
  font-size: 0.82rem;
  padding: 0.3rem 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 3px;
  background: #ffffff;
  color: #36405b;
}
.fb-select:focus { outline: 2px solid #c9a84c; outline-offset: 0; border-color: #1a2744; }

/* ── Checkbox rows ─────────────────────────────────────────── */
.fb-check {
  display: inline-flex; align-items: center;
  gap: 0.3rem;
  font-size: 0.82rem; color: #4b5563;
  margin-right: 0.6rem;
  cursor: pointer;
}

/* ── Reset + active count ──────────────────────────────────── */
.fb-active-count {
  font-size: 0.78rem;
  color: #c9a84c;
  font-weight: 600;
  margin-right: 0.6rem;
}
.fb-reset {
  background: #ffffff;
  border: 1px solid #c94c4c;
  color: #c94c4c;
  padding: 0.35rem 0.7rem;
  border-radius: 3px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
}
.fb-reset:hover { background: #c94c4c; color: #ffffff; }
.fb-reset:focus { outline: 2px solid #c9a84c; outline-offset: 2px; }

/* Zone chip group -- coastal/inland sub-district filter (P1-3). */
.fb-zone-group .fb-chip[aria-pressed="true"] {
  outline: 2px solid var(--apollo-accent, #2d8a4e);
  outline-offset: 1px;
}
.fb-zone-group .fb-chip {
  font-size: 11.5px;
}
