/* Brands.
 *
 * The logo plate is the same problem the exporter directory solved and the same
 * answer — supplied artwork with a baked white background, so a white well
 * rather than the theme's dark photographic one. It is repeated here rather
 * than shared because the two plugins are independent; if a third surface needs
 * it, it belongs in styles.css as a component.
 * See wordpress/plugin/eca-exporters/assets/exporters.css.
 */

/* SPECIFICITY: the theme styles the well as `.card-gallery .media` — two
   classes, `display: block`, dark plate — so every rule that must win names
   `.media` too, and the theme's dark-mode rule carries an attribute on :root,
   which is why both stamped themes are named. */
.brand-logo,
.card-gallery .media.brand-logo,
:root[data-theme="dark"] .card-gallery .media.brand-logo,
:root[data-theme="light"] .card-gallery .media.brand-logo {
  --brand-plate: #ffffff;

  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  aspect-ratio: 16 / 10;
  /* Tighter than the exporter plate on purpose: a brand mark is the card's
     subject, not a credential beside a company name, so it is allowed to fill
     more of the well. */
  padding: var(--space-4) var(--space-5);
  background: var(--brand-plate);
  border-bottom: 1px solid var(--color-divider);
}

.brand-logo img,
.card-gallery .media.brand-logo img {
  display: block;
  max-width: 100%;
  /* A tall, narrow mark would otherwise draw at a fraction of a wide one and
     the row would read as inconsistent rather than as nine different brands. */
  max-height: 84%;
  width: auto;
  height: auto;
  margin: auto;
  object-fit: contain;
}

.brand-logo-lg {
  aspect-ratio: 16 / 10;
  width: clamp(9rem, 22vw, 13rem);
  height: auto;
  flex: none;
  padding: var(--space-4);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
}

.brand-logo-lg img {
  max-height: 100%;
}

/* ── card ─────────────────────────────────────────────────────── */

.brand-card .brand-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5);
}

.brand-card .card-title {
  font-size: var(--text-lg);
  line-height: var(--leading-heading);
}

.brand-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.brand-card .card-meta {
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
}

/* ── record ───────────────────────────────────────────────────── */

.brand-head {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  flex-wrap: wrap;
}

.brand-group h2 {
  font-size: var(--text-xl);
}

.brand-record {
  display: flex;
  flex-direction: column;
  margin: 0;
  max-width: 54rem;
  border-top: 1px solid var(--color-divider);
}

.brand-row {
  display: grid;
  grid-template-columns: minmax(9rem, 14rem) 1fr;
  gap: var(--space-4);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-divider);
}

.brand-row dt {
  margin: 0;
  font-weight: var(--weight-semibold);
}

.brand-row dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.brand-note {
  padding: var(--space-4) var(--space-5);
  background: var(--color-surface);
  border-left: 2px solid var(--color-accent);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

@media (max-width: 40rem) {
  .brand-row {
    grid-template-columns: 1fr;
    gap: var(--space-1);
  }
}

/* ── the shop grid ────────────────────────────────────────────────
 * A brand's packed products, laid out the way a storefront lays them out, so
 * a reader understands what is coming without anything pretending to be
 * buyable. There are no prices: nothing is for sale here yet, and a figure on
 * this domain reads as a published price whatever the styling says.
 */

.brand-shop {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: var(--space-4);
}

.brand-item {
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/* Product shots get the same white well as the marks, and for the same reason:
   a pack shot is supplied artwork, usually cut out on white. */
.brand-item .shot {
  --brand-plate: #ffffff;

  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  padding: var(--space-4);
  background: var(--brand-plate);
  border-bottom: 1px solid var(--color-divider);
}

.brand-item .shot img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  margin: auto;
  object-fit: contain;
}

/* No photograph is drawn as the system's striped placeholder, captioned for
   what it is. A brand's shelf is not invented to fill a grid. */
.brand-item .photo {
  border-radius: 0;
}

.brand-item .meta {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-4) var(--space-4);
  flex: 1;
}

.brand-item .name {
  font-weight: var(--weight-semibold);
  line-height: var(--leading-heading);
}

.brand-item .spec {
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
}

.brand-item .soon {
  margin-top: auto;
  padding-top: var(--space-2);
  color: var(--color-text-secondary);
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* A shot the brand publishes only as a marketing composite — bag plus props
   plus baked-in copy — is shown as found and said to be so, rather than
   cropped into something the brand never released. */
.brand-item.is-lifestyle .shot {
  padding: 0;
}

.brand-item.is-lifestyle .shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
