/* =========================================================================
   merch.css - the Merch page only (loaded after theme.css).

   One card per piece in the shop: the product picture on a light square (the
   shop's pictures are shot on white), its name, and its price in gold. The
   whole card is the link. Colours come from the variables in theme.css.
   tests/style.test.mjs checks the text colours here are readable (4.5:1) and
   that the cards fit a 320px phone.
   ========================================================================= */

.merch-go {
  display: flex;
  justify-content: center;
  margin: 18px 0 0;
}

.merch-title {
  margin: 12px 0 6px;
  text-align: center;
}

.merch-status {
  max-width: 60ch;
  margin: 0 auto 22px;
  text-align: center;
  color: var(--muted);
}
.merch-status .btn { min-height: 44px; padding: 0.4em 1.1em; font-size: 1rem; }

/* As many 200px-wide columns as fit; on a phone narrower than two of those, the
   cards shrink to share the row two by two rather than overflow. */
.merch-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
  gap: 16px;
  margin: 0 0 40px;
  padding: 0;
  list-style: none;
}
@media (max-width: 460px) {
  .merch-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}

.merch-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
  min-height: 44px;
  padding: 10px 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--cream);
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.merch-card:hover,
.merch-card:focus-visible {
  border-color: var(--line-strong);
  box-shadow: var(--glow);
  transform: translateY(-2px);
}

.merch-pic {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 10px;
  background: #f4efe6;
}
.merch-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.merch-img-none {
  padding: 8px;
  text-align: center;
  font-size: 0.9rem;
  color: #4a3a33;
}

.merch-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.merch-price {
  margin-top: auto;
  font-weight: 700;
  color: var(--gold);
}
