/* MHC native Gutenberg homepage. Load after the theme foundation.
 * Scoped to homepage blocks; no navigation, global tokens, or foundation resets.
 * Natural content height: no viewport-height sections or artificial spacer blocks.
 */
.mhc-homepage-content,
.editor-styles-wrapper .mhc-home-section {
  --home-navy: var(--navy, #14283f);
  --home-white: var(--white, #fff);
  --home-warm: var(--offwhite, #f7f6f3);
  --home-ink: var(--charcoal, #29313a);
  --home-gold: var(--gold, #b59a69);
  --home-muted: var(--muted, #58616b);
  --home-line: var(--line, #d9dde0);
  --home-width: var(--content-width, 1200px);
  --home-gap: clamp(24px, 3vw, 40px);
  --home-section-space: clamp(64px, 5vw, 80px);
}

.mhc-homepage-content {
  width: 100%;
  max-width: none;
  margin: 0;
  color: var(--home-ink);
  background: var(--home-white);
}

.mhc-homepage-content > section.wp-block-group.mhc-home-section,
.editor-styles-wrapper .mhc-home-section {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: var(--home-section-space) 0;
  color: var(--home-ink);
  scroll-margin-top: 104px;
  overflow-wrap: anywhere;
}

.mhc-home-section,
.mhc-home-section *,
.mhc-home-section *::before,
.mhc-home-section *::after { box-sizing: border-box; }

.mhc-home-section .container {
  width: min(var(--home-width), calc(100% - 64px));
  max-width: var(--home-width);
  margin-inline: auto;
}

/* Core group containers may use either modern layout or legacy inner wrappers. */
.mhc-home-section > .wp-block-group__inner-container {
  width: 100%;
  max-width: none;
}
.mhc-home-section .container > .wp-block-group__inner-container {
  width: 100%;
  max-width: none;
}
.mhc-home-section :is(.wp-block-group, .wp-block-column, .wp-block-image, form) {
  min-width: 0;
}
.mhc-home-section :is(h1, h2, h3, h4) {
  color: var(--home-navy);
  font-family: var(--font-heading, Georgia, "Times New Roman", serif);
  font-weight: 400;
  text-wrap: balance;
}
.mhc-home-section h2 {
  margin: 0 0 24px;
  font-size: clamp(1.875rem, 3vw, 2.75rem);
  line-height: 1.16;
}
.mhc-home-section h3 {
  margin: 0 0 16px;
  font-size: clamp(1.375rem, 2vw, 1.75rem);
  line-height: 1.25;
}
.mhc-home-section p {
  margin-block: 0 24px;
  font-size: 1rem;
  line-height: 1.6;
}
.mhc-home-section .section-heading { max-width: 760px; margin-bottom: 32px; }
.mhc-home-section .eyebrow {
  margin-bottom: 16px;
  color: var(--home-navy);
  font-family: var(--font-body, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .13em;
  line-height: 1.6;
  text-transform: uppercase;
}
.mhc-home-section :is(.wp-block-column, .home-card, .section-heading) > :last-child,
.mhc-home-section .home-card > .wp-block-group__inner-container > :last-child {
  margin-bottom: 0;
}

/* Use named grids only; unrelated core columns retain the theme's behavior. */
.mhc-home-section :is(.home-two-col, .home-three-col, .home-four-col,
  .home-feature-grid, .home-community-grid, .home-consultation-grid,
  .mhc-home-hero-grid) {
  display: grid;
  grid-template-columns: var(--home-columns, repeat(2, minmax(0, 1fr)));
  align-items: stretch;
  gap: var(--home-gap);
  width: 100%;
  margin-block: 0;
}
.mhc-home-section .home-three-col { --home-columns: repeat(3, minmax(0, 1fr)); }
.mhc-home-section :is(.home-four-col, .home-community-grid) {
  --home-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}
.mhc-home-section :is(.home-feature-grid, .home-consultation-grid) {
  --home-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
}
.mhc-home-section .home-consultation-grid { align-items: start; }
.mhc-home-section :is(.home-two-col, .home-three-col, .home-four-col,
  .home-feature-grid, .home-community-grid, .home-consultation-grid,
  .mhc-home-hero-grid) > .wp-block-column {
  width: auto;
  max-width: 100%;
  min-width: 0;
  margin: 0;
}

/* Headline stays editorial, not oversized; the 55/45 split gives copy room. */
.mhc-homepage-content > .mhc-home-section.mhc-home-hero,
.editor-styles-wrapper .mhc-home-section.mhc-home-hero {
  padding-block: 64px;
  background: var(--home-warm);
}
.mhc-home-section .mhc-home-hero-grid {
  --home-columns: minmax(0, 55fr) minmax(0, 45fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: center;
}
.mhc-home-section .mhc-home-hero-copy { padding: 0; }
.mhc-home-section .mhc-home-hero-copy h1 {
  max-width: 640px;
  margin: 0 0 24px;
  font-size: clamp(2.1rem, 4.2vw, 3.8rem);
  letter-spacing: -.035em;
  line-height: 1.08;
}
.mhc-home-section .mhc-home-hero-copy p:not(.eyebrow) {
  max-width: 60ch;
  font-size: 1.125rem;
  line-height: 1.65;
}
.mhc-home-section :is(.mhc-home-hero-media, .mhc-home-hero-media figure) {
  margin: 0;
  min-width: 0;
}
.mhc-home-section .mhc-home-hero-media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center;
  border-radius: 2px;
}
.mhc-home-section .wp-block-image { margin: 0; }
.mhc-home-section .wp-block-image img { display: block; max-width: 100%; height: auto; }
.mhc-home-section .wp-block-image figcaption {
  margin-top: 8px;
  color: var(--home-muted);
  font-size: .875rem;
}
.mhc-home-section .home-feature-grid .wp-block-image img,
.mhc-home-section .home-management :is(figure img, picture img),
.mhc-home-section.home-management :is(figure img, picture img) {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  object-position: center;
  border-radius: 2px;
}

.mhc-home-section .wp-block-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-block: 24px 0;
}
.mhc-home-section .wp-block-button { min-width: 0; max-width: 100%; }
.mhc-home-section :is(.wp-block-button__link, .button, button[type="submit"], input[type="submit"]) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  max-width: 100%;
  padding: 12px 20px;
  border: 1px solid var(--home-navy);
  border-radius: 2px;
  background: var(--home-navy);
  color: var(--home-white);
  font-size: .9375rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: normal;
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.mhc-home-section :is(.wp-block-button__link, .button, button[type="submit"], input[type="submit"]):hover {
  background: #233f5d;
  border-color: #233f5d;
  color: var(--home-white);
}
.mhc-home-section .wp-block-button.is-style-outline > .wp-block-button__link,
.mhc-home-section .button-outline {
  background: transparent;
  border-color: var(--home-navy);
  color: var(--home-navy);
}
.mhc-home-section .wp-block-button.is-style-outline > .wp-block-button__link:hover,
.mhc-home-section .button-outline:hover {
  background: var(--home-navy);
  color: var(--home-white);
}
/* Preserve navy labels on every gold-filled core/button variant, including hover. */
.mhc-home-section :is(.button-gold, .wp-block-button__link.has-gold-background-color),
.mhc-home-section .wp-block-button:is(.button-gold, .is-style-gold) > .wp-block-button__link {
  background: var(--home-gold);
  border-color: var(--home-gold);
  color: var(--home-navy);
}
.mhc-home-section :is(.button-gold, .wp-block-button__link.has-gold-background-color):hover,
.mhc-home-section .wp-block-button:is(.button-gold, .is-style-gold) > .wp-block-button__link:hover {
  background: #c5ae84;
  border-color: #c5ae84;
  color: var(--home-navy);
}
.mhc-home-section :focus-visible {
  outline: 2px solid var(--home-navy);
  outline-offset: 4px;
}

/* Search uses real labelled fields and an honest provider-pending note. */
.mhc-home-section .mhc-home-search {
  width: 100%;
  max-width: none;
  margin: 0;
}
.mhc-home-section .home-search-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
  gap: 24px;
}
.mhc-home-section .home-search-grid > * { min-width: 0; margin-bottom: 0; }
.mhc-home-section :is(.home-search-grid, .home-form-grid) label {
  display: block;
  margin-bottom: 8px;
  color: var(--home-navy);
  font-size: 1rem;
  font-weight: 600;
}
.mhc-home-section .home-search-note {
  margin-top: 24px;
  padding: 20px 24px;
  border: 1px solid var(--home-line);
  border-left: 3px solid var(--home-gold);
  border-radius: 2px;
  background: var(--home-warm);
  color: var(--home-muted);
}
.mhc-home-section .home-search-note p { color: inherit; font-size: .9375rem; }
.mhc-home-section .home-search-note > :last-child { margin-bottom: 0; }
.mhc-home-section .mhc-home-search > :is(.wp-block-buttons, .home-search-actions) { margin-top: 24px; }

.mhc-home-section .home-card {
  height: 100%;
  padding: 24px;
  border: 1px solid var(--home-line);
  border-top: 2px solid var(--home-gold);
  border-radius: 2px;
  background: var(--home-warm);
}
.mhc-home-section .home-card p { font-size: 1rem; }
.mhc-home-section .home-card > a:not(.wp-block-button__link) {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 600;
}
.mhc-home-section .home-community-grid .home-card {
  padding: 24px 20px;
  background: var(--home-white);
}
.mhc-home-section .home-community-grid h3 { font-size: 1.375rem; }

.mhc-homepage-content > .mhc-home-section:is(.home-navy, .home-management),
.editor-styles-wrapper .mhc-home-section:is(.home-navy, .home-management),
.mhc-home-section .home-navy {
  background: var(--home-navy);
  color: var(--home-white);
}
.mhc-home-section:is(.home-navy, .home-management) :is(h1, h2, h3, h4, p, li, .eyebrow),
.mhc-home-section .home-navy :is(h1, h2, h3, h4, p, li, .eyebrow) {
  color: var(--home-white);
}
.mhc-home-section:is(.home-navy, .home-management) a:not(.wp-block-button__link):not(.button),
.mhc-home-section .home-navy a:not(.wp-block-button__link):not(.button) { color: var(--home-white); }
.mhc-home-section:is(.home-navy, .home-management) .wp-block-button.is-style-outline > .wp-block-button__link,
.mhc-home-section .home-navy .wp-block-button.is-style-outline > .wp-block-button__link {
  border-color: var(--home-white);
  color: var(--home-white);
  background: transparent;
}
.mhc-home-section:is(.home-navy, .home-management) .wp-block-button.is-style-outline > .wp-block-button__link:hover,
.mhc-home-section .home-navy .wp-block-button.is-style-outline > .wp-block-button__link:hover {
  background: var(--home-white);
  color: var(--home-navy);
}
.mhc-home-section:is(.home-navy, .home-management) :focus-visible,
.mhc-home-section .home-navy :focus-visible { outline-color: var(--home-gold); }
.mhc-homepage-content > .mhc-home-section.home-valuation,
.editor-styles-wrapper .mhc-home-section.home-valuation,
.mhc-home-section .home-valuation { background: var(--home-warm); }
.mhc-home-section .home-empty-state {
  padding: 24px;
  border: 1px solid var(--home-line);
  border-radius: 2px;
  background: var(--home-warm);
  color: var(--home-muted);
}
.mhc-home-section .home-broker-note {
  margin-top: 24px;
  padding: 16px 20px;
  border-left: 3px solid var(--home-gold);
  background: var(--home-warm);
  color: var(--home-muted);
  font-size: .9375rem;
}
.mhc-home-section :is(.home-empty-state, .home-broker-note) > :last-child { margin-bottom: 0; }

/* Native details keep their browser disclosure marker and keyboard behavior. */
.mhc-home-section .home-resources .wp-block-details,
.mhc-home-section .wp-block-details.home-resources {
  margin-block: 0;
  padding: 16px 0;
  border: 0;
  border-top: 1px solid var(--home-line);
}
.mhc-home-section .home-resources .wp-block-details:last-child {
  border-bottom: 1px solid var(--home-line);
}
.mhc-home-section .home-resources summary {
  min-height: 44px;
  padding-block: 10px;
  color: var(--home-navy);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
  cursor: pointer;
}
.mhc-home-section .home-resources .wp-block-details[open] > summary { margin-bottom: 16px; }
.mhc-home-section .home-resources .wp-block-details > :last-child:not(summary) { margin-bottom: 0; }

/* Form controls inherit foundation borders, typography, and input treatment. */
.mhc-home-section .mhc-consultation-form { width: 100%; max-width: none; margin: 0; }
.mhc-home-section .home-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 24px;
}
.mhc-home-section .home-form-grid > * { min-width: 0; margin-bottom: 0; }
.mhc-home-section .home-form-grid :is(.home-field-message, .home-form-full, .home-consent),
.mhc-home-section .home-form-grid > :has(textarea) { grid-column: 1 / -1; }
.mhc-home-section .mhc-consultation-form textarea { min-height: 128px; }
.mhc-home-section .home-consent { margin-block: 20px; }
.mhc-home-section .home-consent label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 44px;
  margin: 0;
  font-size: .9375rem;
  font-weight: 400;
  line-height: 1.6;
}
.mhc-home-section .home-consent input[type="checkbox"] {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  margin: 3px 0 0;
  accent-color: var(--home-navy);
}
.mhc-home-section :is(.home-form-status, .home-form-errors) {
  margin-block: 20px;
  padding: 16px 20px;
  border: 1px solid var(--home-line);
  border-left: 3px solid var(--home-navy);
  border-radius: 2px;
  background: var(--home-warm);
  color: var(--home-ink);
}
.mhc-home-section :is(.home-form-status, .home-form-errors):empty { display: none; }
.mhc-home-section .home-form-errors { border-left-color: #8a2929; }
.mhc-home-section .home-form-errors :is(p, li, a),
.mhc-home-section .mhc-consultation-form .field-error { color: #8a2929; }
.mhc-home-section .mhc-consultation-form [aria-invalid="true"] { border-color: #8a2929; }
.mhc-home-section .home-form-errors ul { margin: 0; padding-left: 24px; }
.mhc-home-section .home-form-status > :last-child { margin-bottom: 0; }
.mhc-home-section .home-test-notice {
  margin-block: 20px;
  padding: 16px 20px;
  border: 1px solid var(--home-line);
  border-left: 3px solid var(--home-navy);
  background: var(--home-warm);
  color: var(--home-navy);
  font-size: .9375rem;
  line-height: 1.6;
}
.mhc-home-section .home-test-notice > :last-child { margin-bottom: 0; }
/* State styling does not disable forms or intercept provider requests. */
.mhc-home-section :is(button, input, select, textarea):disabled,
.mhc-home-section :is(.button, .wp-block-button__link)[aria-disabled="true"] {
  background: #e8eaec;
  border-color: #a8afb6;
  color: #5a626a;
  cursor: not-allowed;
}

/* Gutenberg's editor places columns inside an InnerBlocks layout wrapper. */
.editor-styles-wrapper .mhc-home-section :is(.home-two-col, .home-three-col,
  .home-four-col, .home-feature-grid, .home-community-grid,
  .home-consultation-grid, .mhc-home-hero-grid):has(> .block-editor-inner-blocks) {
  display: block;
}
.editor-styles-wrapper .mhc-home-section :is(.home-two-col, .home-three-col,
  .home-four-col, .home-feature-grid, .home-community-grid,
  .home-consultation-grid, .mhc-home-hero-grid)
  > .block-editor-inner-blocks > .block-editor-block-list__layout {
  display: grid;
  grid-template-columns: var(--home-columns, repeat(2, minmax(0, 1fr)));
  gap: var(--home-gap);
  align-items: inherit;
}
.editor-styles-wrapper .mhc-home-section .block-editor-block-list__block { min-width: 0; }

@media (max-width: 1023px) {
  .mhc-home-section :is(.home-four-col, .home-community-grid) {
    --home-columns: repeat(2, minmax(0, 1fr));
  }
  .mhc-home-section .home-search-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mhc-home-section .mhc-home-hero-grid { gap: 24px; }
  .mhc-home-section .mhc-home-hero-copy h1 { font-size: clamp(2.1rem, 4.6vw, 3rem); }
  .mhc-home-section .home-card { padding: 24px 20px; }
}

/* Stack before WordPress's 781px columns breakpoint, including inline bases. */
@media (max-width: 781px) {
  .mhc-homepage-content,
  .editor-styles-wrapper .mhc-home-section {
    --home-gap: 24px;
    --home-section-space: 40px;
  }
  .mhc-homepage-content > section.wp-block-group.mhc-home-section,
  .editor-styles-wrapper .mhc-home-section { scroll-margin-top: 88px; }
  .mhc-home-section .container { width: calc(100% - 32px); }
  .mhc-home-section :is(.home-two-col, .home-three-col, .home-four-col,
    .home-feature-grid, .home-community-grid, .home-consultation-grid,
    .mhc-home-hero-grid) {
    --home-columns: minmax(0, 1fr);
    gap: 24px;
  }
  .mhc-homepage-content > .mhc-home-section.mhc-home-hero,
  .editor-styles-wrapper .mhc-home-section.mhc-home-hero { padding-block: 40px; }
  .mhc-home-section .mhc-home-hero-copy h1 { font-size: clamp(2.1rem, 6vw, 2.5rem); }
  .mhc-home-section .mhc-home-hero-media img { aspect-ratio: 3 / 2; max-height: 360px; }
  .mhc-home-section .section-heading { margin-bottom: 24px; }
  .mhc-home-section .home-card { height: auto; }
  .mhc-home-section .home-consultation-grid { gap: 32px; }
}

@media (max-width: 599px) {
  .mhc-home-section :is(.home-search-grid, .home-form-grid) {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
  .mhc-home-section .home-search-note { padding: 20px; }
  .mhc-home-section .wp-block-buttons { align-items: stretch; gap: 12px; }
  .mhc-home-section .wp-block-buttons > .wp-block-button { flex: 1 1 100%; width: 100%; }
  .mhc-home-section .wp-block-buttons .wp-block-button__link { width: 100%; }
  .mhc-home-section :is(.mhc-home-search, .mhc-consultation-form)
    :is(button[type="submit"], input[type="submit"]) { width: 100%; }
  .mhc-home-section .home-empty-state { padding: 20px; }
}

@media print {
  .mhc-homepage-content > section.wp-block-group.mhc-home-section,
  .editor-styles-wrapper .mhc-home-section { padding-block: 24px; }
  .mhc-home-section:is(.home-navy, .home-management),
  .mhc-home-section .home-navy { background: #fff; color: #14283f; }
  .mhc-home-section:is(.home-navy, .home-management) :is(h1, h2, h3, h4, p, li, a),
  .mhc-home-section .home-navy :is(h1, h2, h3, h4, p, li, a) { color: #14283f; }
  .mhc-home-section .home-card { break-inside: avoid; }
}

/* Filled dark-band CTAs must stand apart from the band; outlines stay white. */
.mhc-home-section:is(.home-navy, .home-management)
  .wp-block-button:not(.is-style-outline) > .wp-block-button__link,
.mhc-home-section .home-navy
  .wp-block-button:not(.is-style-outline) > .wp-block-button__link {
  background: var(--home-gold);
  border-color: var(--home-gold);
  color: var(--home-navy);
}
.mhc-home-section:is(.home-navy, .home-management)
  .wp-block-button:not(.is-style-outline) > .wp-block-button__link:hover,
.mhc-home-section .home-navy
  .wp-block-button:not(.is-style-outline) > .wp-block-button__link:hover {
  background: #c5ae84;
  border-color: #c5ae84;
  color: var(--home-navy);
}

/* Generated native-block and form integration hooks. */
.mhc-home-section .home-eyebrow { margin-bottom:16px; font-size:.75rem; font-weight:700; letter-spacing:.13em; text-transform:uppercase; line-height:1.6; }
.mhc-home-section .mhc-home-hero-copy p.home-eyebrow { font-size:.75rem; }
.home-stage-notice { margin-block:12px; color:var(--muted); font-size:.75rem; }
.mhc-home-section .home-search-panel { margin-top:40px; padding-top:32px; border-top:1px solid var(--home-line); }
.mhc-home-section .home-search-panel h2 { font-size:1.6rem; margin-bottom:12px; }
.mhc-home-section .home-search-intro { max-width:80ch; font-size:.9375rem; }
.mhc-home-section .home-search-actions { margin-top:20px; display:flex; align-items:center; gap:24px; }
.mhc-home-section .home-search-actions .home-search-note { padding:0; margin:0; border:0; background:transparent; font-size:.875rem; max-width:72ch; }
.mhc-home-section :is(.home-service-copy,.home-investment-card,.home-community-card) { padding:24px; border-top:2px solid var(--home-gold); background:var(--home-warm); }
.mhc-home-section .home-community-card { display:flex; flex-direction:column; }
.mhc-home-section .home-community-card .wp-block-buttons { margin-top:auto; padding-top:12px; }
.mhc-home-section .home-community-card .wp-block-button__link { padding:10px 12px; font-size:.875rem; }
.mhc-home-section .home-listing-empty { padding:24px 28px; background:var(--home-warm); border-left:3px solid var(--home-gold); }
.mhc-home-section .home-value-accent { padding:28px; border-left:3px solid var(--home-gold); background:var(--home-white); }
.mhc-home-section .home-image-note,.mhc-home-section .home-fine-print,.mhc-home-section .home-resource-meta,.mhc-home-section .home-broker-pending { font-size:.875rem; }
.mhc-home-section .home-image-note { margin-top:16px; }
.mhc-home-section.home-resources .wp-block-details { margin-block:16px; padding:16px 24px; border:1px solid var(--home-line); background:var(--home-warm); }
.mhc-home-section.home-resources summary { min-height:44px; font-weight:600; cursor:pointer; }
.mhc-home-section .home-contact-grid { align-items:start; }
.mhc-home-section .home-form-wide { grid-column:1/-1; }
.mhc-home-section label.home-consent { display:flex; gap:12px; align-items:flex-start; font-weight:400; font-size:.875rem; }
.mhc-home-section .required-mark { font-size:.75rem; font-weight:400; color:var(--home-muted); }
.mhc-home-section .home-honeypot { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
.mhc-home-section .field-note:empty { display:none; }
.mhc-home-section .home-policies { margin-top:32px; padding-top:24px; border-top:1px solid var(--home-line); font-size:.875rem; }
.mhc-home-section .home-policies h3 { font-size:1.2rem; margin-bottom:12px; }
@media(max-width:781px) { .mhc-home-section .home-search-actions { flex-direction:column; align-items:stretch; gap:16px; } .mhc-home-section .home-search-panel { margin-top:32px; } }
