/* ============================================================
   AXIS WEBPRO | components/service-cards.css
   Shared service-card grid + card pattern. Used on home and
   services-hub. Lifted out of pages/home.css at the 2026-05-20
   service-card-fix pass so all pages emitting .services-grid +
   .service-card get the same styling regardless of which page
   CSS file is loaded.

   Markup contract (emitted by axis_render_section_service_cards):
     <div class="services-grid">
       <article class="card service-card reveal">
         <picture>...</picture>          (image, 16:9 aspect, no border-radius on inner)
         <div class="service-card-body">
           <h3><a>Title</a></h3>
           <p>Description</p>
           <div class="card-cta"><a class="btn btn-ghost">CTA</a></div>
         </div>
       </article>
       ...
     </div>

   References tokens.css. Zero hardcoded hex except the 8%-alpha
   border value (kept as rgba literal since color-mix on alpha
   requires a token we don't have for that exact opacity).
   ============================================================ */

/* Responsive grid:
   - mobile (<48em):   1 column
   - tablet (>=48em):  2 columns
   - desktop (>=64em): 4 columns
   Gap tightens at the 4-up breakpoint so card width stays usable. */
.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
}

@media (min-width: 48em) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-5);
  }
}

@media (min-width: 64em) {
  .services-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-4);
  }
}

.service-card {
  display: flex;
  flex-direction: column;
  background: var(--color-base);
  border-radius: var(--radius-md);
  border: 1px solid rgba(12, 31, 63, 0.08);
  box-shadow: var(--shadow-2);
  overflow: hidden;
  transition:
    transform var(--motion-duration-base) var(--motion-easing),
    box-shadow var(--motion-duration-base) var(--motion-easing),
    border-color var(--motion-duration-base) var(--motion-easing);
}

@media (hover: hover) {
  .service-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-4);
    border-color: var(--color-accent);
  }
}

/* Image area, 16:9 aspect, fills card top, no internal radius. */
.service-card picture {
  display: block;
  inline-size: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  margin: 0;
  border-radius: 0;
}

.service-card picture img {
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  display: block;
  border-radius: 0;
  margin: 0;
}

/* Card body. Flex column so the CTA can sit at the bottom edge. */
.service-card-body {
  padding: var(--space-5) var(--space-5) var(--space-6);
  display: flex;
  flex-direction: column;
  flex: 1;
}

.service-card h3 {
  font-size: var(--fs-h3);
  margin-block-end: var(--space-3);
}

.service-card h3 a {
  color: inherit;
  text-decoration: none;
}

@media (hover: hover) {
  .service-card h3 a:hover {
    color: var(--color-accent);
  }
}

.service-card p {
  font-size: var(--fs-body);
  color: var(--color-text-muted);
  flex-grow: 1;
}

.service-card .card-cta {
  margin-block-start: var(--space-4);
}

/* The "See the X service" link uses .btn .btn-ghost. Override the
   global .btn-ghost (which targets the secondary CTA color) to the
   accent orange and strip the underline. */
.service-card .card-cta .btn-ghost {
  color: var(--color-accent);
  font-weight: var(--fw-bold);
  padding-inline: 0;
  background: transparent;
  border: none;
  text-decoration: none;
}

@media (hover: hover) {
  .service-card .card-cta .btn-ghost:hover {
    text-decoration: underline;
    text-underline-offset: 0.25em;
  }
}

/* ----------------------------------------
   4-UP DESKTOP | tighten card internals
   At ~250px card width inside a 1200px container, the h3 + body
   padding from the wider layouts overflows. Selectors below match
   the actual emitted markup (h3, p, .card-cta inside .service-card-body)
   not the BEM forms in the original spec.
   ---------------------------------------- */
@media (min-width: 64em) {
  .service-card-body {
    padding: var(--space-4);
  }

  .service-card h3 {
    font-size: var(--fs-h4);
    margin-block-end: var(--space-3);
  }

  .service-card p {
    font-size: var(--fs-small);
    line-height: var(--lh-body);
  }

  .service-card .card-cta {
    margin-block-start: var(--space-3);
  }

  .service-card .card-cta .btn-ghost {
    font-size: var(--fs-small);
  }
}
