/* =========================================================
   Sitewide responsive fixes — header cut-off + layout
   Mobile nav (hamburger): ≤992px
   Desktop nav + mega: ≥993px
   ========================================================= */

html {
  overflow-x: clip;
}

body {
  overflow-x: clip;
  max-width: 100vw;
}

img,
video,
svg,
canvas {
  max-width: 100%;
  height: auto;
}

/* Avoid fixed header covering content on small screens */
main,
#main {
  overflow-x: clip;
}

/* Fixed header clearance — default 6.6rem is too short once Blog/CTA are in nav */
:root {
  --nav-h: 7.5rem;
}

@media (max-width: 991.98px) {
  :root {
    --nav-h: 7.75rem;
  }
}

@media (max-width: 48rem) {
  :root {
    --nav-h: 6.75rem;
  }
}

/* ---------- Heroes: keep content below fixed header (all pages) ---------- */
.Hero-module___w2HtG__hero,
.ServiceHero-module__6pe69W__section,
.page-module__BdiYHW__hero,
.page-module__IEM2ma__hero,
.page-module__7XaXdG__hero,
.LegalProse-module__UOpP9W__head,
section.Library-module__Y8xula__section,
.page-module__H_zkza__inner,
[class*="ServiceHero-module"][class*="__section"],
[class*="page-module"][class*="__hero"],
.blog-page .blog-hero,
.blog-single-page .blog-hero,
.blog-author-page .blog-hero {
  scroll-margin-top: var(--nav-h);
}

.Hero-module___w2HtG__hero {
  padding-block-start: calc(var(--nav-h) + clamp(1rem, 5svh, 2.5rem)) !important;
  box-sizing: border-box;
}

.ServiceHero-module__6pe69W__section,
.page-module__BdiYHW__hero,
.page-module__IEM2ma__hero,
.page-module__7XaXdG__hero,
.LegalProse-module__UOpP9W__head {
  padding-block-start: calc(var(--nav-h) + clamp(1.5rem, 8svh, 3.5rem)) !important;
}

section.Library-module__Y8xula__section {
  padding-block-start: calc(var(--nav-h) + clamp(0.75rem, 3svh, 1.5rem)) !important;
}

.page-module__H_zkza__inner {
  padding-block-start: calc(var(--nav-h) + 1rem) !important;
}

.blog-page,
.blog-single-page,
.blog-author-page {
  --blog-header-offset: var(--nav-h);
}

.blog-hero {
  padding-top: calc(var(--nav-h) + 3rem) !important;
}

/* Mid widths: give hero extra air under hamburger header */
@media (min-width: 48rem) and (max-width: 991.98px) {
  .Hero-module___w2HtG__hero {
    padding-block-start: calc(var(--nav-h) + clamp(1.25rem, 6svh, 3rem)) !important;
  }

  .ServiceHero-module__6pe69W__section,
  .page-module__BdiYHW__hero,
  .page-module__IEM2ma__hero,
  .page-module__7XaXdG__hero,
  .LegalProse-module__UOpP9W__head {
    padding-block-start: calc(var(--nav-h) + clamp(2rem, 9svh, 4rem)) !important;
  }
}

/* ---------- CTA buttons: stop text sticking to edges ---------- */
.CtaGroup-module__7kcBwG__actionRow {
  gap: clamp(0.75rem, 2vw, 1.25rem);
}

.CtaGroup-module__7kcBwG__group .CtaGroup-module__7kcBwG__action,
.CtaGroup-module__7kcBwG__group a.CtaGroup-module__7kcBwG__action,
.CtaGroup-module__7kcBwG__group button.CtaGroup-module__7kcBwG__action {
  flex: 0 1 auto !important;
  min-width: 0 !important;
  max-width: none !important;
  width: auto !important;
  padding: 1.15em 2.35em !important;
  box-sizing: border-box;
  white-space: nowrap;
  letter-spacing: 0.12em;
  line-height: 1.2 !important;
}

.CtaGroup-module__7kcBwG__group .CtaGroup-module__7kcBwG__action > span,
.CtaGroup-module__7kcBwG__group .CtaGroup-module__7kcBwG__action > span > span {
  display: inline-block;
  padding-inline: 0.05em;
}

