/* Final content-rail correction and contextual visual sizing. */

:root{
  --mm-content-rail:1280px;
  --mm-content-gutter:1.25rem;
}

/*
 * Full-width sections keep their backgrounds, but their actual content follows
 * one centered rail. This intentionally overrides the earlier emergency
 * alignment rules that pushed headings and cards against the viewport edge.
 */
:is(
  .mm-home-hero__grid,
  .mm-home-trust>.alignwide,
  .mm-home-section>.alignwide,
  .mm-services-hero-grid,
  .mm-services-catalog>.alignwide,
  .mm-services-process>.alignwide,
  .mm-services-proof>.alignwide,
  .mm-services-final-cta__inner,
  .mm-service-detail-hero__grid,
  .mm-service-section>.alignwide,
  .mm-service-section--faq>.mm-faq-list,
  .mm-service-detail-final-cta__inner,
  .mm-industries-hero__grid,
  .mm-industries-context>.alignwide,
  .mm-industries-grid-section>.alignwide,
  .mm-industries-final-cta__inner,
  .mm-industry-detail__hero-grid,
  .mm-industry-section>.alignwide,
  .mm-industry-detail__cta-inner,
  .mm-work-hero__grid,
  .mm-work-grid-section>.alignwide,
  .mm-work-final-cta__inner,
  .mm-case-study-content>.alignwide,
  .mm-case-study-services>.alignwide,
  .mm-case-study-related>.alignwide,
  .mm-about-hero__inner,
  .mm-about-section>.alignwide,
  .mm-about-final-cta__inner,
  .mm-contact-hero__grid,
  .mm-contact-section>.alignwide,
  .mm-contact-section>.mm-contact-layout,
  .mm-insights-hero-grid,
  .mm-insights-context>.alignwide,
  .mm-insights-feed>.alignwide
){
  width:min(calc(100% - 2.5rem),var(--mm-content-rail))!important;
  max-width:var(--mm-content-rail)!important;
  margin-left:auto!important;
  margin-right:auto!important;
  box-sizing:border-box!important;
}

/* Headings and the content immediately following them share the exact rail. */
:is(
  .mm-home-section-heading,
  .mm-home-section-heading--wide,
  .mm-section-intro,
  .mm-service-section__intro,
  .mm-industry-section__intro
){
  width:100%!important;
  max-width:none!important;
  margin-left:0!important;
  margin-right:0!important;
  text-align:left!important;
  box-sizing:border-box!important;
}
:is(
  .mm-home-section-heading,
  .mm-section-intro,
  .mm-service-section__intro,
  .mm-industry-section__intro
)>*{
  margin-left:0!important;
  margin-right:auto!important;
  text-align:left!important;
}

/* FAQ heading and accordion use the same left and right bounds. */
.mm-service-section--faq>.mm-section-intro,
.mm-service-section--faq>.mm-faq-list,
.mm-faq-section>.mm-section-intro,
.mm-faq-section>.mm-faq-list{
  width:min(calc(100% - 2.5rem),var(--mm-content-rail))!important;
  max-width:var(--mm-content-rail)!important;
  margin-left:auto!important;
  margin-right:auto!important;
  padding-left:0!important;
  padding-right:0!important;
  box-sizing:border-box!important;
  text-align:left!important;
}
.mm-faq-list details,
.mm-faq-list summary,
.mm-faq-list details p{
  text-align:left!important;
}

/* The footer background remains full bleed; footer CONTENT matches page content. */
.mm-site-footer>.mm-footer-inner,
.mm-site-footer .mm-footer-inner{
  width:min(calc(100% - 2.5rem),var(--mm-content-rail))!important;
  max-width:var(--mm-content-rail)!important;
  margin-left:auto!important;
  margin-right:auto!important;
  padding-left:0!important;
  padding-right:0!important;
  box-sizing:border-box!important;
}
.mm-site-footer .mm-footer-cta,
.mm-site-footer .mm-footer-grid,
.mm-site-footer .mm-footer-bottom,
.mm-site-footer .wp-block-separator{
  width:100%!important;
  max-width:none!important;
  margin-left:0!important;
  margin-right:0!important;
}

/* Contact hero must start on exactly the same rail as the form section. */
.mm-contact-hero__grid,
.mm-contact-layout{
  width:min(calc(100% - 2.5rem),var(--mm-content-rail))!important;
  max-width:var(--mm-content-rail)!important;
  margin-inline:auto!important;
}
.mm-contact-hero__grid>*,
.mm-contact-layout>*{
  min-width:0;
}

