/* ==========================================================================
   DMW-Performance — Service Cards
   Minimalist grid with fixed-height media, equal card heights via CSS grid
   ========================================================================== */

.services-section {
  background-color: var(--color-bg);
  background-image: var(--grain);   /* subtle film grain over the flat bg */
}

/* ==========================================================================
   Grid — align-items: stretch ensures all cards in a row share the same height
   ========================================================================== */
.service-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-8);
  align-items: stretch;
}

@media (max-width: 640px) {
  .service-cards {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
}

/* ==========================================================================
   Card
   ========================================================================== */
.service-card {
  background-color: var(--color-surface);
  /* Transparent border holds the layout; it only becomes visible on hover so
     the resting state is calm (no generic permanent border + shadow combo). */
  border: 1px solid transparent;
  border-radius: var(--radius-xl);        /* softer container radius */
  overflow: hidden;
  box-shadow: var(--shadow-sm);           /* navy-tinted via design token */
  display: flex;
  flex-direction: column;
  height: 100%;                         /* fills grid cell → equal heights */
  position: relative;
  transition:
    transform 220ms ease,
    box-shadow 220ms ease,
    border-color 220ms ease;
}

/* Gold accent bar — wipes in from the left on hover/focus. */
.service-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-dark));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 280ms ease;
  z-index: 3;
}

.service-card:hover,
.service-card:focus-within {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-border);
}

.service-card:hover::after,
.service-card:focus-within::after {
  transform: scaleX(1);
}

/* ==========================================================================
   Media block — FIXED 200px height regardless of source image dimensions
   ========================================================================== */
.service-card__media {
  position: relative;
  height: 200px;          /* fixed: prevents unequal card heights from variable image sizes */
  flex-shrink: 0;
  overflow: hidden;
  background-color: var(--color-accent);
}

.service-card__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 400ms ease;
}

.service-card:hover .service-card__media img,
.service-card:focus-within .service-card__media img {
  transform: scale(1.06);
}


/* ==========================================================================
   Body
   ========================================================================== */
.service-card__body {
  padding: var(--space-6);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.service-card__title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-3);
  line-height: 1.2;
}

.service-card__text {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: 1.65;
  flex: 1;
  margin-bottom: var(--space-6);
}

/* ==========================================================================
   CTA link
   ========================================================================== */
.service-card__link {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-gold-ink);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--text-sm);
  text-decoration: none;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: gap 200ms ease, color 200ms ease;
  position: relative;
  z-index: 2;
}

.service-card__link::after {
  content: '';
  position: absolute;
  inset: calc(-1 * var(--space-8));   /* expand clickable area */
  z-index: 0;
}

.service-card__link .fa-arrow-right {
  transition: transform 200ms ease;
  font-size: 0.8em;
}

.service-card__link:hover,
.service-card__link:focus-visible {
  color: var(--color-primary-dark);
  gap: var(--space-3);
}

.service-card__link:hover .fa-arrow-right {
  transform: translateX(4px);
}
