/* Onyoda product card — shared by the archive grid and any future product
   loop. Scoped under .ony-tile so it can't leak into other blocks. */

/* Alias the Shopify font-family variable names (used by the ported rules
   below) onto the WordPress theme.json font tokens, so the card keeps
   Cormorant Garamond titles + Hanken Grotesk body without editing each rule. */
:root {
  --font-heading-family: var(--wp--preset--font-family--heading);
  --font-body-family: var(--wp--preset--font-family--body);
}

.ony-tile {
  display: block;
  text-decoration: none;
  color: inherit;
}

.ony-tile__media {
  position: relative;
  height: var(--ony-tile-height, 440px);
  background: #EDE4D7;
  overflow: hidden;
}

.ony-tile__badge {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 1;
  background: #F5F0EA;
  color: #7E4903;
  font-family: var(--font-body-family);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 6px 11px;
}

.ony-tile__media img,
.ony-tile__placeholder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 1100ms cubic-bezier(0.16, 1, 0.3, 1);
}

.ony-tile:hover .ony-tile__media img,
.ony-tile:hover .ony-tile__placeholder {
  transform: scale(1.05);
}

/* WooCommerce ships `.woocommerce img { height: auto }` (specificity 0,1,1),
   which ties `.ony-tile__media img` and only loses by stylesheet load order.
   This higher-specificity rule (0,2,1) makes the WooCommerce product image
   always fill the fixed tile height and crop via object-fit, so cards keep a
   uniform 480px media height instead of pushing their natural image height. */
.ony-tile .ony-tile__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.ony-tile__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}

.ony-tile__placeholder span {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(126, 73, 3, 0.34);
}

.ony-tile__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 20px 2px 0;
}

.ony-tile__title {
  font-family: var(--font-heading-family);
  font-weight: 400;
  font-size: 24px;
  line-height: 1.15;
  color: #7E4903;
}

.ony-tile__price {
  font-family: var(--font-body-family);
  font-size: 14px;
  letter-spacing: 0.02em;
  color: #2A1D0E;
  white-space: nowrap;
}

.ony-tile__category {
  margin: 4px 0 0;
  font-family: var(--font-body-family);
  font-weight: 300;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: #8a7a6a;
}

@media (max-width: 749px) {
  /* Direct override (not via var) so a section's inline --ony-tile-height
     can't beat this on mobile. */
  .ony-tile__media { height: 360px; }
  .ony-tile__title { font-size: 22px; }
}
