/* xag-filters.css  ONE listing-filter component for every listing page (design standard, template 2 "Listing"):
   filters on the left in a compact panel (collapsible groups, counts), result cards on the right, sort at the top,
   selected filters as small removable chips above the results with "Clear all". On phones the panel collapses to one "Filters" button.
   Used by: Teachers (xag-filters.js builds the markup), course and class chips (courses-public.js, course-filter.js), marketplace and events (field bar).
   Colours, radii and shadows come from the shared tokens only (--xag-c-*, --xag-radius-*, xag-theme.css); no hex colours, no fonts here.
   Chips are all the same height, quiet when off (no glow), gold (the accent token) when on. Spacing uses 4, 8, 12, 16, 24, 32 px only. */

/* ---- layout: panel left, results right (one column on phones) ---- */
.xlf-layout { display: grid; grid-template-columns: 20rem minmax(0, 1fr); gap: 24px; align-items: start; margin: 16px 0; }
.xlf-aside { min-width: 0; }
.xlf-main { min-width: 0; }
.xlf-bare, .xlf-detail { display: block; }
.xlf-bare .xlf-aside, .xlf-bare .xlf-bar, .xlf-bare .xlf-active, .xlf-detail .xlf-aside, .xlf-detail .xlf-bar, .xlf-detail .xlf-active { display: none; }
.xlf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 24px; margin: 16px 0; }
.xlf-main .xlf-grid { grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 24px; }

/* ---- the filter panel ---- */
.xlf-panel { display: flex; flex-direction: column; gap: 16px; padding: 16px; border: 1px solid var(--xag-c-line); border-radius: var(--xag-radius); background: var(--xag-c-surface); color: var(--xag-c-text); font-size: .9375rem; line-height: 1.4; }
.xlf-panel * { box-sizing: border-box; }
.xlf-panel.hidden, .xlf-aside.hidden { display: none; }
.xlf-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.xlf-field > label, .xlf-field > .xlf-lbl { font-weight: 700; font-size: .875rem; color: var(--xag-c-text-2); }
.xlf-field input, .xlf-field select, .xlf-sort select { width: 100%; max-width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--xag-c-line-strong); border-radius: var(--xag-radius-s); background: var(--xag-c-surface-2); color: var(--xag-c-text); font: inherit; text-overflow: ellipsis; }
.xlf-field input::placeholder { color: var(--xag-c-text-3); opacity: 1; text-overflow: clip; }
.xlf-field input:focus-visible, .xlf-field select:focus-visible, .xlf-sort select:focus-visible { outline: 2px solid var(--xag-c-solid-warn); outline-offset: 2px; }

/* ---- collapsible groups ---- */
.xlf-group { border-top: 1px solid var(--xag-c-line-soft); padding-top: 12px; }
.xlf-group:first-child { border-top: 0; padding-top: 0; }
.xlf-gh { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 32px; padding: 0; border: 0; background: none; color: var(--xag-c-text); font: inherit; font-weight: 700; font-size: .9375rem; cursor: pointer; text-align: left; }
.xlf-gh::after { content: "\25BE"; font-size: .8em; transition: transform .15s; }
.xlf-gh[aria-expanded="false"]::after { transform: rotate(-90deg); }
.xlf-gh:focus-visible { outline: 2px solid var(--xag-c-solid-warn); outline-offset: 2px; border-radius: var(--xag-radius-s); }
.xlf-gt { display: inline-flex; align-items: center; gap: 8px; }
.xlf-n { display: inline-block; min-width: 20px; padding: 0 8px; border-radius: var(--xag-radius-pill); background: var(--xag-c-accent); color: var(--xag-c-on-accent); font-size: .75rem; font-weight: 700; line-height: 20px; text-align: center; }
.xlf-n[hidden] { display: none; }
.xlf-body { margin-top: 8px; }
.xlf-body[hidden] { display: none; }

/* ---- chips: one size, one look, in every listing (the course filter bar's chips share it) ---- */
.xlf-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.xlf-chip, .xcf-chip { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 40px; max-width: 100%; padding: 4px 12px; border: 1px solid var(--xag-c-line); border-radius: var(--xag-radius-pill); background: var(--xag-c-surface-2); color: var(--xag-c-text); font: inherit; font-size: .875rem; font-weight: 700; line-height: 1.2; text-align: center; white-space: nowrap; cursor: pointer; box-shadow: none; transition: background-color .15s, border-color .15s, color .15s; }
.xlf-chip { flex: 1 1 auto; }
.xlf-chip:hover, .xcf-chip:hover { border-color: var(--xag-c-line-strong); }
.xlf-chip[aria-pressed="true"], .xcf-chip[aria-pressed="true"], .xcf-on { background: var(--xag-c-accent); border-color: var(--xag-c-accent); color: var(--xag-c-on-accent); }
.xlf-chip:focus-visible, .xcf-chip:focus-visible { outline: 2px solid var(--xag-c-solid-warn); outline-offset: 2px; }
.xlf-chip[disabled], .xlf-chip[aria-disabled="true"] { opacity: .5; cursor: default; }
.xlf-chip-n { font-size: .75rem; font-weight: 600; opacity: .8; }
.xlf-chips-fixed .xlf-chip { flex: 0 0 auto; }

