/*
 * RM Theme 0.3.14 — Native Gutenberg layout compatibility.
 * Private and opt-in, loaded only when native RM Theme renders a pilot.
 * Do not use on Avada / regular editorial pages.
 * Root cause: generic WordPress reading max-width:760px was applied to
 * full-bleed Gutenberg editorial modules and broke their internal CSS grids.
 */

/* Restore viewport-wide sections; the existing .rm-pilot-shell centers content. */
body.rm-pilots .wp-site-blocks,
body.rm-pilots .rm-pilot-main,
body.rm-pilots .rm-pilot-main > .wp-block-post-content{
  width:100%;
  max-width:none!important;
  min-width:0;
}
body.rm-pilots .rm-pilot-main > .wp-block-post-content{
  margin:0!important;
  padding:0!important;
}
body.rm-pilots .rm-pilot-main > .wp-block-post-content > .rm-pilot-section,
body.rm-pilots .rm-pilot-main > .wp-block-post-content > .rm-pilot-article-header {
  display:block;
  box-sizing:border-box;
  max-width:none!important;
  width:100%!important;
  margin-inline:0!important;
  margin-block-start:0!important;
  margin-block-end:0!important;
}

/* Article body remains comfortably readable, independent of wide masthead. */
body.rm-pilots .rm-pilot-main > .wp-block-post-content > .rm-pilot-reading-layout {
  width:100%!important;
  max-width:var(--rm-canvas)!important;
  margin-inline:auto!important;
  margin-block-start:0!important;
}
body.rm-pilots .rm-pilot-article-header-inner{
  width:100%!important;
  max-width:1160px!important;
  margin-inline:auto!important;
}
body.rm-pilots .rm-pilot-article-masthead{
  display:grid!important;
  grid-template-columns:minmax(0,1.12fr) minmax(0,.88fr)!important;
  align-items:center;
  gap:clamp(32px,5vw,70px);
  width:100%!important;
}
body.rm-pilots .rm-pilot-article-masthead > *,
body.rm-pilots .rm-pilot-tool-firstfold .rm-pilot-shell > *{
  min-width:0!important;
  max-width:none;
}

/* The actual GEO diagnostic must occupy its own right-hand column. */
body.rm-pilots .rm-pilot-tool-firstfold .rm-pilot-shell{
  display:grid!important;
  grid-template-columns:minmax(0,.86fr) minmax(0,1.14fr)!important;
  width:100%!important;
  max-width:var(--rm-canvas)!important;
  gap:clamp(28px,4.4vw,70px)!important;
  margin-inline:auto!important;
}
body.rm-pilots .rm-pilot-tool-form-card{
  position:relative!important;
  display:block;
  width:100%!important;
  max-width:none!important;
  min-width:0!important;
  margin:0!important;
  transform:none!important;
}
body.rm-pilots .rm-pilot-tool-form-card .rmgt-tool,
body.rm-pilots .rm-pilot-tool-form-card .rmtools-shell,
body.rm-pilots .rm-pilot-tool-form-card form,
body.rm-pilots .rm-pilot-tool-form-card .rmgt-field-group,
body.rm-pilots .rm-pilot-tool-form-card :is(input,textarea,select){
  display:block;
  box-sizing:border-box;
  max-width:100%!important;
  min-width:0;
  width:100%!important;
  margin-inline:0!important;
}
body.rm-pilots .rm-pilot-tool-form-card button{
  max-width:100%;
}
body.rm-pilots .rm-pilot-tool-firstcopy h1{
  max-width:530px!important;
  overflow-wrap:normal;
}
body.rm-pilots .rm-pilot-main .rm-pilot-section > .rm-pilot-shell{
  width:100%!important;
  box-sizing:border-box;
}

/* Responsive: sections may become one-column; never force horizontal overflow. */
@media(max-width:950px){
  body.rm-pilots .rm-pilot-tool-firstfold .rm-pilot-shell {
    grid-template-columns:minmax(0,.92fr) minmax(0,1.08fr)!important;
    gap:24px!important;
  }
}
@media(max-width:800px){
  body.rm-pilots .rm-pilot-article-masthead{
    grid-template-columns:1fr!important;
    gap:24px!important;
  }
  body.rm-pilots .rm-pilot-article-featured img{
    aspect-ratio:16/9;
    max-height:390px;
  }
}
@media(max-width:760px){
  body.rm-pilots .rm-pilot-tool-firstfold .rm-pilot-shell {
    grid-template-columns:1fr!important;
    gap:20px!important;
  }
  body.rm-pilots .rm-pilot-tool-form-card{
    margin-top:12px!important;
  }
  body.rm-pilots .rm-pilot-article-header{
    padding-inline:20px!important;
  }
}

