/* Phone refinements shared by all pages (presentation only; no wording changes). */
@media (max-width: 767px) {
  /* Justified text creates wide gaps in narrow columns: use left alignment */
  body .pbmit-title-bar-wrapper .pbmit-breadcrumb-inner span,
  body .pbmit-title-bar-wrapper .pbmit-breadcrumb-inner span span,
  body main [style*="justify"],
  body main .about-us-two_innerbox,
  body main .about-us-two_innerbox *,
  body main .it-card-body,
  body main .it-card-body *,
  body main .it-card-list *,
  body main .bloque-mision-vision p,
  body main .faq-answer-inner,
  body main .faq-answer-inner--list,
  body main .desc-sl-mov,
  body main .testimonial-three_bg h3,
  body main .testimonial-three_bg p { text-align: left !important; word-spacing: normal !important; }

  /* Closing banner ("Research that advances with you."): readable text over the photo */
  body main .testimonial-three_bg { position: relative; padding: 56px 0 !important; }
  body main .testimonial-three_bg::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(43,16,64,.9) 0%, rgba(43,16,64,.78) 58%, rgba(43,16,64,.2) 100%); pointer-events: none; }
  body main .testimonial-three_bg > .container { position: relative; z-index: 1; }
  body main .testimonial-three_bg .pbminfotech-box-desc { max-width: 100%; margin-top: 0 !important; }
  /* A legacy page rule shrank the slider wrapper to 60% (about 128px of text at 390px): give the copy a readable measure that still clears the photo */
  body main .testimonial-three_bg .swiper-wrapper { width: 72% !important; }
  body main .testimonial-three_bg h3 { font-size: 26px; line-height: 1.2; margin-bottom: 12px; }
  body main .testimonial-three_bg p { font-size: 16px; line-height: 1.55; }
}

