/* Services hub (services.html) and the four category pages (services-*.html) that its tiles open.
   All run on main.svp.svh: section shell and heading row from service-page.css, testimonials from
   service-sections.css, closing panel is the site's .cta. This file adds the hub's category tiles, the
   category pages' service cards. The Why PinnacleQM band is the About page's .abx-stats (about-page.css). Tokens from pin.css; motion is hover and
   focus only. Responsive rules sit directly after the base rules they change (see README, CSS ordering). */

/* ---------- category tiles: a 7/5 over 5/7 bento of full-bleed photos ---------- */

.svh-tiles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--s-3);
}

.svh-tile {
  grid-column: span 7;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 480px;
  padding: clamp(24px, 3vw, 40px);
  border-radius: var(--r-panel);
  background: var(--navy);
  color: var(--on-navy);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

/* The diagonal: wide, narrow, then narrow, wide. */
.svh-tile:nth-child(2),
.svh-tile:nth-child(3) {
  grid-column: span 5;
}

.svh-tile__img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--svp-slow);
}

/* A light shade behind the arrow button at the top; navy builds under the copy at the bottom. */
.svh-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to bottom, rgba(0, 24, 69, 0.6) 0%, rgba(0, 24, 69, 0) 30%),
    linear-gradient(to top, rgba(0, 24, 69, 0.97) 0%, rgba(0, 24, 69, 0.86) 36%, rgba(0, 24, 69, 0.3) 68%, rgba(0, 24, 69, 0.12) 100%);
}

.svh-tile__top {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--s-2);
  margin-bottom: auto;
  padding-bottom: var(--s-4);
}

.svh-tile h3 {
  margin: 0;
  max-width: 18ch;
  font-family: var(--ff-head);
  font-size: clamp(1.5rem, 1.1rem + 1.2vw, 2.125rem);
  line-height: 1.12;
  letter-spacing: -0.025em;
  font-weight: 700;
  color: var(--on-navy);
}

/* One link per tile, stretched over the whole tile. */
.svh-tile__link {
  color: inherit;
  text-decoration: none;
}

.svh-tile__link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.svh-tile__link:focus-visible {
  outline: none;
}

.svh-tile:has(.svh-tile__link:focus-visible) {
  outline: 3px solid var(--magenta);
  outline-offset: 4px;
}

.svh-tile p {
  margin: 12px 0 0;
  max-width: 46ch;
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--on-navy-mut);
}

.svh-tile__go {
  flex: none;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: var(--white);
  color: var(--navy);
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.svh-tile__go svg {
  width: 22px;
  height: 22px;
}

@media (hover: hover) and (pointer: fine) {
  .svh-tile:hover {
    transform: translateY(-4px);
    box-shadow: var(--svp-shadow-lg);
  }
  .svh-tile:hover .svh-tile__img {
    transform: scale(1.05);
  }
  .svh-tile:hover .svh-tile__go {
    background: var(--magenta);
    color: var(--white);
    transform: rotate(45deg);
  }
}

@media (max-width: 1100px) {
  .svh-tile,
  .svh-tile:nth-child(2),
  .svh-tile:nth-child(3) {
    grid-column: span 6;
  }
}

@media (max-width: 760px) {
  .svh-tiles {
    gap: var(--s-2);
  }
  .svh-tile,
  .svh-tile:nth-child(2),
  .svh-tile:nth-child(3) {
    grid-column: 1 / -1;
    min-height: 440px;
    padding: 24px 22px;
    border-radius: var(--r-tile);
  }
  .svh-tile__go {
    width: 48px;
    height: 48px;
  }
}

/* ---------- category pages: one image card per service ---------- */

.svh-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-3);
}

/* Whole card is the link: photo on top, then title and arrow on one line, one line of description. */
.svh-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border-radius: var(--r-tile);
  border: 1px solid var(--tint-12);
  background: var(--white);
  color: var(--ink);
  text-decoration: none;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.svh-link__img {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--navy);
}

.svh-link__img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--svp-slow);
}

.svh-link__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20px;
  align-content: start;
  gap: 8px 16px;
  padding: 22px 24px 26px;
}

