/* Styles personnalisés du site REDSHIFT.
   Réservé aux ajustements légers sans modifier les pages générées. */

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.service-card-media img,
.portfolio-card img,
.project img,
.client img,
.photo-preview-item img,
.media-showcase img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.service-hero::before,
.project-hero::before {
  background-size: cover;
  background-position: center;
}

.service-card-media,
.portfolio-card,
.project-gallery-item,
.photo-preview-item {
  background-color: #120808;
}

.project-gallery {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: clamp(0.85rem, 1.6vw, 1.45rem) !important;
  column-count: initial !important;
  column-gap: 0 !important;
}

.project-gallery-item,
.project-gallery-item:nth-child(n) {
  display: block !important;
  width: 100% !important;
  margin: 0 !important;
  overflow: hidden !important;
  border-radius: 18px !important;
  border: 1px solid rgba(245, 235, 224, 0.1);
  background: #120808 !important;
  box-shadow: 0 18px 70px rgba(0, 0, 0, 0.32);
}

.project-gallery-item:nth-child(6n+1),
.project-gallery-item:nth-child(6n+4) {
  grid-column: span 2;
  aspect-ratio: 16 / 9 !important;
}

.project-gallery-item:nth-child(6n+2),
.project-gallery-item:nth-child(6n+3),
.project-gallery-item:nth-child(6n+5),
.project-gallery-item:nth-child(6n+6) {
  aspect-ratio: 4 / 3 !important;
}

.project-gallery img,
.project-gallery-item img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
  display: block !important;
}

.project-gallery-item::after {
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(10, 6, 6, 0.02), rgba(10, 6, 6, 0.14)) !important;
}

.services .services-inner {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.services .services-intro {
  grid-column: 1 / -1;
}

.services .services-intro h2 {
  font-family: var(--font-services-title, var(--font-section-title, var(--font-title)));
}

.services .services-intro p {
  font-family: var(--font-services-text, var(--font-section-text, var(--font-body)));
}

.services .service-category-card {
  min-height: 520px;
  padding: 2rem;
  align-content: start;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 2.2rem;
  border-radius: 18px;
}

.services .service-card {
  --card-bg: rgba(8, 7, 7, 0.7);
  --card-border: rgba(245, 235, 224, 0.15);
  position: relative;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045), 0 24px 90px rgba(0, 0, 0, 0.22);
  overflow: hidden;
  isolation: isolate;
  backdrop-filter: blur(18px);
}

.services .service-card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: var(--service-card-image);
  background-size: cover;
  background-position: center;
  opacity: var(--service-card-image-opacity, 0.58);
  filter: saturate(0.9) contrast(1.08) brightness(var(--service-card-image-brightness, 0.92));
  transform: scale(1.04);
  transition: transform 0.7s ease, opacity 0.45s ease, filter 0.45s ease;
}

.services .service-card::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 8%, rgb(230 57 70 / var(--service-card-red-glow, 0.24)), transparent 34%),
    linear-gradient(180deg, rgb(7 6 6 / var(--service-card-overlay-strength, 0.56)) 0%, rgb(7 6 6 / var(--service-card-overlay-strength, 0.56)) 48%, rgba(7, 6, 6, 0.94) 100%),
    linear-gradient(90deg, rgba(230, 57, 70, 0.1), transparent 58%);
}

