/* PKBI Katalog Seranaya v2.4.15 — Responsive safety layer.
   Loaded AFTER existing full-width styles and on the homepage separately.
   Does not change media files, product metadata, URLs, print templates, consent or CV data. */
:where(body.sncv-responsive-home,body.sncv-responsive-page,body.sncv-responsive-product){
  --sncv-mobile-gutter:clamp(12px,2.4vw,36px);
  width:100%;max-width:100%;min-width:0;
}
:where(body.sncv-responsive-home,body.sncv-responsive-page,body.sncv-responsive-product) :is(img,video,iframe,picture,canvas){max-width:100%;}
:where(body.sncv-responsive-home,body.sncv-responsive-page,body.sncv-responsive-product) :is(.site-content,.entry-content,.wp-block-post-content,.elementor,.e-con,.e-con-inner,.elementor-container,.elementor-widget-wrap,.wp-block-columns,.wp-block-column,.site-main,main){min-width:0;box-sizing:border-box;}
:where(body.sncv-responsive-home,body.sncv-responsive-page,body.sncv-responsive-product) :is(h1,h2,h3,h4,p,a,button){overflow-wrap:break-word;}

/* Homepage: do not force desktop hero widths on a handheld viewport. */
body.sncv-responsive-home :is(.site-header,.header-inner,.site-header .container,.site-header .wrap,.site-header .ast-container){max-width:100%;box-sizing:border-box;}
body.sncv-responsive-home :is(.site-branding,.site-logo,.custom-logo-link) img{max-width:min(250px,64vw);height:auto;}
body.sncv-responsive-home :is(.hero,.home-hero,.hero-section,.hero-banner,.homepage-hero,.site-hero,.hero-wrapper,.hero-inner){min-width:0;max-width:100%;box-sizing:border-box;}
body.sncv-responsive-home main :is(.hero,.home-hero,.hero-section,.hero-banner,.homepage-hero,.site-hero) :is(img,picture img){max-width:100%;}
body.sncv-responsive-home :is(.services-grid,.caregivers-grid,.candidates-grid,.candidate-grid,.features-grid,.feature-grid,.cards-grid,.blog-grid,.posts-grid){min-width:0;max-width:100%;}
body.sncv-responsive-home :is(.service-card,.candidate-card,.caregiver-card,.post-card,.feature-card){min-width:0;max-width:100%;box-sizing:border-box;}

/* Catalog, shortcode hero and profile: keep every block inside its own viewport.
   The full-width JS continues to position the catalog; this layer ensures its
   interior does not overflow when filters and names wrap. */
body.sncv-responsive-page :is(.sncv-catalog,.sncv-catalog-shell,.sncv-filter-layout,.sncv-filter-main-group,.sncv-filter-placement-group,.sncv-grid,.sncv-card),
body.sncv-responsive-product :is(.sncv-product-page,.sncv-profile,.sncv-profile-shell,.sncv-profile-top,.sncv-section,.sncv-facts){min-width:0;box-sizing:border-box;}
body.sncv-responsive-page .sncv-catalog .sncv-filter-main-group > .sncv-filter{white-space:normal!important;overflow-wrap:anywhere!important;min-width:0!important;}
body.sncv-responsive-page .sncv-catalog .sncv-grid{min-width:0!important;}
body.sncv-responsive-page .sncv-catalog :is(.sncv-card-body,.sncv-card-profession-meta,.sncv-card-profession-value){min-width:0!important;overflow-wrap:anywhere;}

