/* --------- Solution card block (blocks/solution-card) --------- */

/* Fills its column, so cards in a row match in height. The ribbon is cut to
   the card's own box at 1440, so pinned to the top-right corner at the
   card's full height it sits where the mockup draws it; a wider card only
   shows more navy on the left. */
.solution-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  height: 100%;
  min-height: clamp(220px, 14.84vw + 164.4px, 378px);
  padding: clamp(24px, 1.78vw + 17.3px, 43px);
  border-radius: clamp(24px, 0.75vw + 21.6px, 36px);
  background-color: var(--wp--preset--color--primary);
  color: var(--wp--preset--color--base);
}

.solution-card-ribbon {
  position: absolute;
  top: 0;
  right: 0;
  z-index: -1;
  width: auto;
  max-width: none;
  height: 100%;
  pointer-events: none;
  user-select: none;
}

.solution-card-icon {
  display: block;
  flex: none;
  width: 58px;
  height: 46px;
  background-color: var(--wp--preset--color--secondary);
  mask: var(--card-icon) no-repeat left center / contain;
  -webkit-mask: var(--card-icon) no-repeat left center / contain;
}

.solution-card-body {
  margin-top: auto;
  padding-top: var(--wp--preset--spacing--60);
}

.solution-card .solution-card-title {
  margin: 0;
  color: inherit;
  font-size: var(--wp--preset--font-size--xl);
  font-weight: 500;
  line-height: 1.2;
}

.solution-card .solution-card-text {
  max-width: 30rem;
  margin: var(--wp--preset--spacing--50) 0 0;
}

.solution-card-title a {
  color: inherit;
  text-decoration: none;
}

/* The title's link covers the whole card. */
.solution-card-title a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.solution-card-title a:focus-visible {
  outline: none;
}

.solution-card:has(.solution-card-title a:focus-visible) {
  outline: 2px solid var(--wp--preset--color--secondary);
  outline-offset: 2px;
}

@media (hover: hover) {
  .solution-card:has(.solution-card-title a):hover .solution-card-title {
    color: var(--wp--preset--color--secondary);
  }
}

/* --------- The four cards on the home page (patterns/solution-cards.php) --------- */

/* A Group with the class solution-grid. On a desktop two rows whose wide
   card swaps sides (44% and 56%); up to tablet width a mosaic, as the mobile
   mockup draws it: the first card across the top, the third and second
   stacked on the left, the fourth down the whole right side. */
.solution-grid {
  display: grid;
  grid-template-columns: 44fr 12fr 44fr;
  gap: var(--wp--preset--spacing--30);
}

/* The grid stretches the cards to their row; height: 100% would not. Two
   classes, to outrank core's flow-layout margin (:root :where(…) > *). */
.solution-grid > .wp-block-e88-solution-card {
  height: auto;
  margin: 0;
}

.solution-grid > :nth-child(1) {
  grid-column: 1;
}

.solution-grid > :nth-child(2) {
  grid-column: 2 / 4;
}

.solution-grid > :nth-child(3) {
  grid-column: 1 / 3;
}

.solution-grid > :nth-child(4) {
  grid-column: 3;
}

@media (max-width: 781px) {
  .solution-grid {
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: minmax(clamp(160px, 25vw + 70px, 260px), auto);
  }

  .solution-grid > :nth-child(1) {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .solution-grid > :nth-child(2) {
    grid-column: 1;
    grid-row: 3;
  }

  .solution-grid > :nth-child(3) {
    grid-column: 1;
    grid-row: 2;
  }

  .solution-grid > :nth-child(4) {
    grid-column: 2;
    grid-row: 2 / 4;
  }

  .solution-grid .solution-card {
    min-height: 0;
  }
}

/* A phone has room for the titles only, and smaller. */
@media (max-width: 599px) {
  .solution-grid .solution-card-title {
    font-size: var(--wp--preset--font-size--large);
  }

  .solution-grid .solution-card-text {
    display: none;
  }

  .solution-grid .solution-card-body {
    padding-top: var(--wp--preset--spacing--40);
  }
}
