/*
 * M1-v2 review stability layer.
 * Loaded only by the EN/ZH home and projects samples under review.
 */

/* Scrolling must never leave real content transparent or displaced. */
html.motion-safe body.m1-layout-sample [data-reveal],
html.motion-safe body.m1-layout-sample [data-reveal].is-visible,
body.m1-layout-sample [data-reveal] {
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  animation: none !important;
  transition: none !important;
}

body.m1-layout-sample .section-head {
  min-width: 0 !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

body.m1-layout-sample .section-head :is(h1, h2, h3, p) {
  min-width: 0 !important;
  max-width: 100% !important;
  overflow-wrap: anywhere !important;
}

/* Home: keep scope, trust evidence, projects and FAQs visually coherent. */
body.m1-home-sample.m1-layout-sample .capabilities .capability-grid > div {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: auto auto !important;
  align-content: start !important;
  column-gap: 0 !important;
  row-gap: 8px !important;
  min-height: 0 !important;
  padding: 22px 20px !important;
  overflow: visible !important;
}

body.m1-home-sample.m1-layout-sample .capabilities .capability-grid > div::before {
  display: none !important;
  content: none !important;
}

body.m1-home-sample.m1-layout-sample .capabilities .capability-grid > div :is(h3, p) {
  grid-column: 1 !important;
  margin: 0 !important;
}

body.m1-home-sample.m1-layout-sample .capability-public-record {
  width: 100% !important;
  max-width: none !important;
  margin: clamp(18px, 2vw, 28px) 0 0 !important;
  padding: clamp(16px, 1.8vw, 22px) clamp(18px, 2vw, 26px) !important;
  color: #294761 !important;
  line-height: 1.65 !important;
  border: 1px solid #c8ddec !important;
  border-left: 4px solid #17679f !important;
  border-radius: 8px !important;
  background: rgba(255, 255, 255, 0.86) !important;
}

body.m1-home-sample.m1-layout-sample .capability-public-record a {
  display: inline-block !important;
  margin-left: 8px !important;
  font-weight: 800 !important;
}

body.m1-home-sample.m1-layout-sample #projects .project-feature {
  align-items: stretch !important;
}

body.m1-home-sample.m1-layout-sample #projects .project-feature > figure {
  order: 1 !important;
  aspect-ratio: 16 / 9 !important;
  min-height: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  border-right: 1px solid #d6e7f5 !important;
  border-left: 0 !important;
}

body.m1-home-sample.m1-layout-sample #projects .project-feature > figure > .asset-picture,
body.m1-home-sample.m1-layout-sample #projects .project-feature > figure img {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  object-fit: cover !important;
  object-position: center !important;
}

body.m1-home-sample.m1-layout-sample #projects .project-feature > .project-feature-copy {
  order: 2 !important;
  border-left: 0 !important;
}

body.m1-home-sample.m1-layout-sample .faq-grid {
  align-items: start !important;
  grid-auto-flow: row !important;
  grid-auto-rows: auto !important;
}

body.m1-home-sample.m1-layout-sample .faq-grid > details {
  position: static !important;
  align-self: start !important;
  min-height: 0 !important;
  height: auto !important;
  transform: none !important;
  overflow: visible !important;
}

body.m1-home-sample.m1-layout-sample .faq-grid > details:last-child {
  grid-column: 1 / -1 !important;
}

/*
 * Replace the legacy fixed-width process ribbon at the 767/768 boundary.
 * The same two-part composition is retained, but card geometry now follows
 * the real viewport instead of the old 400px + 1330px desktop canvas.
 */
