/* ==========================================================================
   CESURNES — Collection (template-collection.php)
   The page came as a static export styled entirely inline; every declaration
   below is one of those inline styles moved onto a class, so the rendering is
   unchanged. Loaded only on this page, after page-hero.css and
   closing-band.css (the hero and closing band use their shared defaults).
   Classes are "catalog-*": ".product" and ".piece" belong to the home page.
   ========================================================================== */

/* The export gives every link on this page a terracotta hover. :where() keeps
   it at the export's a:hover weight, so the .btn hover colours still win. */
:where(.page-collection) a:hover { color: var(--c-terracota); }

/* ================================================================== pieces */
.catalog {
  padding: clamp(56px, 8vw, 120px) 0 clamp(72px, 10vw, 160px);
  background: var(--c-white);
  color: var(--c-black);
}

.catalog__inner {
  display: flex;
  flex-direction: column;
  gap: clamp(40px, 5vw, 72px);
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* -- category tabs and count ------------------------------------------ */
.catalog__bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px 40px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--c-black);
}

.catalog__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 32px;
}

.catalog__tab {
  padding: 4px 0;
  font-size: clamp(18px, 1.6vw, 24px);
  line-height: 1.1;
  font-weight: 300;
  text-transform: uppercase;
  color: var(--c-black);
  cursor: pointer;
}

.catalog__tab[aria-pressed="true"] { color: var(--c-terracota); }

.catalog__count {
  font-size: 14px;
  line-height: 16px;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--c-muted);
}

/* -- grid ------------------------------------------------------------- */
.catalog__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: clamp(40px, 4vw, 64px) 21px;
}

/* ==================================================================== card */
.catalog-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Filtered out by collection.js; [hidden] alone loses to display: flex. */
.catalog-card[hidden] { display: none; }

/* The card opens the piece's page: its name's link covers it, the quantity
   and "Commander" above it (inc/piece.php). */
.catalog-card { position: relative; }

.catalog-card__link::after {
  content: "";
  position: absolute;
  inset: 0;
}

.catalog-card__actions {
  position: relative;
  z-index: 1;
}

.catalog-card__media {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #f2efea;
}

.catalog-card__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.catalog-card__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--c-black);
}

.catalog-card__name {
  font-size: clamp(18px, 1.5vw, 22px);
  line-height: 1.1;
  font-weight: 300;
  text-transform: uppercase;
}

.catalog-card__price {
  font-size: 15px;
  line-height: 1;
  font-weight: 400;
  white-space: nowrap;
}

.catalog-card__material {
  font-size: 13px;
  line-height: 16px;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--c-terracota);
}

.catalog-card__details {
  font-size: 15px;
  line-height: 1.5;
  font-weight: 300;
  color: var(--c-muted);
}

/* -- quantity + buy --------------------------------------------------- */
.catalog-card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 10px;
  margin-top: 6px;
}

.catalog-qty {
  display: flex;
  align-items: center;
  height: 48px;
  border: 1px solid var(--c-black);
}

.catalog-qty__btn {
  width: 44px;
  height: 100%;
  font-size: 18px;
  font-weight: 300;
  cursor: pointer;
}

.catalog-qty__value {
  min-width: 28px;
  font-size: 15px;
  font-weight: 400;
  text-align: center;
}

.catalog-card__buy {
  flex: 1 1 140px;
  height: 48px;
}
