/* search.css — the header search box.
   Loaded on every page; the index behind it is fetched only on first focus. */

/* Last child of the bar, after the nav. The bar is justify-content:
   space-between, so with three children the free space would land between
   the nav and the search box and split them apart. Handing it all to the
   nav's left margin instead keeps the tabs and the search box together at
   the right, with only the bar's own 16px gap between them, and leaves the
   wordmark alone on the left. */
.bar__find{
  position:relative;
  flex:0 1 260px;
  min-width:0;
}
.bar .bar__nav{ margin-left:auto; }
.bar__find form{ display:flex; align-items:center; }

.bar__find input{
  width:100%;
  font:inherit;
  font-size:clamp(13px,1.05vw,15px);
  line-height:1.2;
  color:var(--paper-hi, #e4e2df);
  background:rgba(228,226,223,.07);
  border:1px solid rgba(228,226,223,.22);
  border-radius:2px;
  padding:7px 30px 7px 30px;
  transition:border-color .18s ease, background .18s ease;
  -webkit-appearance:none;
  appearance:none;
}
.bar__find input::placeholder{ color:rgba(228,226,223,.52); }
.bar__find input:focus{
  outline:none;
  background:rgba(228,226,223,.12);
  border-color:rgba(228,226,223,.62);
}

/* the magnifier is drawn, not an icon font, so nothing extra is fetched */
.bar__find .find__ico{
  position:absolute; left:10px; top:50%; width:12px; height:12px;
  margin-top:-6px; pointer-events:none; opacity:.62;
  border:1.6px solid currentColor; border-radius:50%;
}
.bar__find .find__ico::after{
  content:""; position:absolute; right:-5px; bottom:-4px;
  width:6px; height:1.6px; background:currentColor;
  transform:rotate(45deg); transform-origin:left center;
}

.bar__find .find__clear{
  position:absolute; right:4px; top:50%; margin-top:-11px;
  width:22px; height:22px; padding:0; line-height:1;
  font:inherit; font-size:16px; color:inherit;
  background:none; border:0; cursor:pointer; opacity:.5;
  display:none;
}
.bar__find .find__clear:hover{ opacity:1; }
.bar__find.is-filled .find__clear{ display:block; }

/* ── results ─────────────────────────────────────────────────────────── */
.find__out{
  /* Anchored to the right, because the box is at the right end of the bar:
     with left:0 a 420px panel ran off the viewport and cut the town off every
     congregation, which is the half of the row that tells them apart. */
  position:absolute; top:calc(100% + 8px); right:0; left:auto;
  width:min(460px,90vw);
  max-height:min(64vh,460px); overflow-y:auto;
  background:var(--paper, #f4f2ef); color:var(--ink, #0d0c0c);
  border:1px solid rgba(13,12,12,.20);
  box-shadow:0 14px 40px rgba(13,12,12,.30);
  display:none; z-index:40;
}
.bar__find.is-open .find__out{ display:block; }

.find__out a{
  display:flex; align-items:baseline; gap:10px;
  padding:9px 14px; text-decoration:none; color:inherit;
  border-bottom:1px solid rgba(13,12,12,.09);
}
.find__out a:last-child{ border-bottom:0; }
.find__out a:hover,
.find__out a.is-on{ background:rgba(13,12,12,.07); }
.find__out a b{ font-weight:600; }

.find__nm{ flex:1 1 auto; min-width:0; font-size:14px;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.find__kind{
  flex:0 0 auto; font-size:10.5px; letter-spacing:.09em;
  text-transform:uppercase; opacity:.52;
}
.find__note{ padding:11px 14px; font-size:13px; opacity:.62; margin:0; }
/* As a footer under the results it needs a rule above it; on its own, as the
   "nothing found" message, it must not have one. */
.find__out a + .find__note{
  border-top:1px solid rgba(13,12,12,.20);
  background:rgba(13,12,12,.04);
  position:sticky; bottom:0;
}

@media (max-width:900px){ .bar__find{ flex-basis:200px; } }
@media (max-width:640px){
  .bar__find{ flex-basis:38px; }
  .bar__find input{ padding-right:8px; }
  .bar__find input:not(:focus){ color:transparent; }
  .bar__find input:focus{ position:relative; z-index:41; width:min(70vw,300px); }
}
