/**
 * Join Us section (team grid + carousel, CTA).
 * Uses bordered-section for layout; this file styles inner content.
 */
:root {
  --aptly-ju-primary: #000677;
  --aptly-ju-gradient-start: #8918d2;
  --aptly-ju-gradient-mid: #486ad2;
  --aptly-ju-gradient-end: #08bbd2;
}

/* TEAM GRID - Maintains 11 column layout and shrinks proportionally */
.aptly-ju-team-row {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  gap: 0.5rem;
  margin-bottom: 5rem;
}

.aptly-ju-team-item {
  opacity: 0;
  transition:
    opacity 0.6s ease,
    transform 0.3s ease;
}

.aptly-ju-team-item.aptly-ju-revealed {
  opacity: 1;
}

.aptly-ju-team-row > .aptly-ju-team-item:nth-child(11n + 2),
.aptly-ju-team-row > .aptly-ju-team-item:nth-child(11n + 10) {
  transform: translateY(80%);
}

.aptly-ju-team-row > .aptly-ju-team-item:nth-child(11n + 3),
.aptly-ju-team-row > .aptly-ju-team-item:nth-child(11n + 9) {
  transform: translateY(40%);
}

/* Container for image + overlay: needs position relative and min-height so overlay has area */
.aptly-ju-team-item .aptly-ju-img > div {
  position: relative;
  min-height: 0;
}

/* LinkedIn overlay: full-cover link; visible when hovering the team card */
.aptly-ju-linkedin-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  opacity: 0;
  background-color: transparent;
  transition:
    opacity 0.25s ease,
    background-color 0.25s ease;
  pointer-events: auto;
}

/* Show overlay when hovering anywhere on the team item (card) */
.aptly-ju-team-item:hover .aptly-ju-linkedin-overlay {
  opacity: 1;
  background-color: rgba(0, 0, 0, 0.6);
}
.aptly-ju-linkedin-overlay:hover {
  opacity: 1 !important;
  background-color: rgba(0, 0, 0, 0.7) !important;
}

.aptly-ju-linkedin-icon {
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
  color: #fff;
  transform: scale(0);
  transition: transform 0.25s ease;
}
.aptly-ju-team-item:hover .aptly-ju-linkedin-overlay .aptly-ju-linkedin-icon,
.aptly-ju-linkedin-overlay:hover .aptly-ju-linkedin-icon {
  transform: scale(1);
}

/* CTA Section */
.aptly-ju-cta-section {
  padding: 0 1.5rem;
}

.aptly-ju-heading {
  color: var(--aptly-ju-primary);
  font-size: 34px;
  line-height: 1.2;
  font-weight: 400;
}

