/* ========================
   Service Home Section
   Desktop: dark cards + emerald feature
   Mobile (<992): accordion closed/expanded + CTAs
   ======================== */

.service-home-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  /* gap-2.5 mobile */
  margin-top: var(--space-17);
  /* 40px mobile */
}

/* ========================
   Default service card
   ======================== */

.service-home-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-2xl);
  overflow: hidden;
  background-color: var(--bs-primary-900);
  border: 0.125rem solid rgba(var(--bs-primary-400-rgb), 0.25);
  outline: none;
  transition:
    transform var(--transition-base),
    box-shadow var(--transition-base),
    border-color var(--transition-base);
}

.service-home-card-image {
  position: relative;
  width: 100%;
  height: 11rem;
  /* h-44 mobile */
  overflow: hidden;
  border-bottom: 0;
  border-radius: 0;
}

.service-home-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--transition-slow);
}

.service-home-card-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 15px;

  padding: var(--space-9);

  background-color: var(--bs-primary-900);
  border: 0;
  border-radius: 0;
}

.service-home-card-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  /* gap-2 — pill row */
}

.service-home-card-tag {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  /* gap-3 */
  width: auto;
  max-width: 100%;
  height: auto;
  min-height: 0;
  padding: 0.375rem 0.75rem;
  box-sizing: border-box;
  background-color: var(--bs-primary-100);
  /* emerald-100 */
  border: 0;
  outline: none;
  border-radius: var(--radius-full);
  /* pill / capsule */
  color: var(--bs-primary-700);
  /* emerald-700 */
  font-size: var(--font-size-12);
  /* text-xs */
  font-weight: var(--font-weight-bold);
  font-family: var(--font-family-mono);
  text-transform: uppercase;
  letter-spacing: 0;
  line-height: 1;
  /* leading-4 */
  text-align: center;
  white-space: nowrap;
}

.service-home-card-text {
  display: flex;
  flex-direction: column;
  gap: 0.9375rem;
  /* 15px — client review when expanded */
  flex: 1;
}

.service-home-card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-7);
  width: 100%;
  padding: 0;
  /* py-[5px] */
  text-decoration: none;
  color: inherit;
  background: none;
  border: 0;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.service-home-card-title-row-desktop {
  display: none;
}

.service-home-card-title-row-toggle {
  display: flex;
}

.service-home-card-title {
  margin: 0;
  color: var(--bs-primary-50);
  /* cyan-100 / emerald-100 */
  font-size: var(--font-size-24);
  /* text-2xl mobile */
  font-weight: var(--font-weight-semibold);
  font-family: var(--font-family-base);
  line-height: var(--line-height-heading);
  flex: 1;
  min-width: 0;
  transition: color var(--transition-base);
}

.service-home-card-chevron {
  display: inline-flex;
  flex-shrink: 0;
  color: var(--bs-primary-50);
  line-height: 0;
  transition:
    transform var(--transition-base),
    color var(--transition-base);
}

/* Mobile: right chevron rotated → points down when closed */
.service-home-card-chevron-toggle {
  width: 1.5rem;
  height: 1.5rem;
  align-items: center;
  justify-content: center;
  transform: rotate(90deg);
}

.service-home-card.is-expanded .service-home-card-chevron-toggle {
  transform: rotate(-90deg);
  /* up when expanded */
}

/* Mobile closed: hide description */
.service-home-card-description {
  display: none;
  margin: 0;
  color: var(--bs-white);
}

/* Beat Elementor/global mobile .text-description color overrides */
.service-home-section .service-home-card-text .service-home-card-description,
.service-home-section .service-home-card-text .service-home-card-description *,
.service-home-section .service-home-card-text .service-home-card-description span,
.service-home-section .service-home-card-text .text-description,
.service-home-section .service-home-card-text .text-description *,
.service-home-section .service-home-card-text .text-description span {
  color: var(--bs-white) !important;
  font-weight: var(--font-weight-regular) !important;
}

.service-home-card-description p {
  margin: 0;
  color: inherit;
  font: inherit;
  line-height: inherit;
}

.service-home-card.is-expanded .service-home-card-description {
  display: block;
}

/* Mobile CTAs — always visible */
.service-home-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  gap: var(--space-4);
  /* gap-2.5 */
  margin-top: 0;
}

.service-home-card-btn {
  flex-grow: 1;
}

.service-home-card-button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  gap: var(--space-7);
  margin-top: auto;
}

/* ========================
   Feature / insight card
   ======================== */

.service-home-card-feature .service-home-card-image img {
  filter: grayscale(100%);
}

.service-home-card-feature .service-home-card-content {
  background-color: var(--bs-primary-400);
  gap: var(--space-4);
  /* gap-2.5 mobile */
}

.service-home-card-feature .service-home-card-title {
  color: var(--bs-primary-900);
  font-size: var(--font-size-20);
  /* text-xl mobile */
  font-weight: var(--font-weight-bold);
  line-height: 1.5rem;
}

.service-home-card-feature .service-home-card-tag {
  font-size: var(--font-size-12);
  padding: var(--space-2) var(--space-7);
  border-radius: var(--radius-full);
}

.service-home-card-tag-outline {
  background-color: transparent;
  color: var(--bs-primary-900);
  outline: 0.0625rem solid var(--bs-primary-900);
  outline-offset: -0.0625rem;
}

.service-home-card-tag-dark {
  background-color: var(--bs-primary-900);
  color: var(--bs-primary-400);
}

