/* Workbench: a sticky filter rail above a dense card grid. */

@import url("/static/tokens.css");

*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.shell { max-width: 1440px; margin: 0 auto; padding: 0 var(--space-24); }

/* ---------------------------------------------------------------- masthead */

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-16);
  padding: var(--space-24) 0 var(--space-16);
}

.masthead h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  font-style: normal;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
  min-width: 0;
}

.masthead .counts { color: var(--color-ink-2); font-size: var(--text-sm); }
.masthead .counts b { color: var(--color-ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.masthead .spacer { flex: 1 1 auto; }

.theme-toggle {
  border: var(--rule);
  background: var(--color-paper-2);
  color: var(--color-ink-2);
  border-radius: var(--radius-md);
  padding: var(--space-8) var(--space-12);
  font: inherit;
  font-size: var(--text-sm);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}
.theme-toggle:hover { background: var(--color-paper-3); color: var(--color-ink); }
.theme-toggle:active { transform: translateY(1px); }

/* ------------------------------------------------------------------ filters */

.filters {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-12);
  align-items: flex-end;
  padding: var(--space-12) var(--space-24);
  margin: 0 calc(-1 * var(--space-24));
  background: color-mix(in oklab, var(--color-paper) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: var(--rule);
}

.field { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.field > span {
  font-size: var(--text-xs);
  color: var(--color-ink-3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.field input, .field select {
  font: inherit;
  font-size: var(--text-sm);
  color: var(--color-ink);
  background: var(--color-paper-2);
  border: var(--rule);
  border-radius: var(--radius-md);
  padding: var(--space-8) var(--space-12);
  min-width: 0;
  width: 7.5rem;
  transition: border-color var(--dur-fast) var(--ease-out);
}
.field select { width: 11rem; }
.field input:hover, .field select:hover { border-color: var(--color-ink-3); }
.field input:focus-visible, .field select:focus-visible { border-color: var(--color-focus); }

.toggles { display: flex; gap: var(--space-16); align-items: center; padding-bottom: var(--space-8); }
.toggles label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  font-size: var(--text-sm);
  color: var(--color-ink-2);
  cursor: pointer;
  white-space: nowrap;
}
.toggles input { accent-color: var(--color-accent); }

.reset {
  border: none;
  background: none;
  color: var(--color-accent);
  font: inherit;
  font-size: var(--text-sm);
  cursor: pointer;
  padding: var(--space-8) 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}

/* --------------------------------------------------------------------- grid */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: var(--space-24);
  padding: var(--space-24) 0 var(--space-48);
}

.card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--color-paper-2);
  border: var(--rule);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform var(--dur-mid) var(--ease-out),
              border-color var(--dur-mid) var(--ease-out);
}
.card:hover { transform: translateY(-2px); border-color: var(--color-ink-3); }
.card:focus-within { border-color: var(--color-focus); }

.photo {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--color-paper-3);
  overflow: hidden;
}
.photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--dur-mid) var(--ease-out);
}
.card:hover .photo img { transform: scale(1.02); }

.photo .none {
  display: grid; place-items: center; height: 100%;
  color: var(--color-ink-3); font-size: var(--text-sm);
}

/* Thumbnail strip: only shown when the album has more than one photo. */
.thumbs {
  position: absolute; inset-inline: var(--space-8); bottom: var(--space-8);
  display: flex; gap: var(--space-4);
}
.thumbs button {
  flex: 1 1 0; height: 3px; padding: 0; border: none; cursor: pointer;
  border-radius: 999px;
  background: oklch(100% 0 0 / 0.45);
  transition: background var(--dur-fast) var(--ease-out);
}
.thumbs button[aria-current="true"] { background: oklch(100% 0 0 / 0.95); }
.thumbs button:hover { background: oklch(100% 0 0 / 0.8); }

.badge {
  position: absolute; top: var(--space-8); inset-inline-start: var(--space-8);
  background: var(--color-paper-2);
  color: var(--color-ink-2);
  border-radius: 999px;
  padding: var(--space-2) var(--space-8);
  font-size: var(--text-xs);
  box-shadow: var(--shadow-card);
}

.body { display: flex; flex-direction: column; gap: var(--space-8); padding: var(--space-16); flex: 1; }

.price {
  display: flex; align-items: baseline; gap: var(--space-8); flex-wrap: wrap;
}
.price b {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1;
}
.price .extra { font-size: var(--text-xs); color: var(--color-ink-3); }

.specs {
  display: flex; flex-wrap: wrap; gap: var(--space-4) var(--space-12);
  color: var(--color-ink-2); font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}

.where { color: var(--color-ink); font-size: var(--text-sm); overflow-wrap: anywhere; }
.where .kvart { color: var(--color-ink-3); }
.where .derived {
  margin-left: 0.4em; padding: 0 0.35em;
  border: var(--rule); border-radius: 3px;
  color: var(--color-ink-3); font-size: var(--text-xs);
  white-space: nowrap;
}

.flags { display: flex; flex-wrap: wrap; gap: var(--space-4); }
.flag {
  font-size: var(--text-xs);
  color: var(--color-ink-2);
  background: var(--color-paper-3);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-8);
}

/* The only other place colour is spent: this listing was not fully verifiable. */
.caution {
  display: flex; gap: var(--space-8);
  background: var(--color-caution-bg);
  color: var(--color-caution);
  border-radius: var(--radius-md);
  padding: var(--space-8) var(--space-12);
  font-size: var(--text-xs);
  line-height: 1.4;
}
.caution b { font-weight: 600; }

.foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-8); margin-top: auto; padding-top: var(--space-8);
  border-top: var(--rule);
}
.foot time { color: var(--color-ink-3); font-size: var(--text-xs); }

.open {
  display: inline-block;
  background: var(--color-accent);
  color: var(--color-accent-ink);
  text-decoration: none;
  border-radius: var(--radius-md);
  padding: var(--space-8) var(--space-16);
  font-size: var(--text-sm);
  font-weight: 500;
  white-space: nowrap;              /* a wrapped CTA is unclickable-looking */
  transition: filter var(--dur-fast) var(--ease-out);
}
.open:hover { filter: brightness(1.08); }
.open:active { transform: translateY(1px); }

/* ------------------------------------------------------------------- states */

.state { padding: var(--space-48) 0; color: var(--color-ink-2); text-align: center; }
.state b { display: block; color: var(--color-ink); font-size: var(--text-lg); margin-bottom: var(--space-8); }

.skeleton { background: var(--color-paper-3); border-radius: var(--radius-lg); height: 340px; }
@media (prefers-reduced-motion: no-preference) {
  .skeleton { animation: pulse 1.4s var(--ease-in-out) infinite; }
  @keyframes pulse { 50% { opacity: 0.55; } }
}

.more {
  display: block; margin: 0 auto var(--space-48);
  border: var(--rule); background: var(--color-paper-2); color: var(--color-ink);
  border-radius: var(--radius-md); padding: var(--space-12) var(--space-32);
  font: inherit; font-size: var(--text-sm); cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out);
}
.more:hover { background: var(--color-paper-3); }
.more[disabled] { opacity: 0.5; cursor: default; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .card:hover { transform: none; }
  .card:hover .photo img { transform: none; }
}

@media (max-width: 640px) {
  .shell { padding: 0 var(--space-16); }
  .filters { margin: 0 calc(-1 * var(--space-16)); padding: var(--space-12) var(--space-16); gap: var(--space-8); }
  .field input { width: 6rem; }
  .field select { width: 100%; }
  .field:has(select) { flex: 1 1 100%; }
  .grid { gap: var(--space-16); }
}
