/*
 * Header menu: the item for the current section (e.g. "Insights" on /case-study/) keeps its dark
 * "active" style. While another top-level item is hovered or open, show only that one as active
 * so two items are never highlighted at the same time.
 */
@media only screen and (min-width: 1025px) {
  #mega-menu-wrap-primary #mega-menu-primary:has(> li.mega-menu-item:not(.mega-current-menu-ancestor):not(.mega-current-menu-item):hover, > li.mega-menu-item.mega-toggle-on:not(.mega-current-menu-ancestor):not(.mega-current-menu-item))
    > li.mega-menu-item:is(.mega-current-menu-ancestor, .mega-current-menu-item, .mega-current-page-ancestor):not(:hover):not(.mega-toggle-on)
    > a.mega-menu-link {
    background: transparent;
    color: #222;
  }
}

/*
 * Arabic (RTL): js/script.js starts most carousels with `rtl: isRTL`, but a few have that option
 * commented out. Those run in LTR mode inside a right-to-left page, which pushes the slides
 * off-screen; give them an LTR track while the slide contents stay right-to-left.
 */
html[dir="rtl"] .owl-carousel:not(.owl-rtl) {
  direction: ltr;
}
html[dir="rtl"] .owl-carousel:not(.owl-rtl) .owl-item > * {
  direction: rtl;
}

/*
 * Blog / detail content from the admin editor: images never overflow the column, and tables
 * (often pasted from Word with fixed point widths) fill it and stay readable.
 */
.blogDetails-inner img {
  max-width: 100%;
  height: auto;
}
.blogDetails-inner figure,
.blogDetails-inner .wp-caption {
  max-width: 100%;
}
.blogDetails-inner table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
}
.blogDetails-inner td,
.blogDetails-inner th {
  border: 1px solid #ccc;
  padding: 10px 14px;
  vertical-align: top;
}
.blogDetails-inner td p,
.blogDetails-inner th p {
  margin: 0 0 6px;
  font-size: 16px;
  line-height: 26px;
}
@media only screen and (max-width: 767px) {
  .blogDetails-inner table {
    display: block;
    overflow-x: auto;
  }
}

/*
 * No sideways scrolling on any page.
 * - Header: the last flyout ("Careers") opened to the right of its item and ran past the screen edge
 *   (it is in the layout even while hidden), so the page scrolled right on desktop. Open the
 *   flyouts near the right end of the menu leftwards instead.
 * - Long words with no spaces (e.g. "#ChronicFatigueSyndromeAwarenessDay" post titles) could not wrap
 *   and pushed mobile pages wider than the screen.
 * - Safety net: anything else that pokes past the edge is clipped instead of making the page scroll.
 */
@media only screen and (min-width: 1025px) {
  #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-flyout:nth-last-child(-n + 2) > ul.mega-sub-menu {
    left: auto;
    right: 0;
  }
}
h1, h2, h3, h4, h5, h6, p, li, td, th, a {
  overflow-wrap: break-word;
}
.blogKHSection ul li h4,
.blogKHSection ul li p {
  overflow-wrap: anywhere;
}
html,
body {
  overflow-x: clip;
}