/* the dark themes put a blue glow on every button (themes.css); filter controls stay quiet */
.xlf-chip, .xcf-chip, .xlf-gh, .xlf-tag, .xlf-clear, .xlf-toggle { box-shadow: none !important; }

/* ---- the bar above the results: count on the left, sort on the right ---- */
.xlf-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 0 0 12px; }
.xlf-count { margin: 0; font-weight: 700; color: var(--xag-c-text-2); }
.xlf-sort { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: .875rem; color: var(--xag-c-text-2); }
.xlf-sort select { width: auto; min-width: 12rem; }

/* ---- the selected filters: small removable chips, then "Clear all" ---- */
.xlf-active { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; }
.xlf-active:empty { display: none; }
.xlf-tag { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 4px 8px 4px 12px; border: 1px solid var(--xag-c-accent); border-radius: var(--xag-radius-pill); background: var(--xag-c-surface-2); color: var(--xag-c-text); font: inherit; font-size: .8125rem; font-weight: 600; line-height: 1.2; white-space: nowrap; cursor: pointer; }
.xlf-tag::after { content: "\00D7"; font-size: 1.1em; line-height: 1; }
.xlf-tag:hover { background: var(--xag-c-surface-3); }
.xlf-tag:focus-visible, .xlf-clear:focus-visible { outline: 2px solid var(--xag-c-solid-warn); outline-offset: 2px; }
.xlf-clear { min-height: 32px; padding: 4px 12px; border: 1px solid var(--xag-c-line-strong); border-radius: var(--xag-radius-pill); background: transparent; color: var(--xag-c-text); font: inherit; font-size: .8125rem; font-weight: 700; cursor: pointer; }
.xlf-clear:hover { background: var(--xag-c-surface-3); }

/* ---- the phone button: hidden on wide screens ---- */
.xlf-toggle { display: none; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 44px; padding: 8px 16px; border: 1px solid var(--xag-c-line-strong); border-radius: var(--xag-radius-pill); background: var(--xag-c-surface); color: var(--xag-c-text); font: inherit; font-weight: 700; cursor: pointer; }
.xlf-toggle::after { content: "\25BE"; font-size: .8em; transition: transform .15s; }
.xlf-toggle[aria-expanded="true"]::after { transform: rotate(180deg); }
.xlf-toggle:focus-visible { outline: 2px solid var(--xag-c-solid-warn); outline-offset: 2px; }

/* ---- the field bar (marketplace, events): search, selects and dates in one tidy row ---- */
.xlf-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 12px; margin: 16px 0; align-items: end; }
.xlf-fields .xlf-wide { grid-column: 1 / -1; }
.xlf-fields input, .xlf-fields select, input.xlf-in, select.xlf-in { width: 100%; max-width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--xag-c-line-strong); border-radius: var(--xag-radius-s); background: var(--xag-c-surface-2); color: var(--xag-c-text); font: inherit; text-overflow: ellipsis; }
.xlf-fields input::placeholder, input.xlf-in::placeholder { color: var(--xag-c-text-3); opacity: 1; }
.xlf-fields input:focus-visible, .xlf-fields select:focus-visible { outline: 2px solid var(--xag-c-solid-warn); outline-offset: 2px; }

/* ---- phones and tablets: the panel hides behind one "Filters" button; chips get full tap size ---- */
@media (max-width: 52rem) {
  .xlf-layout { display: block; }
  .xlf-toggle { display: inline-flex; }
  .xlf-aside .xlf-panel { display: none; margin-top: 8px; }
  .xlf-aside[data-open] .xlf-panel { display: flex; }
  .xlf-aside.hidden { display: none; }
  .xlf-main { margin-top: 16px; }
  .xlf-chip, .xcf-chip { min-height: 44px; }
  .xlf-tag, .xlf-clear { min-height: 40px; }
  .xlf-sort select { min-width: 0; }
}
@media (max-width: 30rem) {
  .xlf-bar { flex-direction: column; align-items: stretch; }
  .xlf-sort { display: flex; justify-content: space-between; }
  .xlf-sort select { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) { .xlf-chip, .xcf-chip, .xlf-gh::after, .xlf-toggle::after { transition: none; } }

/* ---- slim filter bar (Digital Solutions): one search field, no frame, no count; the category choices are the side buttons ---- */
.xcf[data-xcf="digital"] { padding: 0; border: 0; background: none; margin: 0 0 16px; max-width: none; }
.xcf[data-xcf="digital"] .xcf-prim, .xcf[data-xcf="digital"] .xcf-count { display: none; }
.xcf[data-xcf="digital"] .xcf-status { margin-top: 8px; min-height: 0; }
.xcf[data-xcf="digital"] .xcf-more:not([hidden]) { border-top: 0; }
/* the page notices (disclaimers) use the ONE standard box (disclaimers.js): bottom left, content edge; no page-specific offset (owner 2026-11-04) */
