/* Mobile-only AgroNetwork stories on the RU home page. */
.home-network-stories,
.home-mobile-actions,
.home-mobile-work-link,
.home-story-viewer {
  display: none;
}

body.home-story-viewer-open {
  overflow: hidden;
}

@media (max-width: 767.98px) {
  /* The existing desktop hero stays in the DOM; only mobile renders this card rail. */
  body .home-b2b-page .home-b2b-hero {
    display: none;
  }

  .home-network-stories {
    width: 100%;
    margin: 2px 0 8px;
    display: block;
    overflow: hidden;
  }

  .home-network-stories__track {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    padding: 8px 4px 6px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .home-network-stories__track::-webkit-scrollbar {
    display: none;
  }

  .home-network-story {
    flex: 0 0 78px;
    width: 78px;
    min-width: 78px;
    height: 76px;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    appearance: none;
    cursor: pointer;
    scroll-snap-align: start;
    -webkit-tap-highlight-color: transparent;
  }

  .home-network-story__ring {
    width: 72px;
    height: 72px;
    padding: 3px;
    display: block;
    overflow: hidden;
    border: 3px solid #118f3f;
    border-radius: 50%;
    background: #fff;
    box-sizing: border-box;
  }

  .home-network-story__picture {
    width: 100%;
    height: 100%;
    display: block;
  }

  .home-network-story__image,
  .home-network-story__video-preview {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border-radius: 50%;
    background: #eef7f0;
  }

  .home-network-story__video-preview {
    pointer-events: none;
  }

  .home-network-story:focus-visible .home-network-story__ring {
    outline: 2px solid #075d2d;
    outline-offset: 2px;
  }

  .home-network-story:active .home-network-story__ring {
    transform: scale(.96);
  }

  .home-mobile-work-link {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 44px;
    margin: 0 0 8px;
    padding: 7px 12px;
    border-radius: 14px;
    box-sizing: border-box;
    background: #f1f2f3;
    color: #16663e;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
  }

  .home-mobile-work-link__icon {
    width: 25px;
    height: 25px;
    flex: 0 0 25px;
  }

  .home-mobile-work-link__copy {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    font-size: 11px;
    line-height: 1.2;
    color: #66756c;
  }

  .home-mobile-work-link__copy strong {
    font-size: 14px;
    color: #1c2821;
  }

  .home-mobile-work-link__arrow {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
  }

  .home-mobile-work-link:focus-visible {
    outline: 2px solid #087b42;
    outline-offset: -2px;
  }

  .home-mobile-work-link:active {
    background: #e7e9e9;
  }

  .home-mobile-actions {
    display: flex;
    align-items: stretch;
    gap: 7px;
    width: 100%;
    margin: 0 0 10px;
    padding: 2px 0 8px;
    overflow: hidden;
  }

  .home-mobile-action {
    position: relative;
    isolation: isolate;
    flex: 0 0 calc((100% - 21px) / 4);
    height: 113px;
    min-width: 0;
    overflow: hidden;
    display: block;
    padding: 10px 8px;
    border: 0;
    border-radius: 18px;
    background: #f1f2f3;
    color: #161a18;
    text-decoration: none;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
  }

  .home-mobile-action__title {
    position: relative;
    z-index: 1;
    display: block;
    max-width: 100%;
    font-size: clamp(10px, 2.85vw, 12px);
    line-height: 1.13;
    font-weight: 700;
    letter-spacing: -.2px;
    overflow-wrap: anywhere;
  }

  .home-mobile-action__art {
    position: absolute;
    right: -6px;
    bottom: -8px;
    width: 80px;
    height: 68px;
    filter: drop-shadow(0 5px 5px rgba(12, 56, 40, .08));
    pointer-events: none;
  }

  .home-mobile-action--network .home-mobile-action__art {
    width: 88px;
    height: 70px;
    right: -7px;
  }

  .home-mobile-action:focus-visible {
    outline: 3px solid #078c3c;
    outline-offset: -3px;
  }

  .home-mobile-action:active {
    background: #e7e9e9;
    transform: scale(.985);
  }

  @media (prefers-reduced-motion: reduce) {
    .home-mobile-action:active {
      transform: none;
    }
  }

  .home-story-viewer:not([hidden]) {
    position: fixed;
    inset: 0;
    z-index: 1000000;
    display: flex;
    align-items: stretch;
    justify-content: center;
    background: #000;
    overscroll-behavior: contain;
  }

  .home-story-viewer__backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: #000;
  }

  .home-story-viewer__shell {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 480px;
    height: 100dvh;
    min-height: 100%;
    overflow: hidden;
    background: #000;
    isolation: isolate;
  }

  .home-story-viewer__progress {
    position: absolute;
    top: max(10px, env(safe-area-inset-top));
    left: 10px;
    right: 54px;
    z-index: 5;
    height: 3px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, .34);
    pointer-events: none;
  }

  .home-story-viewer__progress-fill {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: inherit;
    background: #fff;
    transform: scaleX(0);
    transform-origin: left center;
  }

  .home-story-viewer__close {
    position: absolute;
    top: max(20px, calc(env(safe-area-inset-top) + 10px));
    right: 8px;
    z-index: 7;
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, .34);
    color: #fff;
    font-size: 32px;
    line-height: 1;
    font-weight: 300;
    cursor: pointer;
  }

  .home-story-viewer__stage {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #000;
  }

  .home-story-viewer__image,
  .home-story-viewer__video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    background: #000;
  }

  .home-story-viewer__image[hidden],
  .home-story-viewer__video[hidden],
  .home-story-viewer__nav {
    display: none;
  }
}
