/* search-results.css — Search results overlay panel styles.
   Reuses all token variables from shared.css. No new color tokens. */

/* ── Panel container ──────────────────────────────────────────────────────── */
.sr-panel {
  position: absolute;
  inset: 0;
  background: var(--bg-shell);
  border-radius: 26px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* Hidden by default — shown when search has a committed query */
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity .18s ease, transform .18s ease;
}
.sr-panel.open {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

/* ── Top bar (chips + close button) ───────────────────────────────────────── */
.sr-topbar {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  border-bottom: 0.5px solid var(--border-soft);
}

/* ── Filter chip row ──────────────────────────────────────────────────────── */
.sr-filters {
  display: flex;
  gap: 6px;
  padding: 10px 14px 8px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
  min-width: 0;
}
.sr-filters::-webkit-scrollbar { display: none; }

/* ── Close button ─────────────────────────────────────────────────────────── */
.sr-close-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  margin: 0 10px 0 4px;
  border-radius: 50%;
  border: none;
  background: var(--bg-control);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background .12s;
}
.sr-close-btn:active { background: var(--bg-elevated); }

.sr-filter-chip {
  padding: 6px 13px;
  border-radius: 999px;
  border: 0.5px solid var(--border-default);
  background: transparent;
  color: var(--text-tertiary);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .12s, color .12s, border-color .12s;
}
.sr-filter-chip.active {
  background: var(--text-primary);
  color: var(--bg-shell);
  border-color: var(--text-primary);
}

/* ── Scroll body ──────────────────────────────────────────────────────────── */
.sr-body {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: none;
  padding: 8px 0 100px; /* enough clearance above the bottom bar */
}
.sr-body::-webkit-scrollbar { display: none; }

/* ── Empty / no-results state ─────────────────────────────────────────────── */
.sr-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 60px 24px;
  color: var(--text-faint);
  font-size: 13px;
  text-align: center;
}
.sr-empty-icon { font-size: 32px; line-height: 1; }
.sr-empty-title { font-size: 16px; font-weight: 500; color: var(--text-secondary); }

/* ── Section ──────────────────────────────────────────────────────────────── */
.sr-section { margin-bottom: 4px; }

.sr-section-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 7px;
}
.sr-section-hdr-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.sr-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}
.sr-section-count {
  font-size: 11px;
  color: var(--text-faint);
  font-weight: 500;
}
.sr-section-arrow {
  color: var(--text-faint);
  flex-shrink: 0;
  cursor: pointer;
  padding: 4px;
}

/* ── Chapter cards (reuses .page-card / .page-cover styles from chapters.css) ─── */
.sr-chapter-list {
  padding: 0 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sr-chapter-card {
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-card);
  border: 0.5px solid var(--border-soft);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 10px 10px;
}
.sr-chapter-cover {
  width: 58px;
  height: 58px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-control);
}
.sr-chapter-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
.sr-chapter-info { min-width: 0; flex: 1; }
.sr-chapter-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sr-chapter-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}
.sr-chapter-chevron {
  color: var(--text-faint);
  flex-shrink: 0;
}

/* ── Page strip (horizontal scroll) ──────────────────────────────────────── */
.sr-page-strip {
  display: flex;
  gap: 8px;
  padding: 0 14px;
  overflow-x: auto;
  scrollbar-width: none;
}
.sr-page-strip::-webkit-scrollbar { display: none; }

.sr-page-tile {
  flex-shrink: 0;
  width: 120px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-card);
  border: 0.5px solid var(--border-soft);
  cursor: pointer;
}
.sr-page-thumb {
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--bg-control);
  overflow: hidden;
}
.sr-page-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
.sr-page-info { padding: 7px 8px 8px; }
.sr-page-breadcrumb {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}
.sr-page-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sr-page-more {
  flex-shrink: 0;
  width: 80px;
  aspect-ratio: unset;
  border-radius: 12px;
  background: var(--bg-card);
  border: 0.5px dashed var(--border-default);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 500;
  min-height: 100px;
}

/* ── Photo grid (reuses .gc from feed.css) ────────────────────────────────── */
.sr-photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  padding: 0 14px;
}
.sr-photo-grid .gc {
  border-radius: 6px;
  aspect-ratio: 1;
  background: var(--bg-card);
  overflow: hidden;
  cursor: pointer;
}
.sr-photo-grid .gc img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 6px;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}
.sr-photo-grid .gc-skeleton {
  background: linear-gradient(90deg, #181818 25%, #232323 50%, #181818 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}

/* ── Age section ─────────────────────────────────────────────────────────── */
.sr-age-range {
  padding: 0 14px 8px;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}
.sr-age-months {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 0 0 4px;
}
.sr-age-month { }
.sr-age-month-hdr {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px 7px;
}
.sr-age-month-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}
.sr-age-month-count {
  font-size: 11px;
  color: var(--text-faint);
}

/* ── "Show all" expander row ──────────────────────────────────────────────── */
.sr-show-all {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px 14px 6px;
  font-size: 12px;
  color: var(--text-tertiary);
  cursor: pointer;
  font-weight: 500;
}
.sr-show-all:hover { color: var(--text-secondary); }
