/* cogitator/codex-col1.css v6 */
/* Codex Viewer Column 1 — Filters panel content styles. DevAgent15 - 2026-06-02 */

/* DevAgent29 - 2026-07-19
   What: v6 — .cc1-switch-row right-aligns: justify-content space-between →
         flex-end, so the label sits beside the switch instead of across the
         column from it.
   Why:  Jérôme review. space-between pushed the label to the far left, and a
         label that far from its control reads as unrelated to it. */

/* DevAgent29 - 2026-07-19
   What: v5 — three changes.
         1. .cc1-switch* — the Legends control, a labelled on/off switch.
         2. Filter section labels enlarged: .cc1-acc__title and
            .cc1-section__title go --text-xs → --text-sm.
         3. DEAD RULES SWEPT: .cc1-gamemode, .cc1-segmented, .cc1-seg,
            .cc1-seg--active. Their markup went with the Combat Patrol ruling
            and the game-mode toggle in codex-col1.js v4; nothing has referenced
            them since.
            ⚠ .cc1-note is NOT swept — it was on that same dead list, and
            codex-col1.js v5 gave it a use again under the Legends switch.
   Why:  Jérôme review. The sweep is in scope only because this file was
         already open. */

/* DevAgent15 - 2026-06-02
   What: v4 — Accordion header→options gap 6px → 12px (.cc1-acc__body padding-top).
   Why:  Jérôme review. */

/* DevAgent15 - 2026-06-02
   What: v3 — 6px gap between an accordion header block and its filter options
         (.cc1-acc__body padding-top 0 → 6px).
   Why:  Jérôme review — breathing room under the toggle header. */

/* DevAgent15 - 2026-06-02
   What: v2 — Gate 3 review: collapsible filter categories (.cc1-acc* — header
         block with +/− toggle and a count badge), game-mode spacing (.cc1-gamemode),
         and greyed/disabled pill state (.cc1-pill--unavailable) for abilities not
         present on the current faction's units. The Game Mode section title is
         gone (handled in CodexCol1.js); .cc1-section/.cc1-section__title now back
         only the always-visible Allegiance block.
   Why:  Jérôme review — compact, collapsible filters; list-all abilities greyed. */

/* DevAgent15 - 2026-06-02
   What: v1 — .cc1-* styles for the always-visible inline filters: section
         headers, segmented Game Mode toggle, allegiance selects, stat range
         fields, multi-select pills, keyword search, and the Reset button.
         Visually matches the Army Builder filter primitives (range inputs,
         amber active states) without reusing their popover machinery.
   Why:  Col1 owns the Codex filter UI. */

.cc1 {
  padding: var(--space-3) var(--space-3) var(--space-6);
  display: flex;
  flex-direction: column;
}

/* ── Section ── */
.cc1-section {
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
}
.cc1-section:first-child { padding-top: var(--space-1); }

.cc1-section__title {
  margin: 0 0 var(--space-2);
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.cc1-section__count {
  color: var(--amber-dim);
  font-weight: 700;
}

/* ── Field + select ── */
.cc1-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.cc1-field + .cc1-field { margin-top: var(--space-3); }

.cc1-label {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.cc1-select {
  width: 100%;
  height: 36px;
  min-height: var(--touch-target);
  padding: 0 var(--space-8) 0 var(--space-3);
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text);
  cursor: pointer;
  appearance: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236b6560' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  transition: border-color var(--transition-fast);
}
.cc1-select:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px var(--amber-glow); }
.cc1-select--placeholder { color: var(--text-dim); }

.cc1-note {
  margin: var(--space-1) 0 0;
  font-size: var(--text-xs);
  font-style: italic;
  color: var(--text-dim);
  line-height: 1.4;
}

/* ── Stat range field ── */
.cc1-range {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.cc1-range + .cc1-range { margin-top: var(--space-2); }

.cc1-range__label {
  width: 78px;
  flex-shrink: 0;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-dim);
}

.cc1-range__inputs {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 1;
}