/* Mid screens: keep generous CTA side padding */
@media (min-width: 48rem) and (max-width: 991.98px) {
  .CtaGroup-module__7kcBwG__group .CtaGroup-module__7kcBwG__action {
    padding: 1.2em 2.5em !important;
    font-size: 0.8125rem !important;
  }
}

@media (max-width: 40rem) {
  .CtaGroup-module__7kcBwG__group .CtaGroup-module__7kcBwG__action {
    width: 100% !important;
    max-width: 22rem !important;
    white-space: normal;
    text-align: center;
    padding: 1.15em 1.75em !important;
    line-height: 1.35 !important;
  }
}

/* Hero primary/secondary CTAs (home) */
.Hero-module___w2HtG__primary,
.Hero-module___w2HtG__secondary {
  min-width: 0 !important;
  padding: 1.15em 2.35em !important;
  box-sizing: border-box;
}

/* Generic site buttons */
.Button-module__8RiFmG__base:not(.Button-module__8RiFmG__tertiary) {
  padding: 1.05em 2em;
  box-sizing: border-box;
}

@media (max-width: 30rem) {
  .CtaGroup-module__7kcBwG__group .CtaGroup-module__7kcBwG__action {
    padding: 1.15em 1.65em !important;
  }
}

/* ---------- Header / nav ---------- */
/* Mobile hamburger: ≤992px | Desktop menu: ≥993px */

@media (max-width: 991.98px) {
  .Nav-module__CBhHSW__links {
    display: none !important;
  }

  .MobileMenu-module__UHEhLG__toggle {
    display: grid !important;
  }

  .Nav-module__CBhHSW__nav {
    gap: var(--space-3, 1rem);
  }

  .Nav-module__CBhHSW__navCta {
    padding: 0.8em 1.1em;
  }

  .Nav-module__CBhHSW__mega {
    display: none !important;
  }
}

@media (min-width: 992px) {
  /* Center nav WITHOUT transform — transform makes position:fixed mega
     stick to the links bar and overflow/cut off at ~1280. */
  .Nav-module__CBhHSW__links {
    display: flex !important;
    justify-content: center;
    position: absolute;
    inset-inline: 0;
    inset-inline-start: 0;
    transform: none !important;
    translate: none !important;
    margin-inline: auto;
    width: max-content;
    gap: clamp(0.45rem, 0.9vw, 1.35rem);
    max-width: min(54rem, calc(100vw - 20rem));
    flex-wrap: nowrap;
  }

  .MobileMenu-module__UHEhLG__toggle {
    display: none !important;
  }

  .Nav-module__CBhHSW__link {
    font-size: clamp(0.58rem, 0.48rem + 0.22vw, 0.75rem);
    letter-spacing: 0.07em;
  }

  .Nav-module__CBhHSW__brand {
    width: clamp(6.25rem, 7.5vw, 8.75rem);
  }

  .Nav-module__CBhHSW__actions {
    gap: clamp(0.4rem, 0.9vw, 1rem);
  }
}

/* Compact desktop (992–1360): keep links from colliding with brand/CTA */
@media (min-width: 992px) and (max-width: 1360px) {
  .Nav-module__CBhHSW__links {
    gap: 0.4rem;
    max-width: calc(100vw - 18rem);
  }

  .Nav-module__CBhHSW__link {
    font-size: 0.58rem;
    letter-spacing: 0.05em;
    padding-block: 0.35em;
  }

  .Nav-module__CBhHSW__navCta {
    padding: 0.7em 0.95em;
  }

  .Nav-module__CBhHSW__phone {
    display: none !important;
  }
}

@media (min-width: 1361px) and (max-width: 1599px) {
  .Nav-module__CBhHSW__links {
    gap: 0.55rem;
    max-width: calc(100vw - 20rem);
  }

  .Nav-module__CBhHSW__link {
    font-size: 0.625rem;
    letter-spacing: 0.06em;
  }

  .Nav-module__CBhHSW__phone {
    display: none !important;
  }
}

/* Phone only when truly wide */
@media (min-width: 1600px) {
  .Nav-module__CBhHSW__phone {
    display: inline-block;
  }
}