/* The shared plugin UI normally centers a full-bleed widget with
 * margin:30px 50% and transform:translateX(-50%). Inside a Gutenberg
 * diagnostic card those rules move the interactive form OVER other columns.
 * Reset them only in this native theme's GEO card, not in the actual plugin. */
body.rm-pilots .rm-pilot-tool-form-card .rmgt-tool.rmtools-shell{
  transform:none!important;
  position:static!important;
  margin:0!important;
  width:100%!important;
  max-width:100%!important;
  padding:0!important;
  border:0!important;
  border-radius:0!important;
  box-shadow:none!important;
  background:transparent;
  overflow:visible!important;
}
body.rm-pilots .rm-pilot-tool-form-card .rmgt-tool.rmtools-shell *{
  max-width:100%;
}
body.rm-pilots .rm-pilot-tool-form-card .rmgt-tool.rmtools-shell .rmtools-cta{
  margin-inline:0!important;
}

/*
 * RM Theme 0.3.16 — Fix actual content density, not just the initial form.
 *
 * The GEO shortcode contains the whole diagnosis AND the expanded report:
 * it cannot live in a permanent narrow sidebar. Move it to a full-width
 * document-flow block immediately after a compact editorial introduction.
 *
 * On Think, replace the split, competing masthead with a conventional
 * editorial headline/deck and a wide featured image underneath.
 * The article body, semantics, copy, and images are unchanged.
 */

/* GEO — compact one-column introduction + full-width dynamic results. */
body.rm-pilots .rm-pilot-main .rm-pilot-tool-firstfold{
  padding-top:clamp(30px,3.3vw,48px)!important;
  padding-bottom:clamp(45px,5vw,70px)!important;
}
body.rm-pilots .rm-pilot-main .rm-pilot-tool-firstfold .rm-pilot-shell{
  display:flex!important;
  flex-direction:column!important;
  align-items:stretch!important;
  gap:clamp(22px,3vw,36px)!important;
  width:min(100%,1180px)!important;
  max-width:var(--rm-canvas)!important;
  margin:0 auto!important;
}
body.rm-pilots .rm-pilot-tool-firstcopy{
  display:block!important;
  width:100%!important;
  max-width:900px!important;
  padding-top:0!important;
  margin:0!important;
}
body.rm-pilots .rm-pilot-tool-firstcopy h1{
  max-width:900px!important;
  font-size:clamp(2.15rem,3.1vw,3.35rem)!important;
  line-height:1.16!important;
  margin-bottom:16px!important;
}
body.rm-pilots .rm-pilot-tool-firstcopy .rm-pilot-lead{
  max-width:820px!important;
  margin-bottom:0!important;
  font-size:1.04rem;
  line-height:1.64;
}
body.rm-pilots .rm-pilot-tool-safety{
  margin:18px 0 8px!important;
  padding-top:14px!important;
  max-width:820px!important;
}
body.rm-pilots .rm-pilot-tool-safety .rm-pilot-eyebrow{
  margin-bottom:8px!important;
}
body.rm-pilots .rm-pilot-tool-safety p:last-child{
  max-width:820px!important;
  margin-bottom:0!important;
}
body.rm-pilots .rm-pilot-tool-further{
  margin:8px 0 0!important;
}
body.rm-pilots .rm-pilot-tool-firstfold .rm-pilot-tool-form-card{
  width:100%!important;
  max-width:var(--rm-canvas)!important;
  margin:0 auto!important;
  padding:clamp(19px,3.3vw,36px)!important;
  overflow:visible!important;
  min-width:0!important;
  border-radius:12px!important;
}
body.rm-pilots .rm-pilot-tool-form-card > .rm-pilot-eyebrow{
  margin:0 0 17px!important;
}
body.rm-pilots .rm-pilot-tool-form-card .rmgt-tool.rmtools-shell{
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  margin:0!important;
  transform:none!important;
}
body.rm-pilots .rm-pilot-tool-form-card .rmgt-tool.rmtools-shell :is(
 .rmgt-result,.rmgt-results,.rmgt-analysis-result,.rmgt-report,
 .rmtools-section,.rmtools-results,.rmtools-report,table
 ){
  max-width:100%;
}
body.rm-pilots .rm-pilot-tool-form-card .rmgt-tool.rmtools-shell table{
  display:table;
  width:100%;
}
@media(max-width:760px){
  body.rm-pilots .rm-pilot-main .rm-pilot-tool-firstfold .rm-pilot-shell{
    display:flex!important;
    flex-direction:column!important;
    gap:18px!important;
  }
  body.rm-pilots .rm-pilot-tool-form-card{
    padding:18px!important;
  }
}

