/* EVAFoams v1.5.4 | Gutenberg Exact-Page Layout Bridge
 * Applies ONLY to the manually authored About and Contact core blocks.
 * Previous automatic conversions, homepage and ordinary legacy pages untouched.
 * The core/group render path can contain Gutenberg's optional
 * .wp-block-group__inner-container wrapper, breaking grid/flex children.
 */

/* Break out of inherited parent theme content widths exactly once.  The theme
 * now renders a plain <main> for these two hand-authored block pages. */
body.evaf-modern-body #evaf-content.evaf154-native-page {
  box-sizing:border-box!important;display:block!important;
  width:100%!important;max-width:none!important;min-width:0!important;
  margin:0!important;padding:0!important;position:relative!important;
  left:auto!important;right:auto!important;transform:none!important;
  float:none!important;overflow:visible!important;
}
body.evaf-modern-body #evaf-content.evaf154-native-page > .wp-block-group,
body.evaf-modern-body #evaf-content.evaf154-native-page > #eva-about.evaf152-page,
body.evaf-modern-body #evaf-content.evaf154-native-page > .evaf153-contact {
  box-sizing:border-box!important;
  position:relative!important;
  width:100%!important;max-width:100%!important;
  min-width:0!important;margin:0!important;padding:0!important;
  left:auto!important;right:auto!important;
  transform:none!important;float:none!important;clear:both!important;
}

/* Gutenberg inserts an extra inner-container <div> in some themes/versions.
 * It is a nonsemantic div; treat it as layout-transparent so each authored
 * Group displays its actual editable children, restoring native HTML geometry.
 * No editor drag/drop wrapper is changed. */
#eva-about.evaf152-page .wp-block-group > .wp-block-group__inner-container,
.evaf153-contact.evacf-page .wp-block-group > .wp-block-group__inner-container {
  display:contents!important;
}
#eva-about.evaf152-page,
.evaf153-contact.evacf-page {box-sizing:border-box!important;min-width:0!important;}
#eva-about.evaf152-page .eva-wrap,
.evaf153-contact.evacf-page .evacf-wrap {
  min-width:0!important;box-sizing:border-box!important;
  margin-inline:auto!important;
}
#eva-about.evaf152-page .wp-block-group,
.evaf153-contact.evacf-page .wp-block-group {min-width:0;}
#eva-about.evaf152-page :is(.eva-hero,.eva-section,.eva-cta),
.evaf153-contact.evacf-page :is(.evacf-hero,.evacf-contact,.evacf-location,.evacf-cta) {
  width:100%!important;max-width:none!important;margin:0!important;
}

/* About: grid/flex items can now be children even with a WP inner wrapper. */
#eva-about.evaf152-page .eva-stats{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;}
#eva-about.evaf152-page .eva-company-layout{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;}
#eva-about.evaf152-page .eva-company-values{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;}
#eva-about.evaf152-page .eva-company-testing{display:grid!important;grid-template-columns:minmax(0,.82fr) minmax(0,1.18fr)!important;}
#eva-about.evaf152-page .eva-process-showcase{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;}
#eva-about.evaf152-page .eva-process-showcase .eva-factory-wide{grid-column:1 / -1!important;}
#eva-about.evaf152-page .eva-factory-video-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;}
#eva-about.evaf152-page .eva-products-grid{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;}
#eva-about.evaf152-page .eva-grid.eva-three{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;}
#eva-about.evaf152-page #eva-materials .eva-detail-grid{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;}
#eva-about.evaf152-page .eva-industry-extra .eva-detail-grid{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;}
#eva-about.evaf152-page .eva-quality{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;}
#eva-about.evaf152-page .eva-steps{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;}
#eva-about.evaf152-page .eva-benefits{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;}
#eva-about.evaf152-page .eva-product-card{display:flex!important;flex-direction:column!important;}
#eva-about.evaf152-page .eva-product-copy{flex:1;}
#eva-about.evaf152-page .eva-product-media{display:flex!important;align-items:center;justify-content:center;}
#eva-about.evaf152-page .eva-company-photo,
#eva-about.evaf152-page .eva-photo{position:relative!important;overflow:hidden!important;}
#eva-about.evaf152-page .eva-company-photo > .wp-block-image,
#eva-about.evaf152-page .eva-photo > .wp-block-image {position:absolute!important;inset:0!important;margin:0!important;width:100%!important;height:100%!important;}
#eva-about.evaf152-page .eva-company-photo .wp-block-image img,
#eva-about.evaf152-page .eva-photo .wp-block-image img {width:100%!important;height:100%!important;object-fit:cover!important;}
#eva-about.evaf152-page .eva-company-photo .evaf152-figcaption {position:absolute!important;z-index:2;bottom:0;left:0;right:0;}
#eva-about.evaf152-page .eva-factory-video-card{display:flex;flex-direction:column;}

