/* ==========================================================================
   HeartandHome — Footer Section (HOME-07)
   Theme Builder footer (post ID=53).
   Targets Divi TB classes directly:
     Section: .et_pb_section_1_tb_footer  (main footer content)
     Row 0:   .et_pb_row_0_tb_footer      (3-col: brand / contact / nav)
     Row 1:   .et_pb_row_1_tb_footer      (trust badges)
     Row 2:   .et_pb_row_2_tb_footer      (copyright)

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

/* --------------------------------------------------------------------------
   Both footer sections — dark warm background
   -------------------------------------------------------------------------- */

/* Hide footer until JS content injection is complete, then fade in */
.et-l.et-l--footer {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.et-l.et-l--footer.hh-footer-ready {
  opacity: 1;
}

/* Section 0 is an empty spacer — collapse it so no dark strip flashes */
.et-l.et-l--footer > .et_builder_inner_content > .et_pb_section.et_pb_section_0_tb_footer {
  background-color: var(--hh-footer-bg) !important;
  padding: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
}

.et-l.et-l--footer > .et_builder_inner_content > .et_pb_section.et_pb_section_1_tb_footer {
  background-color: var(--hh-footer-bg) !important;
}

.et-l--footer .et_pb_section_1_tb_footer {
  padding: 72px 80px 48px !important;
  border: none !important;
}

/* Kill any stray borders on rows except copyright */
.et-l--footer .et_pb_row_0_tb_footer {
  border: none !important;
}

/* --------------------------------------------------------------------------
   Main row — 3-column equal grid
   -------------------------------------------------------------------------- */

.et-l--footer .et_pb_row_0_tb_footer {
  display: grid !important;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 40px;
  max-width: 1100px !important;
  width: 100% !important;
  padding: 0 !important;
  margin: 0 auto !important;
}

/* --------------------------------------------------------------------------
   Column reset — balanced 3-column alignment
   -------------------------------------------------------------------------- */

.et-l--footer .et_pb_row_0_tb_footer .et_pb_column {
  width: auto !important;
  padding: 0 !important;
}

/* Left column — left-aligned, nudged up for visual balance */
.et-l--footer .et_pb_row_0_tb_footer .et_pb_column_0_tb_footer {
  text-align: left !important;
  margin-top: -13px !important;
}

/* Middle column — centered */
.et-l--footer .et_pb_row_0_tb_footer .et_pb_column_1_tb_footer {
  text-align: center !important;
}

/* Right column — centered */
.et-l--footer .et_pb_row_0_tb_footer .et_pb_column_2_tb_footer {
  text-align: center !important;
}

.et-l--footer .et_pb_section_1_tb_footer .et_pb_column_0_tb_footer .et_pb_module {
  text-align: left !important;
}

.et-l--footer .et_pb_section_1_tb_footer .et_pb_column_1_tb_footer .et_pb_module {
  text-align: center !important;
}

.et-l--footer .et_pb_section_1_tb_footer .et_pb_column_2_tb_footer .et_pb_module {
  text-align: center !important;
}

.et-l--footer .et_pb_section_1_tb_footer .et_pb_column_0_tb_footer .et_pb_social_media_follow {
  justify-content: flex-start !important;
}

.et-l--footer .et_pb_section_1_tb_footer .et_pb_column_1_tb_footer .et_pb_social_media_follow {
  justify-content: center !important;
}

.et-l--footer .et_pb_section_1_tb_footer .et_pb_column_2_tb_footer .et_pb_social_media_follow {
  justify-content: center !important;
}

/* --------------------------------------------------------------------------
   Headings — "Contact Us", "Navigation" labels
   -------------------------------------------------------------------------- */

.et-l--footer .et_pb_section_1_tb_footer .et_pb_text_1_tb_footer p,
.et-l--footer .et_pb_section_1_tb_footer h5 {
  font-family: var(--hh-font-heading) !important;
  font-size: 20px !important;
  font-weight: 400 !important;
  letter-spacing: var(--hh-ls-heading) !important;
  color: var(--hh-footer-text) !important;
  margin-bottom: 16px !important;
}

/* Navigation heading — nudged down 5px to align with Contact Us */
.et-l--footer .et_pb_column_2_tb_footer .et_pb_text:first-child p {
  font-family: var(--hh-font-heading) !important;
  font-size: 20px !important;
  font-weight: 400 !important;
  letter-spacing: var(--hh-ls-heading) !important;
  color: var(--hh-footer-text) !important;
  margin-bottom: 10px !important;
  padding-top: 5px !important;
}

/* --------------------------------------------------------------------------
   Body text
   -------------------------------------------------------------------------- */

.et-l--footer .et_pb_section_1_tb_footer p {
  font-family: var(--hh-font-body) !important;
  font-size: 14px !important;
  line-height: 1.8 !important;
  color: var(--hh-footer-text) !important;
  margin: 0 0 8px !important;
}

/* Navigation column — link list spacing */
.et-l--footer .et_pb_column_2_tb_footer .et_pb_text {
  margin-bottom: 25px !important;
}

.et-l--footer .et_pb_column_2_tb_footer .et_pb_text p {
  line-height: 1.3 !important;
  margin: 0 !important;
}

/* --------------------------------------------------------------------------
   Links
   -------------------------------------------------------------------------- */

.et-l--footer .et_pb_section_1_tb_footer a {
  color: var(--hh-footer-text) !important;
  text-decoration: none !important;
  transition: color 0.2s ease;
}

.et-l--footer .et_pb_section_1_tb_footer a:hover,
.et-l--footer .et_pb_section_1_tb_footer a:focus-visible {
  color: var(--hh-accent-sage) !important;
}

/* --------------------------------------------------------------------------
   Social icons — dark charcoal on dark bg
   -------------------------------------------------------------------------- */

.et-l--footer .et_pb_section_1_tb_footer .et_pb_social_media_follow li a,
.et-l--footer .et_pb_section_1_tb_footer .et_pb_social_media_follow a {
  background-color: #3d3a36 !important;
  border-color: #3d3a36 !important;
}

/* --------------------------------------------------------------------------
   Tighten module margins inside footer
   -------------------------------------------------------------------------- */

.et-l--footer .et_pb_section_1_tb_footer .et_pb_module {
  margin-bottom: 18px !important;
}

/* --------------------------------------------------------------------------
   Brand column — hide logo, show injected brand text
   -------------------------------------------------------------------------- */

.et-l--footer .et_pb_column_0_tb_footer .et_pb_image {
  display: none !important;
}

.hh-footer-brand {
  margin-bottom: 24px !important;
}

.hh-footer-logo {
  display: block;
  width: 180px !important;
  height: auto !important;
  margin-bottom: 20px !important;
}

.hh-footer-brand-name {
  font-family: var(--hh-font-heading) !important;
  font-size: 22px !important;
  font-weight: 400 !important;
  letter-spacing: var(--hh-ls-heading) !important;
  color: var(--hh-accent-sage) !important;
  margin: 0 0 4px 0 !important;
  line-height: 1.3 !important;
}

.hh-footer-brand-sub {
  display: block;
  font-family: var(--hh-font-body) !important;
  font-size: 15px !important;
  font-weight: 400 !important;
  color: var(--hh-footer-text) !important;
  margin-bottom: 16px !important;
}

.hh-footer-brand-desc {
  font-family: var(--hh-font-body) !important;
  font-size: 14px !important;
  line-height: 1.7 !important;
  color: var(--hh-footer-text) !important;
  margin: 0 !important;
  opacity: 0.8;
}

/* --------------------------------------------------------------------------
   Trust badges row — hidden (badges moved into brand column via JS)
   -------------------------------------------------------------------------- */

.et-l--footer .et_pb_row_1_tb_footer {
  display: none !important;
}

/* --------------------------------------------------------------------------
   Badges inside brand column
   -------------------------------------------------------------------------- */

.hh-footer-badges {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  margin-top: 28px !important;
}

.hh-footer-badges img {
  height: 60px !important;
  width: auto !important;
  display: block;
}

/* EOS badge sits slightly high vs BBB; direct child is EOS only (BBB is in <a>). */
.hh-footer-badges > img {
  transform: translateY(4px);
}

/* BBB seal image includes "Click for Profile" text baked into the bottom
   ~18% of the image. Negative margin-bottom shifts the BBB down so the
   seal border aligns with the EOS badge border; the text hangs below. */
.hh-footer-badges a {
  margin-bottom: -13px;
}

/* --------------------------------------------------------------------------
   Copyright row
   -------------------------------------------------------------------------- */

.et-l--footer .et_pb_row_2_tb_footer {
  padding-top: 24px !important;
  margin-top: 44px !important;
  border-top: 1px solid var(--hh-accent-sage) !important;
  max-width: 1100px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.et-l--footer .et_pb_row_2_tb_footer p {
  font-family: var(--hh-font-body) !important;
  font-size: 12px !important;
  color: rgba(237, 230, 218, 0.45) !important;
  text-align: left !important;
  margin: 0 !important;
}

/* --------------------------------------------------------------------------
   Divider
   -------------------------------------------------------------------------- */

.et-l--footer .et_pb_section_1_tb_footer hr,
.et-l--footer .et_pb_divider_0_tb_footer,
.et-l--footer .et_pb_section_1_tb_footer .et_pb_divider {
  display: none !important;
}

/* Remove any Divi-generated borders on the section or section 0 spacer */
.et-l--footer .et_pb_section_0_tb_footer,
.et-l--footer .et_pb_section_1_tb_footer {
  border-top: none !important;
  border-bottom: none !important;
}

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

@media (max-width: 767px) {
  .et-l--footer .et_pb_section_1_tb_footer {
    padding: 40px 20px !important;
  }

  .et-l--footer .et_pb_row_0_tb_footer {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  /* On mobile stack, revert all columns to left-align */
  .et-l--footer .et_pb_row_0_tb_footer .et_pb_column_1_tb_footer,
  .et-l--footer .et_pb_row_0_tb_footer .et_pb_column_2_tb_footer {
    text-align: left !important;
  }

  .et-l--footer .et_pb_section_1_tb_footer .et_pb_column_1_tb_footer .et_pb_module,
  .et-l--footer .et_pb_section_1_tb_footer .et_pb_column_2_tb_footer .et_pb_module {
    text-align: left !important;
  }

  .et-l--footer .et_pb_section_1_tb_footer .et_pb_column_1_tb_footer .et_pb_social_media_follow,
  .et-l--footer .et_pb_section_1_tb_footer .et_pb_column_2_tb_footer .et_pb_social_media_follow {
    justify-content: flex-start !important;
  }
}

/* --------------------------------------------------------------------------
   Reduced motion — disable transitions for users who prefer it
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .et-l.et-l--footer,
  .et-l--footer .et_pb_section_1_tb_footer a {
    transition: none !important;
  }
}
