/* ==========================================================================
   COMLOG — HOME
========================================================================== */

/* ==========================================================================
   HOME LOADING SCREEN
========================================================================== */

html.is-loading,
body.is-loading {
  overflow: hidden !important;
  overscroll-behavior: none;
}

.loading--screen {
  position: fixed;
  inset: 0;
  z-index: 10000;

  display: flex;
  align-items: center;
  justify-content: center;

  width: 100%;
  height: 100dvh;

  opacity: 1;
  visibility: visible;
  pointer-events: auto;

  overflow: hidden;
  will-change: clip-path, opacity;
}

.brand--loading-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;

  will-change: transform, opacity;
}

.brand--loading-wrapper img,
.brand--loading-wrapper svg {
  display: block;
  width: 100%;
  height: auto;
  will-change: opacity;
}

/*
  Prevent a flash of the page before GSAP initializes the loader.
  Webflow Designer remains unaffected.
*/
html:not(.w-editor) body:has(.loading--screen) .main-wrapper,
html:not(.w-editor) body:has(.loading--screen) .navbar {
  opacity: 0;
  visibility: hidden;
}

html:not(.w-editor) body:not(.is-loading) .main-wrapper,
html:not(.w-editor) body:not(.is-loading) .navbar {
  opacity: 1;
  visibility: visible;
}

/* ==========================================================================
   SHARED SWIPER
========================================================================== */

.swiper.is--services,
.swiper.is--projects {
  width: 100%;
}

.swiper-wrapper.is--services,
.swiper-wrapper.is--projects {
  align-items: stretch;
}

.swiper-slide.is--services,
.swiper-slide.is--projects {
  height: auto;
}

.swiper--button {
  -webkit-tap-highlight-color: transparent;
}

.swiper--button.swiper-button-disabled {
  opacity: 0.4;
  pointer-events: none;
}

.swiper--button.swiper-button-lock {
  display: flex !important;
}

/* ==========================================================================
   SERVICES SLIDER
========================================================================== */

/*
  Swiper layout:

  Desktop (≥992px): 3 slides, move by 1
  Tablet (≥768px):  2 slides, move by 1
  Mobile:           1 slide, move by 1

  Spacing: 0 at all breakpoints
*/

.swiper.is--services .swiper-wrapper {
  gap: 0 !important;
}

.swiper-slide.is--services {
  position: relative;
}

/* ==========================================================================
   SERVICES CARD HOVER — DESKTOP ONLY
   Motion is handled by GSAP in home.js
========================================================================== */

@media screen and (min-width: 992px) and (hover: hover) and (pointer: fine) {
  .swiper-slide.is--services {
    overflow: hidden;
  }

  .swiper-slide.is--services .service--image {
    overflow: hidden;
  }

  .swiper-slide.is--services .image--absolute100 {
    transform-origin: center center;
    will-change: transform;
  }

  .swiper-slide.is--services .service--card-hover {
    pointer-events: none;
  }

  .swiper-slide.is--services .heading-style-76 {
    will-change: transform, opacity;
  }

  .swiper-slide.is--services .service--content {
    overflow: hidden;
    will-change: height;
  }

  .swiper-slide.is--services .service--card-bg,
  .swiper-slide.is--services .service--card-gradient {
    will-change: opacity;
  }
}

/* ==========================================================================
   PROJECTS SLIDER
========================================================================== */

/*
  Swiper layout:

  Desktop (≥992px): 3 slides, move by 1
  Tablet (≥768px):  2 slides, move by 1
  Mobile:           1 slide, move by 1

  Spacing:
  Desktop: 1.5rem
  Tablet:  1rem
  Mobile:  0
*/

.swiper.is--projects .swiper-wrapper {
  gap: 0 !important;
}

/* ==========================================================================
   TABLET
========================================================================== */

@media screen and (min-width: 768px) and (max-width: 991px) {
  /*
    Services: 2 per view via Swiper — drop Webflow's 50vw max-width hack.
  */
  .swiper-slide.is--services {
    max-width: none;
  }
}

/* ==========================================================================
   MOBILE
========================================================================== */

@media screen and (max-width: 767px) {
  /*
    Both sliders use 0 spacing on mobile.
    Internal slide dimensions remain controlled by Webflow.
  */

  .swiper.is--services,
  .swiper.is--projects {
    overflow: visible;
  }
}

/* ==========================================================================
   WEBFLOW DESIGNER
========================================================================== */

.w-editor .loading--screen {
  display: none !important;
}

.w-editor .main-wrapper,
.w-editor .navbar {
  opacity: 1 !important;
  visibility: visible !important;
}

/* ==========================================================================
   REDUCED MOTION
========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .loading--screen {
    display: none !important;
  }

  .main-wrapper,
  .navbar {
    opacity: 1 !important;
    visibility: visible !important;
  }

  .swiper-slide.is--services .image--absolute100,
  .swiper-slide.is--services .heading-style-76,
  .swiper-slide.is--services .service--content,
  .swiper-slide.is--services .service--card-bg,
  .swiper-slide.is--services .service--card-gradient {
    transition: none !important;
  }
}
