/* Modular Grid - Service-Focused Variation (Design 7) */
/* Refined with AJ Tutoring visual hierarchy patterns */

:root {
  --carousel-card-gap: 24px;
  --carousel-card-pad: 24px;
}

.services-carousel {
  padding: 80px 0;
  background: var(--warm-white);
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 1;
}

.services-carousel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url('/images/organic-lines-bg.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.3;
  z-index: -1;
}

.services-carousel .container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

/* Section Header - Uses shared styles from main CSS */
.services-carousel .section-header h2 {
  background: rgb(247 244 236 / 70%);
  padding: 20px;
  border-radius: 8px;
  display: inline-block;
}

.services-carousel .section-sub-wrapper {
  display: inline-block;
  background: rgb(247 244 236 / 70%);
  padding: 12px 20px;
  border-radius: 8px;
}

/* Carousel Controls - AJ Tutoring style */
.services-carousel .carousel-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
  justify-content: flex-start;
}

.services-carousel .carousel-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--sage-green);
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 200ms ease;
}

.services-carousel .carousel-btn:hover:not(:disabled) {
  background: var(--sage-green);
}

.services-carousel .carousel-btn:hover:not(:disabled) svg {
  stroke: #fff;
}

.services-carousel .carousel-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.services-carousel .carousel-btn svg {
  stroke: var(--sage-green);
  transition: stroke 200ms ease;
}

/* Keyboard focus states */
.services-carousel .carousel-btn:focus-visible {
  outline: 3px solid var(--sage-green);
  outline-offset: 2px;
}

/* Pagination dots */
.services-carousel .carousel-dots {
  display: flex;
  gap: 8px;
  align-items: center;
}

.services-carousel .carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgb(38 92 47 / 25%);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: all 200ms ease;
}

.services-carousel .carousel-dot:hover {
  background: rgb(38 92 47 / 50%);
  transform: scale(1.15);
}

.services-carousel .carousel-dot.active {
  background: var(--sage-green);
  transform: scale(1.2);
}

/* Carousel Viewport */
.services-carousel .carousel-viewport {
  overflow: hidden;
  padding: 18px; /* padding for hover shadow: 16px blur + 4px lift + 2px buffer */
  margin: -18px; /* negative margin to offset padding */
}

/* Grid Layout */
.services-carousel .service-grid {
  display: flex;
  gap: var(--carousel-card-gap);
  margin-top: 0;
  transform: translateX(0);
  transition: transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Approach Cards - Enhanced depth & interaction */
.services-carousel .service-card {
  background: rgb(255 255 255 / 95%);
  border-radius: 12px;
  padding: 12px 24px 24px;
  display: flex;
  flex-direction: column;
  height: auto; /* Allow card to expand to fit content */
  box-shadow: 0 4px 12px rgb(0 0 0 / 5%);
  transition: all 300ms cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  overflow: visible; /* Allow content to overflow - prevents button clipping */
  border: 1px solid rgb(38 92 47 / 8%);
}

/* Card body for flex layout */
.services-carousel .service-card .card-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.services-carousel .service-card:hover {
  background: #f8f8f8;
  border-color: rgb(38 92 47 / 25%);
}

/* Icon Styles - Enhanced visual weight */
.services-carousel .service-card .card-icon {
  width: 56px;
  height: 56px;
  background: var(--sage-green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 8px auto 20px;
  transition: all 300ms cubic-bezier(0.25, 0.8, 0.25, 1);
}

.services-carousel .service-card .card-icon svg {
  stroke: white;
  width: 42px;
  height: 42px;
  stroke-width: 2;
}

.services-carousel .service-card:hover .card-icon {
  background: #3d6447;
}

/* Typography - Refined hierarchy */
.services-carousel .service-card h3 {
  font-family: var(--font-palatino);
  font-size: 1.4rem;
  color: var(--sage-green);
  margin-bottom: 14px;
  font-weight: 600;
  text-align: center;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.services-carousel .service-card .card-body p {
  font-family: var(--font-gentium);
  font-size: 1rem;
  color: var(--body);
  line-height: 1.65;
  flex-grow: 1;
  margin-bottom: 20px;
  letter-spacing: 0.01em;
}

/* Learn More Button - matches btn-primary styling */
.services-carousel .service-card .learn-more-btn {
  display: inline-block;
  background: var(--sage-green);
  color: white;
  border: 2px solid var(--sage-green);
  border-radius: var(--radius-sm);
  padding: 0.85em 2em;
  font-family: var(--font-gentium);
  font-size: var(--text-base);
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  text-align: center;
  align-self: center;
  margin-top: auto;
}

.services-carousel .service-card .learn-more-btn:hover {
  background: var(--dark-green);
  border-color: var(--dark-green);
}

.services-carousel .learn-more-btn:focus-visible {
  outline: 3px solid var(--sage-green);
  outline-offset: 3px;
}


/* Responsive Card Widths - exact widths to prevent peeking */
@media (width >= 1024px) {
  .services-carousel .service-card {
    flex: 0 0 calc((100% - 2 * var(--carousel-card-gap)) / 3);
  }
}

@media (width >= 768px) and (width <= 1023.98px) {
  .services-carousel .service-card {
    flex: 0 0 calc((100% - var(--carousel-card-gap)) / 2);
  }

  .services-carousel {
    padding: 60px 0;
  }
}

@media (width <= 767.98px) {
  .services-carousel .service-card {
    flex: 0 0 100%;
  }

  .services-carousel {
    padding: 50px 0;
  }

  .services-carousel .service-card {
    padding: 24px 20px;
  }

  .services-carousel .service-card h3 {
    font-size: 1.25rem;
  }

  .services-carousel .carousel-controls {
    margin-top: 24px;
  }
}

@media (width <= 480px) {
  .services-carousel h2 {
    font-size: 1.875rem;
  }

  .services-carousel .section-sub {
    font-size: 1rem;
  }

  .services-carousel .service-card h3 {
    font-size: 1.125rem;
  }

  .services-carousel .container {
    padding: 0 16px;
  }

  .services-carousel .carousel-btn {
    width: 32px;
    height: 32px;
  }

  .services-carousel .carousel-btn svg {
    width: 16px;
    height: 16px;
  }
}
