@layer site {
/* Site search outside the dialog (order 013; order 027): the search button in the header and the blog's inline field
   with its results. The dialog itself, its rows and its states are owned by site/components/search/SearchDialog.css.
   The result rules below are scoped to the blog field with :where(.search-inline), so they never reach the dialog
   and keep exactly the specificity and declarations they had in order 026. Mobile first. No inline styles (CSP). The [hidden] attribute always wins. */
.nav-search[hidden], .search-inline[hidden] { display: none !important; }

.nav-search {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 12px; border: 0; background: transparent;
  color: var(--primary-dark); cursor: pointer;
}
.nav-search:hover { background: var(--bg-chip); }
.nav-search:focus-visible,
:where(.search-inline) .search-link:focus-visible,
:where(.search-inline) .search-section-link:focus-visible,
:where(.search-inline) .search-suggest:focus-visible,
:where(.search-inline) .search-start-list a:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }

:where(.search-inline) .search-input {
  flex: 1; min-width: 0; min-height: 44px; border: 0; background: transparent; font: inherit; font-size: 1.05rem; color: var(--text-primary);
  appearance: none; -webkit-appearance: none;
}
:where(.search-inline) .search-input::-webkit-search-cancel-button { appearance: none; }
:where(.search-inline) .search-input::placeholder { color: var(--text-muted); }

:where(.search-inline) .search-status { padding: 8px 16px 0; min-height: 1.4em; font-size: .85rem; color: var(--text-muted); overflow-wrap: anywhere; }
:where(.search-inline) .search-start-list { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
:where(.search-inline) .search-start-list a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 999px; background: var(--primary-pale); color: var(--primary-dark); font-weight: 600; text-decoration: none; }
:where(.search-inline) .search-start-list a:hover { background: var(--primary-light); }

:where(.search-inline) .search-list { list-style: none; margin: 0; padding: 8px 8px 12px; flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
:where(.search-inline) .search-list > li { list-style: none; padding: 0; margin: 0; }
:where(.search-inline) .search-list > li::marker { content: none; }
:where(.search-inline) .search-list > li::before, :where(.search-inline) .search-list > li::after { content: none; display: none; }
:where(.search-inline) .search-status { flex: none; }
:where(.search-inline) .search-item { border-radius: 8px; }
:where(.search-inline) .search-item:focus-within { background: var(--primary-pale); }
:where(.search-inline) .search-link { display: grid; gap: 2px; padding: 12px 14px 6px; border-radius: 8px; color: inherit; text-decoration: none; }
:where(.search-inline) .search-item:hover { background: var(--bg-base); }
:where(.search-inline) .search-kind { font-size: .8rem; font-weight: 700; color: var(--primary); }
:where(.search-inline) .search-title { font-size: 1.05rem; font-weight: 700; color: var(--text-primary); line-height: 1.3; }
:where(.search-inline) .search-excerpt { font-size: .93rem; line-height: 1.5; color: var(--text-secondary); overflow-wrap: anywhere; }
:where(.search-inline) .search-excerpt mark { background: var(--warning-bg); color: inherit; border-radius: 3px; padding: 0 1px; font-weight: 600; }
:where(.search-inline) .search-sections { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 0 14px 10px; font-size: .85rem; }
:where(.search-inline) .search-section-link { color: var(--primary-dark); text-decoration: underline; text-underline-offset: 3px; }
:where(.search-inline) .search-empty { padding: 12px 12px 8px; }
:where(.search-inline) .search-empty-text { color: var(--text-secondary); margin: 6px 0 10px; line-height: 1.5; }
:where(.search-inline) .search-suggest { font: inherit; font-weight: 700; color: var(--primary-dark); background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; min-height: 24px; }

/* Inline field (blog overview) */
.search-inline { margin: 0 0 24px; }
.search-inline-label { display: block; margin-bottom: 6px; font-weight: 700; font-size: .95rem; }
.search-inline-field { display: flex; align-items: center; gap: 10px; padding: 0 14px; min-height: 52px; border-radius: 14px; border: 1px solid var(--separator); background: var(--bg-card); color: var(--primary); }
/* One focus cue, the same idea as the dialog (order 035B): the whole field takes the ring, the input inside draws none. */
.search-inline-field:focus-within { border-color: var(--primary-dark); box-shadow: 0 0 0 2px var(--primary-dark); }
.search-inline .search-input { min-height: 48px; }
.search-inline .search-input:is(:focus, :focus-visible) { outline: none; }
@media (forced-colors: active) { .search-inline-field:focus-within { outline: 2px solid CanvasText; } }
.search-inline-results .search-list { padding: 8px 0; max-height: none; }
.search-inline-results .search-item { background: var(--bg-card); border: 1px solid var(--separator); margin-bottom: 8px; }
.search-inline-results .search-status { padding-left: 0; }

:where(.search-inline) .search-start-list li { list-style: none; padding: 0; margin: 0; }
:where(.search-inline) .search-start-list li::before, :where(.search-inline) .search-start-list li::marker { content: none; }
:where(.search-inline) .search-result-icon { display: none; }
}