/* Mega menu — viewport fixed + pinned to gutters (never cut at 1280) */
.Nav-module__CBhHSW__nav,
.Nav-module__CBhHSW__links,
.Nav-module__CBhHSW__item {
  overflow: visible !important;
}

.Nav-module__CBhHSW__mega {
  display: grid !important;
  position: fixed !important;
  top: 4.6rem !important;
  left: 1.25rem !important;
  right: 1.25rem !important;
  inset-block-start: 4.6rem !important;
  inset-inline: 1.25rem !important;
  width: auto !important;
  max-width: none !important;
  margin: 0 !important;
  margin-inline: 0 !important;
  transform: none !important;
  padding: var(--space-5) !important;
  gap: var(--space-5) !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  box-sizing: border-box;
  translate: 0 -6px;
  opacity: 0;
  visibility: hidden;
  z-index: 200 !important;
  background-color: var(--deep-forest);
  border: 1px solid var(--rule);
  box-shadow: 0 24px 60px -20px #0000008c;
  max-height: calc(100svh - 5.5rem);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.Nav-module__CBhHSW__item:hover .Nav-module__CBhHSW__mega,
.Nav-module__CBhHSW__item:focus-within .Nav-module__CBhHSW__mega {
  opacity: 1;
  visibility: visible;
  translate: 0;
  transform: none !important;
}

.Nav-module__CBhHSW__groupWide {
  grid-column: span 2;
}

.Nav-module__CBhHSW__groupWide .Nav-module__CBhHSW__groupList {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem var(--space-4);
}

.Nav-module__CBhHSW__group {
  min-width: 0;
}

/* Wide screens: restore original max-content centered panel */
@media (min-width: 1440px) {
  .Nav-module__CBhHSW__mega {
    left: 50% !important;
    right: auto !important;
    inset-inline: auto !important;
    inset-inline-start: 50% !important;
    width: max-content !important;
    max-width: min(72rem, calc(100vw - 2.5rem)) !important;
    transform: translateX(-50%) !important;
    translate: 0 -6px;
  }

  .Nav-module__CBhHSW__item:hover .Nav-module__CBhHSW__mega,
  .Nav-module__CBhHSW__item:focus-within .Nav-module__CBhHSW__mega {
    transform: translateX(-50%) !important;
    translate: 0;
  }

  .Nav-module__CBhHSW__mega {
    grid-template-columns: repeat(4, minmax(10rem, 1fr)) !important;
  }
}

/* Hero smoke / foil overlay — keep visible over plate */
.HeroFoil-module__5UpN5W__wrap {
  z-index: 1 !important;
  pointer-events: none !important;
}

.HeroFoil-module__5UpN5W__canvas {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  opacity: 0.55 !important;
  mix-blend-mode: screen !important;
}

.InkField-module__Q7A8aa__canvas {
  z-index: 1 !important;
  opacity: 0.5 !important;
  pointer-events: none !important;
}

/* Mobile / mid-width menu: fill viewport and scroll services list */
.MobileMenu-module__UHEhLG__overlay {
  height: 100dvh;
  max-height: 100dvh;
  box-sizing: border-box;
}

.MobileMenu-module__UHEhLG__overlay[hidden],
.House-module__dYTEua__layer[hidden] {
  display: none !important;
}

/* Signup popup — explicit open/close (do not rely on [hidden] alone) */
#signup-dialog.SignUpDialog-module__xf0vZW__layer,
.SignUpDialog-module__xf0vZW__layer#signup-dialog {
  display: none !important;
  z-index: 99999 !important;
  position: fixed !important;
  inset: 0 !important;
  place-items: center !important;
  padding: clamp(0.75rem, 3vw, 2rem);
}

#signup-dialog.is-open,
.SignUpDialog-module__xf0vZW__layer#signup-dialog.is-open {
  display: grid !important;
  z-index: 2147483646 !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.MobileMenu-module__UHEhLG__scroll {
  min-height: 0 !important;
  flex: 1 1 auto !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 48rem) {
  .Nav-module__CBhHSW__nav {
    padding-inline: max(0.85rem, env(safe-area-inset-left))
      max(0.85rem, env(safe-area-inset-right));
    gap: 0.65rem;
  }

  .Nav-module__CBhHSW__brand {
    width: clamp(6.25rem, 28vw, 7.5rem);
  }

  .Nav-module__CBhHSW__navCta {
    padding: 0.7em 0.85em;
  }
}

