/* ==========================================================================
   HeartandHome — Services Section: Horizontal Cards (V1)
   Source of truth: HeartandHomeredesign.pen, node yQSjt ("V1 — Horizontal Cards")

   CSS ID "hh-services-section" is set on the ROW (via Divi Builder
   Add Attribute). So #hh-services-section IS the .et_pb_row element.

   Layout: 4 alternating horizontal cards stacked vertically
     Card 1 (Routine):  image LEFT,  text RIGHT
     Card 2 (Deep):     text LEFT,   image RIGHT
     Card 3 (Moving):   image LEFT,  text RIGHT
     Card 4 (Office):   text LEFT,   image RIGHT

   Enqueued by: wp-content/themes/heartandhome-child/functions.php
   Handle: hh-services (depends on hh-tokens)
   ========================================================================== */

/* --------------------------------------------------------------------------
   Section container
   -------------------------------------------------------------------------- */

.et_pb_section:has(#hh-services-section) {
  background-color: var(--hh-bg-cream) !important;
  padding-top: 10rem !important;
  padding-bottom: var(--hh-padding-section-y) !important;
  padding-left: var(--hh-padding-section-x) !important;
  padding-right: var(--hh-padding-section-x) !important;
}

/* --------------------------------------------------------------------------
   Section header — centered pill + heading + subtitle
   -------------------------------------------------------------------------- */

.hh-services-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  margin-bottom: 32px;
}

.hh-services-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  background: #FFFFFF;
  border: 1px solid var(--hh-border-light);
  border-radius: 999px;
  font-family: var(--hh-font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--hh-accent-sage);
}

.hh-services-pill svg {
  width: 14px;
  height: 14px;
  stroke: var(--hh-accent-sage);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hh-services-header h2 {
  font-family: var(--hh-font-heading) !important;
  font-size: var(--hh-font-heading-section) !important;
  letter-spacing: var(--hh-ls-heading) !important;
  color: var(--hh-text-primary) !important;
  margin: 0 !important;
  line-height: 1.2 !important;
}

.hh-services-header p {
  font-family: var(--hh-font-body) !important;
  font-size: 16px !important;
  color: var(--hh-text-secondary) !important;
  margin: 0 !important;
}

/* Remove old CSS-injected heading */
#hh-services-section::before {
  display: none !important;
}

/* --------------------------------------------------------------------------
   Vertical stack (replaces bento grid)
   -------------------------------------------------------------------------- */

#hh-services-section {
  display: flex !important;
  flex-direction: column !important;
  gap: 24px !important;
  max-width: 100% !important;
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* --------------------------------------------------------------------------
   All cards — shared base
   -------------------------------------------------------------------------- */

#hh-services-section .et_pb_column {
  position: relative;
  border-radius: var(--hh-radius-card);
  overflow: hidden;
  padding: 0 !important;
  margin: 0 !important;
  width: 100% !important;
  height: 220px;
  background: #FFFFFF;
  border: 1px solid var(--hh-border-light);
  cursor: pointer;
  transition:
    box-shadow 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    border-color 0.35s ease;
}

#hh-services-section .et_pb_column:hover,
#hh-services-section .et_pb_column:focus-within {
  border-color: var(--hh-accent-sage);
  box-shadow:
    0 4px 16px rgba(91, 111, 96, 0.15),
    0 1px 4px rgba(0, 0, 0, 0.05);
}

/* --------------------------------------------------------------------------
   Alternating color accent strips — rose (1 & 3) / sage (2 & 4)
   -------------------------------------------------------------------------- */

#hh-services-section .et_pb_column::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 8px;
  z-index: 3;
  border-radius: var(--hh-radius-card) 0 0 var(--hh-radius-card);
  transition: width 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Cards 1 & 3 (Routine, Moving) — rose */
#hh-services-section .et_pb_column:nth-of-type(even)::before {
  background: var(--hh-accent-rose);
}

