/**
 * Site-wide responsive fixes: overflow, CMS HTML, legacy markup helpers.
 */

html {
  -webkit-text-size-adjust: 100%;
}

.wrapper {
  overflow-x: clip;
  max-width: 100%;
}

/* Rich text / CMS blocks */
.cms-prose,
.post-show .post-content,
.mg-service .panel-body,
.legal-page .container,
.tw-blocks,
.tw-pdDesc,
.block-image img {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.cms-prose img,
.post-show .post-content img,
.mg-service .panel-body img,
.tw-pdDesc img,
.tw-blocks img,
.block-image img {
  max-width: 100%;
  height: auto;
}

.cms-prose iframe,
.post-show .post-content iframe,
.tw-pdDesc iframe {
  max-width: 100%;
}

.cms-prose table,
.post-show .post-content table,
.mg-service .panel-body table,
.tw-pdDesc table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.cms-prose pre,
.post-show .post-content pre {
  max-width: 100%;
  overflow-x: auto;
}

/* Legacy promo banners (contact / old pages still using .promo) */
.promo .max-container {
  max-width: 100% !important;
  width: 100%;
}

.promo .img img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
}

/* Page header on small screens */
.page-header.ptb-120 {
  padding-top: 3.5rem !important;
  padding-bottom: 3.5rem !important;
}

@media (max-width: 575.98px) {
  .page-header .display-5 {
    font-size: clamp(1.35rem, 5vw, 1.75rem);
  }

  .page-header .lead {
    font-size: 0.95rem;
  }

  .page-header .bg-circle {
    display: none;
  }
}

/* Bootstrap 3 class aliases */
.col-xs-12 {
  flex: 0 0 auto;
  width: 100%;
}

@media (max-width: 767.98px) {
  .hidden-xs {
    display: none !important;
  }
}

@media (max-width: 991.98px) {
  .hidden-sm {
    display: none !important;
  }
}

/* Blog sidebar: content first on mobile */
.blog-list-area .blog-main-col {
  order: 1;
}

.blog-list-area .blog-side-col {
  order: 2;
}

@media (min-width: 992px) {
  .blog-list-area .blog-main-col {
    order: 0;
  }

  .blog-list-area .blog-side-col {
    order: 0;
  }

  .blog-sidebar-sticky {
    position: sticky;
    top: 1.25rem;
  }
}

@media (max-width: 991.98px) {
  .blog-sidebar-sticky {
    position: static;
    top: auto;
  }
}

/* Shop column order handled via Bootstrap order-* utilities in templates */

/* Topbar AI row */
.top-banner-ai {
  min-width: 0;
}

.top-banner-ai__links {
  flex-wrap: wrap;
  min-width: 0;
}
