/* The site search (Kyle, 3 November 2026): Search in the menu, the magnifier alone below 1180px and on a phone, and the
   panel over the whole screen under the risk warning. Markup src/components/Search.astro and the header; script search.js.
   Pop-ups soften the page behind them, as the gate does (an animation, never at rest). */

/* ---------- the button ---------- */
/* wide screens: Search as the last word in the menu, after a thin rule, in the menu's own type and underline */
.head .mnav > .sxb-sep { width: 1px; height: 1.25rem; background: var(--rule); }
.head .mnav > button.sxb-word { position: relative; display: inline-flex; align-items: center; gap: .4375rem; border: 0; background: none; padding: 0; cursor: pointer; color: var(--ink); font: 500 1rem var(--sans); transition: color var(--fill); height: 44px; }
.head .mnav > button.sxb-word svg { width: 1.0625rem; height: 1.0625rem; color: var(--brick-word); transition: color var(--fill); }
.head .mnav > button.sxb-word::after { content: ""; position: absolute; left: 0; right: 100%; bottom: 8px; height: 1.5px; background: var(--brick-word); transition: right .5s var(--ease-soft); }
.head .mnav > button.sxb-word:hover { color: var(--brick-word); }
.head .mnav > button.sxb-word:hover::after { right: 0; }
html.bar-dark .head .mnav > button.sxb-word { color: var(--chalk); }
html.bar-dark .head .mnav > button.sxb-word svg { color: var(--brick-accent); }
html.bar-dark .head .mnav > button.sxb-word:hover { color: var(--brick-accent); }
html.bar-dark .head .mnav > button.sxb-word::after { background: var(--brick-accent); }
html.bar-dark .head .mnav > .sxb-sep { background: var(--navy-line); }
/* over the homepage's opening the header is see-through (html.wl-top, home.css): the search takes the chalk with the rest of the nav from the first paint */
html.wl-top .head:not(.solid):not(:has(.mbtn[aria-expanded="true"])) .mnav > button.sxb-word { color: var(--chalk); }
html.wl-top .head:not(.solid):not(:has(.mbtn[aria-expanded="true"])) .mnav > button.sxb-word svg { color: var(--brick-accent); }
html.wl-top .head:not(.solid):not(:has(.mbtn[aria-expanded="true"])) .mnav > .sxb-sep { background: var(--navy-line); }
html.wl-top .head:not(.solid):not(:has(.mbtn[aria-expanded="true"])) .wrap > .sxb-icon { color: var(--chalk); }