/* Cards 2 & 4 (Deep, Office) — sage */
#hh-services-section .et_pb_column:nth-of-type(odd)::before {
  background: var(--hh-accent-sage);
}

/* --------------------------------------------------------------------------
   Hide blurb icon/image placeholder
   -------------------------------------------------------------------------- */

#hh-services-section .et_pb_main_blurb_image {
  display: none !important;
}

/* --------------------------------------------------------------------------
   Hide "Learn More" button module (if present)
   -------------------------------------------------------------------------- */

#hh-services-section .et_pb_button_module_wrapper,
#hh-services-section .et_pb_module.et_pb_button {
  display: none !important;
}

/* --------------------------------------------------------------------------
   Blurb module — full-card coverage, image sized to panel area
   -------------------------------------------------------------------------- */

#hh-services-section .et_pb_blurb {
  position: absolute !important;
  inset: 0;
  z-index: 0;
  margin: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
  border: none !important;
  border-radius: 0 !important;
  background-repeat: no-repeat !important;
  opacity: 1 !important;
  animation: none !important;
}

/* No overlays */
#hh-services-section .et_pb_blurb::before,
#hh-services-section .et_pb_blurb::after {
  display: none !important;
}

/* --------------------------------------------------------------------------
   IMAGE-LEFT cards (1 & 3 = even nth-of-type because header div is 1st)
   -------------------------------------------------------------------------- */

#hh-services-section .et_pb_column:nth-of-type(even) .et_pb_blurb {
  background-size: 360px 100% !important;
  background-position: left center !important;
}

/* --------------------------------------------------------------------------
   IMAGE-RIGHT cards (2 & 4 = odd nth-of-type because header div is 1st)
   -------------------------------------------------------------------------- */

#hh-services-section .et_pb_column:nth-of-type(odd) .et_pb_blurb {
  background-size: 360px 100% !important;
  background-position: right center !important;
}

/* --------------------------------------------------------------------------
   Text content — positioned on the non-image side
   -------------------------------------------------------------------------- */

#hh-services-section .et_pb_blurb_content {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: none !important;
  width: auto !important;
}

#hh-services-section .et_pb_blurb_container {
  padding: 0 !important;
  max-width: none !important;
  width: 100% !important;
}

/* IMAGE-LEFT cards: text right next to image */
#hh-services-section .et_pb_column:nth-of-type(even) .et_pb_blurb_content {
  left: 360px;
  right: 0;
  padding: 32px 36px;
}

/* IMAGE-RIGHT cards: text flush to left edge */
#hh-services-section .et_pb_column:nth-of-type(odd) .et_pb_blurb_content {
  left: 0;
  right: 360px;
  padding: 32px 36px;
}

/* --------------------------------------------------------------------------
   Typography — all cards
   -------------------------------------------------------------------------- */

#hh-services-section .et_pb_module_header,
#hh-services-section h4 {
  font-family: var(--hh-font-subheading) !important;
  font-size: 26px !important;
  font-weight: normal !important;
  line-height: var(--hh-lh-heading-card) !important;
  color: var(--hh-text-primary) !important;
  margin-bottom: 12px !important;
  transition: color 0.3s ease;
}

#hh-services-section .et_pb_column:hover .et_pb_module_header,
#hh-services-section .et_pb_column:hover h4,
#hh-services-section .et_pb_column:focus-within .et_pb_module_header,
#hh-services-section .et_pb_column:focus-within h4 {
  color: var(--hh-accent-sage) !important;
}

#hh-services-section .et_pb_blurb_description,
#hh-services-section .et_pb_blurb_description p {
  font-family: var(--hh-font-body) !important;
  font-size: 14px !important;
  line-height: 1.6 !important;
  color: var(--hh-text-secondary) !important;
  margin: 0 !important;
}

/* --------------------------------------------------------------------------
   "Learn More →" link on all cards
   -------------------------------------------------------------------------- */