@media (max-width:1100px){
  /* Header of the active theme may be one rigid desktop flex row. Allow it
     to wrap instead of pushing navigation and icons outside the viewport. */
  :is(body.sncv-responsive-home,body.sncv-responsive-page,body.sncv-responsive-product) :is(#masthead,.site-header,header[role="banner"]),
  :is(body.sncv-responsive-home,body.sncv-responsive-page,body.sncv-responsive-product) > header {
    max-width:100%!important;min-width:0!important;height:auto!important;
    flex-wrap:wrap!important;box-sizing:border-box!important;
  }
  :is(body.sncv-responsive-home,body.sncv-responsive-page,body.sncv-responsive-product) :is(#masthead,.site-header,header[role="banner"]) :is(nav,.main-navigation,.primary-navigation,.menu),
  :is(body.sncv-responsive-home,body.sncv-responsive-page,body.sncv-responsive-product) > header nav{
    max-width:100%!important;min-width:0!important;flex-wrap:wrap!important;white-space:normal!important;
  }
  :is(body.sncv-responsive-home,body.sncv-responsive-page,body.sncv-responsive-product) :is(#masthead,.site-header,header[role="banner"]) :is(nav,.main-navigation,.primary-navigation) :is(ul,.menu,.nav-menu),
  :is(body.sncv-responsive-home,body.sncv-responsive-page,body.sncv-responsive-product) > header nav :is(ul,.menu,.nav-menu){
    display:flex;flex-wrap:wrap!important;max-width:100%!important;min-width:0!important;
    white-space:normal!important;justify-content:center;gap:clamp(7px,1.8vw,16px)!important;
  }
  :is(body.sncv-responsive-home,body.sncv-responsive-page,body.sncv-responsive-product) :is(#masthead,.site-header,header[role="banner"]) nav li,
  :is(body.sncv-responsive-home,body.sncv-responsive-page,body.sncv-responsive-product) > header nav li{min-width:0!important;white-space:normal!important;}
  :is(body.sncv-responsive-home,body.sncv-responsive-page,body.sncv-responsive-product) :is(#masthead,.site-header,header[role="banner"]) :is(.container,.wrap,.header-inner,.site-header-inner){
    max-width:100%!important;min-width:0!important;flex-wrap:wrap!important;box-sizing:border-box!important;
  }
  /* Both tablet orientations: catalog hero photo must not be cropped by
     fixed-height desktop slider rules; the copy is BELOW, not over faces. */
  body.sncv-responsive-page .sncv-hero-slider.sncv-hero-standalone .sncv-hero-track,
  body.sncv-responsive-page .sncv-hero-slider.sncv-hero-standalone .sncv-hero-slide:not(.sncv-hero-slide--template){min-height:0!important;height:auto!important;}
  body.sncv-responsive-page .sncv-hero-slider.sncv-hero-standalone .sncv-hero-slide.is-active:not(.sncv-hero-slide--template){display:flex!important;flex-direction:column!important;}
  body.sncv-responsive-page .sncv-hero-slider.sncv-hero-standalone .sncv-hero-slide:not(.sncv-hero-slide--template)>img{
    display:block!important;width:100%!important;max-width:100%!important;height:auto!important;
    min-height:0!important;max-height:none!important;object-fit:contain!important;object-position:center!important;
  }
  body.sncv-responsive-page .sncv-hero-slider.sncv-hero-standalone .sncv-hero-slide:not(.sncv-hero-slide--template) .sncv-hero-overlay{
    display:flex!important;flex-direction:column!important;position:relative!important;inset:auto!important;
    width:100%!important;min-width:0!important;max-width:100%!important;transform:none!important;
    padding:clamp(16px,2.5vw,26px) var(--sncv-mobile-gutter)!important;
    background:#fffaf0!important;box-sizing:border-box!important;
  }
  body.sncv-responsive-page .sncv-hero-slider.sncv-hero-standalone .sncv-hero-slide:not(.sncv-hero-slide--template) .sncv-hero-overlay h2{
    font-size:clamp(27px,4.6vw,43px)!important;line-height:1.12!important;max-width:100%!important;margin:3px 0 10px!important;
  }
  body.sncv-responsive-page .sncv-hero-slider.sncv-hero-standalone .sncv-hero-slide:not(.sncv-hero-slide--template) .sncv-hero-overlay p{
    font-size:clamp(13px,1.7vw,17px)!important;line-height:1.55!important;max-width:100%!important;
  }
  body.sncv-responsive-page .sncv-hero-slider.sncv-hero-standalone .sncv-hero-nav{
    position:relative!important;left:auto!important;right:auto!important;bottom:auto!important;
    width:100%!important;min-height:45px!important;padding:5px 10px 9px!important;
    background:#fffaf0!important;box-sizing:border-box!important;
  }
  body.sncv-responsive-page .sncv-hero-slider.sncv-hero-standalone .sncv-hero-wave{display:none!important;}
  body.sncv-responsive-home :is(.hero,.home-hero,.hero-section,.hero-banner,.homepage-hero,.site-hero){height:auto;min-height:0;}
  body.sncv-responsive-home :is(.hero,.home-hero,.hero-section,.hero-banner,.homepage-hero,.site-hero) :is(h1,h2){
    font-size:clamp(30px,4.4vw,50px)!important;line-height:1.12!important;
    overflow-wrap:break-word!important;text-wrap:balance;
  }
  body.sncv-responsive-home :is(.hero,.home-hero,.hero-section,.hero-banner,.homepage-hero,.site-hero) :is(img,picture img){width:100%;height:auto!important;object-fit:contain!important;object-position:center!important;}
  body.sncv-responsive-home :is(.hero-overlay,.hero-copy,.hero-content,.hero-text,.banner-copy){min-width:0;max-width:100%;box-sizing:border-box;}
  body.sncv-responsive-home :is(.services-grid,.candidates-grid,.caregivers-grid,.cards-grid,.features-grid,.blog-grid,.posts-grid){grid-template-columns:repeat(2,minmax(0,1fr));}
  body.sncv-responsive-home :is(.wp-block-columns,.elementor-container,.e-con-inner){max-width:100%;min-width:0;}
}
@media(max-width:768px){
  :where(body.sncv-responsive-home,body.sncv-responsive-page,body.sncv-responsive-product) :is(.site-header,.site-header .container,.site-header .wrap,.header-inner){max-width:100%;min-width:0;box-sizing:border-box;}
  :where(body.sncv-responsive-home,body.sncv-responsive-page,body.sncv-responsive-product) :is(.site-header,.main-header) :is(.main-navigation,.primary-navigation,.site-navigation,nav){min-width:0;max-width:100%;}
  :where(body.sncv-responsive-home,body.sncv-responsive-page,body.sncv-responsive-product) :is(.site-header,.main-header) :is(.menu,.nav-menu,.primary-menu){max-width:100%;flex-wrap:wrap;}
  :where(body.sncv-responsive-home,body.sncv-responsive-page,body.sncv-responsive-product) :is(.site-header,.main-header) img{height:auto;max-width:100%;}
  body.sncv-responsive-home :is(.hero,.home-hero,.hero-section,.hero-banner,.homepage-hero,.site-hero){display:block;max-height:none;overflow:visible;}
  body.sncv-responsive-home :is(.hero,.home-hero,.hero-section,.hero-banner,.homepage-hero,.site-hero) :is(h1,h2){font-size:clamp(28px,7.5vw,38px)!important;line-height:1.15!important;}
  body.sncv-responsive-home :is(.hero-overlay,.hero-copy,.hero-content,.hero-text,.banner-copy){position:relative!important;inset:auto!important;transform:none!important;width:100%!important;max-width:100%!important;padding:clamp(12px,4vw,24px)!important;}
  body.sncv-responsive-home :is(.wp-block-columns,.elementor-container,.e-con-inner){flex-wrap:wrap;}
  body.sncv-responsive-home .wp-block-columns > .wp-block-column{flex-basis:100%!important;min-width:0!important;}
  body.sncv-responsive-page .sncv-catalog .sncv-catalog-shell{width:100%!important;max-width:100%!important;min-width:0!important;padding-inline:12px!important;}
  body.sncv-responsive-page .sncv-catalog .sncv-filter-layout .sncv-filter-main-group{grid-template-columns:repeat(2,minmax(0,1fr))!important;grid-auto-rows:minmax(48px,auto)!important;}
  body.sncv-responsive-page .sncv-catalog .sncv-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important;}
  body.sncv-responsive-product .sncv-product-page>.sncv-profile,
  body.sncv-responsive-product .sncv-product-page .sncv-profile-shell{width:100%!important;max-width:100%!important;padding-inline:12px!important;}
  body.sncv-responsive-product .sncv-profile-top{grid-template-columns:minmax(0,1fr)!important;gap:16px!important;}
  body.sncv-responsive-product .sncv-profile .sncv-facts,
  body.sncv-responsive-product .sncv-profile .sncv-work-fields{grid-template-columns:minmax(0,1fr)!important;}
  body.sncv-responsive-product .sncv-product-nav-inner{width:100%!important;min-width:0!important;}
  body.sncv-responsive-product .sncv-product-nav-bar .sncv-pkbi-nav-fallback{flex-wrap:wrap!important;justify-content:center!important;}
}
@media(max-width:560px){
  body.sncv-responsive-home :is(.services-grid,.candidates-grid,.caregivers-grid,.cards-grid,.features-grid,.blog-grid,.posts-grid){grid-template-columns:minmax(0,1fr)!important;}
  body.sncv-responsive-home :is(.service-card,.candidate-card,.caregiver-card,.feature-card){width:100%;max-width:100%;}
  body.sncv-responsive-page .sncv-hero-slider.sncv-hero-standalone .sncv-hero-slide .sncv-hero-overlay h2{font-size:clamp(24px,7.2vw,34px)!important;}
  body.sncv-responsive-page .sncv-catalog .sncv-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important;}
  body.sncv-responsive-page .sncv-catalog .sncv-filter-layout .sncv-filter-main-group > button.sncv-filter{font-size:10.5px!important;padding:8px 6px!important;min-height:54px!important;}
  body.sncv-responsive-page .sncv-catalog .sncv-catalog-privacy-disclaimer{max-width:100%!important;padding:12px!important;gap:8px!important;}
  body.sncv-responsive-page .sncv-catalog .sncv-catalog-heading h2{font-size:clamp(28px,8vw,40px)!important;}
  body.sncv-responsive-page .sncv-catalog .sncv-card-buttons a{min-height:38px;}
}
@media(max-width:350px){
  body.sncv-responsive-page .sncv-catalog .sncv-grid{grid-template-columns:minmax(0,1fr)!important;}
  body.sncv-responsive-page .sncv-catalog .sncv-filter-layout .sncv-filter-main-group{grid-template-columns:minmax(0,1fr)!important;}
  body.sncv-responsive-product .sncv-profile{padding:12px 8px!important;}
}
@media print{
  :where(body.sncv-responsive-home,body.sncv-responsive-page,body.sncv-responsive-product) :is(.sncv-hero-slider,.sncv-catalog,.sncv-profile){break-inside:auto;}
}
