/* =============================================================
   WOLF HOME PROS - ASTRA COMPATIBILITY v1.5.1
   Only applies to pages assigned Gutenberg Full Width.
   The user-facing Wolf site stylesheet still owns the design.
============================================================= */

/* Astra header/footer stay intact; the Wolf Gutenberg template fills the body. */
body.wolf-gutenberg-full-width.ast-page-builder-template .site-content > .ast-container {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.wolf-gutenberg-full-width #primary.wolf-gutenberg-page {
  display: block !important;
  float: none !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Lift width restrictions from page-level sections, not from their inner
   content groups. The v1.5.0 generic nested selector was too broad and
   interfered with social, town, and CTA centering/width constraints. */
body.wolf-gutenberg-full-width #primary.wolf-gutenberg-page > .wp-block-group,
body.wolf-gutenberg-full-width #primary.wolf-gutenberg-page > .wp-block-cover,
body.wolf-gutenberg-full-width #primary.wolf-gutenberg-page > .wp-block-columns {
  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* Support an optional extra Gutenberg outer group without resetting inner
   containers such as .wolf-social-break-inner or .wolf-contact-options. */
body.wolf-gutenberg-full-width #primary.wolf-gutenberg-page > .wp-block-group.is-layout-constrained > :is(
  .wolf-home-hero, .wolf-split-section, .wolf-social-break,
  .wolf-areas-section, .wolf-contact-cta, .wolf-services-section
) {
  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* Preserve Wolf's existing full-bleed split-section composition. */
body.wolf-gutenberg-full-width .wolf-gutenberg-page .wolf-split-section,
body.wolf-gutenberg-full-width .wolf-gutenberg-page .wolf-split-section > .wolf-split-row,
body.wolf-gutenberg-full-width .wolf-gutenberg-page .wolf-split-section > .wp-block-group__inner-container > .wolf-split-row {
  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* =============================================================
   NEWER GUTENBERG: no .wp-block-group__inner-container is emitted
   The original Wolf stylesheet applied the service grid to that old
   wrapper. Apply the same grid directly to the Group under Astra.
============================================================= */
body.wolf-gutenberg-full-width .wolf-gutenberg-page .wolf-services-cards {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  column-gap: 28px !important;
  row-gap: 22px !important;
  width: min(100%, 1200px) !important;
  max-width: 1200px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  min-width: 0 !important;
}

body.wolf-gutenberg-full-width .wolf-gutenberg-page .wolf-services-cards > .wolf-service-card {
  min-width: 0 !important;
}

/* Restore the homepage's 2-column service-area directory. */
body.wolf-gutenberg-full-width .wolf-gutenberg-page .wolf-areas-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-template-rows: none !important;
  grid-auto-flow: row !important;
  column-gap: 16px !important;
  row-gap: 14px !important;
  width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* The Downingtown home-base tile spans both columns, like before. */
body.wolf-gutenberg-full-width .wolf-gutenberg-page .wolf-areas-grid > .wolf-area-home-base {
  grid-column: 1 / -1 !important;
}

@media (min-width: 782px) and (max-width: 1099px) {
  body.wolf-gutenberg-full-width .wolf-gutenberg-page .wolf-services-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    column-gap: 24px !important;
    row-gap: 24px !important;
  }
}

@media (max-width: 781px) {
  body.wolf-gutenberg-full-width .wolf-gutenberg-page .wolf-services-cards {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 22px !important;
  }
}

@media (max-width: 600px) {
  body.wolf-gutenberg-full-width .wolf-gutenberg-page .wolf-areas-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    row-gap: 12px !important;
  }

  body.wolf-gutenberg-full-width .wolf-gutenberg-page .wolf-areas-grid > .wolf-area-home-base {
    grid-column: auto !important;
    width: 100% !important;
    max-width: 100% !important;
  }
}


/* =============================================================
   v1.5.2 — ABOUT / FAMILY SECTION WIDTH

   The family section is full bleed, but Gutenberg's default
   constrained layout limits its immediate row children to the
   global 800px content size. Release only these two family rows;
   preserve the narrow inner containers in social, towns and CTA.
============================================================= */
body.wolf-gutenberg-full-width #primary.wolf-gutenberg-page
.wolf-family-section .wolf-family-top-row,
body.wolf-gutenberg-full-width #primary.wolf-gutenberg-page
.wolf-family-section .wolf-family-bottom-row {
  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* =============================================================
   v1.5.2 — CTA SVG GOLD BORDER DRAW

   The original border uses a <rect pathLength="100">.
   Animating dash offset is more reliable in modern Chromium
   than transitioning stroke-dasharray from "8 92" to "100 0".
   Preserve the short resting segment (8%), and draw the whole
   perimeter on hover/focus without changing the card layout.
============================================================= */
body.wolf-gutenberg-full-width #primary.wolf-gutenberg-page
.wolf-contact-option .wolf-contact-border-tracer rect {
  stroke-dasharray: 100 100 !important;
  stroke-dashoffset: 92 !important;
  transition:
    stroke-dashoffset 1.10s linear,
    filter 0.24s ease !important;
}

body.wolf-gutenberg-full-width #primary.wolf-gutenberg-page
.wolf-contact-option:is(:hover, :focus-within)
.wolf-contact-border-tracer rect {
  stroke-dasharray: 100 100 !important;
  stroke-dashoffset: 0 !important;
}

@media (prefers-reduced-motion: reduce) {
  body.wolf-gutenberg-full-width #primary.wolf-gutenberg-page
  .wolf-contact-option .wolf-contact-border-tracer rect {
    transition: none !important;
  }
}
