/* ==========================================
   ELEMENTOR TWO-COLUMN SECTION
========================================== */

.project-gallery-section {
  --gallery-brown: #5b2024;
  --gallery-muted: #cfc4c2;
  --gallery-text: #4e4946;
}

/* ==========================================
   GALLERY WRAPPER
========================================== */

.alforce-project-gallery {
  position: relative !important;
  display: block !important;
  width: 100% !important;
  padding-left: clamp(80px, 7vw, 120px) !important;
  overflow: visible !important;
  outline: none;
}

/* ==========================================
   IMAGE STACK
========================================== */

.alforce-gallery-stack {
  position: relative !important;
  isolation: isolate;
  display: block !important;
  width: 100% !important;
  aspect-ratio: 1.28 / 1;
  overflow: visible !important;
}

.alforce-gallery-card {
  position: absolute !important;
  inset: 0 !important;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  overflow: hidden !important;
  border-radius: clamp(20px, 2vw, 36px);
  background: #efefec;
  box-shadow: 0 18px 45px rgba(30, 25, 22, 0.1);
  transform-origin: center;
  transition:
    transform 0.8s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.65s ease;
  will-change: transform, opacity;
}

/* Front image: full size and full opacity */
.alforce-gallery-card[data-position="0"] {
  z-index: 4 !important;
  opacity: 1 !important;
  transform: translate3d(0, 0, 0) scale(1) !important;
  pointer-events: auto;
}

/* Second image: slightly smaller and 40% opacity */
.alforce-gallery-card[data-position="1"] {
  z-index: 3 !important;
  opacity: 0.4 !important;
  transform: translate3d(clamp(-76px, -4.5vw, -50px), 0, 0) scale(0.8) !important;
  pointer-events: none;
}

/* Third image: smaller and 20% opacity */
.alforce-gallery-card[data-position="2"] {
  z-index: 2 !important;
  opacity: 0.2 !important;
  transform: translate3d(clamp(-130px, -7.5vw, -86px), 0, 0) scale(0.6) !important;
  pointer-events: none;
}

/* Fourth or unused image */
.alforce-gallery-card[data-position="3"] {
  z-index: 1 !important;
  opacity: 0 !important;
  transform: translate3d(-175px, -9.5vw, -90px) scale(0.5) !important;
  pointer-events: none;
}

/* Image leaving the front */
.alforce-gallery-card.is-leaving {
  z-index: 6 !important;
  opacity: 0 !important;
  transform: translate3d(8%, 0, 0) scale(1.02) !important;
}

.alforce-gallery-image {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  object-fit: cover !important;
  object-position: center !important;
  border-radius: inherit;
  user-select: none;
  -webkit-user-drag: none;
}

/* ==========================================
   LEFT VERTICAL PAGINATION
========================================== */

.alforce-gallery-pagination {
  position: absolute !important;
  z-index: 20;
  top: 50% !important;
  left: clamp(10px, 1.5vw, 24px) !important;
  right: auto !important;
  bottom: auto !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center;
  justify-content: center;
  width: auto !important;
  gap: 13px;
  margin: 0 !important;
  transform: translateY(-50%) !important;
}

.alforce-gallery-dot {
  display: block !important;
  flex: 0 0 auto;
  width: 14px !important;
  min-width: 14px !important;
  height: 14px !important;
  min-height: 14px !important;
  margin: 0 !important;
  padding: 0 !important;
  cursor: pointer;
  border: 0 !important;
  border-radius: 50% !important;
  background: var(--gallery-muted) !important;
  box-shadow: none !important;
  transition:
    background-color 0.3s ease,
    transform 0.3s ease !important;
}

.alforce-gallery-dot::before,
.alforce-gallery-dot::after {
  display: none !important;
}

.alforce-gallery-dot:hover,
.alforce-gallery-dot:focus-visible {
  background: #9e7c7e !important;
  transform: scale(1.12);
}

.alforce-gallery-dot.is-active {
  width: 16px !important;
  min-width: 16px !important;
  height: 16px !important;
  min-height: 16px !important;
  background: var(--gallery-brown) !important;
  transform: scale(1.08);
}

.alforce-gallery-dot:focus-visible {
  outline: 2px solid var(--gallery-brown);
  outline-offset: 4px;
}

/* Single image */
.alforce-project-gallery.has-single-image {
  padding-left: 0 !important;
}

/* ==========================================
   RIGHT CONTENT
========================================== */

.project-gallery-content,
.project-gallery-content p {
  color: var(--gallery-text);
  font-family: "Source Serif 4", Georgia, serif;
  font-size: clamp(18px, 1.3vw, 27px);
  font-weight: 300;
  line-height: 1.75;
}

.project-gallery-content p {
  margin: 0;
}

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

@media (max-width: 1024px) {
  .project-gallery-section {
    gap: 50px;
  }

  .project-gallery-left {
    width: 56%;
  }

  .project-gallery-content {
    width: 44%;
  }

  .alforce-project-gallery {
    padding-left: 66px !important;
  }

  .alforce-gallery-card[data-position="1"] {
    transform: translate3d(-47px, 0, 0) scale(0.92) !important;
  }

  .alforce-gallery-card[data-position="2"] {
    transform: translate3d(-78px, 0, 0) scale(0.84) !important;
  }

  .alforce-gallery-card[data-position="3"] {
    transform: translate3d(-96px, 0, 0) scale(0.78) !important;
  }

  .alforce-gallery-pagination {
    left: 5px !important;
    gap: 10px;
  }

  .alforce-gallery-dot {
    width: 11px !important;
    min-width: 11px !important;
    height: 11px !important;
    min-height: 11px !important;
  }

  .alforce-gallery-dot.is-active {
    width: 13px !important;
    min-width: 13px !important;
    height: 13px !important;
    min-height: 13px !important;
  }
}

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

@media (max-width: 767px) {
  .project-gallery-section {
    flex-direction: column;
    align-items: stretch;
    gap: 42px;
  }

  .project-gallery-left,
  .project-gallery-content {
    width: 100%;
  }

  .alforce-project-gallery {
    padding: 0 0 38px !important;
  }

  .alforce-gallery-stack {
    width: calc(100% - 44px) !important;
    margin-left: 44px;
    aspect-ratio: 1 / 1;
  }

  .alforce-gallery-card {
    border-radius: 18px;
  }

  .alforce-gallery-card[data-position="1"] {
    transform: translate3d(-25px, 0, 0) scale(0.92) !important;
  }

  .alforce-gallery-card[data-position="2"] {
    transform: translate3d(-42px, 0, 0) scale(0.84) !important;
  }

  .alforce-gallery-card[data-position="3"] {
    transform: translate3d(-52px, 0, 0) scale(0.78) !important;
  }

  .alforce-gallery-pagination {
    top: auto !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    flex-direction: row !important;
    gap: 10px;
    transform: none !important;
  }

  .project-gallery-content,
  .project-gallery-content p {
    font-size: 18px;
    line-height: 1.65;
  }
}

@media (prefers-reduced-motion: reduce) {
  .alforce-gallery-card,
  .alforce-gallery-dot {
    transition-duration: 0.01ms !important;
  }
}
