/*
 * Stay Dry Go Green — responsive stabilization layer v10.29
 * Loaded last so legacy theme generations cannot re-break tablet/mobile layouts.
 */

/* Global overflow / media safety */
html,body{max-width:100%;overflow-x:hidden}
.sdgg{width:100%;max-width:100%;overflow-x:clip}
.sdgg img,.sdgg video,.sdgg iframe,.sdgg svg{max-width:100%}
.sdgg img,.sdgg video{height:auto}
.sdgg iframe{display:block}
.sdgg input,.sdgg select,.sdgg textarea,.sdgg button{max-width:100%}
.sdgg :where(.sd-container,.wrap,.sdp-shell,.sdgg-c20-wrap,.sdgg-kb-container){min-width:0}
.sdgg :where(.sd-container,.wrap)>*,.sdgg :where([class*="grid"],[class*="split"],[class*="columns"] )>*{min-width:0}
.sdgg :where(h1,h2,h3,h4,p,a,span,strong,li,summary){overflow-wrap:break-word}

/* Navigation: keep desktop clean and switch decisively before it crowds. */
@media (max-width:1190px){
  .sd-navin{gap:12px!important}
  .sd-logo{width:145px!important;max-width:28vw!important}
  .sd-desktop-menu{gap:8px!important}
  .sd-desktop-menu>a,.sd-menu-trigger{font-size:11.5px!important}
  .sd-nav .sd-nav-cta a.sd-nav-phone{display:none!important}
}
@media (max-width:1024px){
  .sd-navin{min-height:76px!important}
  .sd-desktop-menu,.sd-nav-cta,.sd-links{display:none!important}
  .sd-mobile-toggle,.sd-menu{display:block!important;margin-left:auto!important}
  .sd-mobile-nav{width:100%!important;max-height:calc(100dvh - 76px);overflow-y:auto;overscroll-behavior:contain}
  .sd-mobile-nav.sd-show{display:grid!important}
  .sd-mobile-nav a,.sd-mobile-nav summary{font-size:14px!important;line-height:1.35!important;padding:13px 16px!important}
  .sd-mobile-nav details a{padding-left:30px!important;font-size:13px!important}
  .sd-mega{display:none!important}
}
@media (max-width:600px){
  .sd-top .sd-container{padding:7px 0!important;font-size:11px!important;line-height:1.35!important}
  .sd-logo{width:132px!important;height:62px!important;max-width:55vw!important}
  .sd-navin{min-height:68px!important}
  .sd-mobile-toggle,.sd-menu{padding:8px 11px!important;font-size:21px!important}
}

/* Shared spacing and typography */
@media (max-width:1024px){
  .sd-section{padding:78px 0!important}
  .sd-sectionhead{margin-bottom:34px!important}
  .sd-sectionhead h2{font-size:clamp(31px,5vw,46px)!important}
}
@media (max-width:600px){
  .sd-container,.sdgg-detail-page .wrap,.sdgg-c20-wrap,.sdgg-kb-container{width:calc(100% - 30px)!important;max-width:100%!important}
  .sd-section{padding:58px 0!important}
  .sd-sectionhead{margin-bottom:28px!important}
  .sd-sectionhead h2{font-size:clamp(28px,8.5vw,38px)!important;line-height:1.14!important}
  .sd-sectionhead p{font-size:15px!important;line-height:1.65!important}
  .sd-kicker{font-size:10px!important;letter-spacing:.13em!important;gap:8px!important}
  .sd-actions{gap:10px!important}
  .sd-actions .sd-btn{width:100%!important;min-width:0!important;white-space:normal!important;text-align:center!important;padding:13px 16px!important}
}

