/* The family search's look (HQ order 0035): the compact result rows, the
   coloured type and section tags, the filter chips, the /search form and the
   header search panel. ONE file for every page: /search links it in its
   <head>; the static pages and the home page get it from /pwf-search.js when
   the visitor first opens the header search (nothing loads before that).

   Rows, tags and chips follow the hub (Mortgage-Guru feat/family-search-0034,
   e5f4e399, src/styles.css round 3): one link per title, the type tag (a
   small icon plus the word in its own colour, underlined, no box, no pill),
   the section or site tag, the read time in small muted text, a thin muted
   dot between them, a hairline between rows, rows 44px or taller, every
   link 24 x 24px or larger.

   THE TAG COLOURS are the hub's tokens (src/lib/search-tokens.ts, copied
   unchanged), written here as --tag-<key>-fg / -bg / -edge, light first,
   then dark (the static pages' .app[data-theme="dark"], the home page's
   html[data-pwf-theme="dark"]). Rows use only -fg; scripts/search-check.mjs
   checks every hex here against the tokens file and every -fg at 4.5:1 or
   more on this site's page colours (white, the dyslexia cream #faf5e8, the
   panel #f4f5f7; dark #0e1420, #0e0a06, #161e2e). ASCII only. */
:root, .app[data-theme="light"] {
  --tag-calculator-fg:#0B5E5A; --tag-calculator-bg:#DDF4F1; --tag-calculator-edge:#0E7C76;
  --tag-case-fg:#4C2A9E; --tag-case-bg:#ECE6FA; --tag-case-edge:#6A41C9;
  --tag-program-fg:#0D4D8F; --tag-program-bg:#E1ECFA; --tag-program-edge:#1F6FC4;
  --tag-faq-fg:#6B4400; --tag-faq-bg:#FFF0D2; --tag-faq-edge:#B06F00;
  --tag-article-fg:#1F5A1F; --tag-article-bg:#E2F3DF; --tag-article-edge:#2E8B2E;
  --tag-partner-fg:#8A1E4A; --tag-partner-bg:#FAE4EC; --tag-partner-edge:#BF3A6E;
  --tag-city-fg:#0B4A6E; --tag-city-bg:#DEEEF9; --tag-city-edge:#1D7FB3;
  --tag-guide-fg:#5A4A1A; --tag-guide-bg:#F1ECD9; --tag-guide-edge:#8A7222;
  --tag-desk-fg:#8A4A04; --tag-desk-bg:#FCE9D2; --tag-desk-edge:#C46B10;
  --tag-commercial-fg:#1B2F6B; --tag-commercial-bg:#E4E8F6; --tag-commercial-edge:#3A55B0;
  --tag-construction-fg:#7A3B00; --tag-construction-bg:#FCE9DC; --tag-construction-edge:#B85A12;
  --tag-residential-fg:#1C5E3E; --tag-residential-bg:#DFF2E8; --tag-residential-edge:#2E8F62;
  --tag-private-fg:#5B1F6B; --tag-private-bg:#F1E4F6; --tag-private-edge:#8E3FA6;
}
.app[data-theme="dark"], html[data-pwf-theme="dark"] {
  --tag-calculator-fg:#A6EBE4; --tag-calculator-bg:#0F3634; --tag-calculator-edge:#3FBDB3;
  --tag-case-fg:#D6C8FF; --tag-case-bg:#2A1C57; --tag-case-edge:#A48BEE;
  --tag-program-fg:#BCD8FA; --tag-program-bg:#10304F; --tag-program-edge:#64A3E6;
  --tag-faq-fg:#FFD98F; --tag-faq-bg:#3D2A05; --tag-faq-edge:#D9A23A;
  --tag-article-fg:#BDEDB6; --tag-article-bg:#173A17; --tag-article-edge:#66C466;
  --tag-partner-fg:#FFBCD4; --tag-partner-bg:#4A1530; --tag-partner-edge:#E3709F;
  --tag-city-fg:#ADDDF8; --tag-city-bg:#0F2F43; --tag-city-edge:#56AEE0;
  --tag-guide-fg:#E8DBA6; --tag-guide-bg:#3A3113; --tag-guide-edge:#B59E48;
  --tag-desk-fg:#FFCB90; --tag-desk-bg:#4A2A08; --tag-desk-edge:#E28F32;
  --tag-commercial-fg:#C3CEF5; --tag-commercial-bg:#1A2446; --tag-commercial-edge:#7A90DE;
  --tag-construction-fg:#FFC9A6; --tag-construction-bg:#44220A; --tag-construction-edge:#DE8243;
  --tag-residential-fg:#B5EBD0; --tag-residential-bg:#133A28; --tag-residential-edge:#5EC594;
  --tag-private-fg:#E6BFF2; --tag-private-bg:#36173F; --tag-private-edge:#BE78D6;
}
.st-calculator{ --st-fg:var(--tag-calculator-fg); } .st-case{ --st-fg:var(--tag-case-fg); }
.st-program{ --st-fg:var(--tag-program-fg); } .st-faq{ --st-fg:var(--tag-faq-fg); }
.st-article{ --st-fg:var(--tag-article-fg); } .st-partner{ --st-fg:var(--tag-partner-fg); }
.st-city{ --st-fg:var(--tag-city-fg); } .st-guide{ --st-fg:var(--tag-guide-fg); }
.st-desk{ --st-fg:var(--tag-desk-fg); } .st-commercial{ --st-fg:var(--tag-commercial-fg); }
.st-construction{ --st-fg:var(--tag-construction-fg); } .st-residential{ --st-fg:var(--tag-residential-fg); }
.st-private{ --st-fg:var(--tag-private-fg); }