/*
 * About-page grids were being clipped by the previous full-width override.
 * Keep every grid cell shrinkable and let the section itself expose shadows.
 */
.mm-about-section,
.mm-about-final-cta{
  overflow:visible!important;
}
.mm-about-split,
.mm-about-journey,
.mm-about-beliefs,
.mm-about-team-grid,
.mm-about-delivery-list{
  min-width:0;
  max-width:100%;
  box-sizing:border-box;
}
.mm-about-split>*,
.mm-about-journey>*,
.mm-about-beliefs>*,
.mm-about-team-grid>*,
.mm-about-delivery-list>*{
  min-width:0;
  max-width:100%;
  box-sizing:border-box;
}
.mm-about-beliefs article,
.mm-about-team-grid article{
  width:100%;
}
.mm-about-journey__visual svg{
  max-width:100%!important;
}

/*
 * Hero visuals should carry similar visual weight to the adjacent copy. Richer
 * SVGs use the full visual column rather than sitting as small decorations.
 */
:is(
  .mm-services-hero-visual,
  .mm-industries-hero__visual,
  .mm-work-hero__visual,
  .mm-contact-hero-art,
  .mm-insights-hero-art
){
  display:flex;
  align-items:center;
  justify-content:center;
  min-width:0;
  width:100%;
  margin:0!important;
}
:is(
  .mm-services-hero-visual,
  .mm-industries-hero__visual,
  .mm-work-hero__visual,
  .mm-contact-hero-art,
  .mm-insights-hero-art
) svg{
  display:block!important;
  width:min(112%,840px)!important;
  max-width:840px!important;
  height:auto!important;
  margin-inline:auto!important;
  filter:drop-shadow(0 28px 56px rgba(0,8,32,.28));
}

/* Give hero copy/visual columns more balanced weight on wide screens. */
@media(min-width:981px){
  .mm-services-hero-grid>.wp-block-column:first-child{flex-basis:52%!important}
  .mm-services-hero-grid>.wp-block-column:last-child{flex-basis:48%!important}
  .mm-industries-hero__grid>.wp-block-column:first-child{flex-basis:52%!important}
  .mm-industries-hero__grid>.wp-block-column:last-child{flex-basis:48%!important}
  .mm-work-hero__grid>.wp-block-column:first-child{flex-basis:52%!important}
  .mm-work-hero__grid>.wp-block-column:last-child{flex-basis:48%!important}
  .mm-contact-hero__grid{grid-template-columns:minmax(0,1.02fr) minmax(390px,.98fr)!important;gap:clamp(2rem,4vw,4.5rem)!important}
  .mm-insights-hero-grid{grid-template-columns:minmax(0,1.02fr) minmax(390px,.98fr)!important;gap:clamp(2rem,4vw,4.5rem)!important}
}

@media(max-width:980px){
  :is(
    .mm-services-hero-visual,
    .mm-industries-hero__visual,
    .mm-work-hero__visual,
    .mm-contact-hero-art,
    .mm-insights-hero-art
  ) svg{
    width:100%!important;
    max-width:720px!important;
  }
}

@media(max-width:640px){
  :is(
    .mm-home-hero__grid,
    .mm-home-trust>.alignwide,
    .mm-home-section>.alignwide,
    .mm-services-hero-grid,
    .mm-services-catalog>.alignwide,
    .mm-services-process>.alignwide,
    .mm-services-proof>.alignwide,
    .mm-services-final-cta__inner,
    .mm-service-detail-hero__grid,
    .mm-service-section>.alignwide,
    .mm-service-section--faq>.mm-faq-list,
    .mm-service-detail-final-cta__inner,
    .mm-industries-hero__grid,
    .mm-industries-context>.alignwide,
    .mm-industries-grid-section>.alignwide,
    .mm-industries-final-cta__inner,
    .mm-industry-detail__hero-grid,
    .mm-industry-section>.alignwide,
    .mm-industry-detail__cta-inner,
    .mm-work-hero__grid,
    .mm-work-grid-section>.alignwide,
    .mm-work-final-cta__inner,
    .mm-about-hero__inner,
    .mm-about-section>.alignwide,
    .mm-about-final-cta__inner,
    .mm-contact-hero__grid,
    .mm-contact-section>.alignwide,
    .mm-contact-section>.mm-contact-layout,
    .mm-insights-hero-grid,
    .mm-insights-context>.alignwide,
    .mm-insights-feed>.alignwide,
    .mm-site-footer>.mm-footer-inner,
    .mm-site-footer .mm-footer-inner
  ){
    width:calc(100% - 2rem)!important;
  }
}
