/* Search page (help/templates/help/search_page.html): a blue band with the field alone, then the results line
   with the count and the Language and Topic menus (design system: SearchField, SearchResult, BottomSheet).
   Only the search page loads it. */

/* The band continues the home page's hero: the same blue (--hero), no line under it; the field white, as wide
   as the results column under it, its focus a white ring */
.s-head{background:var(--hero);border-bottom:0}
.s-head .in{max-width:860px;padding:40px 24px 32px;gap:0}  /* .sp is 860 too: the field on the results' edges */
.s-head .s-field{height:58px;max-width:none;background:var(--s-lowest);border:0}
.s-head .s-field:focus-within{outline:3px solid var(--on-hero);outline-offset:2px}
.s-field .icon-btn{flex:none}  /* the clear button keeps its 48 px on narrow phones */

/* The results line: the count at the start, the two menu buttons at the end, on the results column's edges */
.sp .s-bar{display:flex;align-items:center;justify-content:space-between;gap:8px 16px;flex-wrap:wrap;margin:0 0 4px}
.sp .s-sum{flex:1 1 auto;min-width:0;margin:0;font-size:var(--fs-ui);line-height:1.5;color:var(--ink-muted)}
.sp .s-sum b{color:var(--ink);font-weight:700}
.s-menus{display:flex;align-items:center;gap:8px;flex:none}
.s-menu{position:relative}
.s-mb{display:inline-flex;align-items:center;gap:6px;height:34px;padding-inline:10px 8px;border:1px solid var(--line);border-radius:var(--radius-md);background:var(--card);color:var(--ink);font-size:var(--fs-small);font-weight:500;white-space:nowrap;cursor:pointer;list-style:none;user-select:none}
.s-mb::-webkit-details-marker{display:none}
.s-mb .ico{width:18px;height:18px;flex:none;color:var(--ink-muted)}
.s-mb-t{max-width:220px;overflow:hidden;text-overflow:ellipsis}
.s-mb:hover{background:var(--surface-tile)}
.s-mb:focus-visible{outline:2px solid var(--focus);outline-offset:2px}
.s-mb.on{background:var(--primary-container);border-color:var(--primary-container);color:var(--on-primary-container)}
.s-mb.on .ico{color:var(--on-primary-container)}
.s-menu[open] .s-mb-x{transform:rotate(180deg)}

/* The menu: a popover under its button, the end one on the end edge */
.s-pop{position:absolute;z-index:30;top:calc(100% + 6px);inset-inline-start:0;min-width:220px;max-width:min(320px,calc(100vw - 32px));max-height:320px;overflow-y:auto;overscroll-behavior:contain;padding:6px;border:1px solid var(--line);border-radius:var(--radius-lg);background:var(--card);box-shadow:var(--shadow-menu)}
.s-menu-end .s-pop{inset-inline:auto 0}
.s-pop-h{display:none}
.s-list{list-style:none;margin:0;padding:0}
.s-list a{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:40px;padding:0 12px;border-radius:var(--radius-md);color:var(--ink);font-size:var(--fs-small);font-weight:500;text-decoration:none;white-space:nowrap}
.s-list a:hover{background:var(--menu-hover)}
.s-list a:focus-visible{outline:2px solid var(--focus);outline-offset:-2px}
.s-list a[aria-checked="true"]{color:var(--primary);font-weight:600}
.s-tick{width:18px;height:18px;flex:none;visibility:hidden}
.s-list a[aria-checked="true"] .s-tick{visibility:visible}
.s-sep{height:1px;margin:6px 4px;background:var(--line)}
.s-scrim{display:none}

/* Results: about twice as many on a screen */
.sp{padding-block:24px 72px;gap:12px}
.results .res{gap:4px;padding:16px 0}
.res .path{font-size:var(--fs-caption)}
.res h2{font-size:var(--fs-article);line-height:1.35}
.results .res p{font-size:var(--fs-ui);line-height:1.55}
.res .more{min-height:32px;margin-top:2px}
/* synonyms and typo fixes the search used as well (Search → Synonyms) */
.s-also{margin:-8px 0 16px;font-size:var(--fs-small);color:var(--text2)}
/* no results: "Search all languages" is the main way on, a white outlined button */
.sp .empty .btn-outline{background:var(--s-lowest)}

/* Phones: the count on its own line, the two buttons under it at the start; a menu opens as the bottom sheet */
@media (max-width:759.98px){
  .s-head .in{padding:16px}
  .sp .s-sum{flex-basis:100%}
  /* two long names (Bahasa Indonesia, a Greek topic) do not fit one row of 320-390 px: Topic goes under
     Language; a name wider than the screen ends in an ellipsis */
  .s-menus{flex:1 1 100%;flex-wrap:wrap;min-width:0}
  .s-menu{min-width:0;max-width:100%}
  .s-mb{max-width:100%}
  .s-mb-t{max-width:none;min-width:0}
  .s-pop{position:fixed;z-index:101;top:auto;bottom:0;inset-inline:0;min-width:0;max-width:none;max-height:78vh;padding:0 8px calc(16px + env(safe-area-inset-bottom,0px));border:0;border-radius:var(--radius-sheet) var(--radius-sheet) 0 0;box-shadow:var(--shadow-sheet)}
  .s-menu-end .s-pop{inset-inline:0}
  .s-pop-h{position:sticky;top:0;z-index:1;display:flex;align-items:center;justify-content:space-between;padding-block:8px 4px;padding-inline:12px 0;background:var(--card)}
  .s-pop-t{margin:0;font-size:var(--fs-article);font-weight:700;color:var(--ink)}
  .s-list a{min-height:48px;font-size:var(--fs-body)}
  .s-scrim:not([hidden]){display:block;position:fixed;inset:0;z-index:100;background:rgba(0,0,0,.32)}
  .results .res{padding:14px 0}
  .res h2{font-size:var(--fs-article)}
  .results .res p{font-size:var(--fs-small)}
}
@media print{.s-menus,.s-scrim{display:none!important}}

/* Design package 4: the results and no-results pages on white like articles (the band stays blue; the dark
   theme keeps its page colour); a step between the results line and the first result; the Language / Topic
   buttons at 40 px on phones; the field centred in the band on desktop (36 + 36 = 40 + 32: same band height) */
body[data-page="search"]{background:var(--s-lowest)}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) body[data-page="search"]{background:var(--bg)}}
:root[data-theme="dark"] body[data-page="search"]{background:var(--bg)}
.sp .s-bar{gap:12px 16px;margin:0 0 12px}
@media (max-width:759.98px){
  .sp .s-bar{row-gap:12px}
  .s-mb{height:40px;padding-inline:10px 6px;gap:4px}
}
@media (min-width:760px){.s-head .in{padding-block:36px}}
/* no results: "Ask the Community ↗" leads to another site, its arrow after the text */
.sp .empty .btn-text .ico{width:16px;height:16px;flex:none}