/* THINK — quiet editorial masthead; no 50/50 split between long title and image. */
body.rm-pilots .rm-pilot-main .rm-pilot-article-header{
  padding:clamp(38px,4.5vw,62px) 24px clamp(38px,5vw,72px)!important;
}
body.rm-pilots .rm-pilot-article-header-inner{
  width:100%!important;
  max-width:1100px!important;
  margin:0 auto!important;
}
body.rm-pilots .rm-pilot-article-header .rm-pilot-editorial-topline{
  margin-bottom:clamp(25px,3vw,40px)!important;
}
body.rm-pilots .rm-pilot-article-masthead{
  display:flex!important;
  flex-direction:column!important;
  align-items:stretch!important;
  gap:clamp(24px,3.3vw,42px)!important;
  width:100%!important;
  max-width:1100px!important;
  margin:0 auto!important;
}
body.rm-pilots .rm-pilot-article-masthead-text{
  width:100%;
  max-width:1050px!important;
  min-width:0;
  margin:0!important;
}
body.rm-pilots .rm-pilot-article-masthead-text h1{
  max-width:1020px!important;
  font-size:clamp(2.35rem,3.4vw,3.4rem)!important;
  font-weight:690!important;
  letter-spacing:-.038em;
  line-height:1.13!important;
  margin:0 0 24px!important;
}
body.rm-pilots .rm-pilot-article-masthead-text .rm-pilot-lead{
  max-width:770px!important;
  font-size:clamp(1.08rem,1.3vw,1.2rem);
  line-height:1.68;
  margin-bottom:14px!important;
}
body.rm-pilots .rm-pilot-article-masthead-text .rm-pilot-article-byline{
  margin-bottom:0!important;
}
body.rm-pilots .rm-pilot-article-featured{
  width:100%!important;
  max-width:1050px!important;
  margin:0!important;
  align-self:flex-start!important;
  min-width:0!important;
}
body.rm-pilots .rm-pilot-article-featured figure{
  width:100%!important;
  max-width:1050px!important;
  margin:0!important;
  overflow:hidden;
  border-radius:7px;
}
body.rm-pilots .rm-pilot-article-featured img{
  display:block;
  width:100%!important;
  height:clamp(240px,30vw,420px)!important;
  max-height:420px!important;
  aspect-ratio:auto!important;
  object-fit:cover;
  object-position:center 63%;
  border-radius:7px;
}
@media(max-width:800px){
  body.rm-pilots .rm-pilot-article-masthead{
    display:flex!important;
    flex-direction:column!important;
  }
  body.rm-pilots .rm-pilot-article-masthead-text h1{
    font-size:clamp(2.1rem,6.5vw,2.9rem)!important;
  }
  body.rm-pilots .rm-pilot-article-featured img{
    height:auto!important;
    max-height:none!important;
    aspect-ratio:16/9!important;
    object-fit:contain;
  }
}
@media(max-width:560px){
  body.rm-pilots .rm-pilot-main .rm-pilot-article-header{
    padding:30px 18px 28px!important;
  }
  body.rm-pilots .rm-pilot-article-masthead-text h1{
    font-size:clamp(2rem,7vw,2.4rem)!important;
  }
}


/* RM 0.4.2 · Gutenberg flow layout applies a top block-gap to grid children
   after the first. Clear that inherited gap on visual grid cells only. */
body.rm-pilots :is(
 .rm-personal-journey-track,.rm-personal-principles,.rm-personal-orgs,
 .rm-about-journey-summary,.rm-about-projects-grid,.rm-about-method-columns,
 .rm-related-tools,.rm-grid,.rm-steps,.rm-pilot-three-principles,
 .rm-pilot-resource-grid,.rm-pilot-credentials-grid,.rm-native-tool-related-links,
 .rm-research-findings
) > * {margin-block-start:0!important;margin-block-end:0!important;min-width:0;}
