/* ============================================================
   Explore — discovery grid with filters (app/explore.html)
   Mobile: search sits below the heading at full width.
   Filters have a clear hierarchy: sort = segmented control,
   categories = quiet chips. Gold marks the active filter only.
   ============================================================ */

/* heading + search: stacked on mobile, one row on desktop */
.explore-head { flex-direction: column; align-items: stretch; gap: 12px; }

.explore-tools { display: flex; align-items: center; gap: 12px; }
.explore-count { flex: none; }

.explore-search { position: relative; width: 100%; flex: 1; }
.explore-search .input { padding-left: 40px; min-height: 46px; font-size: 14.5px; }
.search-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px; height: 15px;
  border: 1.8px solid var(--muted);
  border-radius: 50%;
  pointer-events: none;
}
.search-icon::after {
  content: "";
  position: absolute;
  right: -4.5px;
  bottom: -3px;
  width: 6px;
  height: 1.8px;
  background: var(--muted);
  transform: rotate(45deg);
  border-radius: 2px;
}

/* ---------- filters ---------- */
.filter-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 12px;
  scrollbar-width: none;
}
.filter-row::-webkit-scrollbar { display: none; }
.filter-row .chip { flex: none; }

/* sort — segmented control, gold only when active */
.filter-row.sorts {
  display: inline-flex;
  gap: 2px;
  width: fit-content;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  margin-bottom: 14px;
}
.filter-row.sorts .chip {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 8px 16px;
  min-height: 34px;
  font-size: 13px;
}
.filter-row.sorts .chip:hover { color: var(--txt); }
.filter-row.sorts .chip[aria-pressed="true"] {
  background: var(--gold-faint);
  border-color: rgba(244, 176, 33, 0.4);
  color: var(--gold);
}

/* category — quiet text chips */
.filter-row.cats { margin-bottom: 14px; }
.filter-row.cats .chip {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.12);
  padding: 7px 14px;
  min-height: 32px;
  font-size: 12.5px;
}
.filter-row.cats .chip[aria-pressed="true"] {
  background: var(--gold-faint);
  border-color: rgba(244, 176, 33, 0.45);
  color: var(--gold);
}

/* ---------- grid ---------- */
.explore-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  min-height: 200px;
}

/* one toolbar row on desktop: sort segmented + category chips
   (scrollable, fills the row) — search lives with the heading */
.explore-toolbar { display: flex; flex-direction: column; gap: 0; }
.explore-toolbar .filter-row { margin-bottom: 12px; }

@media (min-width: 768px) {
  .explore-head { flex-direction: row; align-items: center; justify-content: space-between; }
  .explore-search { width: min(340px, 34vw); flex: none; }
  .explore-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .explore-toolbar { flex-direction: row; align-items: center; gap: 14px; }
  .explore-toolbar .filter-row { margin-bottom: 16px; }
  .explore-toolbar .filter-row.cats { flex: 1; min-width: 0; overflow-x: auto; }
}
@media (min-width: 1200px) {
  .explore-grid { grid-template-columns: repeat(4, 1fr); gap: 18px; }
}

/* skeleton cards */
.sk-card { aspect-ratio: 9 / 16; border-radius: var(--r-md); }