/* Homepage hero */
@media (max-width:1024px){
  .sdgg .sd-hero-v3 .sd-heroin{grid-template-columns:1fr!important;width:min(760px,calc(100% - 44px))!important;min-height:0!important;gap:28px!important;padding:52px 0 34px!important}
  .sdgg .sd-hero-v3 .sd-hero-copy{padding:0!important}
  .sdgg .sd-hero-v3 h1,.sdgg .sd-hero-v3 .sd-slide-title{font-size:clamp(40px,7vw,58px)!important;line-height:1.06!important}
  .sdgg .sd-hero-v3 .sd-hero-art{height:420px!important;max-width:650px!important;width:100%!important;margin:0 auto!important;transform:none!important}
  .sdgg .sd-hero-v3 .sd-image-frame{width:82%!important;height:88%!important}
  .sd-hero-controls{width:min(760px,calc(100% - 44px))!important;margin:auto!important}
}
@media (max-width:600px){
  .sdgg .sd-hero-v3 .sd-heroin{width:calc(100% - 30px)!important;padding:38px 0 14px!important;gap:18px!important}
  .sdgg .sd-hero-v3 h1,.sdgg .sd-hero-v3 .sd-slide-title{font-size:clamp(34px,10.5vw,46px)!important;line-height:1.07!important;letter-spacing:-.04em!important;margin:16px 0!important}
  .sdgg .sd-hero-v3 .sd-hero-subtitle{font-size:15px!important;line-height:1.5!important}
  .sdgg .sd-hero-v3 .sd-hero-copy>p{font-size:14px!important;line-height:1.65!important}
  .sd-badgebar{gap:6px!important}
  .sd-badgebar span{font-size:9px!important;padding:7px 9px!important}
  .sdgg .sd-hero-v3 .sd-hero-art{height:300px!important}
  .sdgg .sd-hero-v3 .sd-image-frame{width:86%!important;height:88%!important;border-width:5px!important}
  .sd-glass{max-width:58%!important;padding:8px 10px!important}
  .sd-glass strong{font-size:11px!important}
  .sd-glass small{font-size:9px!important}
  .sd-glass-bottom strong{font-size:20px!important}
  .sd-hero-controls{width:calc(100% - 30px)!important;padding-bottom:18px!important}
}
@media (max-width:380px){
  .sdgg .sd-hero-v3 .sd-hero-art{height:265px!important}
  .sd-glass{display:none!important}
}

