/* 2-up "next case study" tile grid for the case study detail page (Figma
   "Desktop - 1", 1440x974 board). Sibling of case-studies' 3-up tiles.css: same visual
   language (card texture, pill CTA, headline/subline pairing) at a larger
   640x861 card size, two columns instead of three.

   Row content is 1320px (60px side pad, not the shared 1280 .container) —
   verified exact at the 1440 board: 60 + 640 + 40 gap + 640 + 60 = 1440.
   Below 1024 no board was designed; cards stack full-width, single column.

   Horizontal proportions (image/logo width) are expressed as percentages of
   the card's own padded content box, so they track the Figma ratio at any
   card width without a container-query rig. Card min-height at desktop
   reproduces Figma's fixed 861px row so the CTA settles to the bottom via
   space-between: a fixed-height Figma frame won't hug its content, so the
   wrapper carries the frame's min-height instead. */

.tiles-2up {
  background-color: var(--pure-white);
  padding-block: var(--space-40);
}

.tiles-2up__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-40);
  max-width: var(--board-max);
  margin-inline: auto;
  padding-inline: var(--container-padding);
  list-style: none;
}

.tiles-2up__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  padding: var(--space-40) var(--space-40) var(--space-60) var(--space-40);
  background-color: var(--pure-white);
  background-image: url("../../img/case-tile-bg.jpg");
  background-image: image-set(
    url("../../img/case-tile-bg-m.avif") type("image/avif"),
    url("../../img/case-tile-bg-m.webp") type("image/webp"),
    url("../../img/case-tile-bg.jpg") type("image/jpeg")
  );
  background-size: cover;
  background-position: center;
}

.tiles-2up__media {
  width: 70.3571%; /* 394 / 560 — Figma's image column */
}

/* Square canvases with cutout + overflow accents in the alpha; each renders
   at its box's tall side, centered — never object-fit (crops the accents). */
.tiles-2up__photo {
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
  aspect-ratio: 1 / 1;
}

.tiles-2up__item--hca .tiles-2up__photo {
  margin-block: -2.667%; /* box 300x284; canvas overhangs 8px top/bottom */
}

.tiles-2up__item--elephant .tiles-2up__photo {
  width: 102.333%; /* 307/300 */
  margin-inline: -1.167%;
}

.tiles-2up__item--integrity .tiles-2up__photo {
  margin-block: -1.667%;
}

.tiles-2up__item--closing-times .tiles-2up__photo {
  margin-block: -2%; /* phone overhangs the D at top/bottom */
}

.tiles-2up__body {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  flex: 1 1 auto;
  gap: 3.125rem; /* 50px — Figma's media-to-body row gap, reused as the
    body's own internal minimum before space-between takes over at desktop */
}

.tiles-2up__top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.875rem; /* 30px */
}

.tiles-2up__logo {
  display: block;
  height: auto;
}

.tiles-2up__item--hca .tiles-2up__logo {
  width: 27.1429%; /* 152 / 560 */
}

.tiles-2up__item--elephant .tiles-2up__logo {
  width: 58.9286%; /* 330 / 560 */
}

.tiles-2up__item--integrity .tiles-2up__logo {
  width: 53.5714%; /* 300 / 560 */
}

.tiles-2up__item--closing-times .tiles-2up__logo {
  width: 53.5714%; /* sized up to match the sibling tiles' logos */
}

.tiles-2up__copy {
  display: flex;
  flex-direction: column;
  gap: var(--space-10);
}

.tiles-2up__headline {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: var(--weight-heading);
  font-style: normal;
  font-size: 1.625rem; /* 26px */
  line-height: 1.2;
  color: var(--dozen-dark);
}

.tiles-2up__subline {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: var(--weight-heading);
  font-style: italic;
  font-size: 1.25rem; /* 20px */
  line-height: var(--p-leading);
  color: var(--dozen-blue);
}

.tiles-2up__cta {
  display: flex;
  width: 100%;
  /* Bottom-justified across the pair, matching the 3-up tiles. */
  margin-top: auto;
  align-items: center;
  justify-content: center;
  padding: var(--space-20) var(--space-40);
  border: 2px solid var(--dozen-blue);
  border-radius: 999px;
  background-color: transparent;
  font-family: var(--font-heading);
  font-weight: var(--weight-heading);
  font-size: 1.25rem; /* 20px */
  line-height: 1.2;
  letter-spacing: -0.035em;
  color: var(--dozen-blue);
  text-decoration: none;
  text-align: center;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.tiles-2up__cta:hover,
.tiles-2up__cta:focus-visible {
  background-color: var(--dozen-blue);
  color: var(--pure-white);
  transform: translateY(-1px);
}

@media (min-width: 1024px) {
  /* Figma frame is fixed 974 with 40px pads around 861px cards — the
     33px slack falls below the cards. */
  .tiles-2up {
    padding-block: var(--space-40);
    min-height: 974px;
  }

  .tiles-2up__list {
    flex-direction: row;
    align-items: stretch;
    padding-inline: 60px;
  }

  .tiles-2up__item {
    flex: 1 1 0;
    max-width: 640px;
  }

  .tiles-2up__card {
    height: 100%;
    min-height: 861px;
  }

  .tiles-2up__body {
    justify-content: space-between;
  }
}

/* Full-size art once the layout is desktop-wide; mobile ships 828w encodes. */
@media (min-width: 1024px) {
  .tiles-2up__card {
    background-image: image-set(
      url("../../img/case-tile-bg.avif") type("image/avif"),
      url("../../img/case-tile-bg.webp") type("image/webp"),
      url("../../img/case-tile-bg.jpg") type("image/jpeg")
    );
  }
}
