/* search page */

/* Shimmer uses border tokens so it adapts to every palette automatically */

@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position:  600px 0; }
}

/* Base skeleton line — shimmer gradient scrolls horizontally */
.sk-line {
  border-radius: 2px;
  background: linear-gradient(
    90deg,
    var(--line)        25%,
    var(--line-strong) 50%,
    var(--line)        75%
  );
  background-size: 1200px 100%;
  animation: shimmer 1.6s ease-in-out infinite;
}

/* Skeleton line sizes matching real post-item content */
.sk-date      { height: 11px; width: 72px; }
.sk-title     { height: 17px; width: 68%; margin-top: 6px; }
.sk-summary-a { height: 11px; width: 92%; margin-top: 10px; }
.sk-summary-b { height: 11px; width: 58%; margin-top: 5px; }
.sk-tag       { height: 20px; width: 52px; margin-top: 2px; }

/* Cascade shimmer phase across cards so they don't pulse in lock-step */
.sk-card:nth-child(2) .sk-line { animation-delay: 0.15s; }
.sk-card:nth-child(3) .sk-line { animation-delay: 0.30s; }
.sk-card:nth-child(4) .sk-line { animation-delay: 0.45s; }

/* Disable hover styles on skeleton cards */
.sk-card { pointer-events: none; }
.sk-card:hover { transform: none !important; }

@keyframes searchItemIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.post-item.search-enter {
  animation: searchItemIn 0.3s ease both;
}
@media (prefers-reduced-motion: reduce) {
  .post-item.search-enter { animation: none; }
}


.search-box {
  display: flex;
  align-items: center;
  border: 1px dashed var(--line-strong);
  padding: 10px 14px;
  margin: 24px 0 0;
  gap: 10px;
  transition: border-color .15s;
}
.search-box:focus-within { border-color: var(--accent); }
.search-box::before { content: "$"; color: var(--accent); flex-shrink: 0; }
#search {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--fg);
  font-family: inherit;
  font-size: 14px;
  caret-color: var(--accent);
}
#search::placeholder { color: var(--dim); opacity: 0.7; }
.search-results { padding-top: 8px; min-height: 240px; }
.search-results-list { padding-top: 0; border-top: none; }
.search-meta { color: var(--dim); font-size: 12px; padding: 16px 0 0; }
.search-empty { color: var(--dim); padding: 32px 0; }

/* Saved-posts page (/blog/saved/) — reuses .post-item/.pi-* but adds a per-card
   remove control and a "clear all" affordance in the meta line. */
.saved-item { position: relative; padding-right: 28px; }
.saved-remove {
  position: absolute;
  top: 18px;
  right: 0;
  background: none;
  border: none;
  color: var(--faint);
  font-family: inherit;
  font-size: 13px;
  line-height: 1;
  padding: 4px;
  cursor: pointer;
  transition: color .15s;
}
.saved-remove:hover { color: var(--accent); }
.saved-clear {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--dim);
  cursor: pointer;
}
.saved-clear:hover { color: var(--accent); }

/* Highlighted query matches in result titles/summaries. Accent-tinted, no heavy
   background block — keeps the terminal look. */
#search-results mark {
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}

/* Body-match excerpt — a dim, monospace-context snippet shown when a result matched in
   the post body (not its title/summary), so the reason it surfaced is visible. */
.pi-snippet {
  color: var(--dim);
  font-size: 12px;
  line-height: 1.6;
  margin: 2px 0 8px;
  padding-left: 10px;
  border-left: 2px solid var(--line-strong);
  opacity: 0.92;
}
