/* Shared screen-size refinements. Keep this after the page styles. */
:root {
  --fp-gutter: 48px;
  --fp-header-offset: 112px;
  --fp-bottom-offset: 0px;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: var(--fp-header-offset);
  scroll-padding-bottom: var(--fp-bottom-offset);
}
/* Grid children must be able to shrink around long headings and native selects. */
.fx-hero-layout > *, .fp-craft-grid > *, .fp-local-grid > *,
.fp-faq-grid > *, .fp-estimate-grid > *, .fp-footer-grid > *,
.pg-hero-grid > *, .pg-contact-layout > *, .pg-form > *,
.fp-form .fields > *, .cv-optional-grid > *, .ex-owner-grid > *,
.ex-story-body > *, .ex-gallery-hero .pg-wrap > * {
  min-width: 0;
}
main h1, main h2, main h3, .pg-breadcrumb,
.pg-contact-info a, .pg-prose, .fp-footer-bottom {
  overflow-wrap: anywhere;
}
@supports (width: max(1px, 2px)) {
  .fp-container, .pg-wrap {
    width: min(1280px, calc(100% - max(var(--fp-gutter), env(safe-area-inset-left, 0px)) - max(var(--fp-gutter), env(safe-area-inset-right, 0px))));
  }
}
.pg-breadcrumb { font-size: 12px; }
.pg-breadcrumb a, .fp-footer-bottom a, .ex-credentials a { min-height: 44px; }
.fx-photo-action { white-space: normal; text-align: center; }
.fp-form.cv-lead-form label, .pg-form.cv-lead-form label { font-size: 14px; line-height: 1.5; }
.cv-optional-fields > summary { font-size: 14px; line-height: 1.6; }
.cv-lead-form input:not([type="hidden"]),
.cv-lead-form select, .cv-lead-form textarea {
  font-size: 16px;
  max-width: 100%;
  scroll-margin-block: 24px;
}
.fp-form .fp-form-note, .pg-form-privacy { font-size: 13px !important; }
/* Use a viewport-height fallback for older embedded browsers. */
.pg-lightbox {
  box-sizing: border-box;
  width: min(1200px, 94vw);
  max-width: 94vw;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  overscroll-behavior: contain;
}
.pg-lightbox img {
  max-height: calc(100vh - 160px);
  max-height: calc(100dvh - 160px);
}
.pg-dialog-close { min-width: 80px; }
.fx-compare input::-moz-range-thumb {
  width: 52px;
  height: 52px;
  border: 0;
  background: transparent;
}
@media (max-width: 1100px) {
  :root { --fp-gutter: 28px; }
}
@media (max-width: 980px) {
  .fp-header .fp-brand, .fp-header .fp-menu { flex-shrink: 0; }
  .fp-menu { width: 46px; height: 46px; padding: 11px; }
  .fp-header-cta { min-height: 46px; font-size: 12px; padding: 12px; }
  .fp-header .fp-nav {
    max-height: calc(100vh - var(--fp-header-offset) - var(--fp-bottom-offset));
    max-height: calc(100dvh - var(--fp-header-offset) - var(--fp-bottom-offset));
    overscroll-behavior-y: contain;
    padding-inline: max(var(--fp-gutter), env(safe-area-inset-left, 0px)) max(var(--fp-gutter), env(safe-area-inset-right, 0px));
  }
  .fp-header .fp-nav a { min-height: 48px; white-space: normal; }
}
@media (max-width: 900px) {
  .pg-contact-layout { display: flex; flex-direction: column; gap: 32px; }
  .pg-contact-layout .pg-form-panel { order: -1; width: 100%; }
  .pg-contact-info { width: 100%; }
}
@media (max-width: 760px) {
  :root {
    --fp-header-offset: 94px;
    --fp-bottom-offset: calc(84px + env(safe-area-inset-bottom, 0px));
  }
  /* Keep every service visible to people who scroll normally. */
  .fp-edition-two .fp-services-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
    scroll-snap-type: none;
    gap: 28px 20px;
    padding-bottom: 0;
  }
  .fp-edition-two .ex-swipe-note { display: none !important; }
  .fx-hero-copy > p:not(.fx-eyebrow),
  .fp-edition-two .fp-card-text p, .fx-process-grid p,
  .fp-edition-two .fp-craft-copy .fp-lead {
    font-size: 16px;
    line-height: 1.75;
  }
  .fp-interior main .pg-prose p, .ex-city-hero .pg-intro-copy {
    font-size: 16px !important;
  }
  .fx-hero-actions .fp-button, .pg-actions .pg-button {
    font-size: 14px;
    min-height: 50px;
    white-space: normal;
    text-align: center;
  }
  .fx-image-selector button { font-size: 13px; padding: 14px 8px; gap: 6px; }
  .fx-image-selector button > span { display: none; }
  .fp-mobile-bar {
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
  }
  .fp-mobile-bar a { min-width: 0; min-height: 48px; padding: 8px; font-size: 13px; text-align: center; line-height: 1.4; }
  .fp-footer { padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px)); }
  .fp-footer-grid > div > a:not(.fp-brand) { font-size: 14px; }
  .fp-footer .fp-footer-grid > div > a.fp-footer-phone { font-size: 23px; }
  .fp-footer-bottom { font-size: 12px; }
  .pg-lightbox { padding-inline: 12px; }
}
@media (max-width: 650px) {
  :root { --fp-gutter: 20px; }
}
@media (max-width: 600px) {
  .fp-edition-two .fp-services-grid { grid-template-columns: minmax(0, 1fr); }
  .fp-edition-two .fp-extra-services { flex-wrap: wrap; gap: 8px 20px; }
  .fp-extra-services a { min-height: 44px; font-size: 14px; }
  .fx-hero-actions { align-items: stretch; }
  .fx-hero-actions .fp-button { justify-content: center; }
  .fp-interior main .ex-city-hero h1 { font-size: clamp(36px, 9.5vw, 52px) !important; }
  .fp-interior main .ex-gallery-hero h1 { font-size: clamp(36px, 9.5vw, 48px) !important; }
  .fx-assurance .fp-container > div { flex-wrap: wrap; gap: 6px 16px; }
  .pg-city-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
  .pg-city-grid > a > span:last-child { font-size: 13px; }
  .ex-related .pg-card-copy { flex-wrap: wrap; }
}
@media (max-width: 360px) {
  :root { --fp-gutter: 16px; }
  .fp-header .fp-header-inner { gap: 8px; }
  .fp-header-cta { padding-inline: 10px; }
  .fx-hero-actions { flex-direction: column; gap: 12px; }
  .cv-hero-call { justify-content: center; }
}
/* Short landscape windows and a phone keyboard need the available height. */
@media (max-height: 500px) and (max-width: 980px) {
  :root { --fp-header-offset: 16px; --fp-bottom-offset: 16px; }
  .fp-header { position: relative; }
  .fp-header .fp-nav { max-height: calc(100vh - 140px); max-height: calc(100dvh - 140px); }
  .fp-mobile-bar { display: none; }
  .pg-toc { position: static; }
}
@media print {
  .fp-container, .pg-wrap { width: 100%; }
  .fp-edition-two .fp-services-grid { display: grid; overflow: visible; }
}
