/*
 * MFTC v0.9.2 theme compatibility shell.
 * Applied only to recognised MFTC platform pages. The global theme still owns header/footer.
 */
body.mftc-platform-page{--mftc-shell-max:1680px;--mftc-shell-gutter:clamp(14px,2vw,24px);overflow-x:clip}
body.mftc-platform-page #page,
body.mftc-platform-page .site{width:100%!important;max-width:none!important;margin-left:0!important;margin-right:0!important}
body.mftc-platform-page #content,
body.mftc-platform-page .site-content,
body.mftc-platform-page #primary,
body.mftc-platform-page .content-area,
body.mftc-platform-page main.site-main,
body.mftc-platform-page main#primary{width:100%!important;max-width:none!important;margin-left:0!important;margin-right:0!important;float:none!important;box-sizing:border-box}

/* The active MFTC theme uses a 1680px wide shell. Normalise common page wrappers to that same boundary. */
body.mftc-platform-page main .ftc-shell,
body.mftc-platform-page main .mftc-shell,
body.mftc-platform-page main .page-shell,
body.mftc-platform-page main .page-wrap,
body.mftc-platform-page main .page-container,
body.mftc-platform-page main .entry-content,
body.mftc-platform-page main .wp-block-post-content,
body.mftc-platform-page main .page-content,
body.mftc-platform-page #primary > .ftc-shell,
body.mftc-platform-page #primary > .container,
body.mftc-platform-page .site-main > .container{
  width:100%!important;
  max-width:var(--mftc-shell-max)!important;
  margin-left:auto!important;
  margin-right:auto!important;
  padding-left:var(--mftc-shell-gutter)!important;
  padding-right:var(--mftc-shell-gutter)!important;
  box-sizing:border-box!important;
}

/* Theme-specific compatibility: preserve the theme header/footer but remove accidental narrow-page constraints. */
body.mftc-theme-midrand .site-header .ftc-shell,
body.mftc-theme-midrand .site-header .header-shell,
body.mftc-theme-midrand .site-footer .ftc-shell,
body.mftc-theme-midrand .site-footer .footer-shell{
  width:100%!important;
  max-width:var(--mftc-shell-max)!important;
  margin-left:auto!important;
  margin-right:auto!important;
  box-sizing:border-box!important;
}
body.mftc-theme-midrand main .ftc-page,
body.mftc-theme-midrand main .ftc-page-shell,
body.mftc-theme-midrand main .ftc-section-shell,
body.mftc-theme-midrand main .ftc-content-shell,
body.mftc-theme-midrand main .ftc-resources,
body.mftc-theme-midrand main .ftc-resources-page,
body.mftc-theme-midrand main .ftc-contact-page,
body.mftc-theme-midrand main .ftc-courses-page,
body.mftc-theme-midrand main .ftc-learning-page{
  width:100%!important;
  max-width:var(--mftc-shell-max)!important;
  margin-left:auto!important;
  margin-right:auto!important;
  box-sizing:border-box!important;
}

/* Plugin application components should use the full available platform shell, including CRM forms. */
body.mftc-platform-page .mftc-course-grid,
body.mftc-platform-page .mftc-form-shell,
body.mftc-platform-page .mftc-portal,
body.mftc-platform-page .mftc-assessment-shell,
body.mftc-platform-page .mftc-verify,
body.mftc-platform-page .mftc-course-page-copy,
body.mftc-platform-page .mftc-crm-slot,
body.mftc-platform-page [data-ftc-crm],
body.mftc-platform-page [data-mftc-crm]{
  width:100%!important;
  max-width:100%!important;
  box-sizing:border-box!important;
}
body.mftc-platform-page .mftc-form-shell,
body.mftc-platform-page .mftc-portal,
body.mftc-platform-page .mftc-assessment-shell,
body.mftc-platform-page .mftc-verify{margin-left:0;margin-right:0}

/* Defensive containment for third-party/theme components inside MFTC platform pages. */
body.mftc-platform-page img,
body.mftc-platform-page video,
body.mftc-platform-page iframe{max-width:100%;height:auto}
body.mftc-platform-page table{max-width:100%}
body.mftc-platform-page .mftc-table-scroll{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}

@media (max-width:1320px){
  body.mftc-platform-page{--mftc-shell-gutter:20px}
}
@media (max-width:640px){
  body.mftc-platform-page{--mftc-shell-gutter:14px}
  body.mftc-platform-page main .ftc-shell,
  body.mftc-platform-page main .entry-content,
  body.mftc-platform-page main .wp-block-post-content,
  body.mftc-platform-page main .page-content{padding-left:14px!important;padding-right:14px!important}
}

/* Additional outer-wrapper normalisation for classic, hybrid and block themes. */
body.mftc-platform-page > .wp-site-blocks,
body.mftc-platform-page .ftc-site,
body.mftc-platform-page .mftc-site,
body.mftc-platform-page .site-wrapper,
body.mftc-platform-page .page-wrapper{
  width:100%!important;
  max-width:none!important;
  margin-left:0!important;
  margin-right:0!important;
  box-sizing:border-box!important;
}
body.mftc-platform-page header,
body.mftc-platform-page main,
body.mftc-platform-page footer,
body.mftc-platform-page header *,
body.mftc-platform-page main *{min-width:0}
