/* catalog.css : all-beans catalogue - controls bar + scannable card grid. */

.num { direction: ltr; unicode-bidi: isolate; display: inline-block; }

.catalog-head { padding: var(--s-7) 0 var(--s-5); }
.catalog-head .eyebrow { color: var(--accent-ink); }
.catalog-head h1 { font-family: var(--display); font-size: var(--fs-h1); color: var(--ink); margin: 6px 0 10px; }
.catalog-head .lead { color: var(--muted); max-width: 62ch; line-height: 1.6; }

/* controls: airy two-tier bar (non-sticky) */
.cat-controls {
  background: var(--paper);
  border-block: 1px solid var(--hair);
  padding: 14px 0; margin-bottom: 8px;
  display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center;
}
.cat-search { position: relative; flex: 1 1 260px; }
.cat-sort { display: flex; align-items: center; gap: 8px; }
.cat-lbl { font-size: var(--fs-xs); font-weight: 700; color: var(--muted); white-space: nowrap; }
.cat-search input {
  width: 100%; min-height: 44px; padding: 0 42px 0 14px;
  border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--surface); color: var(--ink); font: inherit;
}
.cat-search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.cat-search svg { position: absolute; inset-inline-start: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.cat-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cat-filters select {
  min-height: 44px; padding: 0 14px; font: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill); cursor: pointer;
}
.cat-filters select:hover { border-color: var(--accent); }
.cat-filters select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.cat-filters select.active { border-color: var(--accent); background: var(--crema); color: var(--accent-ink); font-weight: 700; }
.cat-reset {
  min-height: 44px; padding: 0 12px; font: inherit; font-weight: 700; cursor: pointer;
  color: var(--muted); background: none; border: none; text-decoration: underline; text-underline-offset: 3px;
}
.cat-reset:hover { color: var(--accent-ink); }

.cat-countline { color: var(--muted); font-size: var(--fs-sm); margin: 16px 0 18px; font-weight: 600; }
.cat-countline b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* grid */
.cat-grid { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); padding-bottom: var(--s-8); }

.cat-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 20px; display: flex; flex-direction: column;
  content-visibility: auto; contain-intrinsic-size: auto 240px; /* skip layout/paint for off-screen cards */
  transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
}
/* Roles run up to 55 characters (43 of 578 beans are 20+), which a pill cannot
   hold: at 360px it wrapped to a 50px-tall box with the text running into the
   semicircular cap. Plain type, top-aligned against the roast dots. */
.cc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.cc-role { font-size: var(--fs-xs); font-weight: 700; color: var(--accent-ink);
  background: none; padding: 0; border-radius: 0; line-height: 1.4; min-width: 0; }
.cat-card h3 { font-family: var(--display); font-size: 1.12rem; font-weight: 600; line-height: 1.35; color: var(--ink); margin: 0; }
.cc-notes { color: var(--ink); font-size: var(--fs-sm); margin: 11px 0 0; line-height: 1.5; }

.cc-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 18px; }
.cc-price { display: flex; flex-direction: column; line-height: 1.1; font-weight: 800; color: var(--ink); }
.cc-price .num { font-size: 1.1rem; }
.cc-price small { font-weight: 600; color: var(--muted); font-size: var(--fs-xs); margin-top: 3px; }
.cc-buy {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  font-weight: 700; font-size: var(--fs-sm); color: #fff; background: var(--accent);
  padding: 9px 16px; min-height: 44px; border-radius: var(--r-md); text-decoration: none;
  transition: background var(--dur-1) var(--ease);
}
.cc-buy:hover { background: var(--accent-ink); color: #fff; }

/* multi-store: a price + link per store */
/* Matches the single-store footer's 44px buy-button height so the price row
   lands at the same offset on every card regardless of store count. */
.cc-foot-multi { min-height: 44px; align-items: center; margin-top: 0; }
.cc-stores { display: grid; gap: 6px; margin-top: auto; padding-top: 18px; }
.cc-store {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; min-height: 44px;
  padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--paper-2); text-decoration: none; color: var(--ink);
  transition: border-color var(--dur-1) var(--ease), background var(--dur-1) var(--ease);
}
.cc-store:hover { border-color: var(--accent); background: var(--paper); }
.ccs-name { font-weight: 700; color: var(--ink); }
.ccs-price { display: inline-flex; align-items: center; gap: 4px; color: var(--accent-ink); font-weight: 700; white-space: nowrap; }
.ccs-price .num { font-size: 1rem; }

.roastdots { display: inline-flex; gap: 3px; flex: none; margin-top: 4px; }
.roastdots i { width: var(--roast-dot); height: var(--roast-dot); border-radius: 50%; background: var(--roast-dot-off); }
.roastdots i.on { background: var(--roast-dot-on); }

.cat-empty { grid-column: 1/-1; text-align: center; color: var(--muted); padding: 48px 0; }
.cat-empty p { margin-bottom: 14px; }
.cat-empty .cat-reset { display: inline-block; margin: 0; padding: 10px 18px; background: var(--crema);
  color: var(--accent-ink); border-radius: var(--r-md); text-decoration: none; }
.cat-empty .cat-reset:hover { background: var(--accent); color: #fff; }

/* Static catalogue summary. Sits AFTER the grid so the browsing tool stays above
   the fold on mobile, while still giving crawlers real text: the 746 beans render
   client-side, so without this the page carries almost nothing to index. */
.catalog-about { max-width: 62ch; margin: var(--s-7) 0 var(--s-6); }
.catalog-about h2 { font-size: var(--fs-h3); margin: 0 0 var(--s-3); }
.catalog-about p { color: var(--muted); margin: 0 0 var(--s-3); }
.catalog-about p:last-child { margin-bottom: 0; }

@media (max-width: 600px) {
  .cat-search { flex-basis: 100%; }
  .cat-grid { grid-template-columns: 1fr; }
}
