/*
 * The films page, as the same card the site shows on /educational-resources/.
 *
 * Somebody arrives here straight off that page by pressing "Buy a licence", so this
 * grid is the first thing they see after leaving it. It now holds the site's card:
 * white on paper, soft shadow, the still at 16:10, the price in teal and a pill to
 * press. The mint block with the small capitals and the arrow has gone.
 *
 * Its own file rather than part of app.min.css, which is gulp output: the deploy runs
 * collectstatic but not gulp, so touching the bundle would mean committing a built
 * file. This ships as itself, the same way the licence dashboard's stylesheet does.
 * The shared tokens and type live in sfd-brand.css, which every page loads.
 *
 * Every rule is scoped under the page's own body class. That is what lets it beat the
 * single class rules already in the bundle on ordinary specificity, with no
 * !important anywhere, and it keeps all of this off every other page.
 */

.products .products__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: clamp(20px, 2.5vw, 32px);
  margin-top: clamp(28px, 3.5vw, 44px);
  padding: 0;
  list-style: none;
}

.products .products__item {
  position: relative;
  margin-top: 0;
  width: auto;
}

/* The whole card is the link, so it is one tab stop and the hit area is the card. */
.products .products__anchor {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  height: 100%;
  padding: 0;
  overflow: hidden;
  background-color: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease;
}

.products .products__anchor:hover,
.products .products__anchor:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 2px 4px rgb(20 22 28 / .06), 0 16px 36px rgb(20 22 28 / .14);
  text-decoration: none;
}

/* 16:10 because the stills are 6000x3745, so the card crops nothing off them. */
.products .products__image_container {
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
  max-width: none;
  max-height: none;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background-color: #111;
}

.products .products__image {
  display: block;
  margin: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  box-shadow: none;
  transition: transform .5s ease;
}

.products .products__anchor:hover .products__image { transform: scale(1.04); }

.products .products__details {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 20px 22px 0;
}

/* The subject, as the site writes it: a quiet line above the title in sentence
   case, not a small-capitals label. The bundle gives this margin-bottom:auto,
   which in a flex column shoves the rest of the card to the floor. */
.products .products__category {
  margin: 0 0 .5em;
  font-size: .9rem;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: normal;
  text-transform: none;
  color: var(--muted);
}

.products .products__heading {
  margin: 0 0 .35em;
  font-size: 1.45rem;
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -.022em;
  color: var(--heading);
}

/* Takes up the slack, so the price and the button line up across a row however long
   the title and the summary run. */
.products .products__summary {
  flex: 1 1 auto;
  margin: 0 0 1em;
  color: var(--ink);
}

.products .products__price {
  display: block;
  margin: 0 0 .9em;
  font: 600 1.05rem/1.3 var(--display);
  color: var(--brand);
}

/* The bundle sets a small yellow square in front of the price. The site writes
   the price as plain teal text, so the square goes. */
.products .products__price::before { content: none; }

/* The pill, built out of the span the template already has. */
.products .products__call_to_action {
  position: static;
  flex: 0 0 auto;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin: 0 22px 24px;
  padding: .55em 1.35em;
  background: var(--brand);
  border: 2px solid var(--brand);
  border-radius: 999px;
  color: var(--on-brand);
  font: 600 .95rem/1.2 var(--display);
  text-transform: none;
  letter-spacing: normal;
  transition: background .15s, border-color .15s;
}

.products .products__anchor:hover .products__call_to_action,
.products .products__anchor:focus-visible .products__call_to_action {
  background: var(--brand-deep);
  border-color: var(--brand-deep);
}

/* The site's buttons carry no arrow, and the card is already a link. */
.products .products__call_to_action svg { display: none; }