.cc1-range__input {
  width: 64px;
  height: 34px;
  padding: 0 var(--space-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text);
  box-sizing: border-box;
  transition: border-color var(--transition-fast);
}
.cc1-range__input:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px var(--amber-glow); }
.cc1-range__sep { color: var(--text-dim); font-size: var(--text-sm); }

.cc1-range__clear {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-dim);
  font-size: var(--text-base);
  line-height: 1;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}
.cc1-range__clear:hover { background: var(--red-light); border-color: var(--red); color: var(--red); }

/* ── Multi-select pills ── */
.cc1-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.cc1-pill {
  min-height: 32px;
  padding: var(--space-1) var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
  transition: border-color var(--transition-fast), color var(--transition-fast), background var(--transition-fast);
}
.cc1-pill:hover     { border-color: var(--border-hi); color: var(--text); }
.cc1-pill--active   { border-color: var(--amber); color: var(--amber-dim); background: var(--amber-light); }

/* Unavailable — ability not present on the current faction's units */
.cc1-pill--unavailable {
  color: var(--text-dim);
  background: var(--surface-lo);
  border-color: var(--border);
  opacity: 0.5;
  cursor: default;
}
.cc1-pill--unavailable:hover { border-color: var(--border); color: var(--text-dim); }

/* ── Keyword search ── */
.cc1-search {
  width: 100%;
  height: 34px;
  margin-bottom: var(--space-2);
  padding: 0 var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text);
  box-sizing: border-box;
  transition: border-color var(--transition-fast);
}
.cc1-search:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px var(--amber-glow); }

/* ── Empty hint ── */
.cc1-empty {
  margin: 0;
  font-size: var(--text-sm);
  font-style: italic;
  color: var(--text-dim);
}

/* ── Switch (Legends) ── */
.cc1-switch-row {
  display: flex;
  align-items: center;
  /* Label sits beside its switch, not across the column from it. */
  justify-content: flex-end;
  gap: var(--space-2);
  min-height: var(--touch-target);
}

.cc1-switch__label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-dim);
}

.cc1-switch {
  flex-shrink: 0;
  width: 44px;
  height: 26px;
  padding: 0;
  display: flex;
  align-items: center;
  background: var(--surface-lo);
  border: 1px solid var(--border);
  border-radius: 13px;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}
.cc1-switch:hover { border-color: var(--border-hi); }

.cc1-switch__knob {
  width: 20px;
  height: 20px;
  margin-left: 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast);
}

.cc1-switch--on {
  background: var(--amber-light);
  border-color: var(--amber);
}
.cc1-switch--on .cc1-switch__knob {
  transform: translateX(18px);
  border-color: var(--amber);
}

/* ── Reset ── */
.cc1-reset-row {
  padding-top: var(--space-4);
}

.cc1-reset {
  width: 100%;
  min-height: var(--touch-target);
  padding: var(--space-2) var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: var(--heading-weight);
  letter-spacing: var(--heading-tracking);
  text-transform: var(--heading-transform);
  color: var(--text-dim);
  cursor: pointer;
  transition: border-color var(--transition-fast), color var(--transition-fast), background var(--transition-fast);
}
.cc1-reset:hover { border-color: var(--red); color: var(--red); background: var(--red-light); }

/* ── Collapsible filter category (accordion) ── */
.cc1-acc {
  border-bottom: 1px solid var(--border);
}

.cc1-acc__header {
  width: 100%;
  min-height: var(--touch-target);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-2);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background var(--transition-fast);
}
.cc1-acc__header:hover { background: var(--surface-lo); }

.cc1-acc__title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
}

.cc1-acc__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--amber);
  color: var(--text-inv);
  border-radius: 9px;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 700;
  line-height: 1;
}

.cc1-acc__icon {
  width: 20px;
  flex-shrink: 0;
  text-align: center;
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: var(--heading-weight);
  line-height: 1;
  color: var(--text-dim);
}
.cc1-acc--open .cc1-acc__icon { color: var(--amber-dim); }

.cc1-acc__body {
  padding: 12px var(--space-2) var(--space-3);
}