/* narrower screens: the magnifier alone, between the menu and the Investor's Portal, naming itself on hover */
.head .wrap > .sxb-icon { display: none; flex: none; position: relative; align-items: center; justify-content: center; width: 40px; height: 40px; margin: 0 -.25rem 0 -.75rem; border: 1px solid transparent; border-radius: var(--r-button); background: none; color: var(--navy); cursor: pointer; transition: color var(--fill), background-color var(--fill), border-color var(--fill); }
.head .wrap > .sxb-icon svg { width: 1.3125rem; height: 1.3125rem; }
.head .wrap > .sxb-icon:hover { background: var(--stone); }
html.bar-dark .head:not(:has(.mbtn[aria-expanded="true"])) .wrap > .sxb-icon { color: var(--chalk); }   /* not while the phone menu is open: the header is chalk then */
html.bar-dark .head .wrap > .sxb-icon:hover { background: var(--navy-deep); border-color: var(--navy-line); }
.sxb-tip { position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%); white-space: nowrap; padding: .375rem .625rem; border-radius: var(--r-tag); background: var(--navy); color: var(--chalk); font: 500 .875rem var(--sans); pointer-events: none; opacity: 0; transition: opacity .2s ease .15s; }
.sxb-icon:hover .sxb-tip, .sxb-icon:focus-visible .sxb-tip { opacity: 1; }
@media (max-width: 1180px) {
  .head .mnav > button.sxb-word, .head .mnav > span.sxb-sep { display: none; }
  .head .wrap > .sxb-icon { display: inline-flex; }
}
/* a phone: the same size and line as the menu button beside it, and a field at the top of the menu */
@media (max-width: 900px) {
  .head .wrap > .sxb-icon { width: 44px; height: 44px; margin: 0 0 0 auto; border-color: var(--rule); }
  html.bar-dark .head:not(:has(.mbtn[aria-expanded="true"])) .wrap > .sxb-icon { border-color: #8E9BB3; }
  .head .wrap > .sxb-icon ~ .mbtn { margin-left: .5rem; }
  .sxb-tip { display: none; }
}
.sxb-ms { display: flex; align-items: center; gap: .75rem; width: 100%; min-height: 52px; margin: 0 0 1.25rem; padding: 0 1rem; border: 1px solid var(--navy); border-radius: var(--r-button); background: var(--chalk); color: var(--ink-quiet); font: 400 var(--t-body) var(--sans); text-align: left; cursor: text; }
.sxb-ms svg { width: 1.25rem; height: 1.25rem; color: var(--brick-word); }
/* without the script there is no search to open */
html:not(.js) :is(.sxb-word, .sxb-sep, .sxb-icon, .sxb-ms) { display: none !important; }

/* ---------- the panel: the whole screen, under the risk warning ---------- */
@keyframes sx-soften { to { filter: blur(8px); } }
@keyframes sx-fade { from { opacity: 0; } }
@keyframes sx-rise { from { opacity: 0; transform: translateY(.75rem); } }
@keyframes sx-bar { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes sx-sharpen { from { filter: blur(8px); } to { filter: blur(0); } }
@keyframes sx-out { to { opacity: 0; } }
html.sx-open { overflow: hidden; }
html.sx-open body > :is(main, footer, header) { animation: sx-soften .45s cubic-bezier(.4,0,.2,1) both; }
/* on the way out (Kyle, 3 November 2026: it "just drops off in an instant"): the panel fades and the page sharpens under it */
html.sx-open.sx-closing body > :is(main, footer, header) { animation: sx-sharpen .38s cubic-bezier(.4,0,.2,1) both; }
.sx.sx-closing .sx-box { animation: sx-out .32s cubic-bezier(.4,0,.2,1) both; }
.sx { position: fixed; top: var(--rh, 0px); right: 0; bottom: 0; left: 0; z-index: 2147483100; color: var(--ink); font-family: var(--sans); }
.sx-box { position: absolute; inset: 0; background: var(--chalk); overflow-y: auto; overscroll-behavior: contain; animation: sx-fade .3s ease both; }
.sx-in { width: min(1280px, 100% - 32px); margin: 0 auto; padding: 0 0 4rem; }
.sx-top { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; height: 88px; background: var(--chalk); }
.sx-top img { display: block; height: 34px; width: auto; }
.sx-close { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; padding: 0 1rem 0 .875rem; border: 1px solid var(--navy); border-radius: var(--r-button); background: none; color: var(--navy); font: 500 1rem var(--sans); cursor: pointer; transition: background-color var(--fill), color var(--fill); }
.sx-close svg { width: 1rem; height: 1rem; }
.sx-close:hover { background: var(--navy); color: var(--chalk); }
.sx-field { position: relative; display: flex; align-items: center; gap: 1rem; margin-top: clamp(1rem, 6vh, 4rem); border-bottom: 1px solid var(--navy); animation: sx-rise .5s cubic-bezier(.215,.61,.355,1) .05s both; }
.sx-field > svg { flex: none; width: clamp(1.5rem, 2.4vw, 2.25rem); height: clamp(1.5rem, 2.4vw, 2.25rem); color: var(--brick-word); }
html body .sx .sx-field input, html body .sx .sx-field input:focus, html body .sx .sx-field input:hover { flex: 1; min-width: 0; border: 0; background: none; box-shadow: none; outline: none; border-radius: 0; padding: .25rem 0 .875rem; --serif-size: clamp(2.25rem, 5.2vw, 4.5rem); font: 400 var(--serif-fit)/1.1 var(--serif); color: var(--navy); caret-color: var(--brick-word); -webkit-appearance: none; appearance: none; letter-spacing: var(--serif-ls); word-spacing: var(--serif-ws); }
.sx-field input::placeholder { color: var(--taupe); }
.sx-field input::-webkit-search-cancel-button, .sx-field input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; display: none; }
.sx-clear { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; background: none; color: var(--ink-soft); cursor: pointer; border-radius: var(--r-button); }
.sx-clear svg { width: 1.125rem; height: 1.125rem; }
.sx-clear:hover { color: var(--brick-word); background: var(--stone); }
/* a brick line runs under the question while the search is working */
.sx-field::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: var(--brick-word); transform-origin: left; transform: scaleX(0); }
.sx.sx-busy .sx-field::after { animation: sx-bar .9s cubic-bezier(.4,0,.2,1) infinite; }
.sx-try { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: 1.125rem 0 0; font-size: .875rem; color: var(--ink-soft); animation: sx-rise .5s cubic-bezier(.215,.61,.355,1) .12s both; }
.sx-try > span { margin-right: .25rem; }
.sx-try button { min-height: 36px; border: 1px solid var(--rule); border-radius: var(--r-button); background: var(--chalk); padding: .375rem .75rem; font: 500 .875rem var(--sans); color: var(--navy); cursor: pointer; transition: background-color var(--fill), border-color var(--fill); }
.sx-try button:hover, .sx-try button[aria-pressed="true"] { border-color: var(--navy); background: var(--stone); }
.sx-count { margin: 3rem 0 0; padding-bottom: .875rem; border-bottom: 1px solid var(--rule); font: 500 .75rem var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.sx-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(2rem, 5vw, 5rem); }
.sx-r { position: relative; padding: 1.75rem 0; border-bottom: 1px solid var(--rule); animation: sx-rise .45s cubic-bezier(.215,.61,.355,1) both; }
.sx-r:nth-child(2) { animation-delay: .04s; } .sx-r:nth-child(3) { animation-delay: .08s; } .sx-r:nth-child(4) { animation-delay: .12s; } .sx-r:nth-child(5) { animation-delay: .16s; } .sx-r:nth-child(6) { animation-delay: .2s; }
.sx-k { margin: 0 0 .375rem; font: 500 .75rem/1.3 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--brick-word); }
.sx-t { margin: 0; font: 600 1.25rem/1.35 var(--sans); color: var(--navy); transition: color var(--fill); }
.sx-t a { color: inherit; text-decoration: none; }
.sx-t a::after { content: ""; position: absolute; inset: 0; }
.sx-t a:focus-visible { outline: none; }
.sx-t a:focus-visible::after { outline: 2px solid var(--trim-focus); outline-offset: 6px; }
.sx-t span { font-weight: 400; color: var(--ink-soft); }
.sx-r:hover .sx-t, .sx-r:focus-within .sx-t { color: var(--brick-word); }
.sx-x2 { margin: .625rem 0 0; font: 400 var(--t-body)/1.55 var(--sans); color: var(--ink-soft); max-width: 68ch; }
.sx-x2 b { font-weight: 600; color: var(--ink); }
.sx-go { display: inline-flex; align-items: center; gap: .375rem; margin-top: .875rem; font: 500 .875rem var(--sans); color: var(--brick-word); }
.sx-go svg { width: .875rem; height: .875rem; transition: transform var(--fill); }
.sx-r:hover .sx-go svg { transform: translateX(3px); }
.sx-none { padding: 3rem 0 0; animation: sx-rise .45s cubic-bezier(.215,.61,.355,1) both; }
.sx-none h2 { margin: 0 0 .75rem; --serif-size: clamp(1.75rem, 3vw, 2.5rem); --serif-ls: -.012em; --serif-ws: -.02em; font: 400 var(--serif-fit)/1.15 var(--serif); color: var(--navy); letter-spacing: var(--serif-ls); word-spacing: var(--serif-ws); }
.sx-none p { margin: 0 0 1.25rem; font-size: var(--t-body); color: var(--ink-soft); }
.sx-none a { display: inline-flex; align-items: center; gap: .5rem; min-height: 48px; padding: 0 1.25rem; border-radius: var(--r-button); background: var(--navy); color: var(--chalk); font-weight: 500; text-decoration: none; transition: background-color var(--fill); }
.sx-none a:hover { background: var(--brick-word); }
.sx-none a svg { width: 1rem; height: 1rem; }
.sx-wait { padding: 3rem 0 0; color: var(--ink-soft); font-size: .875rem; }
@media (max-width: 800px) { .sx-list { grid-template-columns: 1fr; } }
@media (max-width: 700px) {
  .sx-top { height: 64px; }
  .sx-top img { height: auto; width: 84px; }   /* the header's logo size, so it does not shrink when search opens (11 November 2026) */
  html body .sx .sx-field input, html body .sx .sx-field input:focus, html body .sx .sx-field input:hover { --serif-size: clamp(1.4375rem, 6.2vw, 1.875rem); font-size: var(--serif-fit); }   /* with focus too, so "Search, or ask a question" fits a phone (11 November 2026) */
  .sx-field { margin-top: 1rem; }
  .sx-try { flex-wrap: nowrap; overflow-x: auto; margin-inline: -16px; padding-inline: 16px; scrollbar-width: none; }
  .sx-try button { flex: none; }
  .sx-count { margin-top: 2rem; }
}
@media (prefers-reduced-motion: reduce) { .sx :is(.sx-box, .sx-field, .sx-try, .sx-r, .sx-none), .sx.sx-closing .sx-box { animation: none; } }
