/* Ai CMS 1.19.22.161: widen only published pages and single articles.
   Shared gutters keep the content readable and preserve the wide template. */
body:is(.storefront,.theme-corporate1,.theme-corporate2) .cms-content-page{
  --cms-content-limit:1240px;
  --cms-content-gutter:clamp(16px,3vw,36px);
}
body:is(.storefront,.theme-corporate1,.theme-corporate2) .cms-content-page.template-wide{
  --cms-content-limit:1440px;
}
body:is(.storefront,.theme-corporate2) .cms-content-page .cms-page-frame{
  width:min(var(--cms-content-limit),calc(100% - var(--cms-content-gutter) - var(--cms-content-gutter)));
  max-width:100%;min-width:0;box-sizing:border-box;margin-inline:auto;
}
body:is(.storefront,.theme-corporate2) .cms-content-page :is(.cms-page-intro,.cms-page-body){
  padding-inline:var(--cms-content-gutter);min-width:0;box-sizing:border-box;
}
body:is(.storefront,.theme-corporate2) .cms-content-page .cms-page-hero-image{
  margin-inline:var(--cms-content-gutter);
}
/* Corporate 1 previously capped the outer page at 1100px, and the frame at
   1056px. Use a single gutter/width, without nested horizontal padding. */
body.theme-corporate1 main.cms-content-page{
  width:min(var(--cms-content-limit),calc(100% - var(--cms-content-gutter) - var(--cms-content-gutter)));
  max-width:none;min-width:0;padding-inline:0;box-sizing:border-box;
}
body.theme-corporate1 .cms-content-page .cms-page-frame{
  width:100%;max-width:none;min-width:0;box-sizing:border-box;
  padding-inline:var(--cms-content-gutter);
}
body.theme-corporate1 .cms-content-page :is(.cms-page-intro,.cms-page-body){
  padding-inline:0;min-width:0;box-sizing:border-box;
}
body.theme-corporate1 .cms-content-page .cms-page-hero-image{margin-inline:0}

/* Default article shells use the same desktop width as standard pages.
   Keep headline/lead typography and article lock forms independently sized. */
body.theme-corporate1 .co74-single-shell.co-container{
  width:min(1240px,calc(100% - clamp(32px,6vw,72px)));
  max-width:1240px;min-width:0;box-sizing:border-box;
}
body.theme-corporate1 .co74-single-shell .co74-reading:not(.co74-locked){
  width:100%;max-width:none;min-width:0;box-sizing:border-box;
}
body.theme-corporate1 .co74-single-shell :is(.co74-comment-section,.co74-article-tags,.co74-back){
  width:100%;max-width:none;min-width:0;box-sizing:border-box;
}
body.theme-corporate1 .co74-single-shell .co74-single-cover{width:min(100%,1100px)}
body.theme-corporate2 .ai2-blog-wrap.ai2-article-wrap{
  width:min(1240px,calc(100% - clamp(32px,6vw,72px)));
  max-width:1240px;min-width:0;box-sizing:border-box;
}
body.theme-corporate2 .ai2-article-wrap .ai2-article-surface{padding-inline:clamp(16px,3vw,36px)}
body.storefront .cms-article-1184.container{
  width:min(1240px,calc(100% - clamp(24px,4vw,56px)));
  max-width:1240px;min-width:0;box-sizing:border-box;
  padding-inline:0;
}
body.storefront .cms-article-1184>.article-body{padding-inline:clamp(16px,3vw,36px)}

/* Existing storefront article image overrides must not shrink gallery tiles. */
body.storefront .cms-article-1184 .article-body .aicms-gallery .aicms-gallery-card img{
  width:100%!important;margin:0!important;object-fit:cover!important;
}
body.storefront .cms-article-1184 .article-body .aicms-gallery.gallery-natural .aicms-gallery-card img{object-fit:contain!important}

@media(max-width:700px){
  body:is(.storefront,.theme-corporate1,.theme-corporate2) .cms-content-page{--cms-content-gutter:12px}
  body:is(.storefront,.theme-corporate2) .cms-content-page .cms-page-frame{width:calc(100% - 24px)!important}
  body.theme-corporate1 .cms-content-page .cms-page-frame{width:100%!important}
  body.theme-corporate1 .co74-single-shell.co-container,
  body.theme-corporate2 .ai2-blog-wrap.ai2-article-wrap,
  body.storefront .cms-article-1184.container{width:calc(100% - 24px)}
  body.theme-corporate2 .ai2-article-wrap .ai2-article-surface,
  body.storefront .cms-article-1184>.article-body{padding-inline:14px}
}
