/* ============================================================
   THE READER — /finds/
   ------------------------------------------------------------
   Editorial filter tool: presets + multi-axis controls + a
   grid of results. White paper, navy ink, mono labels.
   ============================================================ */

.finds {
  --paper: #ffffff;
  --paper-soft: #f7f7f9;
  --paper-edge: #f2f2f5;
  --ink: #0e1430;
  --ink-soft: rgba(14, 20, 48, 0.62);
  --ink-faint: rgba(14, 20, 48, 0.4);
  --rule: rgba(14, 20, 48, 0.1);
  --accent: #1F2258;
  --accent-warm: #C3401A;

  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px 96px;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body:has(.finds) {
  background: #fff;
}

.finds .mono {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-feature-settings: 'tnum' 1;
}

/* ============================================================
   MASTHEAD
   ============================================================ */
.finds-masthead {
  padding: 80px 0 48px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 32px;
}
.finds-vol {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 24px;
}
.finds-title {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  font-weight: 800;
  font-size: clamp(48px, 9vw, 104px);
  line-height: 0.95;
  letter-spacing: -0.035em;
  margin: 0 0 28px;
  color: var(--ink);
  max-width: 14ch;
}
.finds-title em {
  font-family: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
  font-style: italic;
  font-weight: 400;
}
.finds-lede {
  max-width: 56ch;
  font-size: clamp(16px, 1.6vw, 19px);
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0;
}

/* ============================================================
   PRESETS — quick chapter switches
   ============================================================ */
.finds-presets {
  margin-bottom: 32px;
}
.finds-presets-label {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0 0 14px;
}
.finds-presets-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}
.preset-btn {
  appearance: none;
  border: 1px solid var(--rule);
  background: transparent;
  border-radius: 12px;
  padding: 16px 18px;
  text-align: left;
  cursor: pointer;
  font: inherit;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.15s ease;
}
.preset-btn:hover {
  border-color: var(--ink);
  background: var(--paper-soft);
}
.preset-btn.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.preset-btn.is-active .preset-detail {
  color: rgba(255, 255, 255, 0.65);
}
.preset-name {
  font-family: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: 20px;
  color: inherit;
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.preset-detail {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-soft);
}
.preset-btn--ghost {
  border-style: dashed;
}
.preset-btn--ghost .preset-name {
  font-style: italic;
  color: var(--ink-soft);
}

/* ============================================================
   CONTROLS — multi-axis filter bar
   ============================================================ */
.finds-controls {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 24px 0;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.finds-controls-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}
.finds-controls-row--narrow {
  grid-template-columns: minmax(220px, 2fr) auto repeat(2, 100px) minmax(180px, 1.4fr);
  gap: 16px;
  align-items: end;
}

.finds-field {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.finds-field-label {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
}

.finds-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  appearance: none;
  border: 1px solid rgba(14, 20, 48, 0.16);
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.chip:hover {
  background: var(--paper-soft);
  border-color: var(--ink);
}
.chip.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

/* Inputs (set search, min/max price) and select */
.finds-field--input {
  cursor: text;
}
.finds-input-wrap,
.finds-select-wrap {
  position: relative;
  display: flex;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1.5px solid var(--ink);
  transition: border-color 0.15s ease;
}
.finds-input-wrap:focus-within,
.finds-select-wrap:focus-within {
  border-bottom-color: var(--accent-warm);
}
.finds-field--input input,
.finds-select-wrap select {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 0;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  outline: none;
  width: 100%;
  padding: 0;
}
.finds-field--input input::placeholder {
  color: var(--ink-faint);
}
.finds-select-wrap {
  padding-right: 20px;
}
.finds-select-wrap select {
  cursor: pointer;
}
.finds-select-wrap svg {
  position: absolute;
  right: 0;
  pointer-events: none;
  color: var(--ink-soft);
}
.finds-field--small {
  max-width: 100px;
}

/* Set picker — direct input wired up; suggestions popover below */
.finds-set-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 8px;
  box-shadow: 0 8px 24px -10px rgba(14, 20, 48, 0.18);
  max-height: 280px;
  overflow-y: auto;
  z-index: 5;
}
.finds-set-suggestions:not([hidden]) {
  display: block;
}
.finds-set-suggestions button {
  display: block;
  width: 100%;
  appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  border-bottom: 1px solid var(--rule);
}
.finds-set-suggestions button:hover {
  background: var(--paper-soft);
}
.finds-set-suggestions button:last-child {
  border-bottom: 0;
}

.finds-set-selected {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.finds-set-selected:empty { display: none; }
.finds-set-selected .chip {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
  padding-right: 4px;
}
.finds-set-selected .chip button {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  margin-left: 4px;
  padding: 2px 4px;
  font-size: 13px;
  opacity: 0.65;
}
.finds-set-selected .chip button:hover { opacity: 1; }

/* ============================================================
   META + RESULTS
   ============================================================ */
.finds-meta {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--ink);
  margin: 0 0 24px;
}

.finds-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 28px 18px;
}

.finds-tile {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.18s ease;
}
.finds-tile:hover { transform: translateY(-3px); }
.finds-tile-art {
  display: block;
  aspect-ratio: 0.72;
  background: var(--paper-soft);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(14, 20, 48, 0.05);
  transition: box-shadow 0.18s ease;
}
.finds-tile:hover .finds-tile-art {
  box-shadow: 0 8px 22px -10px rgba(14, 20, 48, 0.22);
}
.finds-tile-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.finds-tile-placeholder {
  width: 100%;
  height: 100%;
  background:
    linear-gradient(135deg, transparent 49.5%, var(--rule) 49.5%, var(--rule) 50.5%, transparent 50.5%),
    var(--paper-soft);
  display: block;
}
.finds-tile-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 2px;
  min-height: 4em;
}
.finds-tile-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
  letter-spacing: -0.005em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.finds-tile-meta {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 12px;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.finds-tile-bottom {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
}
.finds-tile-rarity {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-soft);
  letter-spacing: 0;
  text-transform: none;
}
.finds-tile-price {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.finds-show-more {
  display: block;
  appearance: none;
  border: 1px solid rgba(14, 20, 48, 0.16);
  background: transparent;
  font: inherit;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
  padding: 12px 24px;
  border-radius: 999px;
  margin: 48px auto 0;
  cursor: pointer;
  transition: all 0.15s ease;
}
.finds-show-more:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 880px) {
  .finds { padding: 0 16px 64px; }
  .finds-masthead { padding: 48px 0 32px; }
  .finds-controls-row {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .finds-controls-row--narrow {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  .finds-field--input.finds-field--small {
    max-width: none;
  }
  .finds-results {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 24px 12px;
  }
}

@media (max-width: 540px) {
  .finds-controls-row--narrow {
    grid-template-columns: 1fr;
  }
  .finds-results {
    grid-template-columns: repeat(2, 1fr);
  }
}
