
/* Wheelixa layout overflow hard-fix.
   Does NOT rename/edit active theme. */

html,body{
  max-width:100%!important;
  overflow-x:hidden!important;
}
body *{box-sizing:border-box!important}

/* Wheelixa known wrappers + generic WP wrappers */
body .wx-post-wrap,
body .wx-article,
body .wx-entry,
body .wx-post-hero,
body .wrap,
body article,
body main,
body .site-main,
body .content-area,
body .site-content,
body .entry-content,
body .post-content{
  min-width:0!important;
  max-width:100%!important;
  box-sizing:border-box!important;
}

/* Screenshot issue: article text escaping to the right */
body .wx-entry,
body .wx-entry > *,
body .entry-content,
body .entry-content > *,
body .post-content,
body .post-content > *{
  width:auto!important;
  min-width:0!important;
  max-width:100%!important;
  overflow-wrap:anywhere!important;
  word-break:normal!important;
  white-space:normal!important;
}

/* Paragraphs/headings/lists/links */
body .wx-entry p,
body .wx-entry h1,
body .wx-entry h2,
body .wx-entry h3,
body .wx-entry h4,
body .wx-entry h5,
body .wx-entry h6,
body .wx-entry li,
body .wx-entry a,
body .wx-entry span,
body .wx-entry strong,
body .wx-entry blockquote,
body .entry-content p,
body .entry-content h1,
body .entry-content h2,
body .entry-content h3,
body .entry-content li,
body .entry-content a{
  max-width:100%!important;
  overflow-wrap:anywhere!important;
  word-break:normal!important;
  white-space:normal!important;
}

/* Force long text blocks back into content column */
body.single-post .wx-entry p,
body.single-post .entry-content p,
body.single-post .post-content p{
  display:block!important;
  width:100%!important;
  clear:both!important;
}

/* Lists */
body.single-post .wx-entry ul,
body.single-post .wx-entry ol,
body.single-post .entry-content ul,
body.single-post .entry-content ol{
  max-width:100%!important;
  padding-left:1.4rem!important;
  margin-right:0!important;
  overflow:hidden!important;
}

/* Images/media */
body.single-post .wx-entry img,
body.single-post .entry-content img,
body.single-post .post-content img,
body.single-post .wx-featured img,
body.single-post iframe,
body.single-post video,
body.single-post svg{
  display:block!important;
  max-width:100%!important;
  width:100%!important;
  height:auto!important;
}

/* Tables */
body.single-post table{
  width:100%!important;
  max-width:100%!important;
  table-layout:fixed!important;
}
body.single-post td,
body.single-post th{
  overflow-wrap:anywhere!important;
}

/* Code/embeds */
body.single-post pre,
body.single-post code{
  max-width:100%!important;
  overflow:auto!important;
}

/* Related reading blocks should stay inside content */
body.single-post .wx-context-link{
  width:100%!important;
  max-width:100%!important;
  overflow:hidden!important;
}
body.single-post .wx-context-link a,
body.single-post .wx-context-link span{
  min-width:0!important;
  max-width:100%!important;
  overflow-wrap:anywhere!important;
  white-space:normal!important;
}

/* Related posts */
body.single-post .wx-related,
body.single-post .wx-related-grid,
body.single-post .wx-related-card{
  min-width:0!important;
  max-width:100%!important;
}
body.single-post .wx-related-grid{
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
}
body.single-post .wx-related-card h3{
  overflow-wrap:anywhere!important;
  white-space:normal!important;
}

/* Footer must not be pulled by oversized content */
body .wx-footer,
body footer{
  position:relative!important;
  clear:both!important;
  width:100%!important;
  max-width:100%!important;
  transform:none!important;
}

/* Tablet */
@media(max-width:980px){
  body.single-post .wx-post-wrap{
    width:min(100% - 28px, 920px)!important;
  }
  body.single-post .wx-article{
    padding:28px 24px!important;
  }
  body.single-post .wx-related-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
}

/* Mobile */
@media(max-width:680px){
  body.single-post .wx-post-wrap{
    width:calc(100% - 20px)!important;
  }
  body.single-post .wx-article{
    padding:18px 14px!important;
  }
  body.single-post .wx-post-hero h1{
    font-size:clamp(2rem,10vw,3.2rem)!important;
    line-height:1!important;
  }
  body.single-post .wx-related-grid{
    grid-template-columns:1fr!important;
  }
}
