/**
 * Global mobile-first responsive layer (statewide / template2 + generated sites).
 * Loaded last. Includes hamburger navigation for .header__nav family.
 */

:root {
  --rp-container: min(1200px, calc(100% - clamp(1.25rem, 4vw, 2.5rem)));
  --rp-space-1: clamp(0.5rem, 1.5vw, 0.75rem);
  --rp-space-2: clamp(0.75rem, 2vw, 1.25rem);
  --rp-space-3: clamp(1rem, 3vw, 2rem);
  --rp-space-4: clamp(1.5rem, 4vw, 3rem);
  --rp-touch: 44px;
  --rp-safe-bottom: env(safe-area-inset-bottom, 0px);
  --rp-safe-top: env(safe-area-inset-top, 0px);
}

/* ---------- Base / box model ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
}

img,
video,
svg,
canvas,
iframe,
embed,
object {
  max-width: 100%;
  height: auto;
}

iframe {
  width: 100%;
  max-width: 100%;
  border: 0;
}

picture,
figure {
  max-width: 100%;
}

/* ---------- Containers & layout primitives ---------- */
.container,
.header__inner,
.footer-inner,
.topbar__inner {
  width: var(--rp-container);
  max-width: 100%;
  margin-inline: auto;
}

.row,
.grid,
.services-grid,
.serveGrid,
.areaGrid,
.citiesGrid,
.metric-grid,
.metrics-grid,
.trust-grid,
.faq-grid,
.contact-grid,
.hero__grid,
.hero__layout,
.footer-main-grid,
.locationIntro__inner {
  min-width: 0;
}

a,
p,
h1, h2, h3, h4, h5, h6,
li,
span,
label,
td,
th,
.nav__areaLabel,
.breadcrumb,
.breadcrumbs,
.header__queriesPhone {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* ---------- Typography (fluid) ---------- */
h1, .hero h1, .hero__title, .page-banner h1 {
  font-size: clamp(1.65rem, 1.1rem + 2.4vw, 3rem);
  line-height: 1.15;
}

h2, .section-title, .landmarkHub__title {
  font-size: clamp(1.35rem, 1rem + 1.5vw, 2.25rem);
  line-height: 1.2;
}

h3 {
  font-size: clamp(1.1rem, 0.95rem + 0.8vw, 1.5rem);
  line-height: 1.25;
}

p, li, .hero__sub, .landmarkHub__sub {
  font-size: clamp(0.95rem, 0.9rem + 0.25vw, 1.05rem);
  line-height: 1.6;
}

/* ---------- Touch targets & controls ---------- */
a.btn,
.btn,
button.btn,
.header__queriesBox,
.header__menuToggle,
.nav__link,
.nav__link--btn,
input[type="submit"],
button[type="submit"],
.fabCall a,
.fab-call a {
  min-height: var(--rp-touch);
}

input,
select,
textarea,
button {
  max-width: 100%;
  font-size: 16px;
}

textarea {
  min-height: 7rem;
  resize: vertical;
}

form {
  max-width: 100%;
}

/* ---------- Media / maps ---------- */
.map iframe,
.contact-map iframe,
.contactEmbeddedMap iframe,
[class*="map"] iframe {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  min-height: 220px;
}

/* ---------- Tables ---------- */
table {
  max-width: 100%;
}

.table-wrap,
.table-responsive,
.responsive-table,
.container > table,
.prose table,
article table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ---------- Fixed / sticky / overlays ---------- */
.header,
.site-header-sticky,
.sticky-header {
  max-width: 100%;
}

.fab-call,
.fabCall,
[class*="fab"],
.cookie-consent,
.cookieConsent,
.scroll-navigator,
.back-to-top {
  max-width: calc(100vw - 1.5rem);
  bottom: max(0.75rem, var(--rp-safe-bottom));
  z-index: 900;
}

.modal,
.dialog,
[role="dialog"] {
  max-width: min(100%, 100vw);
}

.nav__menu,
.nav__menu--wide {
  max-width: min(100vw - 1rem, 100%);
}

/* ---------- Hamburger toggle (hidden on desktop) ---------- */
.header__menuToggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  width: var(--rp-touch);
  min-width: var(--rp-touch);
  min-height: var(--rp-touch);
  padding: 0;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  z-index: 5;
}