@media (max-width: 26rem) {
  .Nav-module__CBhHSW__ctaFull {
    display: none;
  }

  .Nav-module__CBhHSW__ctaShort {
    display: inline;
  }
}

/* ---------- Sections / content ---------- */
.Section-module__WJnb5a__inner,
.Footer-module__q7ZRWa__inner {
  width: min(100% - (var(--gutter, 1.25rem) * 2), var(--content-max, 80rem));
  max-width: 100%;
  box-sizing: border-box;
}

@media (max-width: 40rem) {
  :root {
    --gutter: 1rem;
  }
}

/* Footer address / columns + mega services */
.Footer-module__q7ZRWa__address {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.Footer-module__q7ZRWa__top.FooterMega-top {
  display: grid;
  gap: clamp(1.5rem, 3vw, 2.75rem);
  grid-template-columns: 1fr;
  align-items: start;
}

@media (min-width: 55rem) {
  .Footer-module__q7ZRWa__top.FooterMega-top {
    grid-template-columns: minmax(16rem, 1.5fr) repeat(2, minmax(8rem, 1fr));
  }
}

.FooterMega-newsletter {
  min-width: 0;
}

.FooterMega-services {
  display: grid;
  gap: clamp(1.25rem, 2.5vw, 2rem);
  grid-template-columns: 1fr;
  align-items: start;
  padding-block: var(--space-5, 2rem);
  border-block-end: 1px solid var(--rule, rgba(255, 255, 255, 0.12));
}

@media (min-width: 40rem) {
  .FooterMega-services {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 64rem) {
  .FooterMega-services {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: clamp(1rem, 2vw, 1.75rem);
  }
}

.FooterMega-col {
  min-width: 0;
  gap: 0.55rem !important;
}

.FooterMega-col .Footer-module__q7ZRWa__colTitle {
  margin-block-end: 0.75rem;
  color: var(--brass, #c4a35a);
}

.FooterMega-col .Footer-module__q7ZRWa__link {
  font-size: 0.875rem;
  line-height: 1.35;
}

@media (max-width: 48rem) {
  .Footer-module__q7ZRWa__top.FooterMega-top {
    grid-template-columns: 1fr;
  }

  .Footer-module__q7ZRWa__badges {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .Footer-module__q7ZRWa__bottom {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
}

/* Contact / forms */
input,
textarea,
select,
button {
  max-width: 100%;
}

/* Floating CTAs — phones: inset; tablet+ flush to right edge */
@media (max-width: 47.99rem) {
  .FloatingCtas-module__hmGI0q__dock {
    max-width: calc(100vw - 1.5rem);
    inset-inline: 0.75rem !important;
    justify-content: center;
  }
}

@media (max-width: 40rem) {
  .FloatingCtas-module__hmGI0q__dock {
    flex-wrap: wrap;
  }
}

@media (min-width: 48rem) {
  .FloatingCtas-module__hmGI0q__dock {
    inset-inline: auto 0 !important;
    right: 0 !important;
    left: auto !important;
    padding-inline-end: 0 !important;
    padding-inline-start: 0 !important;
    max-width: none;
    align-items: flex-end;
  }

  .FloatingCtas-module__hmGI0q__action {
    border-start-end-radius: 0 !important;
    border-end-end-radius: 0 !important;
  }
}

/* Partner strip / horizontal tracks */
.PartnerStrip-module__A8QtjW__viewport {
  max-width: 100%;
}

/* Tables if any */
table {
  max-width: 100%;
  display: block;
  overflow-x: auto;
}

/* Blog pages inherit same nav rules */
.blog-page .Nav-module__CBhHSW__nav,
.blog-single-page .Nav-module__CBhHSW__nav,
.blog-author-page .Nav-module__CBhHSW__nav {
  max-width: 100vw;
}