/* Contact: the old published PHP template and v1.5.3 Gutenberg draft used
 * .evacf-page on BOTH main and content root, doubling 100vw transforms.
 * Keep only one real page wrapper; preserve the three contact cards and form. */
#evaf-content.evaf-contact-content > .evaf153-contact.evacf-page,
#evaf-content.evaf-migration-preview > .evaf153-contact.evacf-page {
  width:100%!important;max-width:100%!important;
  margin:0!important;left:auto!important;right:auto!important;
  position:relative!important;transform:none!important;
}
.evaf153-contact.evacf-page .evacf-hero-grid {
  display:grid!important;grid-template-columns:minmax(0,1fr) minmax(380px,485px)!important;
  gap:clamp(26px,5vw,90px)!important;align-items:center!important;
}
.evaf153-contact.evacf-page .evacf-contact-grid {display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:20px!important;}
.evaf153-contact.evacf-page .evacf-location-grid {display:grid!important;grid-template-columns:minmax(0,840px)!important;}
.evaf153-contact.evacf-page .evacf-cta-inner {display:flex!important;align-items:center!important;justify-content:space-between!important;gap:30px!important;}
.evaf153-contact.evacf-page .evacf-hero-copy,
.evaf153-contact.evacf-page .evacf-form-slot {min-width:0!important;max-width:100%!important;}
.evaf153-contact.evacf-page .evacf-form-card {height:auto!important;margin:0!important;max-width:100%!important;}
.evaf153-contact.evacf-page .wp-block-shortcode {margin:0!important;width:100%!important;}
.evaf153-contact.evacf-page .evacf-hero-copy .wp-block-list{list-style:disc!important;}

/* Responsive geometry for each page. These override accidental fixed desktop
 * columns introduced by the original HTML-layout CSS on small screens. */
@media(max-width:1050px){
  #eva-about.evaf152-page #eva-materials .eva-detail-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
}
@media(max-width:980px){
  #eva-about.evaf152-page .eva-stats,
  #eva-about.evaf152-page .eva-process-showcase,
  #eva-about.evaf152-page .eva-products-grid,
  #eva-about.evaf152-page .eva-steps{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
  #eva-about.evaf152-page .eva-process-showcase .eva-factory-wide{grid-column:1/-1!important;}
  .evaf153-contact.evacf-page .evacf-hero-grid{grid-template-columns:minmax(0,1fr) minmax(340px,450px)!important;gap:28px!important;}
}
@media(max-width:860px){
  #eva-about.evaf152-page .eva-company-layout,
  #eva-about.evaf152-page .eva-company-testing{grid-template-columns:minmax(0,1fr)!important;}
  #eva-about.evaf152-page .eva-quality{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
}
@media(max-width:790px){
  .evaf153-contact.evacf-page .evacf-hero-grid,
  .evaf153-contact.evacf-page .evacf-contact-grid{grid-template-columns:minmax(0,1fr)!important;}
  .evaf153-contact.evacf-page .evacf-cta-inner{align-items:flex-start!important;flex-direction:column!important;}
  .evaf153-contact.evacf-page .evacf-form-slot{width:100%!important;max-width:640px!important;}
}
@media(max-width:700px){
  #eva-about.evaf152-page .eva-factory-video-grid,
  #eva-about.evaf152-page .eva-steps,
  #eva-about.evaf152-page .eva-products-grid,
  #eva-about.evaf152-page .eva-benefits,
  #eva-about.evaf152-page .eva-quality{grid-template-columns:minmax(0,1fr)!important;}
  #eva-about.evaf152-page #eva-materials .eva-detail-grid{grid-template-columns:minmax(0,1fr)!important;}
}
@media(max-width:600px){
  #eva-about.evaf152-page .eva-process-showcase,
  #eva-about.evaf152-page .eva-grid.eva-three,
  #eva-about.evaf152-page .eva-industry-extra .eva-detail-grid{grid-template-columns:minmax(0,1fr)!important;}
  #eva-about.evaf152-page .eva-process-showcase .eva-factory-wide{grid-column:auto!important;}
}
@media(max-width:540px){
  #eva-about.evaf152-page .eva-stats{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
  #eva-about.evaf152-page .eva-products-grid,
  #eva-about.evaf152-page .eva-grid.eva-three{grid-template-columns:minmax(0,1fr)!important;}
  .evaf153-contact.evacf-page .evacf-wrap{width:calc(100% - 32px)!important;}
  .evaf153-contact.evacf-page .evacf-hero-grid,
  .evaf153-contact.evacf-page .evacf-contact-grid{gap:16px!important;}
}