/* Trust / common homepage grids */
@media (max-width:900px){
  .sd-trustin{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:0!important}
  .sd-trustitem{padding:16px 18px!important;border-bottom:1px solid #d4e0d2!important}
  .sd-trustitem:nth-child(even){border-right:0!important}
  .sd-aboutgrid,.sd-featuregrid,.sd-guaranteegrid,.sd-faqgrid,.sd-contactgrid,.sd-seo-split,.sd-home-insights-grid,.sd-advice-layout{grid-template-columns:1fr!important;gap:36px!important}
  .sd-aboutimage,.sd-featureimg{max-width:720px;width:100%;margin-inline:auto}
  .sd-aboutimage img{height:clamp(330px,55vw,480px)!important}
  .sd-featureimg img{height:clamp(320px,55vw,460px)!important}
  .sd-servicesgrid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .sd-processgrid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .sd-seo-cardgrid,.sdgg-blog-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
@media (max-width:600px){
  .sd-trustin{grid-template-columns:1fr!important;padding:13px 0!important}
  .sd-trustitem{border-right:0!important;padding:13px 0!important}
  .sd-trustitem:last-child{border-bottom:0!important}
  .sd-trustitem strong{font-size:16px!important}
  .sd-aboutgrid,.sd-featuregrid,.sd-guaranteegrid,.sd-faqgrid,.sd-contactgrid,.sd-seo-split,.sd-home-insights-grid,.sd-advice-layout{gap:27px!important}
  .sd-aboutimage img{height:300px!important;border-radius:12px 72px 12px 12px!important}
  .sd-aboutbadge{right:8px!important;bottom:10px!important;max-width:165px!important;padding:12px!important;font-size:12px!important}
  .sd-featureimg img{height:290px!important;border-radius:62px 12px 12px 12px!important}
  .sd-servicesgrid,.sd-processgrid,.sd-seo-cardgrid,.sdgg-blog-grid{grid-template-columns:1fr!important;gap:14px!important}
  .sd-services .sd-service .sd-photo{height:200px!important}
  .sd-services .sd-servicebody{padding:19px!important}
  .sd-services .sd-servicebody h3{font-size:19px!important}
  .sd-service p{min-height:0!important}
  .sd-step{padding:22px!important}
  .sd-stepnum{font-size:36px!important}
  .sd-checks{grid-template-columns:1fr!important}
}

/* Service areas */
@media (max-width:900px){
  .sd-areas .sd-map-layout{grid-template-columns:1fr!important;gap:18px!important}
  .sd-areas .sd-map-visual{min-height:320px!important}
  .sd-area-groups{grid-template-columns:1fr!important}
}
@media (max-width:600px){
  .sd-areas .sd-map-visual{min-height:245px!important;border-radius:16px!important}
  .sd-areas .sd-map-places{padding:16px!important;border-radius:16px!important}
  .sd-areas .sd-city-tiles{grid-template-columns:1fr!important}
  .sd-map-places-top{align-items:flex-start!important;flex-direction:column!important}
  .sd-area-actions .sd-btn{width:100%!important}
}

/* Reviews */
@media (max-width:900px){.sd-review-platforms{grid-template-columns:1fr!important}}
@media (max-width:600px){
  .sd-platform{padding:20px!important;gap:15px!important;flex-direction:column!important}
  .sd-platform-logo-wrap,.sd-platform-icon{flex-basis:auto!important}
  .sd-platform h3{font-size:21px!important}
}

/* Portfolio / gallery */
@media (max-width:900px){
  #sd-client-portfolio .sdp-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  #sd-client-portfolio .sdp-card{height:260px!important}
}
@media (max-width:600px){
  #sd-client-portfolio{padding:56px 15px!important}
  #sd-client-portfolio .sdp-shell{width:100%!important}
  #sd-client-portfolio .sdp-top{flex-direction:column!important;align-items:flex-start!important;gap:18px!important}
  #sd-client-portfolio .sdp-grid{grid-template-columns:1fr!important;gap:12px!important}
  #sd-client-portfolio .sdp-card{height:280px!important}
  #sd-client-portfolio .sdp-modal{padding:64px 12px 76px!important}
  #sd-client-portfolio .sdp-prev,#sd-client-portfolio .sdp-next{width:38px!important;height:38px!important;font-size:24px!important}
  #sd-client-portfolio .sdp-close{right:12px!important;top:12px!important}
}

/* Client videos */
@media (max-width:1024px){
  .sdgg-home-videos-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .sdgg-home-video-card:last-child{grid-column:1/-1!important;width:min(430px,100%)!important;justify-self:center!important}
}
@media (max-width:600px){
  .sdgg-home-videos{padding:56px 0!important}
  .sdgg-home-videos .wrap{width:calc(100% - 30px)!important}
  .sdgg-home-videos-grid{grid-template-columns:1fr!important;gap:16px!important}
  .sdgg-home-video-card,.sdgg-home-video-card:last-child{grid-column:auto!important;width:100%!important;max-width:420px!important;margin-inline:auto!important}
}

/* Forms and CTA blocks */
@media (max-width:700px){
  .sd-form-row,.sdgg-lead-form .sdgg-form-row,.sdgg-c20-form-card .sdgg-form-row{grid-template-columns:1fr!important}
  .sd-lead-card,.sd-contactbox,.sdgg-c20-form-card{padding:20px!important;border-radius:18px!important}
  .sd-form-head h3{font-size:clamp(25px,7vw,32px)!important}
  .sd-lead-card input:not([type=checkbox]),.sd-lead-card select,.sd-lead-card textarea{font-size:16px!important}
  .sd-depth-banner{padding:30px 20px!important;border-radius:18px!important}
  .sd-depth-banner .sd-btn{width:100%!important;justify-content:center!important}
  .sd-midcta-inner{align-items:flex-start!important;flex-direction:column!important}
  .sd-midcta-actions{width:100%!important}
  .sd-midcta-actions .sd-btn{width:100%!important;min-width:0!important;white-space:normal!important}
}

/* Footer */
@media (max-width:900px){
  .sd-footgrid,.sd-footgrid-rich{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:30px!important}
}
@media (max-width:600px){
  .sd-footer{padding:52px 0 22px!important}
  .sd-footgrid,.sd-footgrid-rich{grid-template-columns:1fr!important;gap:26px!important}
  .sd-footer .sd-footlogo{width:150px!important;height:auto!important;max-height:105px!important}
  .sd-footbottom{flex-direction:column!important;align-items:flex-start!important;margin-top:34px!important}
  .sd-footer-trust{grid-template-columns:1fr!important}
  .sd-footer-trust>div{border-right:0!important}
}

/* Assistant widget must fit short/narrow screens */
@media (max-width:600px){
  .sd-assist-launch{right:12px!important;bottom:12px!important;padding:12px 14px!important;border-radius:18px!important;font-size:12px!important}
  .sd-assist{left:10px!important;right:10px!important;bottom:72px!important;width:auto!important;height:min(560px,calc(100dvh - 88px))!important;border-radius:16px!important}
}

/* Dedicated service/detail pages */
@media (max-width:1024px){
  #sdgg-service-page .hero>.wrap,.sdgg-detail-page .hero>.wrap,.sdgg-detail-page .two{grid-template-columns:1fr!important;gap:34px!important}
  #sdgg-service-page .hero-panel{max-width:680px!important;margin-inline:auto!important}
  #sdgg-service-page .sdgg-service-split,#sdgg-service-page .sdgg-service-reverse{grid-template-columns:1fr!important;gap:32px!important}
  #sdgg-service-page .sdgg-service-photo{min-height:360px!important}
}
@media (max-width:600px){
  .sdgg-detail-page section{padding:52px 0!important}
  .sdgg-detail-page .hero{padding:50px 0!important}
  #sdgg-service-page .hero h1{font-size:clamp(34px,10vw,46px)!important}
  #sdgg-service-page .hero .service-subhead{font-size:19px!important}
  #sdgg-service-page .sdgg-service-photo{min-height:285px!important;border-radius:18px!important}
  .sdgg-detail-page .grid,.sdgg-related-grid,.sdgg-hub-grid,.sdgg-blog-grid,.sdgg-blog-grid-archive,.sdgg-detail-page .steps{grid-template-columns:1fr!important}
  .sdgg-detail-page .strip .wrap{grid-template-columns:1fr!important}
  .sdgg-area-link-grid,.sdgg-area-link-grid.is-compact{grid-template-columns:1fr!important}
}

/* About page */
@media (max-width:900px){
  .sdgg-about-v7 .sdgg-about-hero-grid,.sdgg-about-v7 .sdgg-about-split,.sdgg-about-v7 .sdgg-about-assess-shell{grid-template-columns:1fr!important}
  .sdgg-about-v7 .sdgg-about-service-panels,.sdgg-about-v7 .sdgg-about-steps-compact{grid-template-columns:1fr!important}
}
@media (max-width:600px){
  .sdgg-about-v7 .sdgg-about-hero h1{font-size:clamp(32px,9vw,40px)!important}
  .sdgg-about-v7 .sdgg-faq-two-containers,.sdgg-about-v7 .sdgg-about-gallery-grid,.sdgg-about-v7 .sdgg-about-gallery-grid-3{grid-template-columns:1fr!important}
  .sdgg-about-v7 .sdgg-about-story .sdgg-about-photo,.sdgg-about-v7 .sdgg-about-promise .sdgg-about-photo{min-height:280px!important}
  .sdgg-about-final,.sdgg-about-v7 .sdgg-about-final{padding-inline:15px!important}
}

/* Contact page */
@media (max-width:900px){
  .sdgg-c20-hero-grid,.sdgg-c20-columns,.sdgg-c20-map-grid{grid-template-columns:1fr!important;gap:36px!important}
  .sdgg-c20-hero-photo{max-width:640px!important;width:100%!important;margin:auto!important}
}
@media (max-width:600px){
  .sdgg-c20-wrap{width:calc(100% - 30px)!important}
  .sdgg-c20-intro h1{font-size:clamp(37px,11vw,48px)!important}
  .sdgg-c20-hero-photo,.sdgg-c20-hero-photo img{height:300px!important;min-height:0!important}
  .sdgg-c20-photo-note{left:10px!important;right:10px!important;bottom:12px!important;width:auto!important}
  .sdgg-c20-map-frame iframe{height:280px!important}
}

/* Editorial / knowledge base / gallery pages */
@media (max-width:900px){
  .sdgg-ed-feature-grid,.sdgg-kb-layout,.sdgg-gallery-v25 .sdgg-gallery-request-grid{grid-template-columns:1fr!important}
  .sdgg-ed-card-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .sdgg-gallery-v25 .sdgg-full-gallery{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
@media (max-width:600px){
  .sdgg-kb-hero h1{font-size:clamp(38px,11vw,56px)!important}
  .sdgg-kb-search{padding-inline:12px!important}
  .sdgg-kb-search input{min-width:0!important;font-size:16px!important}
  .sdgg-kb-bottom{padding:28px 20px!important;flex-direction:column!important;align-items:flex-start!important}
  .sdgg-kb-bottom>a{width:100%!important;text-align:center!important;white-space:normal!important}
  .sdgg-ed-card-grid,.sdgg-gallery-v25 .sdgg-full-gallery{grid-template-columns:1fr!important}
  .sdgg-ed-feature-image{height:280px!important}
  .sdgg-ed-outro .sd-container>div{flex-direction:column!important;align-items:flex-start!important}
}

/* Small phone hardening */
@media (max-width:380px){
  .sd-container,.sdgg-detail-page .wrap,.sdgg-c20-wrap,.sdgg-kb-container,.sdgg-home-videos .wrap{width:calc(100% - 24px)!important}
  .sd-section{padding:50px 0!important}
  .sd-btn{padding-inline:13px!important}
  .sdgg-home-video-card{border-radius:15px!important}
}
