/* ============================================================
   ACE Facilities — contact form spacing fix
   Loaded after style.css. Targets two real issues:
   1) The Message textarea wrapper has an inline
      `style="width: 100% !important"` that breaks out of the
      flex container's negative-margin compensation. That makes
      the textarea visibly wider than every other field, which
      in turn makes the privacy checkbox below it look offset
      and disconnected from the rest of the form.
   2) The privacy checkbox row had no explicit padding rules,
      so internal <p>, <ul>, and label spacing leaked through.
   ============================================================ */

/* 1. Override the bad inline width on the Message textarea wrapper.
      We can't edit the inline attribute without touching HTML, but
      we can neutralize its effect by forcing the wrapper to behave
      like a normal flex child with the same margin model. */
.ed-element.preset-contact-form-v3-default form > .ed-element.ed-form-textarea#ed-2531112351 {
  width: auto !important;
  flex-basis: 100% !important;
  max-width: calc(100% - 1rem) !important;
  margin: 0.5rem !important;
}

/* 2. Make the privacy checkbox sit tight against the textarea above it
      and the captcha below, with consistent edge alignment. */
.ed-element.preset-contact-form-v3-default form > .ed-element.ed-form-checkbox.privacy#ed-2531112354 {
  margin-top: 0 !important;
  margin-bottom: 0.5rem !important;
  margin-left: 0.5rem !important;
  margin-right: 0.5rem !important;
  flex-basis: calc(100% - 1rem) !important;
  max-width: calc(100% - 1rem) !important;
  padding: 0;
}

/* 3. Reset internal spacing inside the privacy checkbox label.
      The <p> and <span> nesting were inheriting body-level
      line-height and creating visual padding. */
.ed-element.preset-contact-form-v3-default form > .ed-element.ed-form-checkbox.privacy#ed-2531112354 ul.checkbox_list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ed-element.preset-contact-form-v3-default form > .ed-element.ed-form-checkbox.privacy#ed-2531112354 ul.checkbox_list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  line-height: 1.4;
}

.ed-element.preset-contact-form-v3-default form > .ed-element.ed-form-checkbox.privacy#ed-2531112354 ul.checkbox_list li input[type="checkbox"] {
  margin: 0;
  flex: 0 0 auto;
  align-self: center;
}

.ed-element.preset-contact-form-v3-default form > .ed-element.ed-form-checkbox.privacy#ed-2531112354 ul.checkbox_list li label {
  margin: 0;
  padding: 0;
  flex: 1 1 auto;
  display: inline-block;
  line-height: 1.4;
}

.ed-element.preset-contact-form-v3-default form > .ed-element.ed-form-checkbox.privacy#ed-2531112354 ul.checkbox_list li label p {
  margin: 0;
  padding: 0;
  line-height: 1.4;
}

.ed-element.preset-contact-form-v3-default form > .ed-element.ed-form-checkbox.privacy#ed-2531112354 ul.checkbox_list li label p a,
.ed-element.preset-contact-form-v3-default form > .ed-element.ed-form-checkbox.privacy#ed-2531112354 ul.checkbox_list li label p a span {
  line-height: 1.4;
  vertical-align: baseline;
}

/* ============================================================
   ACE Facilities — Section vertical spacing fix
   ------------------------------------------------------------
   Targets the excessive whitespace between the
   "Additional Aircon Services", "Properties We Serve" and
   "Why Choose Ace Facilities" rows (and the analogous nested
   rows inside the "Office & Commercial Aircon Maintenance"
   section above).

   Diagnosis:
   The outer section wrappers (#ed-2461952726, #ed-2461952633)
   carry the .wv-spacer class. Each content row nested inside
   them ALSO carries .wv-spacer. The global rule in style.css
   line 1872 applies padding-top:60px and padding-bottom:60px
   to every .wv-spacer > .inner, so the padding compounds:
       60px (outer) + 60px (row)  = 120px
   of dead vertical space between every two consecutive rows.
   The empty <ed-spacer> divs between rows have no .space child
   and contribute 0px — they are NOT the cause.

   Fix:
   1) Zero the vertical padding of any wv-spacer that is nested
      inside another wv-spacer. Top-level section padding
      elsewhere on the page is left untouched.
   2) Re-introduce a single, consistent gap between sibling
      rows using margin, scaled per breakpoint.
   3) Tighten the outer section's vertical padding so the page
      feels compact while preserving breathing room.
   ============================================================ */

