/* CBC_FIT_0930: everything fits the screen (Charles, 30 Sept 2026).
   style.css sets html,body{overflow-x:hidden}, so anything wider than the screen was silently CUT OFF
   at the right edge instead of scrolling. These rules stop content from being wider than its column. */

/* Media never wider than its box */
img, video, svg, embed, object { max-width: 100% !important; }
img, video { height: auto; }
iframe { max-width: 100% !important; }

/* Article bodies: long words, codes and links wrap; the column may shrink below its content */
.post-content-area, .post-body, #post-body, .post-toc, .share-bar, article { min-width: 0 !important; max-width: 100% !important; }
.post-body, #post-body { overflow-wrap: break-word; word-wrap: break-word; }
.post-body a, #post-body a { overflow-wrap: anywhere; }

/* Wide tables scroll sideways inside their own box instead of stretching the page */
.post-body table, #post-body table, .product-description table, .container table {
  display: block !important; max-width: 100% !important; width: auto !important; overflow-x: auto !important; -webkit-overflow-scrolling: touch; border-collapse: collapse;
}
.post-body table th, .post-body table td, #post-body table th, #post-body table td { overflow-wrap: break-word; }

/* Flex and grid children may shrink (the default min-width:auto lets content force the page wider) */
main, .container, .product-detail > *, .checkout-layout > *, .cart-layout > *, .shop-layout > *, .post-layout > * { min-width: 0; }

/* Shop: section and grade tab rows stay inside the screen and scroll */
.section-tabs, .sub-bar { max-width: 100%; min-width: 0; }

/* Code and preformatted text scroll rather than overflow */
pre, code { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Desktop menu: on laptops (1024 to 1799px) it no longer runs off the right edge. It uses a
   tighter spacing and, if still too long, folds onto a second line; cart and search stay visible. */
@media (min-width: 1024px) and (max-width: 1799px) {
  .site-nav { min-width: 0; flex: 1 1 auto; }
  .nav__list { flex-wrap: wrap; justify-content: center; row-gap: 2px; }
  .nav__link { font-size: .84rem; padding-left: .45rem; padding-right: .45rem; }
  .header__actions { flex-shrink: 0; }
}

/* Shop: the section-tab row must scroll, never push the page */
.section-tabs, .sub-bar { overflow-x: auto !important; }
