/* Catalogue search (includes/course-search-ui.php, assets/js/course-live-search.js),
   both arms of /courses/courses. Flat design tokens (assets/css/flat-tokens.css)
   with literals as fallbacks, so the old arm renders them the same. */

.cs-rows, .cs-goal-card, .cs-banner, .cs-note, .cs-empty {
  --cs-ink: var(--flat-ink, #0a0a0a); --cs-paper: var(--flat-paper, #fff);
  --cs-hair: var(--flat-hair, #e6e6e6); --cs-blue: var(--flat-blue, #1a3aff);
  --cs-dim: var(--flat-dim, #6b7280);
  font-family: var(--flat-font, 'Be Vietnam Pro', system-ui, sans-serif);
}

/* ── filter chips (old arm) ── */
.cs-rows { display: grid; gap: 10px; margin: 14px 0 0; }
.cs-row { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.cs-row-l { flex: 0 0 72px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--cs-dim); }
.cs-row-c { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.cs-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px;
           font-size: 13px; font-weight: 600; color: var(--cs-ink); text-decoration: none;
           background: var(--cs-paper); border: 1.5px solid var(--cs-hair); border-radius: 0; }
.cs-chip:hover { border-color: var(--cs-ink); color: var(--cs-ink); }
.cs-chip.is-on { background: var(--cs-ink); border-color: var(--cs-ink); color: #fff; }
.cs-chip-n { font-size: 11px; font-weight: 700; color: var(--cs-dim); }
.cs-chip.is-on .cs-chip-n { color: #cfd3d8; }
.cs-chip:focus-visible, .cs-more summary:focus-visible, .cs-goal-card:focus-visible, .cs-banner-go:focus-visible {
  outline: 3px solid var(--cs-blue); outline-offset: 2px; }
.cs-more { display: contents; }
.cs-more summary { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; cursor: pointer;
                   font-size: 13px; font-weight: 700; color: var(--cs-blue); list-style: none; }
.cs-more summary::-webkit-details-marker { display: none; }
.cs-more[open] summary { color: var(--cs-dim); }
.cs-more-c { display: flex; flex-wrap: wrap; gap: 6px; flex-basis: 100%; }
@media (max-width: 640px) {
  .cs-row { flex-direction: column; gap: 6px; }
  .cs-row-l { flex: none; }
  /* One swipeable line per group on a phone, instead of a wall of chips. */
  .cs-row-c { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; padding-bottom: 2px; scrollbar-width: none; }
  .cs-row-c::-webkit-scrollbar { display: none; }
  .cs-chip { flex: 0 0 auto; white-space: nowrap; }
  .cs-more-c { flex-wrap: nowrap; }
}

/* ── "Tìm theo mục tiêu" ── */
.cs-goal-card { display: flex; align-items: center; gap: 14px; margin: 14px 0 0; padding: 14px 16px;
                color: var(--cs-ink); text-decoration: none; background: var(--cs-paper);
                border: 2px solid var(--cs-ink); max-width: 640px; }
.cs-goal-card > .fa-compass { font-size: 22px; color: var(--cs-blue); flex: 0 0 auto; }
.cs-goal-card-t { display: grid; gap: 2px; font-size: 13px; line-height: 1.45; color: var(--cs-dim); }
.cs-goal-card-t b { font-size: 15px; color: var(--cs-ink); }
.cs-goal-card-go { margin-left: auto; color: var(--cs-ink); flex: 0 0 auto; }
.cs-goal-card:hover { background: #f4f4f4; color: var(--cs-ink); }

/* ── above the results ── */
.cs-banner { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; margin: 0 0 16px; padding: 14px 16px;
             background: #eef1ff; border: 2px solid var(--cs-blue); color: var(--cs-ink); }
.cs-banner > .fa-route { font-size: 18px; color: var(--cs-blue); }
.cs-banner-t { flex: 1 1 260px; display: grid; gap: 2px; font-size: 13px; line-height: 1.45; }
.cs-banner-t b { font-size: 15px; }
.cs-banner-go { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; font-size: 14px; font-weight: 800;
                color: #fff; background: var(--cs-blue); text-decoration: none; }
.cs-banner-go:hover { color: #fff; background: var(--cs-ink); }
.cs-note { display: flex; gap: 8px; align-items: baseline; margin: 0 0 14px; padding: 10px 12px; font-size: 13px;
           color: var(--cs-ink); background: #f4f4f4; border-left: 3px solid var(--cs-dim); }
.cs-note .fa-circle-info { color: var(--cs-dim); }

/* ── nothing matched ── */
.courses-grid > .cs-empty { grid-column: 1 / -1; }
.cs-empty { padding: 24px 0; color: var(--cs-ink); }
.cs-empty-h { margin: 0 0 6px; font-size: 20px; font-weight: 800; letter-spacing: -.01em; color: var(--cs-ink); }
.cs-empty-p { margin: 0 0 8px; font-size: 14px; }
.cs-link { color: var(--cs-blue); font-weight: 700; }
.cs-empty-b { margin-top: 20px; }
.cs-empty-k { margin: 0 0 8px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--cs-dim); }
.cs-empty-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--cs-hair); }
.cs-empty-list li { border-bottom: 1px solid var(--cs-hair); }
.cs-empty-list a { display: block; padding: 12px 0; font-size: 14px; font-weight: 600; color: var(--cs-ink); text-decoration: none; }
.cs-empty-list a:hover { color: var(--cs-blue); }
.cs-empty .cs-goal-card { margin: 0; }

/* ── live update ── */
[data-cs-results][aria-busy="true"] { opacity: .55; transition: opacity .15s; }
.cs-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { [data-cs-results][aria-busy="true"] { transition: none; } }

/* ── new arm: length row under the categories ── */
.cn-durs { border-top: 1px solid var(--flat-hair, #e6e6e6); }
.cn-durs .cn-cat { padding-top: 10px; padding-bottom: 10px; font-weight: 600; letter-spacing: .02em; }
.cn-hero .cs-goal-card { margin-top: 16px; }

/* The old arm pinned its filter panel: fine for one row of dropdowns, but three
   chip rows and the goal card would cover most of a phone screen. It scrolls
   with the page now. */
.courses-filters { position: static; }
