/* Mobile layout acceptance hotfix for the homepage and /cases.
   Keep selectors scoped so the independent equipment service is unaffected. */

@media (max-width: 760px) {
  .problems-editorial .problems-editorial__bands {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(0.5rem, 2.5vw, 0.75rem);
  }

  .problems-editorial .problems-editorial__copy,
  .problems-editorial .problems-editorial__band[data-align="media-right"] .problems-editorial__copy {
    width: 100%;
    min-height: 0;
    box-sizing: border-box;
    padding: clamp(0.5rem, 1.8vw, 0.65rem) clamp(0.5rem, 2.4vw, 0.8rem);
    overflow: hidden;
    text-align: center;
  }

  .problems-editorial .problems-editorial__copy h3 {
    width: 100%;
    max-width: none;
    overflow: hidden;
    font-size: clamp(0.95rem, 3.6vw, 1.05rem);
    line-height: 1.15;
    text-align: center;
    white-space: nowrap;
    word-break: keep-all;
  }

  .problems-editorial .problems-editorial__copy p {
    display: -webkit-box;
    width: 100%;
    margin-top: clamp(0.25rem, 1.3vw, 0.4rem);
    overflow: hidden;
    font-size: clamp(0.75rem, 2.8vw, 0.8rem);
    line-height: 1.45;
    text-align: center;
    white-space: pre-line;
    word-break: keep-all;
    overflow-wrap: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }
}

.case-library-grid .case-detail-link--full-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.case-library-grid .case-card--library .case-content {
  display: grid;
  align-content: center;
  justify-items: center;
  flex: 1 1 auto;
  min-height: 104px;
  text-align: center;
}

.case-library-grid .case-card--library .case-meta {
  width: 100%;
  justify-content: center;
  text-align: center;
}

.case-library-grid .case-card--library .case-meta span:first-child,
.case-library-grid .case-card--library .case-content h3 {
  width: 100%;
  text-align: center;
}

.case-library-grid .case-card--library .case-content h3 {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow: visible;
  line-break: strict;
  overflow-wrap: anywhere;
  text-wrap: balance;
  white-space: normal;
  word-break: normal;
  -webkit-box-orient: initial;
  -webkit-line-clamp: unset;
  line-clamp: unset;
}

@media (max-width: 700px) {
  .case-library-grid .case-card--library .case-content {
    min-height: 76px;
    padding: 12px 8px 8px;
  }

  .case-library-grid .case-card--library .case-content h3 {
    margin-top: 6px;
    font-size: 15px;
    line-height: 1.38;
  }

  .case-poster-wall {
    --case-poster-card-width: min(46vw, 172px);
    --case-poster-side-padding: max(
      0px,
      calc((100vw - 32px - var(--case-poster-card-width)) / 2)
    );
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    touch-action: pan-x pan-y;
    overscroll-behavior-inline: contain;
    perspective: none;
  }

  .case-poster-wall::-webkit-scrollbar {
    display: none;
  }

  .case-poster-wall .case-poster-wall__track {
    animation: none;
    transform: none;
    will-change: auto;
  }

  .case-poster-wall .case-poster-wall__track--forward,
  .case-poster-wall .case-poster-wall__clone {
    display: none;
  }

  .case-poster-wall .case-poster-wall__group {
    gap: 12px;
    padding-inline: var(--case-poster-side-padding);
  }

  .case-poster-wall .case-poster-wall__group > li {
    flex-basis: var(--case-poster-card-width);
    width: var(--case-poster-card-width);
    scroll-snap-align: center;
    scroll-snap-stop: always;
    transform-style: flat;
  }

  .case-poster-wall .case-poster-wall__group > li:nth-child(3n + 1) .case-poster-wall__poster,
  .case-poster-wall .case-poster-wall__group > li:nth-child(3n + 2) .case-poster-wall__poster {
    transform: none;
  }
}

@media (max-width: 340px) {
  .case-library-grid .case-card--library .case-content {
    padding-inline: 4px;
  }
}