/* 1. Stop wv-spacer padding from compounding on nested rows.
      Specificity (0,2,1) + !important beats the original
      (0,2,0) + !important rule in style.css L1872.
      Only padding-top/bottom is touched, so the mobile
      left/right safe padding rule (style.css L1957) is
      unaffected. */
.wv-spacer .wv-spacer > .inner {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

/* 2. Consistent vertical rhythm between sibling rows inside
      the affected section wrappers. The `+ .ed-element`
      combinator only adds the gap above rows 2..N, so the
      first row sits flush with the section's own top padding. */
#ed-2461952726 > .inner > .ed-element + .ed-element,
#ed-2461952633 > .inner > .ed-element + .ed-element {
  margin-top: 32px !important;
}
@media screen and (max-width: 64rem) {
  #ed-2461952726 > .inner > .ed-element + .ed-element,
  #ed-2461952633 > .inner > .ed-element + .ed-element {
    margin-top: 24px !important;
  }
}
@media screen and (max-width: 48rem) {
  #ed-2461952726 > .inner > .ed-element + .ed-element,
  #ed-2461952633 > .inner > .ed-element + .ed-element {
    margin-top: 16px !important;
  }
}

/* 3. Tighten outer-section vertical padding. Asymmetrical
      (slightly more bottom than top) lets the section breathe
      against what follows without leaving a giant gap below
      the H2 above it. */
#ed-2461952726 > .inner,
#ed-2461952633 > .inner {
  padding-top: 32px !important;
  padding-bottom: 40px !important;
}
@media screen and (max-width: 64rem) {
  #ed-2461952726 > .inner,
  #ed-2461952633 > .inner {
    padding-top: 24px !important;
    padding-bottom: 32px !important;
  }
}
@media screen and (max-width: 48rem) {
  #ed-2461952726 > .inner,
  #ed-2461952633 > .inner {
    padding-top: 16px !important;
    padding-bottom: 24px !important;
  }
}

/* ============================================================
   ACE Facilities — Mobile L/R margin tightening
   ------------------------------------------------------------
   Scope: section range starting at the
       "Office & Commercial Aircon Maintenance"  block
   and ending at the
       "Fast Response Support"  list item.
   Mobile only. Slightly reduces left/right margins so this
   range uses more of the screen width on small devices.
   Areas outside this range keep the existing 16px mobile safe
   margin untouched.

   Why three layers are touched:
   On mobile (<= 768px) the side margin in this range is
   composed of three independent layers from style.css:
       L1:  16px  .wv-spacer > .inner padding-l/r
       L2:  16px  .ed-element.ed-text/.ed-headline padding-l/r
       L3:  16px  named-container margin-l/r
   For text wrapped in a named container inside a wv-spacer,
   all three stack: 48px from screen edge. Reducing each layer
   from 16px to 8px brings worst case to 24px while keeping
   the layered structure of the original CSS intact.
   ============================================================ */
@media screen and (max-width: 768px) {

  /* L1 — outer section .inner padding (overrides
          style.css L1957 with id specificity (1,1,1)). */
  #ed-2461952633 > .inner,
  #ed-2461952672 > .inner,
  #ed-2461952726 > .inner {
    padding-left:  8px !important;
    padding-right: 8px !important;
  }

  /* L2 — text/headline padding for descendants of the
          three section wrappers, plus the orphan H2
          "Additional Aircon Services" (#ed-2461952729)
          which lives between #ed-2461952672 and
          #ed-2461952726 as a sibling, not a descendant. */
  #ed-2461952633 .ed-element.ed-text,
  #ed-2461952633 .ed-element.ed-headline,
  #ed-2461952672 .ed-element.ed-text,
  #ed-2461952672 .ed-element.ed-headline,
  #ed-2461952726 .ed-element.ed-text,
  #ed-2461952726 .ed-element.ed-headline,
  #ed-2461952729 {
    padding-left:  8px !important;
    padding-right: 8px !important;
  }

  /* L3 — named-container margins. These five IDs are the
          text/headline elements inside the range that the
          original mobile rule (style.css L1971-80) gave a
          16px margin to. */
  #ed-2461952642,  /* H2 "Office & Commercial Aircon Maintenance" */
  #ed-2461952651,  /* text body under it */
  #ed-2461952747,  /* "Additional Aircon Services" body */
  #ed-2461952774,  /* "Properties We Serve" body */
  #ed-2461952795 { /* "Why Choose..." body, ending at "Fast Response Support" */
    margin-left:  8px !important;
    margin-right: 8px !important;
  }
}
