/* ============================================================================
   Stintwise — data explorer ("pit-wall telemetry", matching site.css)
   A faceted readout over the priors corpus. Inherits all tokens.css variables.
   ========================================================================== */

/* centered instrument column (site.css styles .bar/.hero/etc.; the explorer
   page opts in here so it lines up with the rest of the site, not full-bleed) */
.explorer {
  width: min(100% - 2 * var(--space-3), var(--maxw));
  margin-inline: auto;
  padding-block: var(--space-5) var(--space-6);
}
.explorer h1 { font-size: var(--step-2); margin-bottom: var(--space-2); }
.explorer .subtitle { color: var(--text-dim); max-width: 62ch; margin-bottom: var(--space-4); }

/* ---- filter cluster ---- */
.explorer-filters {
  display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: end;
  padding: var(--space-3);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  margin-bottom: var(--space-3);
}
.explorer-filters .filter { display: flex; flex-direction: column; gap: 0.4rem; }
.explorer-filters .filter span {
  font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-faint);
}
.explorer-filters select {
  appearance: none; -webkit-appearance: none;
  background-color: var(--surface-2); color: var(--text);
  border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 0.5rem 2rem 0.5rem 0.7rem;
  font-family: var(--font-mono); font-size: var(--step--1); cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2398a2b2' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.65rem center;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.explorer-filters select:hover { border-color: var(--text-faint); }
.explorer-filters select:focus-visible {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.explorer-filters .btn { padding-block: 0.6rem; }

/* ---- results table (telemetry readout) ---- */
.explorer-scroll { overflow-x: auto; margin-bottom: var(--space-3); border-radius: var(--radius-lg); }
.explorer-table {
  width: 100%; border-collapse: collapse;
  font-family: var(--font-mono); font-size: var(--step--1);
  border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden;
}
.explorer-table thead th {
  text-align: left; padding: 0.7rem 0.85rem; white-space: nowrap;
  background: var(--surface-2); color: var(--text-faint);
  font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 600;
  border-bottom: 1px solid var(--line-2);
}
.explorer-table tbody td {
  padding: 0.6rem 0.85rem; white-space: nowrap;
  border-bottom: 1px solid var(--line); color: var(--text);
  transition: background 0.12s var(--ease);
}
.explorer-table tbody tr:last-child td { border-bottom: 0; }
.explorer-table tbody tr:nth-child(even) td { background: rgba(255, 255, 255, 0.014); }
.explorer-table tbody tr:hover td { background: var(--accent-soft); }
.explorer-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
/* accent the headline metric (fuel μ, the 6th column) */
.explorer-table tbody td:nth-child(6) { color: var(--accent); }

/* ---- pager ---- */
.explorer-pager {
  display: flex; gap: var(--space-3); align-items: center; margin-bottom: var(--space-4);
  font-family: var(--font-mono); font-size: var(--step--1);
}
.explorer-pager a { color: var(--text-dim); letter-spacing: 0.04em; transition: color 0.2s var(--ease); }
.explorer-pager a:hover { color: var(--accent); }

/* ---- "this query → API" strip ---- */
.explorer-api {
  display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap;
  padding: var(--space-3);
  border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--bg-2);
}
.explorer-api > .mono { color: var(--text-faint); font-size: 0.62rem; letter-spacing: 0.14em; }
.explorer-api code {
  flex: 1; min-width: 14rem; overflow-x: auto; white-space: nowrap;
  background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 0.5rem 0.7rem; color: var(--accent-bright);
  font-family: var(--font-mono); font-size: var(--step--1);
}
.explorer-api .btn { padding: 0.55rem 1rem; }

/* ---- empty state ---- */
.explorer-empty {
  color: var(--text-dim); text-align: center;
  padding: var(--space-5) var(--space-3);
  border: 1px dashed var(--line-2); border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--surface), transparent);
  font-family: var(--font-mono); font-size: var(--step--1);
}

/* ---- staggered entrance (reuses site.css @keyframes rise) ---- */
.explorer > * { animation: rise 0.6s var(--ease) both; }
.explorer > .section-label    { animation-delay: 0.04s; }
.explorer > h1                { animation-delay: 0.10s; }
.explorer > .subtitle         { animation-delay: 0.16s; }
.explorer > .explorer-filters { animation-delay: 0.22s; }
.explorer > .explorer-scroll,
.explorer > .explorer-empty   { animation-delay: 0.28s; }

/* ---- responsive ---- */
@media (max-width: 820px) {
  .explorer-filters { gap: var(--space-1); padding: var(--space-2); }
  .explorer-filters .filter { flex: 1 1 8rem; }
  .explorer-filters select { width: 100%; }
}
