/* ==========================================================================
   Services Section
   Block: .services / .services-section
   --------------------------------------------------------------------------
   A grid built for three cards. It does not pretend it could hold eleven.
   ========================================================================== */

.services-section {
  background-color: var(--color-background);
}

.services-section--soft {
  background-color: var(--color-background-sunken);
}

.services-section--dark {
  background-image: var(--gradient-ink);
}

/* ------------------------------------------------------------------ Grid */

.service-grid {
  display: grid;
  gap: var(--space-medium);
}

@media (width >= 52rem) {
  .service-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .service-grid--two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .service-grid--three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ------------------------------------------------------------------ Card */

/* No `position: relative` here on purpose. The card used to carry a covering
   pseudo-element that made the whole surface one link; only the button at the
   foot of the card is clickable now, so there is nothing to position against. */
.service-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: var(--color-background-raised);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-large);
  transition:
    transform var(--duration-base) var(--easing-out),
    box-shadow var(--duration-base) var(--easing-out),
    border-color var(--duration-base) var(--easing-out);
}

.service-card:hover,
.service-card:focus-within {
  transform: translateY(-3px);
  border-color: var(--color-border);
  box-shadow: var(--shadow-medium);
}

/* The ratio is declared so the space is reserved before the image decodes,
   which keeps the cards below from jumping. */
.service-card__illustration {
  aspect-ratio: 16 / 9;
  width: 100%;
  object-fit: cover;
  background-color: var(--color-slate-100);
  border-block-end: 1px solid var(--color-border-subtle);
}

.service-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--space-2x-small);
  padding: var(--space-medium);
}

.service-card__title {
  font-size: var(--font-size-heading-4);
}

/* The title is plain text. Only the button at the foot of the card navigates,
   so a pointer over the card body does nothing and reads as nothing. */

.service-card__text {
  color: var(--color-text-muted);
}

.service-card__list {
  display: grid;
  gap: var(--space-3x-small);
  margin-block-start: var(--space-2x-small);
  font-size: var(--font-size-small);
  color: var(--color-text-subtle);
  list-style: none;
}

.service-card__list li {
  position: relative;
  padding-inline-start: 1.125rem;
}

.service-card__list li::before {
  content: "";
  position: absolute;
  inset-block-start: 0.5rem;
  inset-inline-start: 0;
  width: 0.375rem;
  height: 0.375rem;
  background-color: var(--color-accent);
  border-radius: 50%;
}

/* The only control on the card. Pushed to the bottom with auto margin, so a
   row of cards with different amounts of copy still lines its buttons up. */
.service-card__footer {
  margin-block-start: auto;
  padding-block-start: var(--space-medium);
}

/* Full width inside the card's padding: a button that stops short of the edge
   on a card this narrow reads as floating rather than as the card's action. */
.service-card__action {
  width: 100%;
}

/* The link under the grid. It can be a text link or any of the buttons, and
   it can sit left, centred or right. */
.section-footer-link--center {
  text-align: center;
}

.section-footer-link--end {
  text-align: right;
}

.service-card__text > :first-child {
  margin-block-start: 0;
}

.service-card__text > :last-child {
  margin-block-end: 0;
}