#hh-services-section .et_pb_blurb_description::after {
  content: 'Learn More \2192';
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  font-family: var(--hh-font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--hh-accent-sage);
  transition:
    transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    gap 0.3s ease;
}

#hh-services-section .et_pb_column:hover .et_pb_blurb_description::after,
#hh-services-section .et_pb_column:focus-within .et_pb_blurb_description::after {
  gap: 10px;
  transform: translateX(4px);
}

/* ==========================================================================
   Responsive — Tablet (max-width: 980px)
   ========================================================================== */

@media (max-width: 980px) {
  .et_pb_section:has(#hh-services-section) {
    padding-left: 40px !important;
    padding-right: 40px !important;
  }

  #hh-services-section .et_pb_column {
    height: 200px;
  }

  /* Shrink image panel */
  #hh-services-section .et_pb_column .et_pb_blurb {
    background-size: 260px 100% !important;
  }

  #hh-services-section .et_pb_column:nth-of-type(even) .et_pb_blurb_content {
    left: 260px;
    padding: 24px 28px;
  }

  #hh-services-section .et_pb_column:nth-of-type(odd) .et_pb_blurb_content {
    right: 260px;
    padding: 24px 28px;
  }
}

/* ==========================================================================
   Responsive — Phone (max-width: 767px)
   ========================================================================== */

@media (max-width: 767px) {
  .et_pb_section:has(#hh-services-section) {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  /* Cards: auto height, no clipping */
  #hh-services-section .et_pb_column {
    height: auto !important;
    min-height: auto !important;
    overflow: visible !important;
  }

  /* Blurb: relative flow, pad top to create image window,
     background constrained to top 200px only */
  #hh-services-section .et_pb_column:nth-of-type(even) .et_pb_blurb,
  #hh-services-section .et_pb_column:nth-of-type(odd) .et_pb_blurb,
  #hh-services-section .et_pb_blurb {
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    height: auto !important;
    padding-top: 200px !important;
    background-size: 100% 200px !important;
    background-position: top center !important;
    background-repeat: no-repeat !important;
  }

  /* Text below image — white bg to cleanly separate from image */
  #hh-services-section .et_pb_column:nth-of-type(even) .et_pb_blurb_content,
  #hh-services-section .et_pb_column:nth-of-type(odd) .et_pb_blurb_content,
  #hh-services-section .et_pb_blurb_content {
    position: relative !important;
    inset: auto !important;
    padding: 20px 24px !important;
    background: #FFFFFF !important;
  }

  /* Kill ALL transitions on mobile — prevents bounce on scroll-touch */
  #hh-services-section .et_pb_column,
  #hh-services-section .et_pb_column::before,
  #hh-services-section .et_pb_module_header,
  #hh-services-section h4,
  #hh-services-section .et_pb_blurb_description::after {
    transition: none !important;
  }

  /* Simple, static tap feedback — subtle border, no animation */
  #hh-services-section .et_pb_column:hover,
  #hh-services-section .et_pb_column:focus-within {
    border-color: var(--hh-accent-sage) !important;
    box-shadow: none !important;
  }

  #hh-services-section .et_pb_column:hover .et_pb_module_header,
  #hh-services-section .et_pb_column:hover h4,
  #hh-services-section .et_pb_column:focus-within .et_pb_module_header,
  #hh-services-section .et_pb_column:focus-within h4 {
    color: var(--hh-accent-sage) !important;
  }

  #hh-services-section .et_pb_column:hover .et_pb_blurb_description::after,
  #hh-services-section .et_pb_column:focus-within .et_pb_blurb_description::after {
    gap: 6px !important;
    transform: none !important;
  }
}

/* ==========================================================================
   Reduced Motion — disable transitions for users who prefer it
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  #hh-services-section .et_pb_column,
  #hh-services-section .et_pb_column::before,
  #hh-services-section .et_pb_module_header,
  #hh-services-section h4,
  #hh-services-section .et_pb_blurb_description::after {
    transition: none !important;
    animation: none !important;
  }
}
