/* 02 Services — three service cards side by side on wide screens, stacked on narrow ones.
   Where subgrid is supported the title, text, item list and link of each card line up across the row. */

.service-list {
  --svc-gap: clamp(32px, 4vw, 64px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: var(--svc-gap);
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}

/* every card has the same inner width: no side padding, and the dividers sit in the middle of the column gap */
.service {
  position: relative;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  align-content: start;
  padding: clamp(26px, 2.8vw, 40px) 0 clamp(30px, 3.2vw, 48px);
}
.service + .service::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--svc-gap) / -2);
  width: 1px;
  background: var(--line);
}
@supports (grid-template-rows: subgrid) {
  .service-list { grid-template-rows: auto auto 1fr auto; }
  .service { grid-row: span 4; grid-template-rows: subgrid; }
}

/* a cobalt rule along the top of the card: the feedback for the card's link (hover, keyboard focus) */
.service::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -1px;
  height: 2px;
  background: var(--cobalt);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 240ms var(--ease);
}

.service h3 {
  margin-bottom: 14px;
  font-size: clamp(1.7rem, 1.25rem + 1.1vw, 2.4rem);
  line-height: 1.05;
}
.service > p { max-width: 40ch; margin: 0 0 24px; color: var(--muted); text-wrap: pretty; } /* no lone "turnkey." or "keys." */
.lang-zh .service > p { text-wrap: balance; } /* nor "付。" / "工。" alone (1024 / 768 px) */

.service-items { align-self: start; border-top: 1px solid var(--line); }
.service-items li {
  position: relative;
  padding: 10px 0 10px 18px;
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-support, 0.9375rem);
  line-height: 1.4;
}
/* amber square bullets: the windows of the company mark */
.service-items li::before {
  content: "";
  position: absolute;
  left: 0;
  top: calc(10px + 0.7em - 3.5px);
  width: 7px;
  height: 7px;
  background: var(--amber);
}

/* the card's link: its ::after covers the whole card, so the card is the hit area with one tab stop */
.service-link { justify-self: start; margin-top: 22px; color: var(--cobalt); }
.service-link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.service-link .arrow { transition: transform 160ms var(--ease); }
.service:focus-within::before { transform: scaleX(1); }
.service:has(.service-link):active { background: rgba(var(--cobalt-rgb), 0.03); }
/* the ring goes round the card the link stands for */
.service-link:focus-visible { outline: none; }
.service:has(.service-link:focus-visible) { outline: 2px solid var(--focus); outline-offset: 6px; }

@media (hover: hover) {
  .service:has(.service-link):hover::before { transform: scaleX(1); }
  .service:hover .service-link .arrow { transform: translateX(4px); }
}

/* ---------- stacked: one card per row, the item list in two columns ---------- */
@media (max-width: 959.98px) {
  .service-list { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; border-bottom: 0; }
  .service {
    grid-row: auto;
    grid-template-rows: none;
    padding: clamp(26px, 5vw, 40px) 0 clamp(30px, 5.5vw, 44px);
    border-bottom: 1px solid var(--line-strong);
  }
  .service + .service::after { content: none; }
  .service > p { max-width: 52ch; }
  .service-items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(16px, 3vw, 28px); }
}

@media (max-width: 480px) {
  .service-items { grid-template-columns: minmax(0, 1fr); }
}