/* In the Gutenberg EDITOR, don't alter block-editor's interactive drag/drop
 * wrappers. Apply the grid to its actual child-list container instead. */
.editor-styles-wrapper :is(#eva-about.evaf152-page,.evaf153-contact.evacf-page) {
  width:100%!important;max-width:none!important;position:relative!important;
  left:auto!important;transform:none!important;margin:0!important;
}
.editor-styles-wrapper #eva-about.evaf152-page .eva-wrap,
.editor-styles-wrapper .evaf153-contact.evacf-page .evacf-wrap{max-width:1180px!important;}
.editor-styles-wrapper #eva-about.evaf152-page .wp-block-group > .wp-block-group__inner-container,
.editor-styles-wrapper .evaf153-contact.evacf-page .wp-block-group > .wp-block-group__inner-container {display:contents!important;}
/* Block editor currently nests Group block children within InnerBlocks and
 * its block-list layout. The selector works only where that child-list exists. */
.editor-styles-wrapper #eva-about.evaf152-page :is(.eva-stats,.eva-company-layout,.eva-process-showcase,.eva-factory-video-grid,.eva-products-grid,.eva-quality,.eva-steps,.eva-benefits,.eva-detail-grid,.eva-grid.eva-three,.eva-company-values) > .block-editor-inner-blocks > .block-editor-block-list__layout,
.editor-styles-wrapper .evaf153-contact.evacf-page :is(.evacf-hero-grid,.evacf-contact-grid,.evacf-location-grid) > .block-editor-inner-blocks > .block-editor-block-list__layout {
  display:grid!important;gap:inherit!important;
}
.editor-styles-wrapper #eva-about.evaf152-page .eva-stats > .block-editor-inner-blocks > .block-editor-block-list__layout {grid-template-columns:repeat(4,minmax(0,1fr))!important;}
.editor-styles-wrapper #eva-about.evaf152-page .eva-company-layout > .block-editor-inner-blocks > .block-editor-block-list__layout {grid-template-columns:repeat(2,minmax(0,1fr))!important;}
.editor-styles-wrapper #eva-about.evaf152-page .eva-process-showcase > .block-editor-inner-blocks > .block-editor-block-list__layout,
.editor-styles-wrapper #eva-about.evaf152-page .eva-products-grid > .block-editor-inner-blocks > .block-editor-block-list__layout {grid-template-columns:repeat(3,minmax(0,1fr))!important;}
.editor-styles-wrapper .evaf153-contact.evacf-page .evacf-hero-grid > .block-editor-inner-blocks > .block-editor-block-list__layout {grid-template-columns:minmax(0,1fr) minmax(380px,485px)!important;}
.editor-styles-wrapper .evaf153-contact.evacf-page .evacf-contact-grid > .block-editor-inner-blocks > .block-editor-block-list__layout {grid-template-columns:repeat(3,minmax(0,1fr))!important;}
@media(max-width:980px){
 .editor-styles-wrapper #eva-about.evaf152-page :is(.eva-stats,.eva-products-grid,.eva-process-showcase) > .block-editor-inner-blocks > .block-editor-block-list__layout{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
}
@media(max-width:790px){
 .editor-styles-wrapper .evaf153-contact.evacf-page :is(.evacf-hero-grid,.evacf-contact-grid) > .block-editor-inner-blocks > .block-editor-block-list__layout{grid-template-columns:minmax(0,1fr)!important;}
}
@media(max-width:600px){
 .editor-styles-wrapper #eva-about.evaf152-page .eva-process-showcase > .block-editor-inner-blocks > .block-editor-block-list__layout{grid-template-columns:minmax(0,1fr)!important;}
}
