/* Hallmark · component: source search dialog · genre: editorial · theme: AEF locked system · states: 8 · contrast: pending rendered check · v2.0.0 */
/* Critique: a direct question, a lime action and legible source excerpts; existing AEF tokens and no invented answers. */
/* Scope: targeted search foundation; parent owns global clipping and rendered site review. */
:root {
  --search-backdrop: rgb(21 25 24 / 80%);
  --search-shadow: 0 24px 80px rgb(21 25 24 / 30%);
  --search-error: #9b2828;
  --search-focus: var(--cobalt, #244bff);
}
.aef-search {
  width: min(760px, calc(100% - 32px));
  max-height: min(82dvh, 900px);
  margin: auto;
  padding: clamp(20px, 4vw, 36px);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--search-shadow);
  font-family: var(--body);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.aef-search::backdrop { background: var(--search-backdrop); }
.aef-search__heading { display: flex; gap: 20px; justify-content: space-between; align-items: flex-start; }
.aef-search h2 { margin: 0; min-width: 0; font: 800 clamp(26px, 5vw, 40px)/1.1 var(--body); letter-spacing: -0.04em; overflow-wrap: break-word; text-wrap: balance; }
.aef-search > p { max-width: 58ch; margin: 16px 0; font-size: 16px; line-height: 1.6; }
.aef-search__controls { display: flex; gap: 12px; align-items: flex-end; margin-top: 28px; }
.aef-search__field { flex: 1; min-width: 0; }
.aef-search label { display: block; margin-bottom: 8px; font: 700 14px/1.5 var(--body); }
.aef-search input { width: 100%; min-height: 52px; padding: 12px; border: 1px solid var(--ink); border-radius: var(--radius); background: var(--white); color: var(--ink); font: 500 16px/1.5 var(--body); }
.aef-search input::placeholder { color: var(--muted); opacity: 1; }
.aef-search button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding: 12px 16px; border: 1px solid var(--ink); border-radius: var(--radius); background: var(--paper); color: var(--ink); font: 700 14px/1.4 var(--body); letter-spacing: 0; text-transform: none; cursor: pointer; }
.aef-search button:hover, .aef-search button.is-hover { background: var(--soft); }
.aef-search button:active, .aef-search button.is-active { transform: translateY(1px); }
.aef-search button:disabled, .aef-search button.is-disabled { background: var(--soft); color: var(--muted); border-color: var(--line); cursor: wait; }
.aef-search .aef-search__submit { min-height: 52px; background: var(--gold); }
.aef-search .aef-search__submit:hover, .aef-search .aef-search__submit.is-hover { background: var(--gold-light); }
.aef-search :is(button, input, a):focus-visible, .aef-search .is-focus { outline: 3px solid var(--search-focus); outline-offset: 3px; }
.aef-search .aef-search__status { margin: 20px 0 12px; color: var(--muted); font-size: 14px; }
.aef-search[data-search-state="error"] .aef-search__status { color: var(--search-error); }
.aef-search[data-search-state="loading"] .aef-search__controls { cursor: progress; }
.aef-search[data-search-state="success"] .aef-search__status { color: var(--ink); }
.aef-search [hidden] { display: none; }
.aef-search__results { margin: 0; padding: 0; list-style: none; }
.aef-search__results li { padding: 20px 0; border-top: 1px solid var(--line); }
.aef-search__results a { display: block; min-height: 44px; padding: 8px 0; color: var(--ink); font: 800 20px/1.3 var(--body); text-decoration: underline; text-underline-offset: 4px; overflow-wrap: break-word; }
.aef-search__results a:hover { color: var(--cobalt); }
.aef-search__results a:active { color: var(--ink); }
.aef-search__results p { margin: 0; font-size: 15px; line-height: 1.6; }
.aef-search__results .aef-search__type { color: var(--muted); font-size: 13px; }
.aef-search__results .aef-search__source { margin-top: 8px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.aef-search .aef-search__note { margin: 20px 0 0; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
@media (max-width: 520px) {
  .aef-search__heading { gap: 12px; }
  .aef-search__controls { flex-wrap: wrap; }
  .aef-search__field { flex-basis: 100%; }
  .aef-search .aef-search__submit { width: 100%; }
}
