/**
 * PROGRAM-01 — Learning Runtime programme cards.
 *
 * A file of its own, not an appendix to program-discovery.css, for two reasons. It is a
 * separate surface with its own card, and — the operational one — LiteSpeed names its combined
 * stylesheet after the LIST of sources, not their contents. Editing an existing file therefore
 * leaves the combined URL unchanged, and Cloudflare keeps serving the bytes it cached under
 * that URL: measured here at age 78951s, 25825 bytes, without any of the rules below. Adding a
 * file changes the list, so the combined URL changes and the edge has to fetch it.
 */

/* ------------------------------------------- Programme cards (Learning Runtime)

   One card is one Runtime Course. It carries an image, which the Woo class card never did, so the
   media has a fixed aspect ratio and object-fit: an unconstrained featured image is what once
   stretched a whole grid row. The card's own padding moves onto the body so the image can sit
   flush to the card edge.
*/

.gec-program-program {
  padding: 0;
  overflow: hidden;
}

.gec-program-program .gec-program-course__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  padding: 18px 24px 24px;
}

/* Learning Runtime publishes square course posters whose headline text runs to the top and bottom
   edges, so a 16/9 crop would cut the course name off its own picture. The box is square, and the
   image is taken out of flow on purpose: in flow, `block-size: 100%` resolved against an
   indefinite height, fell back to the intrinsic 1254x1254, and that content height then beat the
   aspect-ratio — a ratio only holds while nothing inside the box can set the height itself. */
.gec-program-program__media {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--color-secondary-50);
}

.gec-program-program__media img {
  position: absolute;
  inset: 0;
  display: block;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
}

.gec-program-program__media--empty {
  background: linear-gradient(135deg, var(--color-secondary-50), var(--color-white));
  border-block-end: var(--border-width) var(--border-style) var(--color-border);
}

.gec-program-program .gec-program-course__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.gec-program-program .gec-program-course__meta span {
  display: inline-block;
  padding: 4px 9px;
  border-radius: 4px;
  background: var(--color-secondary-50);
  font-size: .75rem;
  color: var(--color-text-secondary);
}

.gec-program-program .gec-program-course__meta .gec-program-program__level {
  border-left: 3px solid var(--color-primary-500);
  border-radius: 0 4px 4px 0;
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
}

.gec-program-program__summary {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
  margin: 0;
  color: var(--color-text-secondary);
}

.gec-program-program__facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding-block: 12px;
  border-block: var(--border-width) var(--border-style) var(--color-border);
}

.gec-program-program__facts > div {
  min-inline-size: 0;
}

.gec-program-program__facts dt {
  margin: 0;
  font-size: .75rem;
  color: var(--color-text-secondary);
}

.gec-program-program__facts dd {
  margin: 0;
  font-weight: var(--font-weight-semibold);
}

.gec-program-program__teachers {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin: 0;
}

.gec-program-program__teachers > span {
  font-size: .75rem;
  color: var(--color-text-secondary);
}

/* The Foundation sets white-space: nowrap on every button; a teacher name may wrap. */
.gec-program-program__teachers .gec-program-course__teacher-link {
  white-space: normal;
  max-inline-size: 100%;
}

.gec-program-program .gec-program-course__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-block-start: auto;
  padding-block-start: 4px;
}

@media (max-width: 47.9375rem) {
  .gec-program-program__facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
