/* ============================================================
   Service detail pages - shared styles
   Used by: complex-care-children, complex-care-adults,
            challenging-behaviour, rapid-response, supported-living
   ============================================================ */

/* ---------- Hero ---------- */
.sd-hero {
  position: relative;
  overflow: hidden;
}

/* opt-in hero background: set style="--sd-hero-image: url(...)" on the section
   and add .sd-hero-img. Pages without it keep the base gradient. */
.sd-hero-img {
  background-image: var(--sd-hero-image, none);
  background-size: cover;
  background-position: center 45%;
  background-repeat: no-repeat;
}

.sd-hero-img::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(100deg, rgba(8, 26, 44, 0.86) 0%, rgba(10, 38, 64, 0.58) 42%, rgba(11, 50, 107, 0.26) 72%, rgba(20, 80, 120, 0.08) 100%),
    radial-gradient(680px 420px at 88% 8%, rgba(56, 158, 60, 0.16), transparent 62%);
}

.sd-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 720px;
  padding: 8px 0;
}

.sd-hero-inner .grad {
  background: linear-gradient(118deg, #ffffff 8%, #CFE8FF 45%, #9BE7DD 105%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--white);
}

.sd-hero-inner p {
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.04rem;
  max-width: 640px;
}

.sd-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: var(--white);
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.sd-hero .crumbs,
.sd-hero .crumbs a {
  color: rgba(255, 255, 255, 0.78);
}

.sd-hero .crumbs a:hover {
  color: var(--white);
}

.sd-hero-btn-outline {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
  color: var(--white);
}

.sd-hero-btn-outline:hover {
  background: var(--white);
  color: var(--navy);
}

/* ---------- Intro split ---------- */
.sd-split h2 {
  font-size: clamp(1.9rem, 3.3vw, 2.55rem);
  line-height: 1.16;
  margin-bottom: 18px;
}

.sd-split h2 .grad {
  background: linear-gradient(120deg, var(--teal) 10%, var(--teal-dark) 55%, var(--green-dark) 105%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--teal);
}

.sd-split p {
  color: var(--muted);
  margin-bottom: 16px;
}

.sd-split .check-list li {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px 14px 48px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-xs);
  font-weight: 600;
  color: var(--navy);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.sd-split .check-list li:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
  border-color: transparent;
}

.sd-split .check-list li::before {
  left: 12px;
  top: 12px;
}

.sd-media {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 6px solid var(--white);
  background: var(--teal-mist);
}

.sd-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 4 / 3.4;
  transition: transform 0.55s ease;
}

.sd-media:hover img {
  transform: scale(1.04);
}

.sd-media-tag {
  position: absolute;
  bottom: 22px;
  left: 20px;
  font-family: var(--font-hand);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--white);
  background: linear-gradient(120deg, var(--teal), var(--teal-dark));
  padding: 12px 20px;
  border-radius: 16px;
  box-shadow: var(--shadow);
  z-index: 2;
  max-width: 78%;
}

/* ---------- Feature cards ---------- */
.sd-card {
  position: relative;
  overflow: hidden;
  text-align: left;
}

.sd-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, var(--teal), var(--green));
  opacity: 0;
  transition: opacity 0.25s ease;
}

.sd-card:hover::before {
  opacity: 1;
}

.sd-icon {
  width: 62px;
  height: 62px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--teal-mist), rgba(78, 186, 40, 0.12));
  color: var(--teal-dark);
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  box-shadow: inset 0 0 0 1px rgba(20, 80, 168, 0.08);
  transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.sd-icon svg {
  width: 30px;
  height: 30px;
  transition: transform 0.35s ease;
}

.sd-card:hover .sd-icon {
  background: linear-gradient(135deg, var(--teal), var(--teal-deep));
  color: var(--white);
  transform: translateY(-3px) scale(1.05) rotate(-4deg);
  box-shadow: 0 12px 26px rgba(20, 80, 168, 0.32);
}

.sd-card:hover .sd-icon svg {
  transform: scale(1.08);
}

.sd-card p {
  margin-bottom: 0;
}

.sd-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.sd-tags li {
  list-style: none;
  background: var(--teal-mist);
  color: var(--teal-dark);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
}

/* ---------- Sibling service links ---------- */
.sd-links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}

.sd-link {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow-xs);
  color: var(--navy);
  font-weight: 700;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.sd-link:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
  border-color: transparent;
}

.sd-link-icon {
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 14px;
  background: var(--teal-mist);
  color: var(--teal);
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  transition: background 0.25s ease, color 0.25s ease;
}

.sd-link-icon svg {
  width: 24px;
  height: 24px;
}

.sd-link:hover .sd-link-icon {
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  color: var(--white);
}

.sd-link small {
  display: block;
  font-weight: 500;
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 3px;
}

.sd-link .arrow {
  margin-left: auto;
  color: var(--teal);
}

/* ---------- Responsive ---------- */
@media (max-width: 920px) {
  .sd-links {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .sd-media-tag {
    bottom: 14px;
    left: 14px;
    font-size: 1.3rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sd-media:hover img,
  .sd-card,
  .sd-icon,
  .sd-icon svg {
    transition: none;
  }
}