.svh-link__t {
  font-family: var(--ff-head);
  font-size: var(--fs-title-m);
  line-height: 1.22;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.svh-link__arw {
  width: 20px;
  height: 20px;
  margin-top: 3px;
  color: var(--accent-text);
  transition: transform var(--dur) var(--ease);
}

.svh-link__d {
  grid-column: 1 / -1;
  font-size: var(--fs-card);
  line-height: 1.6;
  color: var(--ink-soft);
}

@media (hover: hover) and (pointer: fine) {
  .svh-link:hover {
    transform: translateY(-4px);
    border-color: var(--tint-24);
    box-shadow: var(--svp-shadow);
  }
  .svh-link:hover .svh-link__img img {
    transform: scale(1.05);
  }
  .svh-link:hover .svh-link__arw {
    transform: translateX(4px);
  }
}

@media (max-width: 1100px) {
  .svh-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .svh-links {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s-2);
  }
  .svh-link__body {
    padding: 18px 20px 22px;
  }
}

/* ---------- closing panel ---------- */

.svh .cta__copy .svp-label {
  margin-bottom: var(--s-2);
}

/* .cta's own breakpoint is one of the dead rules listed in the README, so it is restated here. */
@media (max-width: 820px) {
  .svh .cta {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- Delivery Models page: the models as a progression (client feedback 2026-10) ----------
   template-parts/service/listing-page.php with 'flow' => true. Numbered stages on one connector line,
   each a card (image, "who leads" line, title, text), then a scale bar from the page's two labels.
   Hover/focus: the card lifts, its image zooms, its number fills navy and the arrow moves. */
.dmflow {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s-3);
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: none;
}

/* Connector line through the number badges. */
.dmflow::before {
  content: "";
  position: absolute;
  top: 21px;
  left: 22px;
  right: 22px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--sky) 0%, var(--blue) 55%, var(--magenta) 100%);
  opacity: 0.55;
}

.dmflow__step {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  min-width: 0;
}

.dmflow__no {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--tint-24);
  background: var(--white);
  font-family: var(--ff-head);
  font-size: var(--fs-small);
  font-weight: 700;
  color: var(--navy);
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.dmflow__card {
  display: flex;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--tint-12);
  border-radius: var(--r-tile);
  background: var(--white);
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(0, 32, 96, 0.04);
  transition: transform 320ms var(--ease), box-shadow 320ms var(--ease), border-color 320ms var(--ease);
}

.dmflow__img {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--tint-08);
}

.dmflow__img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms var(--ease);
}

.dmflow__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 22px 24px;
}

.dmflow__role {
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--accent-text);
}

.dmflow__t {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  font-family: var(--ff-head);
  font-size: var(--fs-title-m);
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
}

.dmflow__arw {
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--tint-40);
  transition: transform var(--dur) var(--ease), color var(--dur) var(--ease);
}

.dmflow__d {
  font-size: var(--fs-card);
  line-height: 1.6;
  color: var(--ink-soft);
}

.dmflow__step:hover .dmflow__no,
.dmflow__step:focus-within .dmflow__no {
  border-color: var(--navy);
  background: var(--navy);
  color: var(--white);
}

.dmflow__card:hover,
.dmflow__card:focus-visible {
  transform: translateY(-4px);
  border-color: var(--tint-24);
  box-shadow: 0 22px 40px -24px rgba(0, 32, 96, 0.45);
}

.dmflow__card:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.dmflow__card:hover .dmflow__img img,
.dmflow__card:focus-visible .dmflow__img img {
  transform: scale(1.05);
}

.dmflow__card:hover .dmflow__arw,
.dmflow__card:focus-visible .dmflow__arw {
  transform: translateX(4px);
  color: var(--magenta);
}

/* Scale bar: who leads, from the first model to the last. */
.dmflow__scale {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--s-2);
  align-items: center;
  margin-top: var(--s-4);
  font-size: var(--fs-small);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.dmflow__bar {
  position: relative;
  height: 6px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--tint-24) 0%, var(--blue) 60%, var(--magenta) 100%);
}

/* Arrow head at the "we own" end. */
.dmflow__bar::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -2px;
  width: 12px;
  height: 12px;
  border-top: 3px solid var(--magenta);
  border-right: 3px solid var(--magenta);
  transform: translateY(-50%) rotate(45deg);
}

@media (max-width: 1100px) {
  .dmflow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: var(--s-4);
  }
  .dmflow::before {
    display: none;
  }
}

@media (max-width: 560px) {
  .dmflow {
    grid-template-columns: minmax(0, 1fr);
  }
  .dmflow__scale {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }
  .dmflow__scale > span:last-child {
    text-align: right;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dmflow__card,
  .dmflow__img img,
  .dmflow__arw {
    transition: none;
  }
  .dmflow__card:hover,
  .dmflow__card:focus-visible,
  .dmflow__card:hover .dmflow__img img,
  .dmflow__card:hover .dmflow__arw {
    transform: none;
  }
}