.aptly-ju-gradient-text {
  background: linear-gradient(
    90deg,
    var(--aptly-ju-gradient-start),
    var(--aptly-ju-gradient-mid),
    var(--aptly-ju-gradient-end)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.aptly-ju-description {
  font-size: 16px;
}

/* Hide Carousel on Desktop (Above 700px) */
.aptly-ju-carousel-wrapper {
  display: none;
}

/* ========== RESPONSIVE STYLES ========== */

/* Proportional shrinking from 1200px to 701px - Grid stays intact */
@media (max-width: 1200px) and (min-width: 701px) {
  .aptly-ju-team-row {
    gap: 0.4rem;
    margin-bottom: 4rem;
  }

  .bordered-section-inner.aptly-ju-container {
    padding: 2rem 0 4rem 0;
  }

  .aptly-ju-heading {
    font-size: 30px;
  }

  .aptly-ju-description {
    font-size: 15px;
  }
}

@media (max-width: 1000px) and (min-width: 701px) {
  .aptly-ju-team-row {
    gap: 0.35rem;
    margin-bottom: 3.5rem;
  }

  .aptly-ju-heading {
    font-size: 28px;
  }
}

@media (max-width: 900px) and (min-width: 701px) {
  .aptly-ju-team-row {
    gap: 0.3rem;
    margin-bottom: 3rem;
  }

  .aptly-ju-heading {
    font-size: 26px;
  }

  .aptly-ju-description {
    font-size: 14px;
  }
}

@media (max-width: 800px) and (min-width: 701px) {
  .aptly-ju-team-row {
    gap: 0.25rem;
    margin-bottom: 2.5rem;
  }

  .bordered-section-inner.aptly-ju-container {
    padding: 1.5rem 0 3rem 0;
  }

  .aptly-ju-heading {
    font-size: 24px;
  }
}

/* At 700px: Switch to original slider */
@media (max-width: 700px) {
  .bordered-section-inner.aptly-ju-container {
    padding: 2.5rem 1rem 3rem 1rem;
    background: #f7f7f7;
  }

  /* Hide Desktop Grid */
  .aptly-ju-desktop-grid {
    display: none !important;
  }

  /* Show Original Slider */
  .aptly-ju-carousel-wrapper {
    display: block;
    margin-bottom: 2.5rem;
  }

  /* Original Carousel CSS */
  .aptly-ju-carousel-container {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .aptly-ju-carousel {
    position: relative;
    width: 100%;
    height: 100%;
  }

  .aptly-ju-carousel-item {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 95.55px;
    height: 123.61px;
    transform: translate(-50%, -50%);
    transition: all 0.5s ease-out;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
    border-style: solid;
    border-color: #ffffff;
    background-color: #fff;
  }

  .aptly-ju-carousel-item.active {
    opacity: 1;
    width: 118.55px;
    height: 154.36px;
    border-width: 3.81px;
    border-radius: 6.67px;
    transform: translate(-50%, -50%);
    z-index: 20;
    pointer-events: auto;
  }

  .aptly-ju-carousel-item.next {
    opacity: 1;
    width: 95.55px;
    height: 123.61px;
    border-width: 4.99px;
    border-radius: 6.67px;
    transform: translate(calc(-50% + 105px), -50%);
    z-index: 10;
  }

  .aptly-ju-carousel-item.prev {
    opacity: 1;
    width: 95.55px;
    height: 123.61px;
    border-width: 4.99px;
    border-radius: 6.67px;
    transform: translate(calc(-50% - 105px), -50%);
    z-index: 10;
  }

  .aptly-ju-carousel-item.far-next,
  .aptly-ju-carousel-item.far-prev {
    opacity: 0;
    width: 80px;
    height: 100px;
    z-index: 1;
  }

  .aptly-ju-carousel-card {
    background: transparent;
    box-shadow: none;
    padding: 0;
    width: 100%;
    height: 100%;
  }

  .aptly-ju-carousel-img-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
  }

  .aptly-ju-carousel-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%);
    transition: all 0.4s ease;
  }

  .aptly-ju-carousel-item.active .aptly-ju-carousel-img {
    filter: grayscale(100%);
  }

  .aptly-ju-carousel-controls {
    display: none !important;
  }

  /* CTA Section Mobile */
  .aptly-ju-cta-section {
    padding: 0 0.5rem;
    max-width: 100%;
    margin-top: 1rem;
  }

  .aptly-ju-heading {
    font-size: 24px;
    margin-bottom: 1rem;
  }

  .aptly-ju-description {
    font-size: 14px;
    margin-bottom: 1.5rem;
  }

  .aptly-ju-description p {
    max-width: 100% !important;
  }

  .aptly-ju-button-wrapper {
    padding: 0 0.5rem;
  }
}

/* Small mobile adjustments */
@media (max-width: 500px) {
  .aptly-ju-carousel-item.next {
    transform: translate(calc(-50% + 95px), -50%);
  }

  .aptly-ju-carousel-item.prev {
    transform: translate(calc(-50% - 95px), -50%);
  }
}

/* Extra Small Mobile */
@media (max-width: 399px) {
  .bordered-section-inner.aptly-ju-container {
    padding: 2rem 0.75rem 2.5rem 0.75rem;
  }

  .aptly-ju-heading {
    font-size: 20px;
  }

  .aptly-ju-description {
    font-size: 13px;
  }

  .aptly-ju-carousel-item.next {
    transform: translate(calc(-50% + 85px), -50%);
  }

  .aptly-ju-carousel-item.prev {
    transform: translate(calc(-50% - 85px), -50%);
  }
}
