/* ========================================
   CARROSSEL — SERVIÇOS REALIZADOS
   Integrado ao Hero da home da Iluminar
   ======================================== */

.hero-carousel {
  position: relative;
  min-width: 0;
}

/* Viewport do carrossel — rolagem horizontal controlada
   somente aqui (sem criar scroll na página inteira) */
.services-carousel {
  --card-width: clamp(220px, 24vw, 340px);
  --card-gap: 18px;

  position: relative;
  padding: 14px 18px 22px;

  overflow-x: auto;
  scroll-behavior: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;

  cursor: grab;

  outline: none;

  /* Fade sutil nas extremidades horizontais:
     quase todo o carrossel permanece 100% visível e a
     transparência aparece somente bem próximo das bordas,
     escondendo suavemente o corte do card na saída.
     A máscara usa transparência, revelando o fundo do hero. */
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0%,
    black 4%,
    black 96%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to right,
    transparent 0%,
    black 4%,
    black 96%,
    transparent 100%
  );
}

.services-carousel::-webkit-scrollbar {
  display: none;
}

.services-carousel.dragging {
  cursor: grabbing;
  user-select: none;
  scroll-behavior: auto;
}

.services-track {
  display: flex;
  gap: var(--card-gap);
  width: max-content;
}

/* Card individual — apenas foto + legenda discreta.
   Proporção retrato (mais alto que largo) para ocupar
   a altura principal do hero. */
.service-work-card {
  position: relative;
  flex: 0 0 auto;
  width: var(--card-width);
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border: 1px solid rgba(23, 60, 80, 0.55);
  border-radius: var(--radius);
  background: var(--surface);
  isolation: isolate;

  transition:
    transform 0.35s ease,
    box-shadow 0.35s ease,
    opacity 0.35s ease,
    border-color 0.35s ease;
}

/* Gradiente sutil na base para garantir leitura do título */
.service-work-card::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    transparent 50%,
    rgba(3, 9, 15, 0.5) 80%,
    rgba(3, 9, 15, 0.9) 100%
  );
}

.service-work-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.4s ease;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}

.service-work-card figcaption {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 32px 18px 18px;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.25;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
}

/* Destaque suave no hover:
   card em foco nítido, vizinhos discretos sem blur */
.services-carousel:hover .service-work-card:not(:hover) {
  opacity: 0.78;
}

.service-work-card:hover {
  transform: scale(1.03);
  border-color: rgba(255, 210, 31, 0.5);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.46);
  z-index: 3;
}

.service-work-card:hover img {
  transform: scale(1.05);
}

/* Foco via teclado (acessibilidade) */
.service-work-card:focus-within,
.service-work-card:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 3px;
}

/* ========================================
   RESPONSIVIDADE
   ======================================== */

/* Empilha o hero (texto em cima, carrossel no meio, CTA embaixo) */
@media (max-width: 980px) {
  .hero-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    grid-template-areas:
      "copy"
      "carousel"
      "cta";
    gap: 16px;
  }

  .hero-copy {
    text-align: center;
  }

  .hero-copy .lead {
    margin-inline: auto;
  }

  .hero-copy .actions {
    justify-content: center;
  }

  .hero-cta {
    justify-self: center;
  }

  .services-carousel {
    --card-width: clamp(220px, 30vw, 300px);
    padding: 10px 16px 18px;
  }
}

/* Celular */
@media (max-width: 700px) {
  .hero-cta {
    justify-self: stretch;
    margin-top: 6px;
  }

  .services-carousel {
    --card-width: min(62vw, 260px);
    --card-gap: 14px;
    padding: 0 0 18px;

    /* Fade ainda mais discreto no mobile para não esconder
       uma parte excessiva dos cards */
    -webkit-mask-image: linear-gradient(
      to right,
      transparent 0%,
      black 3%,
      black 97%,
      transparent 100%
    );
    mask-image: linear-gradient(
      to right,
      transparent 0%,
      black 3%,
      black 97%,
      transparent 100%
    );
  }

  .service-work-card figcaption {
    padding: 26px 14px 13px;
    font-size: 0.88rem;
  }
}

/* ========================================
   MOVIMENTO REDUZIDO
   ======================================== */

@media (prefers-reduced-motion: reduce) {
  .services-carousel {
    scroll-behavior: auto;
  }

  .service-work-card,
  .service-work-card img {
    transition: none;
  }

  .services-carousel:hover .service-work-card:not(:hover) {
    opacity: 1;
  }
}