/* Spotlight: a floating search panel in the upper third of the screen. It is part of the floating functional
   layer, so it is the one place besides the Dock that uses glass (liquid-glass.md, materials.md). Results use the
   desktop's file icons; the selected row takes the accent fill with white text, like a macOS selection.
   Contrast (on the solid fallback colours): label 15.3:1 and secondary 6.0:1 light, 12.4:1 and 6.0:1 dark;
   selected row text 10:1 light, 6.3:1 dark. */
.spot {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 18vh 16px 16px;
}
.spot[hidden] { display: none; }

.spot-panel {
  --label: #1d1d1f;
  --label-2: #5d5d58;
  --glass: rgba(246, 246, 244, .84);
  --edge: rgba(255, 255, 255, .7);
  --separator: rgba(0, 0, 0, .1);
  --sel: #0b4d1e;
  --on-sel: #fff;
  --mark: rgba(11, 77, 30, .14);

  width: min(680px, 100%);
  overflow: hidden;
  border-radius: 26px;
  background: var(--glass);
  box-shadow: inset 0 0 0 1px var(--edge), 0 0 0 .5px rgba(0, 0, 0, .22), 0 24px 64px rgba(0, 0, 0, .32);
  -webkit-backdrop-filter: blur(30px) saturate(1.8);
  backdrop-filter: blur(30px) saturate(1.8);
  color: var(--label);
  font-family: var(--font-sys);
}

.spot-field { display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 20px; }
.spot-field svg { flex: none; width: 20px; height: 20px; fill: none; stroke: var(--label-2); stroke-width: 2; stroke-linecap: round; }
.spot-field input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--label);
  font: 400 22px/28px var(--font-sys);
  outline: none; /* the panel itself is the focus indicator: it exists only while the field has focus */
}
.spot-field input::placeholder { color: var(--label-2); opacity: 1; }

.spot-body { max-height: min(440px, 60vh); overflow: auto; overscroll-behavior: contain; padding: 0 8px; border-top: 1px solid var(--separator); }
.spot-body:has(> :not([hidden])) { padding-block: 8px; }
.spot-body:not(:has(> :not([hidden]))) { border-top: 0; }
.spot-head { margin: 4px 12px 6px; font-size: 11px; font-weight: 600; line-height: 14px; color: var(--label-2); }
.spot-empty { margin: 12px; font-size: 13px; line-height: 18px; color: var(--label-2); }
.spot-list { margin: 0; padding: 0; list-style: none; }
.spot-list[hidden], .spot-head[hidden], .spot-empty[hidden] { display: none; }

.spot-list li {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 6px 12px;
  border-radius: 12px;
  cursor: default;
}
.spot-list li[aria-selected='true'] { background: var(--sel); color: var(--on-sel); }
.spot-txt { min-width: 0; }
.spot-txt b, .spot-txt small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spot-txt b { font-size: 14px; font-weight: 500; line-height: 18px; }
.spot-txt small { font-size: 12px; line-height: 16px; color: var(--label-2); }
.spot-where { font-size: 12px; line-height: 16px; color: var(--label-2); white-space: nowrap; }
.spot-list li[aria-selected='true'] :is(small, .spot-where) { color: rgba(255, 255, 255, .85); }
.spot-list mark { padding: 0 1px; border-radius: 3px; background: var(--mark); color: inherit; }
.spot-list li[aria-selected='true'] mark { background: rgba(255, 255, 255, .24); }

.spot-ico { display: grid; place-items: center; }
.spot-ico .fi { --s: 32px; }
.spot-app {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: linear-gradient(#4a4f57, #16181c);
  color: #fff;
}
.spot-app[data-app='mail'] { background: linear-gradient(#45b4ff, #0a6cf0); }
.spot-app[data-app='linkedin'] { background: linear-gradient(#2f86d8, #0a4f99); }
.spot-app .i { width: 18px; height: 18px; }

@media (max-width: 520px) {
  .spot { padding-top: 12px; }
  .spot-where { display: none; } /* the excerpt matters more than the folder on a narrow screen */
}

@media (prefers-color-scheme: dark) {
  .spot-panel {
    --label: #ecece8;
    --label-2: #a3a7a1;
    --glass: rgba(38, 41, 39, .8);
    --edge: rgba(255, 255, 255, .14);
    --separator: rgba(255, 255, 255, .1);
    --sel: #2c6b4a; /* white on it: 6.3:1 */
    --mark: rgba(143, 211, 176, .24);
  }
}
@media (prefers-reduced-transparency: reduce) {
  .spot-panel { --glass: #f4f4f2; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-reduced-transparency: reduce) and (prefers-color-scheme: dark) {
  .spot-panel { --glass: #262927; }
}
@media (prefers-contrast: more) {
  .spot-panel { --label-2: var(--label); --edge: var(--label); --separator: var(--label); }
}
