/*********************
Service cards (Residential / Property Management / Commercial)
Shared by the homepage Company Intro section and the Buyer's Guide page.
Content: Theme Settings → Company Intro. Markup: includes/views/service-cards.php
*********************/
.rb-services {
  --rb-canopy: #123d23;
  --rb-leaf: #9cc5a6;
}

.rb-services {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rb-services__item {
  margin: 0;
}

.rb-service {
  position: relative;
  display: flex;
  align-items: flex-end;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  color: var(--baseLight-color);
  text-decoration: none;
  background-color: var(--rb-canopy);
  isolation: isolate;
}

.rb-service--no-image {
  background:
    radial-gradient(120% 80% at 15% 0%, rgba(156, 197, 166, 0.28), transparent 60%),
    linear-gradient(160deg, var(--primary-color), var(--rb-canopy));
}

.rb-service__img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.rb-service::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to top, rgba(18, 61, 35, 0.92) 0%, rgba(18, 61, 35, 0.4) 45%, rgba(18, 61, 35, 0) 72%);
}

/* The "root": a leaf-green line that grows along the bottom edge */
.rb-service::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 4px;
  background-color: var(--rb-leaf);
  transition: width 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.rb-service__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  padding: 36px 32px;
}

.rb-service .rb-service__title {
  margin: 0;
  color: var(--baseLight-color);
  font-size: 22px;
  font-weight: 300;
  line-height: 1.3;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.rb-service .rb-service__text {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 15px;
  line-height: 1.6;
}

.rb-service__cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-block-start: 8px;
  color: var(--rb-leaf);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.rb-service__cta svg {
  transition: transform 0.3s;
}

a.rb-service:hover .rb-service__img,
a.rb-service:focus-visible .rb-service__img {
  transform: scale(1.06);
}

a.rb-service:hover::after,
a.rb-service:focus-visible::after {
  width: 100%;
}

a.rb-service:hover .rb-service__cta svg,
a.rb-service:focus-visible .rb-service__cta svg {
  transform: translateX(4px);
}

a.rb-service:focus-visible {
  outline: 3px solid var(--rb-leaf);
  outline-offset: 3px;
}

@media screen and (max-width: 1200px) {
  .rb-service__body {
    padding: 28px 24px;
  }
}

/* Mobile: cards become a swipeable row */
@media screen and (max-width: 768px) {
  .rb-services {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 82%;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    /* bleed to the screen edge: .container gutter is 2.5% of the page = 2.6316% of the 95% column */
    margin-inline: -2.6316%;
    padding-inline: 2.6316%;
    scroll-padding-inline: 2.6316%;
  }

  .rb-services::-webkit-scrollbar {
    display: none;
  }

  .rb-services__item {
    scroll-snap-align: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rb-service__img,
  .rb-service::after,
  .rb-service__cta svg {
    transition: none;
  }
}
