/* XMS v1.4.26 — Screenshot-directed homepage mobile + tablet refinements.
 * The desktop hero, four icons, CTA and every inner-page layout remain unchanged.
 * This is loaded after the legacy/home/section-builder responsive styles. */

/* (1) Align "LET'S BUILD WHAT'S NEXT" to the same inset as its details.
 * Keep text, button and editable contact information in document flow. */
@media (max-width: 1024px) {
  body.xms-theme.xms-home-study .xms-main > section.xms-section-study_contact {
    padding-inline: clamp(23px, 3vw, 32px) !important;
    box-sizing: border-box !important;
  }
  body.xms-theme.xms-home-study .xms-main > section.xms-section-study_contact .xms-study-contact-copy {
    text-align: left !important;
    justify-self: start !important;
    align-self: center !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding-left: 0 !important;
    transform: none !important;
  }
  body.xms-theme.xms-home-study .xms-main > section.xms-section-study_contact .xms-study-contact-copy > h2,
  body.xms-theme.xms-home-study .xms-main > section.xms-section-study_contact .xms-study-contact-copy p {
    text-align: left !important;
    margin-left: 0 !important;
    padding-left: 0 !important;
  }
  body.xms-theme.xms-home-study .xms-main > section.xms-section-study_contact .xms-study-contact-copy .xms-study-button {
    margin-left: 0 !important;
  }
  /* (2) Highlights keep the editor-selected column counts, but use bigger
     icons wherever there is room inside each responsive grid cell. */
  body.xms-theme.xms-home-study .xms-main > section.xms-section-study_stats .xms-study-stats {
    justify-items: center !important;
    align-items: center !important;
  }
  body.xms-theme.xms-home-study .xms-main > section.xms-section-study_stats .xms-study-stat {
    min-width: 0 !important;
    padding: 4px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  body.xms-theme.xms-home-study .xms-main > section.xms-section-study_stats .xms-study-stat-icon {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: min(100%, 150px) !important;
    height: auto !important;
    aspect-ratio: 1 / 1 !important;
    flex: 0 1 auto !important;
  }
  body.xms-theme.xms-home-study .xms-main > section.xms-section-study_stats .xms-study-stat-icon img,
  body.xms-theme.xms-home-study .xms-main > section.xms-section-study_stats .xms-study-stat-icon .xms-icon-upload,
  body.xms-theme.xms-home-study .xms-main > section.xms-section-study_stats .xms-study-stat-icon svg {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
  }
}

/* Tablet (768-1024): the image runs to the viewport edge, not an inset
 * photo; the hero heading/content keep a comfortable left text inset. */
@media (min-width: 768px) and (max-width: 1024px) {
  body.xms-theme.xms-home-study .xms-main > section.xms-section-study_hero {
    width: 100vw !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: 0 !important;
    padding: 40px 40px !important;
    min-height: 440px !important;
    border: 0 !important;
    border-radius: 0 !important;
  }
  body.xms-theme.xms-home-study .xms-main > section.xms-section-study_hero .xms-study-hero-visual.xms-study-hero-single {
    right: 0 !important;
    margin-right: 0 !important;
    border-radius: 0 !important;
  }
  body.xms-theme.xms-home-study .xms-main > section.xms-section-study_stats {
    padding: 16px 16px !important;
  }
  body.xms-theme.xms-home-study .xms-main > section.xms-section-study_stats .xms-study-stat {
    min-height: 145px !important;
  }
}

/* Mobile: no portrait/square crop of the 16:9 globe artwork, no white
 * inset around its edges. The hero section can bleed beyond the homepage
 * grid gutters, but the text retains the same ~30px inset as other cards. */
@media (max-width: 767px) {
  body.xms-theme.xms-home-study .xms-main > section.xms-section-study_hero {
    position: relative !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    grid-column: 1 / -1 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    /* (4) Remove the legacy 95–126px top spacer below the landscape video. */
    padding: 26px 30px 0 !important;
    min-height: 0 !important;
    height: auto !important;
    border: 0 !important;
    border-radius: 0 !important;
    overflow: hidden !important;
  }
  body.xms-theme.xms-home-study .xms-main > section.xms-section-study_hero .xms-study-hero-copy {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    align-self: flex-start !important;
    justify-content: flex-start !important;
    margin: 0 !important;
    padding: 0 !important;
    min-height: 0 !important;
  }
  body.xms-theme.xms-home-study .xms-main > section.xms-section-study_hero .xms-study-hero-visual.xms-study-hero-single {
    /* (3) The uploaded/saved hero image now spans the entire mobile screen. */
    position: relative !important;
    inset: auto !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    display: block !important;
    flex: 0 0 auto !important;
    width: calc(100% + 60px) !important;
    max-width: none !important;
    min-width: 0 !important;
    height: auto !important;
    max-height: none !important;
    aspect-ratio: 16 / 9 !important;
    margin: 22px -30px 0 !important;
    padding: 0 !important;
    transform: none !important;
    opacity: 1 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: hidden !important;
  }
  body.xms-theme.xms-home-study .xms-main > section.xms-section-study_hero .xms-study-hero-visual.xms-study-hero-single img {
    position: absolute !important;
    inset: 0 !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    object-fit: cover !important;
    object-position: center center !important;
    transform: none !important;
    border: 0 !important;
    border-radius: 0 !important;
  }
  body.xms-theme.xms-home-study .xms-main > section.xms-section-study_hero .xms-study-hero-visual.xms-study-hero-single::before,
  body.xms-theme.xms-home-study .xms-main > section.xms-section-study_hero .xms-study-hero-visual.xms-study-hero-single::after {
    content: none !important;
    display: none !important;
  }

  /* More prominent four-icon gallery in the default 2x2 layout, without
     overriding the mobile column count selected in the WordPress editor. */
  body.xms-theme.xms-home-study .xms-main > section.xms-section-study_stats {
    padding: 17px 13px !important;
    min-height: 0 !important;
  }
  body.xms-theme.xms-home-study .xms-main > section.xms-section-study_stats .xms-study-stats {
    gap: 14px 6px !important;
  }
  body.xms-theme.xms-home-study .xms-main > section.xms-section-study_stats .xms-study-stat {
    min-height: 0 !important;
    height: auto !important;
    padding: 4px 2px !important;
  }
  body.xms-theme.xms-home-study .xms-main > section.xms-section-study_stats .xms-study-stat-icon {
    width: min(100%, clamp(118px, 34vw, 146px)) !important;
    max-width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1 !important;
  }
  body.xms-theme.xms-home-study .xms-main > section.xms-section-study_stats .xms-study-stat-icon img,
  body.xms-theme.xms-home-study .xms-main > section.xms-section-study_stats .xms-study-stat-icon .xms-icon-upload,
  body.xms-theme.xms-home-study .xms-main > section.xms-section-study_stats .xms-study-stat-icon svg {
    width: 100% !important;
    height: 100% !important;
  }

  /* On narrow screens both contact blocks should start at the same left
     guide line, with a simple divider separating them. */
  body.xms-theme.xms-home-study .xms-main > section.xms-section-study_contact {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 18px !important;
    padding: 24px 23px 27px !important;
  }
  body.xms-theme.xms-home-study .xms-main > section.xms-section-study_contact .xms-study-contact-copy {
    padding: 0 !important;
    align-self: stretch !important;
  }
  body.xms-theme.xms-home-study .xms-main > section.xms-section-study_contact .xms-study-contact-details {
    box-sizing: border-box !important;
    align-self: stretch !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 19px 0 0 !important;
    border-left: 0 !important;
    border-top: 1px solid rgba(145,150,155,.42) !important;
  }
}