.header__menuToggle span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.header__menuToggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.header__menuToggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.header__menuToggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.header__menuToggle:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* ---------- Topbar ---------- */
@media (max-width: 768px) {
  .topbar__tagline {
    white-space: normal;
  }

  .topbar__inner {
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    text-align: center;
  }

  .topbar__left,
  .topbar__center,
  .topbar__right {
    justify-content: center;
    width: 100%;
  }
}

/* ---------- Hero ---------- */
.hero {
  max-width: 100%;
  overflow: hidden;
}

.hero__content,
.hero__copy,
.hero__col,
.hero-contact-form {
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 900px) {
  .hero__layout,
  .hero__grid,
  .contact-grid,
  .about-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: var(--rp-space-3);
  }

  .hero-contact-form,
  .contact-form,
  .contactDockForm {
    width: 100%;
    max-width: 100%;
  }
}

/* ---------- Grids ---------- */
@media (max-width: 1024px) {
  .services-grid,
  .serveGrid,
  .metric-grid,
  .metrics-grid,
  .trust-grid,
  .trust {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 640px) {
  .services-grid,
  .serveGrid,
  .metric-grid,
  .metrics-grid,
  .trust-grid,
  .trust,
  .areaGrid,
  .citiesGrid,
  .faq-grid {
    grid-template-columns: 1fr !important;
  }

  .container {
    width: min(100% - 1.5rem, 1200px);
    padding-left: max(0.75rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.75rem, env(safe-area-inset-right, 0px));
  }

  .btn,
  a.btn,
  .header__queriesBox {
    width: auto;
    max-width: 100%;
  }

  .brand--logoOnly .brand__logo {
    max-width: min(200px, 55vw);
    height: auto;
  }
}

/* ---------- Footer ---------- */
@media (max-width: 768px) {
  .footer-grid,
  .site-footer .grid,
  .footer__grid {
    grid-template-columns: 1fr !important;
    gap: var(--rp-space-3);
  }

  .footer-logo,
  .site-footer img {
    max-width: min(220px, 70vw);
    height: auto;
  }
}

/* ---------- Breadcrumbs ---------- */
.breadcrumbs,
.breadcrumb,
.siteBreadcrumbs__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  max-width: 100%;
}

/* ---------- Mobile hamburger nav (overrides stacked grid) ---------- */
@media (max-width: 991px) {
  .header__inner {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 12px;
    width: 100%;
    max-width: 100%;
  }

  .header__brand {
    flex: 1 1 auto;
    min-width: 0;
    max-width: calc(100% - 56px);
    justify-content: flex-start !important;
  }

  .header__menuToggle {
    display: inline-flex;
    flex: 0 0 auto;
    order: 2;
  }

  .header__nav.nav {
    display: none !important;
    order: 3;
    width: 100%;
    max-width: 100%;
    flex-basis: 100%;
    grid-template-columns: 1fr !important;
    gap: 6px;
    padding: 0.5rem 0 0.25rem;
    max-height: min(70vh, 560px);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .header__nav.nav.is-open {
    display: grid !important;
  }

  .header__queries {
    order: 4;
    width: 100%;
    max-width: 100%;
    justify-content: center;
  }

  .header__queriesBox {
    width: 100%;
    max-width: 100%;
    justify-content: center;
  }

  .header__nav > .nav__link,
  .header__nav > .nav__dropdown {
    width: 100%;
    margin-left: 0 !important;
    padding-left: 0 !important;
  }

  .header__nav > .nav__link:not(:first-child)::before,
  .header__nav > .nav__dropdown:not(:first-child)::before {
    display: none;
  }

  .header__nav .nav__link,
  .header__nav .nav__link--btn {
    width: 100%;
    justify-content: center;
    text-align: center;
    min-height: var(--rp-touch);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
  }

  .header__nav > .nav__dropdown {
    position: relative;
    min-width: 0;
    max-width: 100%;
  }

  body.nav-drawer-open {
    overflow: hidden;
  }
}

/* ---------- Very small phones ---------- */
@media (max-width: 360px) {
  .brand--logoOnly .brand__logo {
    max-width: min(160px, 48vw);
  }

  .header__queriesPhone {
    font-size: 0.85rem;
  }
}

/* ---------- Large monitors ---------- */
@media (min-width: 1440px) {
  .container {
    width: min(1200px, calc(100% - 4rem));
  }
}

/* ---------- Landscape phones ---------- */
@media (max-height: 480px) and (orientation: landscape) {
  .header__nav.nav.is-open {
    max-height: min(55vh, 320px);
  }

  .fabCall,
  .fab-call {
    transform: scale(0.92);
    transform-origin: bottom right;
  }
}
