/* QTX_PHASE1569_MOBILE_ARTICLE_WIDTH_CLOSURE
 * Phase 1569 — Mobile Article Layout & Responsive Width Closure.
 * Final cascade guard for Guide / News / generic singular surfaces.
 * Keeps every reading surface in normal document flow on narrow viewports.
 */

body.qtx-living :where(.qtx-article-shell,.qtx-article,.qtx-guide-article,.qtx-news-article,.qtx-article-layout,.qtx-news-article-layout,.qtx-prose,.qtx-news-prose,.qtx-article-rail,.qtx-news-share-rail){
  min-width:0;
}

body.qtx-living :where(.qtx-article-shell,.qtx-article,.qtx-guide-article,.qtx-news-article){
  width:100%;
  max-width:100%;
}

body.qtx-living :where(.qtx-prose,.qtx-news-prose) :where(img,video,iframe,svg,canvas,figure,pre,blockquote,.wp-block-image,.wp-block-video,.wp-block-embed,.wp-block-table){
  max-width:100%;
}

body.qtx-living :where(.qtx-prose,.qtx-news-prose) :where(p,li,a,h2,h3,h4,h5,h6,code,pre){
  overflow-wrap:anywhere;
  word-break:normal;
}

@media (max-width:1100px){
  body.qtx-living .qtx-article-shell,
  body.qtx-living .qtx-news-article-shell{
    width:min(calc(100% - 36px),var(--qtx-container));
    max-width:100%;
  }

  body.qtx-living .qtx-article-layout,
  body.qtx-living .qtx-news-article-layout{
    display:grid;
    grid-template-columns:minmax(0,1fr);
    width:100%;
    max-width:var(--qtx-prose);
    min-width:0;
    margin-inline:auto;
    justify-content:stretch;
    gap:18px;
  }

  body.qtx-living .qtx-article-rail,
  body.qtx-living .qtx-news-share-rail,
  body.qtx-living .qtx-prose,
  body.qtx-living .qtx-news-prose{
    grid-column:1 / -1;
    width:100%;
    max-width:100%;
    min-width:0;
  }

  body.qtx-living .qtx-article-rail,
  body.qtx-living .qtx-news-share-rail{
    position:static;
  }

  body.qtx-living .qtx-share-panel,
  body.qtx-living .qtx-share-box{
    width:100%;
    max-width:100%;
    min-width:0;
    position:static;
  }
}

@media (max-width:640px){
  body.qtx-living .qtx-article-shell,
  body.qtx-living .qtx-news-article-shell{
    width:calc(100% - 24px);
    max-width:none;
    margin-inline:12px;
    padding-inline:0;
  }

  body.qtx-living .qtx-article,
  body.qtx-living .qtx-guide-article,
  body.qtx-living .qtx-news-article,
  body.qtx-living .qtx-article-header,
  body.qtx-living .qtx-news-article-header,
  body.qtx-living .qtx-answer-capsule,
  body.qtx-living .qtx-trust-capsule,
  body.qtx-living .qtx-article-hero-media,
  body.qtx-living .qtx-news-hero-media,
  body.qtx-living .qtx-end-share,
  body.qtx-living .qtx-preferred-source,
  body.qtx-living .qtx-semantic-path,
  body.qtx-living .qtx-related,
  body.qtx-living .qtx-guide-news-bridge,
  body.qtx-living .qtx-crawl-topics{
    width:100%;
    max-width:100%;
    min-width:0;
    margin-left:0;
    margin-right:0;
  }

  body.qtx-living .qtx-article-layout,
  body.qtx-living .qtx-news-article-layout{
    display:block;
    width:100%;
    max-width:100%;
    min-width:0;
    margin:0;
  }

  body.qtx-living .qtx-article-rail,
  body.qtx-living .qtx-news-share-rail{
    display:block;
    width:100%;
    max-width:100%;
    margin:0 0 18px;
  }

  body.qtx-living .qtx-prose,
  body.qtx-living .qtx-news-prose{
    display:block;
    width:100%;
    max-width:100%;
    min-width:0;
    margin:0;
    padding:0;
    overflow:visible;
  }

  body.qtx-living :where(.qtx-prose,.qtx-news-prose) > *{
    max-width:100%;
    min-width:0;
  }

  body.qtx-living :where(.qtx-prose,.qtx-news-prose) :where(.qtx-toc,.qtx-revenue-cta,.qtx-guide-cta,.qtx-evidence-sources,.qtx-eeat-evidence,.qtx-diagnostic-flow,.qtx-price-table,.qtx-case-study,.qtx-errors,.qtx-checklist,.qtx-front-form,.wp-block-group,.wp-block-columns,.wp-block-column){
    width:100%;
    max-width:100%;
    min-width:0;
  }

  body.qtx-living :where(.qtx-prose,.qtx-news-prose) .wp-block-columns{
    flex-wrap:wrap!important;
  }

  body.qtx-living :where(.qtx-prose,.qtx-news-prose) .wp-block-column{
    flex-basis:100%!important;
    flex-grow:1!important;
  }

  body.qtx-living :where(.qtx-prose,.qtx-news-prose) table,
  body.qtx-living :where(.qtx-prose,.qtx-news-prose) .wp-block-table{
    width:100%;
    max-width:100%;
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
  }

  body.qtx-living :where(.qtx-prose,.qtx-news-prose) pre{
    width:100%;
    overflow-x:auto;
    white-space:pre-wrap;
  }

  body.qtx-living :where(.qtx-prose,.qtx-news-prose) iframe,
  body.qtx-living :where(.qtx-prose,.qtx-news-prose) video{
    width:100%;
  }
}

@media (max-width:390px){
  body.qtx-living .qtx-article-shell,
  body.qtx-living .qtx-news-article-shell{
    width:calc(100% - 20px);
    margin-inline:10px;
  }

  body.qtx-living .qtx-prose,
  body.qtx-living .qtx-news-prose{
    font-size:16px;
    line-height:1.72;
  }

  body.qtx-living :where(.qtx-prose,.qtx-news-prose) :where(ul,ol){
    padding-left:1.18em;
  }
}