/* White text on the teal Sponsors section was not readable */
.sp-body { color: #2b1040 !important; }

/* Long single-word section headings (forced 36px inline) were wider than their column at 320px */
@media (max-width: 767px) {
  body main .pbmit-ele-header-area .pbmit-title { font-size: clamp(1.55rem, 8vw, 2.25rem) !important; overflow-wrap: anywhere; hyphens: auto; }
}

/* ===== Phase 5: mobile hero component (<=767px). One vertical composition shared by every interior page:
   copy on the brand purple at the top, approved photograph in its own area below. Desktop and tablet are untouched. ===== */
@media (max-width: 767px) {
  body .pbmit-title-bar-wrapper.pbmit-title-bar-wrapper.pbmit-title-bar-wrapper.pbmit-title-bar-wrapper {
    --m5-ar: 0.68;
    height: auto !important; min-height: 0 !important; display: block; position: relative;
    padding: 30px 0 calc(100vw * var(--m5-ar) * .9) !important;
    background-color: #443876 !important; background-image: var(--m5-art, none) !important;
    background-repeat: no-repeat !important; background-size: 100% auto !important; background-position: 50% 100% !important;
  }
  body .pbmit-title-bar-wrapper::before { content: none !important; }
  body .pbmit-title-bar-wrapper.bg-slider2 { --m5-art: url('/assets/images/slider-img/m5-hero-about.webp'); }
  body .pbmit-title-bar-wrapper.bg-slider2.bg-slider6 { --m5-art: url('/assets/images/slider-img/m5-hero-areas.webp'); }
  body .pbmit-title-bar-wrapper.bg-slider3 { --m5-art: url('/assets/images/slider-img/m5-hero-sponsors-r4.webp'); }
  body .pbmit-title-bar-wrapper.bg-slider4, body .pbmit-title-bar-wrapper.bg-whatwetreat { --m5-art: url('/assets/images/slider-img/m5-hero-trials.webp'); }
  body .pbmit-title-bar-wrapper.bg-contactus { --m5-art: url('/assets/images/slider-img/m5-hero-contact.webp'); }
  body .pbmit-title-bar-wrapper.bg-whatwedo { --m5-art: url('/assets/images/slider-img/m5-hero-find-r2.webp'); }
  body .pbmit-title-bar-wrapper.bg-slider5.bg-cap-pavia { --m5-art: url('/assets/images/slider-img/m5-hero-cap.webp'); }

  body .pbmit-title-bar-wrapper > .container,
  body .pbmit-title-bar-wrapper .pbmit-title-bar-content,
  body .pbmit-title-bar-wrapper .pbmit-title-bar-content-inner { height: auto !important; min-height: 0 !important; display: block; width: 100%; max-width: 100%; }
  body .pbmit-title-bar-wrapper > .container { padding-left: 22px; padding-right: 22px; }
  body .pbmit-title-bar-wrapper .pbmit-tbar,
  body .pbmit-title-bar-wrapper .pbmit-tbar-inner.container,
  body .pbmit-title-bar-wrapper .pbmit-tbar .anch-mov,
  body .pbmit-title-bar-wrapper .pbmit-breadcrumb,
  body .pbmit-title-bar-wrapper .pbmit-breadcrumb-inner { width: 100% !important; max-width: 100% !important; padding-left: 0; padding-right: 0; }
  body .pbmit-title-bar-wrapper .pbmit-tbar-title {
    color: #fff !important; max-width: 100% !important; width: auto !important;
    font-size: clamp(25px, 7.4vw, 32px) !important; line-height: 1.16 !important; font-weight: 600;
    text-wrap: balance; overflow-wrap: normal; word-break: normal; hyphens: manual; margin: 0 0 12px;
  }
  body .pbmit-title-bar-wrapper .pbmit-breadcrumb-inner span,
  body .pbmit-title-bar-wrapper .pbmit-breadcrumb-inner span span {
    max-width: 100% !important; width: auto !important; font-size: 15.5px !important; line-height: 1.5 !important; color: #fff !important; text-wrap: pretty;
  }
}
@media (max-width: 359px) {
  body .pbmit-title-bar-wrapper .pbmit-tbar-title { font-size: 24px !important; }
  body .pbmit-title-bar-wrapper .pbmit-breadcrumb-inner span, body .pbmit-title-bar-wrapper .pbmit-breadcrumb-inner span span { font-size: 15px !important; }
}

/* Compact mobile header: keep logo, phone, language flags and menu button, drop the dead whitespace */
@media (max-width: 767px) {
  body .site-header .top-bar-custom { max-height: 40px; }
  body .site-header .top-bar-inner { padding: 4px 0; gap: 10px; }
  body .site-header .top-bar-phone, body .site-header .top-bar-lang .lang-item { min-height: 32px; display: inline-flex; align-items: center; }
  body .site-header .site-branding, body .site-header .site-branding .site-title { height: auto !important; margin: 0; }
  body .site-header .site-branding .site-title a { display: block; line-height: 0; padding: 8px 0; }
  body .site-header .site-branding img.logo-img { max-height: 40px; width: auto; }
  body .site-header .site-navigation, body .site-header .navbar-header { margin: 0 !important; }
  body .site-header .navbar-toggler { width: 48px; height: 48px; margin: 0; padding: 0; display: flex !important; align-items: center; justify-content: center; }
}

/* Tablet widths: the wide desktop artwork (subject on the right, empty gradient on the left) suits the wider banner */
@media (min-width: 768px) and (max-width: 991px) {
  body .pbmit-title-bar-wrapper.pbmit-title-bar-wrapper.bg-slider2:not(.bg-slider6):not(.x):not(.y) { background-image: url('/assets/images/slider-img/slider002-r3.webp') !important; background-position: 85% 50% !important; }
}

/* Tablet / small laptop: keep banner copy in the left ~55% so it clears the portrait */
@media (min-width: 768px) and (max-width: 1279px) {
  body .pbmit-title-bar-wrapper .pbmit-tbar-title { max-width: 38vw !important; font-size: clamp(28px, 3.8vw, 44px) !important; line-height: 1.12 !important; }
  body .pbmit-title-bar-wrapper .pbmit-breadcrumb-inner,
  body .pbmit-title-bar-wrapper .pbmit-breadcrumb-inner span,
  body .pbmit-title-bar-wrapper .pbmit-breadcrumb-inner span span { max-width: 38vw !important; }
}

@media (min-width: 768px) and (max-width: 991px) {
  body .pbmit-title-bar-wrapper.pbmit-title-bar-wrapper.bg-slider4 { background-image: url('/assets/images/slider-img/slider004-r3.webp') !important; background-position: 85% 50% !important; background-size: cover !important; }
}

/* Small laptops: banner photo is wider than the viewport; anchor right so the portrait is never cropped */
@media (min-width: 992px) and (max-width: 1599px) {
  body .pbmit-title-bar-wrapper.pbmit-title-bar-wrapper { background-position: 100% 50% !important; }
}

/* About / Find a Study / What we do / Trials: "Pause animation" sits in its own row above the scrolling text instead of floating over it */
@media (max-width: 767px) {
  body .marquesina { padding-top: 6px; }
  body .marquesina .marquee-toggle { position: static; display: block; margin: 8px auto 10px; min-height: 44px; padding: 10px 20px; font-size: 14px; }
}

/* Large statement headings inside coloured bands: readable size, left aligned, no mid-word hyphenation on phones */
@media (max-width: 767px) {
  body main .blockvrd h2.text-white { font-size: clamp(22px, 6.6vw, 28px) !important; line-height: 1.3 !important; text-align: left !important; hyphens: manual !important; overflow-wrap: normal !important; }
}
