/* Site search (/search/: app/pages/search.vue, system/search.js). Harper's mock (the archived site-search mock) on
   the site's tokens (system/tokens.css), so light and dark both come from there: a roomy ruled list, not cards; the
   field on a heavy ink rule; the four filters as plain pressed buttons; the start links beside the results on a wide
   screen and after them on a phone. No assistant panel in the first version (the plan). Motion is a hover colour only,
   and only for visitors who have not asked for less. */

.sx-head { padding-block: clamp(40px, 6vw, 72px) clamp(24px, 3.4vw, 40px); }
.sx-head .in { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 12px clamp(32px, 5vw, 64px); align-items: end; }
.sx-head .eyebrow { grid-column: 1 / -1; }
.sx-head h1 { font-size: clamp(46px, 5.4vw, 76px); line-height: .98; }
.sx-lede { color: var(--muted); font-size: clamp(17px, 1.5vw, 20px); line-height: 1.5; max-width: 30ch; padding-bottom: 6px; }

.sx-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 64px); align-items: start; padding-bottom: clamp(56px, 7vw, 104px); }
.sx-area { min-width: 0; }

/* the field */
.sx-form label { display: block; margin-bottom: 8px; font-size: 15px; }
.sx-row { display: flex; align-items: center; gap: 12px; border-bottom: var(--rule) solid var(--ink); }
.sx-row input { flex: 1; min-width: 0; min-height: 56px; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--ink); font: 400 clamp(22px, 2vw, 26px)/1.3 var(--body); -webkit-appearance: none; appearance: none; }
.sx-row input::placeholder { color: var(--muted); opacity: 1; }
.sx-row input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.sx-row input:focus-visible { outline-offset: 6px; }
.sx-glass, .sx-glass::before, .sx-glass::after { display: block; }
.sx-glass { position: relative; flex: none; width: 22px; height: 22px; }
.sx-glass::before { content: ""; position: absolute; left: 0; top: 0; width: 16px; height: 16px; border: 2px solid currentColor; border-radius: 50%; box-sizing: border-box; }
.sx-glass::after { content: ""; position: absolute; left: 13.5px; top: 14.5px; width: 8px; height: 2px; background: currentColor; transform: rotate(45deg); transform-origin: 0 50%; }
.sx-clear { flex: none; min-width: 44px; min-height: 44px; padding: 0 4px; border: 0; background: none; color: var(--muted); font: 500 var(--small)/1 var(--body); text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.sx-clear:hover { color: var(--ink); }
/* nothing to clear: the button steps out, and the field gets its room back (scripts on or off) */
.sx-row:has(input:placeholder-shown) .sx-clear { display: none; }

/* the filters: All and the four types, each with its count for this query */
.sx-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 0; }
.sx-filters[hidden] { display: none; }
.sx-filters button { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--r); background: transparent; color: var(--ink); font: 500 var(--small)/1 var(--body); cursor: pointer; }
.sx-filters button:hover { border-color: var(--orb); }
.sx-filters button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.sx-n { font-weight: 600; font-variant-numeric: tabular-nums; }

/* the count and the order, on a thin rule */
.sx-meta { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-top: 20px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.sx-meta:has(#sx-count:empty) { border-bottom-color: transparent; }
#sx-count, .sx-order { margin: 0 0 12px; }
.sx:not(.has-q) .sx-meta, .sx.is-none .sx-meta { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* the results: type and section, the title (the whole row is its link), the excerpt, the address */
.sx-results { list-style: none; margin: 0; padding: 0; }
.sx-hit { position: relative; padding: 20px 0; border-bottom: 1px solid var(--line); }
.sx-type { color: var(--orb); font: 600 12px/1.3 var(--body); letter-spacing: .09em; text-transform: uppercase; }
.sx-type span { color: var(--muted); }
.sx-hit h2 { margin: 8px 0 6px; font-size: clamp(21px, 1.9vw, 24px); line-height: 1.22; }
.sx-hit h2 a { text-decoration: none; }
.sx-hit h2 a::after { content: ""; position: absolute; inset: 0; }
.sx-hit:hover h2 a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }
.sx-ex { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; color: var(--muted); font-size: 15px; line-height: 1.5; max-width: 68ch; }
.sx-path { margin-top: 6px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.sx-hit mark { background: color-mix(in srgb, var(--orb) 16%, transparent); color: inherit; border-radius: 2px; padding: 0 1px; }

/* more, nothing found, search down */
.sx-more, .sx-reset { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; border: 1px solid var(--ink); border-radius: 0; background: transparent; color: var(--ink); font: 600 13px/1 var(--body); letter-spacing: .09em; text-transform: uppercase; cursor: pointer; }
.sx-more { margin-top: 28px; }
.sx-more:hover, .sx-reset:hover { background: var(--ink); color: var(--bg); }
.sx-more[hidden], .sx-empty[hidden] { display: none; }
.sx-empty { padding: 28px 0 8px; }
.sx-empty h2 { font-size: clamp(26px, 2.6vw, 32px); line-height: 1.15; overflow-wrap: anywhere; }
.sx-empty p { margin: 10px 0 20px; color: var(--muted); }
.sx-empty .sx-fail { margin: 0; color: var(--ink); }

/* start here: the plan's three doors, on the heavy rule the site puts above a group */
.sx-start { position: sticky; top: 96px; border-top: var(--rule) solid var(--ink); padding-top: 14px; }
.sx-start-h { color: var(--muted); font: 600 var(--label)/1.3 var(--body); letter-spacing: .08em; text-transform: uppercase; }
.sx-start ul { list-style: none; margin: 8px 0 0; padding: 0; }
.sx-start li { border-bottom: 1px solid var(--line); }
.sx-start a { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; font: 400 clamp(24px, 2.2vw, 30px)/1.1 var(--display); text-decoration: none; }
.sx-start a::after { content: "\2192" / ""; font: 400 20px/1 var(--body); color: var(--muted); }
.sx-start a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px; }

@media (prefers-reduced-motion: no-preference) {
  .sx-filters button, .sx-more, .sx-reset, .sx-clear { transition: background var(--t-quick) var(--ease), border-color var(--t-quick) var(--ease), color var(--t-quick) var(--ease); }
}

@media (max-width: 860px) {
  .sx-head .in, .sx-grid { grid-template-columns: minmax(0, 1fr); }
  .sx-lede { max-width: 40ch; }
  .sx-start { position: static; margin-top: 8px; }
}
@media (max-width: 560px) {
  .sx-row input { font-size: 20px; }
  .sx-filters { gap: 6px; }
  .sx-filters button { padding: 0 11px; }
  .sx-meta { font-size: 12px; }
}