@media (min-width: 768px) and (max-width: 1180px) {
  body.m1-home-sample.m1-layout-sample .process-ribbon {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 28px !important;
    padding: 34px 32px !important;
  }

  body.m1-home-sample.m1-layout-sample .process-ribbon-copy {
    width: auto !important;
    max-width: 680px !important;
  }

  body.m1-home-sample.m1-layout-sample .process-flow {
    width: 100% !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  body.m1-home-sample.m1-layout-sample .process-flow > li {
    transform: none !important;
  }
}

@media (min-width: 1181px) and (max-width: 1439px) {
  body.m1-home-sample.m1-layout-sample .process-ribbon {
    grid-template-columns: minmax(280px, 0.35fr) minmax(0, 1fr) !important;
    gap: clamp(34px, 4vw, 64px) !important;
    padding-right: clamp(32px, 4vw, 56px) !important;
    padding-left: clamp(32px, 4vw, 56px) !important;
  }

  body.m1-home-sample.m1-layout-sample .process-ribbon-copy,
  body.m1-home-sample.m1-layout-sample .process-flow {
    width: auto !important;
    min-width: 0 !important;
  }

  body.m1-home-sample.m1-layout-sample .process-flow {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  body.m1-home-sample.m1-layout-sample .process-flow > li {
    transform: none !important;
  }
}

@media (min-width: 768px) and (max-width: 1439px) {
  html.device-desktop body.global-tech-page.global-tech-page.m1-home-sample.m1-layout-sample .process-flow > li {
    transform: none !important;
  }

  html.device-desktop body.global-tech-page.global-tech-page.m1-home-sample.m1-layout-sample .process-flow > li::after {
    display: none !important;
    content: none !important;
  }
}

/* Projects: use the supplied 16:9 case artwork as a true full-bleed frame. */
html > body.global-tech-page.global-tech-page.case-library-page.m1-layout-sample .case-detail {
  grid-template-columns: minmax(0, 1.16fr) minmax(360px, .84fr) !important;
  grid-template-rows: auto !important;
  align-items: stretch !important;
  gap: 0 !important;
  height: auto !important;
  min-height: 0 !important;
}

html > body.global-tech-page.global-tech-page.case-library-page.m1-layout-sample .case-detail > figure {
  aspect-ratio: 16 / 9 !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

html > body.global-tech-page.global-tech-page.case-library-page.m1-layout-sample .case-detail > figure > img {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  aspect-ratio: auto !important;
  object-fit: cover !important;
  object-position: center !important;
  background: transparent !important;
  transform: scale(1.08) !important;
  transform-origin: center !important;
}

html > body.global-tech-page.global-tech-page.case-library-page.m1-layout-sample .case-detail > div {
  display: grid !important;
  align-content: center !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  padding: clamp(24px, 2.5vw, 38px) !important;
}

html > body.global-tech-page.global-tech-page.case-library-page.m1-layout-sample .case-detail > div :is(h3, p, dl) {
  max-width: 100% !important;
}

html > body.global-tech-page.global-tech-page.case-library-page.m1-layout-sample .case-detail > div h3 {
  font-size: clamp(28px, 2.25vw, 38px) !important;
}

/* Undo the historical 430px fixed mobile canvas on real phones. */
@media (max-width: 767.98px) {
  html.device-mobile.input-coarse:has(body.m1-layout-sample),
  html.device-mobile.input-coarse body.global-tech-page.m1-layout-sample,
  html.device-mobile.input-coarse body.global-tech-page.m1-layout-sample :is(
    .site-header,
    main,
    .hero,
    .process-ribbon,
    main > section,
    .contact,
    .site-footer
  ) {
    width: 100% !important;
    inline-size: 100% !important;
    min-width: 0 !important;
    min-inline-size: 0 !important;
    max-width: 100% !important;
    max-inline-size: 100% !important;
  }

  html.device-mobile.input-coarse:has(body.m1-layout-sample),
  html.device-mobile.input-coarse body.global-tech-page.m1-layout-sample {
    overflow-x: visible !important;
  }

  body.m1-layout-sample .section-head h2 {
    font-size: clamp(28px, 8.2vw, 34px) !important;
    line-height: 1.16 !important;
    text-wrap: pretty !important;
  }

  body.m1-home-sample.m1-layout-sample .capability-public-record {
    padding: 16px !important;
  }

  body.m1-home-sample.m1-layout-sample .capabilities .capability-grid > div {
    grid-template-columns: minmax(0, 1fr) !important;
    column-gap: 0 !important;
    padding: 20px 18px !important;
  }

  body.m1-home-sample.m1-layout-sample .capabilities .capability-grid > div::before {
    display: none !important;
    content: none !important;
  }

  body.m1-home-sample.m1-layout-sample .capability-public-record a {
    display: block !important;
    margin: 8px 0 0 !important;
  }

  body.m1-home-sample.m1-layout-sample #projects .project-feature {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body.m1-home-sample.m1-layout-sample #projects .project-feature > figure {
    order: 1 !important;
    width: 100% !important;
    aspect-ratio: 16 / 9 !important;
    border-right: 0 !important;
    border-bottom: 1px solid #d6e7f5 !important;
  }

  body.m1-home-sample.m1-layout-sample #projects .project-feature > .project-feature-copy {
    order: 2 !important;
  }

  body.m1-home-sample.m1-layout-sample .faq-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body.m1-home-sample.m1-layout-sample .faq-grid > details:last-child {
    grid-column: 1 !important;
  }

  html > body.global-tech-page.global-tech-page.case-library-page.m1-layout-sample .case-detail {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto auto !important;
  }

  html > body.global-tech-page.global-tech-page.case-library-page.m1-layout-sample .case-detail > figure {
    aspect-ratio: 16 / 9 !important;
  }

  html > body.global-tech-page.global-tech-page.case-library-page.m1-layout-sample .case-detail > div {
    padding: 24px 20px 28px !important;
  }

  html > body.global-tech-page.global-tech-page.case-library-page.m1-layout-sample .project-library-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}
