/* 26 November 2026 (Luke): "make the services section the same size and style as the technology and equipment
   section". This file replaces homepage-services-grid-20261125.css (now unlinked).

   The nine services are cards built like the five technology cards (homepage-3's .tech-* rules): the same
   border, corners, shadow, hover zoom, type sizes and spacing, and from 1040px the same width and 9:10 photo,
   five across. With nine cards, the second row of four sits centred under the first five: the grid has ten
   columns and each card spans two.

   Below 1040px the technology cards become list cards with a photo strip down the side. The service cards keep
   their photo across the top instead, at 3:2, because their text, tags and link make them much taller and the
   strip came out about a third as wide as it was tall (Luke, later the same day: "on mobile the service photos
   are too thin"). Three across from 900px, two from 600px (the ninth centred) and one below.

   Each card's photo, title, text and link sit on rows it shares with the other cards in its row (CSS
   subgrid), so they line up whatever a title's length. Browsers without subgrid simply stack them in each card.

   What the services keep that the technology cards do not have: the three method tags and the link to each
   service page. The ↗ corner on the photos is gone, since the technology cards have none.

   The photos are new crops of the old service card photos (…-card-400w/600w/800w.webp, 800x804 at full size):
   they keep the band between the printed ADI logo at the top and the printed service name at the bottom, so
   no printed text shows at any card shape. */

.svc-section {
  padding-bottom: 56px;
}

.svc-section .svc-title {
  grid-column: 1 / -1;
  margin-bottom: 24px;
}

.svc-tiles {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.svc-tile {
  display: grid;
  grid-column: span 2;
  grid-row: span 4; /* photo, title, text, link: the method tags came off, 26 Nov 2026 */
  grid-template-rows: subgrid;
  row-gap: 0;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid #dfe5f1;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(22, 30, 111, 0.06), 0 14px 22px -16px rgba(22, 30, 111, 0.34);
  font-family: "Inter", sans-serif;
}

/* The sixth card starts the second row one column in, so the row of four is centred. */
.svc-tile:nth-child(6) {
  grid-column: 2 / span 2;
}

.svc-tile-media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 9 / 10;
  background: #dfe5f1;
}

.svc-tile-img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  max-width: none;
  height: 100%;
  object-fit: cover;
}

/* What each photo keeps in view. The first figure is used where the card crops the photo's sides (the 9:10
   desktop cards); the second where it crops the top and bottom (the 3:2 cards below 1040px). */
.svc-tile:nth-child(1) .svc-tile-img {
  object-position: 38% 12%;
}

.svc-tile:nth-child(2) .svc-tile-img {
  object-position: 62% 45%;
}

.svc-tile:nth-child(3) .svc-tile-img {
  object-position: 55% 40%;
}

.svc-tile:nth-child(4) .svc-tile-img {
  object-position: 62% 25%;
}

.svc-tile:nth-child(6) .svc-tile-img {
  object-position: 45% 60%;
}

.svc-tile:nth-child(8) .svc-tile-img {
  object-position: 45% 40%;
}

.svc-tile:nth-child(9) .svc-tile-img {
  object-position: 60% 45%;
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .svc-tile-img {
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .svc-tile:hover .svc-tile-img {
    transform: scale(1.04);
  }
}

/* The body box steps aside so its parts can sit on the shared rows; its padding becomes their margins. */
.svc-tile-body {
  display: contents;
}

.svc-tile-title {
  margin: 14px 16px 6px;
  font-family: "Inter", sans-serif;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: normal;
  text-align: left;
  text-wrap: balance;
  color: #161e6f;
}

.svc-tile-text {
  margin: 0 16px;
  font-size: 15px;
  line-height: 1.45;
  text-align: left;
  text-wrap: pretty;
  color: #1d2748;
}

/* The method tags, as the engineer finder's chips, a size smaller to suit the narrower card. */
.svc-tile-tags {
  display: flex;
  flex-wrap: wrap;
  align-content: start;
  gap: 5px;
  margin: 12px 16px 0;
  padding: 0;
  list-style: none;
}

.svc-tile-tags li {
  padding: 3px 8px;
  border-radius: 6px;
  background: #edf3fb;
  color: #161e6f;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.35;
}

.svc-tile-more {
  align-self: start;
  justify-self: start;
  margin: 0 16px 18px;
  padding-top: 14px;
  color: #161e6f;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  text-wrap: balance;
}

.svc-tile-more:hover {
  text-decoration-thickness: 2px;
}

.svc-tile-more:focus-visible {
  outline: 3px solid #161e6f;
  outline-offset: 3px;
  border-radius: 2px;
}

@media (max-width: 1279px) {
  .svc-tiles {
    gap: 16px;
  }

  .svc-tile-title {
    margin: 12px 12px 6px;
    font-size: 16px;
  }

  .svc-tile-text {
    margin: 0 12px;
  }

  .svc-tile-tags {
    margin: 12px 12px 0;
  }

  .svc-tile-more {
    margin: 0 12px 16px;
  }
}

/* Three across, with the photo at 3:2. */
@media (max-width: 1039px) {
  .svc-tiles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .svc-tile,
  .svc-tile:nth-child(6) {
    grid-column: auto;
  }

  .svc-tile-media {
    aspect-ratio: 3 / 2;
  }

  .svc-tile-title {
    margin: 12px 14px 4px;
  }

  .svc-tile-text {
    margin: 0 14px;
    line-height: 1.4;
  }

  .svc-tile-tags {
    margin: 10px 14px 0;
  }

  .svc-tile-more {
    margin: 0 14px 16px;
    padding-top: 12px;
  }
}

/* Two across, with the ninth card centred on its own row: four columns, each card spanning two. */
@media (max-width: 899px) {
  .svc-tiles {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .svc-tile,
  .svc-tile:nth-child(6) {
    grid-column: span 2;
  }

  .svc-tile:nth-child(9) {
    grid-column: 2 / span 2;
  }
}

@media (max-width: 768px) {
  .svc-section {
    padding-bottom: 40px;
  }

  .svc-section .svc-title {
    margin-bottom: 16px;
  }

  .svc-tiles {
    gap: 12px;
  }

  .svc-tile,
  .svc-tile:nth-child(6) {
    border-radius: 14px;
  }
}

/* One across on phones. */
@media (max-width: 599px) {
  .svc-tiles {
    grid-template-columns: minmax(0, 1fr);
  }

  .svc-tile,
  .svc-tile:nth-child(6),
  .svc-tile:nth-child(9) {
    grid-column: auto;
  }
}
