/* CSS for Services section */
.acf-layout-services-section {
  color: var(--color-white);
  position: relative;
  overflow-x: clip;
  overflow-y: visible;
}

.acf-layout-services-section::before {
  content: "";
  position: absolute;
  width: 802px;
  height: 802px;
  background-color: #5c489c;
  opacity: 0.35;
  filter: blur(160px);
  top: 56%;
  left: 100%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
}

.acf-layout-services-section .container {
  position: relative;
  z-index: 2;
}

.services-section-header-row {
  margin-bottom: 50px;
}

.services-section-heading {
  margin-bottom: 20px;
}

/* Desktop Grid and Column Layouts */
.services-desktop-row > .col-md-6 {
  display: flex;
  flex-direction: column;
}

.services-desktop-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  height: auto;
}

.services-desktop-item {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 214px;
  padding: 15px 10px;
  background-color: var(--color-5);
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  overflow: hidden;
  z-index: 1;
  box-sizing: border-box;
}

.services-desktop-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--color-4);
  z-index: -1;
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.services-desktop-item:hover::before,
.services-desktop-item.active::before {
  transform: scaleY(1);
}

.services-desktop-item-title {
  color: var(--color-white);
  margin: 0;
  z-index: 2;
}

.services-desktop-item-icon-wrap {
  z-index: 2;
  height: 120px;
  width: auto;
}

.services-desktop-item.width-30 .services-desktop-item-icon-wrap {
  align-self: center;
}

.services-desktop-item.width-70 .services-desktop-item-icon-wrap,
.services-desktop-item.width-100 .services-desktop-item-icon-wrap {
  align-self: flex-end;
}

.services-desktop-item-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Width mapping classes from ACF select (accounting for 7px gaps) */
.services-desktop-item.width-30 {
  width: calc(33.333% - 4.666px);
  flex: 0 0 calc(33.333% - 4.666px);
}

.services-desktop-item.width-70 {
  width: calc(66.666% - 2.333px);
  flex: 0 0 calc(66.666% - 2.333px);
}

.services-desktop-item.width-100 {
  width: 100%;
  flex: 0 0 100%;
}

/* Right Details Pane Wrapper */
.services-desktop-detail-wrapper {
  background-color: var(--color-dark);
  padding: 30px 20px;
  min-height: 656px; /* 3 rows of 214px + 2 gaps of 7px = 656px minimum */
  height: 100%;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

.services-detail-card {
  position: absolute;
  top: 40px;
  left: 40px;
  right: 40px;
  bottom: 40px;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.services-detail-card.active {
  opacity: 1;
  pointer-events: auto;
}

.services-detail-title {
  color: var(--color-white);
  margin-bottom: 20px;
  text-align: left;
}

.services-detail-divider {
  border: 0;
  border-top: 1px solid #ffffff;
  margin: 0 0 15px 0;
}

.services-detail-content {
  text-align: left;
}

.services-detail-image-wrap {
  width: 100%;
  height: 395px;
  overflow: hidden;
  margin-top: auto; /* push the image to the bottom of the card */
}

.services-detail-image {
  width: 100%;
  height: 395px;
  object-fit: cover;
}

@media (max-width: 768px) {
  /* Hide top-right glow on mobile */
  .acf-layout-services-section::before {
    display: none;
  }

  /* Mobile Accordion Styles */
  .services-mobile-accordion {
    display: flex;
    flex-direction: column;
    gap: 25px;
  }

  .services-mobile-accordion-item {
    background-color: #2b2b2b;
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 30px 15px;
    cursor: pointer;
    border-radius: 4px;
    transition:
      background-color 0.3s ease,
      border-color 0.3s ease;
  }

  .services-mobile-accordion-item.active {
    background-color: #5f4ca7;
    border-color: #5f4ca7;
  }

  .services-mobile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }

  .services-mobile-title.heading-2 {
    color: var(--color-white);
    margin: 0;
    font-size: 20px;
    font-weight: 600;
  }

  .services-mobile-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    filter: brightness(0) invert(1);
    opacity: 0.9;
  }

  .services-mobile-content-wrap {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  }

  .services-mobile-accordion-item.active .services-mobile-content-wrap {
    grid-template-rows: 1fr;
  }

  .services-mobile-content {
    overflow: hidden;
  }

  .services-mobile-content-inner.text-4 {
    padding-top: 50px;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.5;
  }

  .services-mobile-content-inner p {
    margin: 0 0 10px 0;
  }

  .services-mobile-content-inner p:last-child {
    margin-bottom: 0;
  }
}
