/* ==========================================================================
   HeartandHome — Three Easy Steps Section
   Source of truth: Home.pen, node HxWAA ("Three Easy Steps Section")

   Targets the "Services" section in Divi (the one with "Three easy steps
   to a cleaner, healthier home"). Selected as the next sibling section
   after the services cards section (which has #hh-services-section).

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

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

.et_pb_section:has(#hh-services-section) + .et_pb_section {
  background-color: var(--hh-bg-cream) !important;
  padding: 72px 80px 80px !important;
}

/* --------------------------------------------------------------------------
   Heading row — "HOW IT WORKS" eyebrow + main heading
   -------------------------------------------------------------------------- */

.et_pb_section:has(#hh-services-section) + .et_pb_section .et_pb_row:first-child {
  max-width: 100% !important;
  padding-bottom: 52px !important;
  text-align: center;
}

/* "HOW IT WORKS" eyebrow via ::before */
.et_pb_section:has(#hh-services-section) + .et_pb_section .et_pb_row:first-child .et_pb_text:first-child::before {
  content: 'HOW IT WORKS';
  display: block;
  font-family: var(--hh-font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--hh-accent-sage);
  text-align: center;
  margin-bottom: 12px;
}

/* Main heading */
.et_pb_section:has(#hh-services-section) + .et_pb_section .et_pb_row:first-child h2 {
  font-family: var(--hh-font-heading) !important;
  font-size: 32px !important;
  font-weight: 500 !important;
  letter-spacing: -0.35px !important;
  line-height: 1.22 !important;
  color: var(--hh-text-primary) !important;
  text-align: center !important;
}

/* --------------------------------------------------------------------------
   Cards row — 3-column grid
   -------------------------------------------------------------------------- */

.et_pb_section:has(#hh-services-section) + .et_pb_section .et_pb_row:last-child {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  max-width: 100% !important;
  width: 100% !important;
  padding: 0 !important;
}

/* --------------------------------------------------------------------------
   Step cards (columns) — add step numbers via ::before
   -------------------------------------------------------------------------- */

.et_pb_section:has(#hh-services-section) + .et_pb_section .et_pb_row:last-child .et_pb_column {
  display: flex !important;
  flex-direction: column;
  gap: 16px;
  width: auto !important;
  padding: 0 !important;
}

/* Step number styling */
.et_pb_section:has(#hh-services-section) + .et_pb_section .et_pb_row:last-child .et_pb_column::before {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--hh-font-heading);
  font-size: 48px;
  font-weight: 300;
  color: var(--hh-accent-sage);
  line-height: 1;
}

/* Step number + horizontal line via background gradient trick */
.et_pb_section:has(#hh-services-section) + .et_pb_section .et_pb_row:last-child .et_pb_column::after {
  content: '';
  position: absolute;
  top: 32px;
  left: 60px;
  right: 0;
  height: 1px;
  background: rgba(124, 144, 130, 0.3);
}

/* Position columns for the ::after line */
.et_pb_section:has(#hh-services-section) + .et_pb_section .et_pb_row:last-child .et_pb_column {
  position: relative;
}

/* Step numbers per column */
.et_pb_section:has(#hh-services-section) + .et_pb_section .et_pb_row:last-child .et_pb_column:nth-child(1)::before {
  content: '01';
}

.et_pb_section:has(#hh-services-section) + .et_pb_section .et_pb_row:last-child .et_pb_column:nth-child(2)::before {
  content: '02';
}

.et_pb_section:has(#hh-services-section) + .et_pb_section .et_pb_row:last-child .et_pb_column:nth-child(3)::before {
  content: '03';
}

/* --------------------------------------------------------------------------
   Step photos — rounded corners, fixed height, cover
   -------------------------------------------------------------------------- */

.et_pb_section:has(#hh-services-section) + .et_pb_section .et_pb_row:last-child .et_pb_image {
  margin: 0 !important;
}

/* Hide Divi's original numbered badges on images */
.et_pb_section:has(#hh-services-section) + .et_pb_section .et_pb_row:last-child .et_pb_image::before {
  display: none !important;
}

.et_pb_section:has(#hh-services-section) + .et_pb_section .et_pb_row:last-child .et_pb_image_wrap {
  display: block;
  width: 100%;
  height: 240px;
  overflow: hidden;
  border-radius: var(--hh-radius-card);
}

.et_pb_section:has(#hh-services-section) + .et_pb_section .et_pb_row:last-child .et_pb_image_wrap img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  object-position: center;
  border-radius: 0 !important;
}

/* --------------------------------------------------------------------------
   Step headings
   -------------------------------------------------------------------------- */

.et_pb_section:has(#hh-services-section) + .et_pb_section .et_pb_row:last-child .et_pb_text:first-of-type h1,
.et_pb_section:has(#hh-services-section) + .et_pb_section .et_pb_row:last-child .et_pb_text:first-of-type h4 {
  font-family: var(--hh-font-subheading) !important;
  font-size: 20px !important;
  font-weight: 500 !important;
  letter-spacing: -0.15px !important;
  line-height: 1.3 !important;
  color: var(--hh-text-primary) !important;
}

/* --------------------------------------------------------------------------
   Step descriptions
   -------------------------------------------------------------------------- */

.et_pb_section:has(#hh-services-section) + .et_pb_section .et_pb_row:last-child .et_pb_text:last-of-type p {
  font-family: var(--hh-font-body) !important;
  font-size: 16px !important;
  line-height: 1.6 !important;
  color: #726E6A !important;
  margin: 0 !important;
}

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

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

  .et_pb_section:has(#hh-services-section) + .et_pb_section .et_pb_row:last-child {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .et_pb_section:has(#hh-services-section) + .et_pb_section .et_pb_row:last-child .et_pb_column::before {
    font-size: 36px;
  }
}

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

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

  .et_pb_section:has(#hh-services-section) + .et_pb_section .et_pb_row:first-child h2 {
    font-size: 26px !important;
  }

  .et_pb_section:has(#hh-services-section) + .et_pb_section .et_pb_row:last-child .et_pb_column::before {
    font-size: 32px;
  }

  .et_pb_section:has(#hh-services-section) + .et_pb_section .et_pb_row:last-child .et_pb_image_wrap {
    height: 200px;
  }
}
