/* ==========================================================================
   Maniro — Services Section
   ========================================================================== */

.services {
  padding-block: 100px;
  background: var(--color-bg-subtle);
  border-top: 1px solid var(--color-border);
}

.services-header {
  max-width: 620px;
  margin: 0 auto 56px;
  text-align: center;
}

.services-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--color-sky-dark);
}

[data-theme="dark"] .services-eyebrow {
  color: var(--color-sky);
}

.services-eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-sky);
}

.services-title {
  margin: 0 0 16px;
  font-size: clamp(30px, 3.6vw, 42px);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: normal;
  color: var(--color-text);
}

.services-subtitle {
  margin: 0 auto;
  font-size: 16px;
  line-height: 1.75;
  color: var(--color-text-muted);
}

/* --- Infinity slider --- */
.services-slider {
  --services-gap: 24px;
  position: relative;
  overflow: hidden;
  /* Slack so card hover-lift/shadow isn't clipped by overflow: hidden;
     the negative margin cancels the extra padding out of normal flow. */
  padding-block: 12px;
  margin-block: -12px;
  /* Soft fade at both edges so cards entering/leaving the viewport don't
     look like they're being cut off by a hard edge. */
  -webkit-mask-image: linear-gradient(
    to right,
    transparent,
    #000 48px,
    #000 calc(100% - 48px),
    transparent
  );
  mask-image: linear-gradient(
    to right,
    transparent,
    #000 48px,
    #000 calc(100% - 48px),
    transparent
  );
}

.services-track {
  display: flex;
  align-items: stretch;
  gap: var(--services-gap);
  width: max-content;
  will-change: transform;
}

/* Fallback for prefers-reduced-motion (JS bails out before duplicating
   cards and adds this class instead of animating). Wraps back into a
   static grid-like layout — no transform, no infinite loop. */
.services-track.is-static {
  flex-wrap: wrap;
  width: 100%;
  transform: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .services-track {
    flex-wrap: wrap;
    width: 100%;
    transform: none !important;
  }
}

.service-card {
  display: flex;
  flex-direction: column;
  flex: 0 0
    calc((100% - (var(--services-gap) * 2)) / 3);
  height: auto;
  padding: 32px 28px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease),
    box-shadow 0.25s var(--ease);
}

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

.service-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-bottom: 20px;
  border-radius: var(--radius-sm);
  background: var(--color-sky-tint);
  color: var(--color-sky-dark);
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease);
}

[data-theme="dark"] .service-icon {
  color: var(--color-sky);
}

.service-card:hover .service-icon {
  background: var(--color-sky);
  color: #ffffff;
}

.service-icon img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  transition: filter 0.25s var(--ease);
}

/* Uploaded icon set ships as solid-black glyphs on transparent PNG —
   recolor via filter instead of currentColor */
[data-theme="dark"] .service-icon img {
  filter: invert(1);
}

.service-card:hover .service-icon img {
  filter: brightness(0) invert(1);
}

.service-title {
  margin: 0 0 10px;
  font-size: 17px;
  font-weight: 600;
  color: var(--color-text);
}

.service-text {
  margin: 0 0 24px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--color-text-muted);
  flex-grow: 1;
}

.service-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  transition: gap 0.2s var(--ease), color 0.2s var(--ease);
}

.service-link svg {
  transition: transform 0.2s var(--ease);
}

/* RTL: arrow points toward reading direction on hover */
.service-card:hover .service-link {
  color: var(--color-sky-dark);
  gap: 10px;
}

[data-theme="dark"] .service-card:hover .service-link {
  color: var(--color-sky);
}

.service-card:hover .service-link svg {
  transform: translateX(-3px) scaleX(-1);
}

.service-link svg {
  transform: scaleX(-1);
}

/* --- Responsive ---
   Breakpoints mirror perViewByWidth() in infinity-slider.js (960 / 640)
   so the pre-JS / is-static layout always matches what JS measures. */
@media (max-width: 960px) {
  .services {
    padding-block: 72px;
  }

  .service-card {
    flex-basis: calc((100% - var(--services-gap)) / 2);
  }
}

@media (max-width: 640px) {
  .service-card {
    flex-basis: 100%;
  }

  .services-header {
    margin-bottom: 40px;
  }
}