.services .service-card:hover {
  transform: translateY(-7px);
  border-color: rgba(230, 57, 70, 0.75);
  box-shadow: 0 28px 110px rgba(230, 57, 70, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.services .service-card:hover::before {
  opacity: 0.48;
  filter: saturate(1.05) contrast(1.1) brightness(0.78);
  transform: scale(1.1);
}

.services .service-card-num {
  font-size: 1.05rem;
}

.services .service-card-icon {
  position: absolute;
  top: 2rem;
  right: 2rem;
  width: 46px;
  height: 46px;
  color: var(--red);
  opacity: 0.95;
  border: 0;
  background: transparent;
}

.services .service-card-icon svg {
  width: 100%;
  height: 100%;
}

.services .service-card-copy {
  display: grid;
  grid-template-rows: minmax(5rem, auto) minmax(4.9rem, auto) auto 1fr;
  gap: 1.05rem;
  align-self: stretch;
}

.services .service-card-title {
  min-height: 5rem;
  font-family: var(--font-service-card-title, var(--font-title));
  font-size: 2.05rem;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.services .service-card-desc {
  min-height: 4.9rem;
  font-family: var(--font-service-card-text, var(--font-body));
  color: var(--ink-dim);
  font-size: 0.94rem;
  line-height: 1.62;
}

.services .service-card-line {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, rgba(245, 235, 224, 0.18), transparent);
  margin: 0.15rem 0;
}

.services .service-card-list {
  display: grid;
  gap: 0.55rem;
  list-style: none;
  font-family: var(--font-service-card-text, var(--font-body));
  color: rgba(245, 235, 224, 0.76);
  font-size: 0.82rem;
  line-height: 1.45;
}

.services .service-card-list li {
  position: relative;
  padding-left: 1rem;
}

.services .service-card-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.68em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 12px var(--red-glow);
}

.services .service-card-action {
  justify-self: start;
  align-self: end;
  text-decoration: none;
}

/* Mobile fallback: keep Services visible if reveal animations fail to fire. */
@media (max-width: 900px) {
  body.service-page .service-hero {
    justify-content: flex-start !important;
    align-items: flex-end !important;
    text-align: left !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  body.service-page .service-hero::before {
    background-position: left center !important;
    transform: scale(1.01) !important;
  }

  body.service-page .service-hero::after {
    background:
      linear-gradient(180deg, rgba(5, 5, 5, 0.18), rgba(5, 5, 5, 0.88) 78%, #050505 100%),
      linear-gradient(90deg, rgba(5, 5, 5, 0.52) 0%, rgba(5, 5, 5, 0.18) 58%, rgba(5, 5, 5, 0.72) 100%) !important;
  }

  body.service-page .service-hero-inner {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  body.service-page .service-hero-copy {
    width: min(100%, 22rem) !important;
    max-width: calc(100vw - 2rem) !important;
    margin-left: 0 !important;
    margin-right: auto !important;
    padding-left: 0 !important;
    left: 0 !important;
    transform: none !important;
    text-align: left !important;
  }

  body.service-page .service-hero .page-kicker,
  body.service-page .service-hero .page-lead,
  body.service-page .service-play-cta {
    text-align: left !important;
  }

  body.service-page .service-hero .page-title {
    width: 100% !important;
    max-width: calc(100vw - 2rem) !important;
    margin-left: 0 !important;
    margin-right: auto !important;
    padding-left: 0 !important;
    text-align: left !important;
    transform: none !important;
    font-size: clamp(2.75rem, 13vw, 4.05rem) !important;
    line-height: 0.92 !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
  }

  html.motion-ready #services,
  html.motion-ready #services .services-intro,
  html.motion-ready #services .service-category,
  html.motion-ready #services .service-card,
  html.motion-ready #services .reveal-item {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    filter: none !important;
    clip-path: none !important;
  }

  #services .service-grid,
  #services .service-stack {
    display: grid !important;
    grid-template-columns: 1fr !important;
  }

  #services .service-card {
    display: grid !important;
    pointer-events: auto !important;
  }

  .service-card-media,
  .photo-preview-item {
    aspect-ratio: 16 / 9;
    min-height: 0 !important;
  }

  .portfolio-card img,
  .service-card-media img,
  .photo-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .project-gallery,
  .project-gallery-shell,
  .project-gallery-item {
    width: 100%;
    max-width: 100%;
  }

  .project-gallery {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  .project-gallery-item,
  .project-gallery-item:nth-child(n) {
    grid-column: span 1 !important;
    aspect-ratio: 4 / 3 !important;
    border-radius: 14px !important;
  }

  .project-gallery-item:nth-child(3n+1) {
    aspect-ratio: 16 / 10 !important;
  }

  .services .services-inner {
    grid-template-columns: 1fr;
    gap: 0.9rem;
  }

  .services .services-intro {
    margin-bottom: 1.4rem;
  }

  .services .service-category-card {
    min-height: 420px;
    padding: 1.25rem;
    border-radius: 15px;
    gap: 1.4rem;
  }

  .services .service-card-icon {
    top: 1.2rem;
    right: 1.2rem;
    width: 38px;
    height: 38px;
  }

  .services .service-card-title {
    font-size: 1.75rem;
    padding-right: 2.4rem;
  }

  .services .service-card-desc {
    font-size: 0.9rem;
  }

  .services .service-card-list {
    font-size: 0.8rem;
  }
}