/* ---- the compact rows (hub round 3) ---- */
.sr-list{ list-style:none; margin:0; padding:0; border-top:1px solid var(--hair, rgba(20,28,44,.12)); }
.sr-row{ display:flex; flex-direction:column; gap:1px; min-height:44px; padding:1px 2px; border-bottom:1px solid var(--hair, rgba(20,28,44,.12)); }
html body li.sr-row > a.sr-title[data-result-title]{ display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; font-size:.9375rem; line-height:1.25; min-height:24px; padding-top:2px; font-weight:600; color:var(--pwf-link, var(--gold-text, #8f6d18)); text-decoration-line:underline; text-decoration-thickness:1px; text-underline-offset:3px; font-family:inherit; }
.sr-meta{ display:flex; flex-wrap:wrap; align-items:center; gap:0 5px; }
html body li.sr-row .sr-meta a.st.st-link, .sr-meta .st{ display:inline-flex; align-items:center; gap:4px; border:0; background:transparent; padding:0 2px; min-height:24px; min-width:24px; font-size:.75rem; font-weight:600; line-height:1.2; text-transform:none; letter-spacing:0; color:var(--st-fg); text-decoration-line:underline; text-decoration-thickness:1px; text-underline-offset:2px; }
.sr-meta .st-icon{ width:13px; height:13px; flex:none; }
.sr-sep, .sr-note{ font-size:.75rem; color:var(--muted, #5b626f); line-height:1.2; }
.sr-desk{ flex:1 1 0; min-width:6rem; margin:0; font-size:.75rem; line-height:1.3; color:var(--muted, #5b626f); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:100%; }
.sr-desk strong{ font-weight:600; color:inherit; }
html body li.sr-row a:focus-visible{ outline:2px solid var(--text, var(--ink, #141c29)); outline-offset:2px; border-radius:2px; }

/* ---- the filter chips (hub SearchChips: 32px pills; under 640px each row
   is one line that scrolls sideways, never widening the page) ---- */
.rc-chipbar{ display:flex; flex-direction:column; gap:.4rem; margin:.1rem 0 .45rem; min-width:0; }
.rc-chips-row{ display:flex; flex-wrap:wrap; gap:.4rem; min-width:0; }
.rc-chip{ display:inline-flex; align-items:center; gap:.35rem; min-height:32px; min-width:24px; padding:0 .8rem; border:1px solid var(--hair, rgba(20,28,44,.18)); border-radius:999px; background:transparent; color:var(--text, var(--ink, #141c29)); font:inherit; font-size:.8rem; font-weight:600; cursor:pointer; white-space:nowrap; }
.rc-chip:hover{ border-color:var(--gold, #bd922a); }
.rc-chip[aria-pressed="true"]{ background:var(--btn-bg, #1a3457); border-color:var(--btn-bg, #1a3457); color:var(--btn-fg, #fff); }
.rc-chip-n{ font-weight:500; opacity:.85; }
.rc-chip:focus-visible{ outline:2px solid var(--text, var(--ink, #141c29)); outline-offset:2px; }
@media (max-width:639px){
  .rc-chips-row{ flex-wrap:nowrap; overflow-x:auto; -webkit-overflow-scrolling:touch; scrollbar-width:thin; padding-bottom:2px; }
  .rc-chip{ flex:none; }
}

/* ---- the /search form and page ---- */
.ps-form{ margin:0 0 .9rem; }
.ps-label{ display:block; font-size:.85rem; font-weight:600; color:var(--text, var(--ink, #141c29)); margin:0 0 .35rem; }
.ps-row{ display:flex; gap:.5rem; align-items:stretch; }
.ps-input{ flex:1 1 auto; min-width:0; min-height:44px; padding:.55rem .8rem; font:inherit; font-size:16px; color:var(--text, var(--ink, #141c29)); background:var(--bg, var(--paper, #fff)); border:1px solid var(--muted, #5b626f); border-radius:2px; }
.ps-input:focus-visible{ outline:2px solid var(--text, var(--ink, #141c29)); outline-offset:1px; }
.ps-go{ flex:none; min-height:44px; padding:0 1.1rem; font:inherit; font-size:.85rem; font-weight:600; letter-spacing:.06em; color:var(--btn-fg, #fff); background:var(--btn-bg, #1a3457); border:1px solid var(--btn-bg, #1a3457); border-radius:2px; cursor:pointer; }
.ps-go:focus-visible{ outline:2px solid var(--text, var(--ink, #141c29)); outline-offset:2px; }
.ps-status{ font-size:.85rem; color:var(--text2, var(--ink-2, #333c49)); margin:.15rem 0 .4rem; min-height:1.3em; }
.ps-h2{ font-family:inherit !important; font-size:.95rem !important; font-weight:600 !important; letter-spacing:0 !important; color:var(--text, var(--ink, #141c29)); margin:.8rem 0 .4rem; line-height:1.3 !important; }
.ps-lib-h{ font-size:1.25rem; margin:1.6rem 0 .5rem; }
.ps-note{ font-size:.8rem; color:var(--muted, #5b626f); margin:.6rem 0 0; }
.sr-only{ position:absolute !important; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }

/* ---- the header search panel (the control itself is styled by its page:
   the static pages' own <style>, the home page's .theme-toggle) ---- */
.pwf-sp{ position:absolute; left:0; right:0; top:100%; z-index:60; background:var(--bg, var(--paper, #fff)); border-bottom:1px solid var(--hair, rgba(20,28,44,.12)); box-shadow:0 18px 30px -18px rgba(10,16,28,.45); max-height:calc(100vh - 120px); max-height:calc(100dvh - 120px); overflow-y:auto; text-align:left; line-height:1.5; }
.pwf-sp[hidden]{ display:none; }
.pwf-sp-in{ max-width:820px; margin:0 auto; padding:.9rem clamp(1.1rem,4vw,2.2rem) 1rem; }
.pwf-sp-top{ display:flex; align-items:center; justify-content:space-between; gap:.5rem; margin:0 0 .35rem; }
.pwf-sp-top .ps-label{ margin:0; }
.pwf-sp-x{ display:inline-flex; align-items:center; justify-content:center; width:34px; height:34px; border:1px solid var(--hair, rgba(20,28,44,.12)); border-radius:999px; background:transparent; color:var(--text, var(--ink, #141c29)); cursor:pointer; font:inherit; font-size:1.1rem; line-height:1; }
.pwf-sp-x:focus-visible{ outline:2px solid var(--text, var(--ink, #141c29)); outline-offset:2px; }
.pwf-sp .ps-status{ margin:.55rem 0 .35rem; }
html body .pwf-sp a.sp-all{ display:inline-flex; align-items:center; min-height:24px; margin:.5rem 0 0; font-size:.85rem; font-weight:600; color:var(--pwf-link, var(--gold-text, #8f6d18)); text-decoration:underline; text-underline-offset:3px; }
html[data-dys="on"] .pwf-sp .ps-input, html[data-dys="on"] .ps-input{ font-size:16px; }
@media (prefers-reduced-motion: reduce){ .pwf-sp{ scroll-behavior:auto; } }
