/* V52: The reference-width setting controls one shared horizontal grid.
   Header logo edge = section content edge = footer edge.
   Keep split-hero imagery, video and section backgrounds full bleed.
   These rules do not modify typography, form state or persisted CMS values. */
:root {
  --wm-shared-side-gutter: 20px;
  --wm-shared-inset: max(var(--wm-shared-side-gutter), calc((100vw - var(--wm-reference-width, 1320px)) / 2));
}

/* Ordinary full-page section content uses the same OUTER width as the header.
   The old .w rules combined that width with 55px internal padding; this
   incorrectly indented every section relative to the logo. */
body.wm-redesign main .w {
  box-sizing: border-box !important;
  width: min(var(--wm-reference-width, 1320px), calc(100% - 40px)) !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Three refined homepage sections still had an old 1300px override.
   Match the exact admin-controlled header width, too. */
@media (min-width: 761px) {
  body.wm-redesign.wm-redesign main :is(.wm-refine-process, .wm-refine-clean, .wm-refine-guides) > .w {
    max-width: var(--wm-reference-width, 1320px) !important;
  }
}

@media (min-width: 1021px) {
  /* Home split: move the STORY content to the logo's gridline, without
     changing its height, the form column or the pinned trust strip. */
  body.wm-redesign.wm-redesign main > section.hero.home-hero[data-wm-layout="21"] > .wm-hero-grid > .wm-hero-story {
    padding-left: var(--wm-shared-inset) !important;
  }

  /* All inner-page two-column heroes, including contact, property and each
     "Who We Help" page. Do not alter the full-cover right hand panel. */
  body.wm-redesign.wm-redesign main > section.hero.wm-split-hero .wm-split-copy {
    padding-left: var(--wm-shared-inset) !important;
  }
}

/* Full-bleed home feature video: leave video full width on the right,
   but start the corresponding copy on the shared section gridline. */
@media (min-width: 901px) {
  body.wm-redesign.wm-redesign main section.wm-landlord-feature > .w.g2 > div:first-child {
    padding-left: var(--wm-shared-inset) !important;
  }
}

/* Preserve the existing responsive stack, using the header's same gutters. */
@media (max-width: 1020px) {
  body.wm-redesign.wm-redesign main > section.hero.wm-split-hero .wm-split-copy,
  body.wm-redesign.wm-redesign main > section.hero.home-hero[data-wm-layout="21"] > .wm-hero-grid > .wm-hero-story,
  body.wm-redesign.wm-redesign main > section.hero.home-hero[data-wm-layout="21"] > .wm-hero-grid > form.form.wm-hero-form {
    padding-left: var(--wm-shared-side-gutter) !important;
    padding-right: var(--wm-shared-side-gutter) !important;
  }
}
@media (max-width: 900px) {
  body.wm-redesign.wm-redesign main section.wm-landlord-feature > .w.g2 > div:first-child {
    padding-left: var(--wm-shared-side-gutter) !important;
    padding-right: var(--wm-shared-side-gutter) !important;
  }
}
@media (max-width: 720px) {
  :root { --wm-shared-side-gutter: 18px; }
  body.wm-redesign main .w {
    width: calc(100% - 36px) !important;
  }
}

/* Note: .wm-hero-grid, full-bleed image/video grids and centred CTA inner
   panels retain their more-specific width rules. The footer already shares
   the header's --wm-reference-width and identical mobile gutters. */
