/*
 * The product cards the home page and the pricing page share (pricing spec D3), rendered by
 * MapWise\App\Products\ProductCards. Tokens only. ProductCardsOwnershipTest keeps these rules here.
 */

/* article.: one step above mw-card, which loads after this sheet and would otherwise win the tie. */
article.platform-card {
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.platform-card__image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: top;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-ground-neutral);
}

article.platform-dev {
  gap: var(--space-3);
  padding: var(--space-6);
}

/* Apple's App Store badge at the foot of the app card, at Apple's 40px minimum height. */
.platform-card__badge {
  display: block;
  width: auto;
  height: 40px;
  margin-top: auto;
  align-self: center;
}

.platform-code {
  display: block;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-control);
  background: var(--color-header);
  color: var(--color-on-dark);
  font-family: var(--font-family-monospace);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
  overflow-wrap: anywhere;
}

.platform-code--response {
  flex-grow: 1;
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: var(--font-size-xs);
  tab-size: 2;
}

.platform-code--response code {
  font: inherit;
  color: inherit;
}

/* "Response" and its status, above the body. */
.platform-code__head {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--space-2);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--color-code-muted);
  color: var(--color-code-muted);
  font-family: var(--font-family-sans);
}

.platform-code__status {
  color: var(--color-accent-on-dark);
  font-family: var(--font-family-monospace);
  font-weight: var(--font-weight-bold);
}

.platform-code__key {
  color: var(--color-code-key);
}

.platform-code__str {
  color: var(--color-code-string);
}

.platform-code__num {
  color: var(--color-code-number);
}

/* The fields and parcels left out. */
.platform-code__more {
  color: var(--color-code-muted);
}

.platform-code__method {
  color: var(--color-accent-on-dark);
  font-weight: var(--font-weight-bold);
}

/* The AI card (spec A11): its buttons stack at full width at the foot, level with the API card's
 * link, and the clip sits centred in the height a taller API card leaves. */
.platform-dev .mw-card__actions {
  margin-top: 0;
}

.platform-dev .platform-media {
  margin-block: auto;
}

.platform-media {
  position: relative;
  z-index: var(--z-raised);
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
}

.platform-media__video {
  display: block;
  width: 100%;
  height: auto;
}

.platform-media__pause {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
}

.platform-media__caption {
  padding: var(--space-2) var(--space-3);
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
}

@media (max-width: 640px) {
  /* Every line of the API response fits a phone, so none wraps out of its indent. */
  .platform-code--response {
    padding: var(--space-3);
    font-size: var(--font-size-2xs);
    tab-size: 1;
  }
}