.service-home-card-cta.btn,
.btn.service-home-card-cta {
  background-color: var(--bs-primary-900);
  color: var(--bs-white);
  border: 0.0625rem solid var(--bs-primary-900);
}

.service-home-card-cta.btn:hover,
.btn.service-home-card-cta:hover {
  background-color: var(--bs-primary-800);
  border-color: var(--bs-primary-800);
  color: var(--bs-white);
}

.service-home-card-cta .btn-icon {
  background-color: var(--bs-white);
}

/* ========================
   Desktop (≥992px)
   ======================== */

@media (min-width: 992px) {
  .service-home-grid {
    gap: var(--gap-20);
    margin-top: var(--space-21);
    /* 64px */
  }

  /* Constrain the measure so the heading never ends on a single orphan word. */
  .service-home-section .basic-content-row h2 {
    max-width: 44ch;
    margin-inline: auto;
    text-wrap: pretty;
  }

  .service-home-card-image {
    height: 16rem;
    /* h-64 */
  }

  .service-home-card-content {
    gap: var(--gap-20);
    /* gap-5 */
    padding: 1.75rem;
    /* p-7 */
  }

  /* Tags sit on one row wherever they fit. A 27" display at 125%/150% scale
     reports a narrower viewport, so the row must wrap rather than squeeze the
     pills and clip their labels mid-word. */
  .service-home-card-tags {
    flex-wrap: wrap;
    gap: 0.375rem;
  }

  .service-home-card-tag {
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-full);
    /* pill */
    background-color: var(--bs-primary-100);
    color: var(--bs-primary-700);
    font-size: var(--font-size-12);
    /* text-xs */
    font-weight: var(--font-weight-bold);
    line-height: 1rem;
    /* leading-4 */
  }

  /* Never shrink a pill below its label — tighter padding buys the row enough
     width to stay on one line at the common desktop sizes. */
  .service-home-card-tags .service-home-card-tag {
    flex: 0 0 auto;
    padding-inline: 0.5rem;
    white-space: nowrap;
  }

  .service-home-card-feature .service-home-card-tag {
    border-radius: var(--radius-full);
  }

  .service-home-card-tag-outline {
    background-color: transparent;
    color: var(--bs-primary-900);
    outline: 0.0625rem solid var(--bs-primary-900);
    outline-offset: -0.0625rem;
  }

  .service-home-card-tag-dark {
    background-color: var(--bs-primary-900);
    color: var(--bs-primary-400);
  }

  .service-home-card-text {
    gap: var(--space-7);
    /* gap-4 */
  }

  .service-home-card-title-row {
    padding: 0;
  }

  .service-home-card-title-row-desktop {
    display: flex;
  }

  .service-home-card-title-row-toggle {
    display: none;
  }

  .service-home-card-title {
    font-size: var(--font-size-32);
  }

  .service-home-card-chevron {
    color: var(--bs-primary-200);
  }

  .service-home-card-description {
    display: block;
  }

  .service-home-card-actions {
    display: none;
  }

  .service-home-card-feature .service-home-card-content {
    gap: var(--space-14);
    /* gap-8 */
  }

  .service-home-card-feature .service-home-card-title {
    font-size: var(--font-size-24);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-heading);
  }

  /* Desktop hover */
  /* .service-home-card:not(.service-home-card-feature):hover,
  .service-home-card:not(.service-home-card-feature):focus-within { */
  .service-home-card:hover,
  .service-home-card:focus-within {
    transform: translateY(-0.25rem);
    border-color: var(--bs-primary-300);
    /* #17C99E */
    box-shadow:
      0 0.75rem 1.75rem rgba(0, 0, 0, 0.4),
      0 0 1.5rem rgba(var(--bs-primary-400-rgb), 0.18);
  }

  .service-home-card:not(.service-home-card-feature):hover .service-home-card-image img,
  .service-home-card:not(.service-home-card-feature):focus-within .service-home-card-image img {
    transform: scale(1.04);
  }

  .service-home-card:not(.service-home-card-feature):hover .service-home-card-title,
  .service-home-card:not(.service-home-card-feature):focus-within .service-home-card-title {
    color: var(--bs-white);
  }

  .service-home-card:not(.service-home-card-feature):hover .service-home-card-title-row-desktop .service-home-card-chevron,
  .service-home-card:not(.service-home-card-feature):focus-within .service-home-card-title-row-desktop .service-home-card-chevron {
    transform: translateX(0.25rem);
    color: var(--bs-primary-50);
  }

  .service-home-card-feature:hover {
    transform: translateY(-0.25rem);
    box-shadow: var(--shadow-lg);
  }
}

@media (min-width: 576px) and (max-width: 991.98px) {
  .service-home-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .service-home-card-cta {
    flex-grow: 1;
  }
}

@media (min-width: 1200px) {
  .service-home-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {

  .service-home-card,
  .service-home-card-image img,
  .service-home-card-title,
  .service-home-card-chevron {
    transition: none;
  }

  .service-home-card:hover,
  .service-home-card:focus-within,
  .service-home-card-feature:hover {
    transform: none;
  }

  .service-home-card:not(.service-home-card-feature):hover .service-home-card-image img,
  .service-home-card:not(.service-home-card-feature):focus-within .service-home-card-image img {
    transform: none;
  }

  .service-home-card:not(.service-home-card-feature):hover .service-home-card-title-row-desktop .service-home-card-chevron,
  .service-home-card:not(.service-home-card-feature):focus-within .service-home-card-title-row-desktop .service-home-card-chevron {
    transform: none;
  }
}