/* Shared responsive adjustments loaded after all theme-owned page styles. */

main * {
  min-width: 0;
}

main :where(img, picture, video, canvas, iframe, embed, object, svg) {
  max-width: 100%;
}

main :where(h1, h2, h3, p, li, a, summary, code) {
  overflow-wrap: anywhere;
}

main .entry-content pre,
main .entry-content table {
  max-width: 100%;
  overflow-x: auto;
}

main :where(input, textarea, select) {
  max-width: 100%;
}

@media (min-width: 768px) and (max-width: 1023px) {
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px;
  }
}

@media (max-width: 767px) {
  .container {
    padding-inline: clamp(16px, 4.5vw, 24px);
  }

  .section {
    padding-block: clamp(48px, 10vw, 72px);
  }

  .page-hero {
    min-height: 0;
    padding-block: clamp(112px, 24vw, 136px) clamp(52px, 12vw, 76px);
  }

  h1.page-title {
    font-size: clamp(2.1rem, 8.5vw, 3.6rem);
    line-height: 1.06;
    overflow-wrap: anywhere;
  }

  .webnif-home-v2 .wn-home-hero {
    padding-block: clamp(108px, 18vw, 132px) clamp(60px, 10vw, 84px);
  }

  .webnif-home-v2 .wn-home-hero-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(26px, 7vw, 40px);
  }

  .webnif-home-v2 .wn-home-copy h1 {
    font-size: clamp(2.25rem, 8.8vw, 3.7rem);
    line-height: 1.04;
  }

  .webnif-home-v2 .wn-home-diagram {
    width: 100%;
    max-width: 620px;
    margin-inline: auto;
  }

  .webnif-home-v2 .wn-home-actions .btn,
  .webnif-home-v2 .wn-home-actions .wn-text-link {
    min-height: 44px;
    max-width: 100%;
  }

  .mobile-bottom {
    right: max(10px, env(safe-area-inset-right, 0px));
    bottom: calc(10px + var(--safe-bottom));
    left: max(10px, env(safe-area-inset-left, 0px));
    gap: 2px;
    padding: 6px;
    border-radius: 22px;
  }

  .mobile-bottom a {
    flex: 1 1 0;
    min-width: 0;
    padding: 8px 2px;
    font-size: clamp(8px, 2.4vw, 10px);
    white-space: nowrap;
  }

  .nav-toggle {
    width: 44px;
    height: 44px;
  }

  .nav-links .nav-item {
    grid-template-columns: minmax(0, 1fr) 44px;
  }

  .nav-links .nav-item > a,
  .nav-links .submenu-toggle {
    min-height: 44px;
  }

  body {
    padding-bottom: calc(100px + var(--safe-bottom));
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
  }

  .footer-bottom {
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  nav.top {
    padding-inline: clamp(10px, 3.5vw, 16px);
  }

  .nav-inner {
    gap: 6px;
    padding: 8px 10px 8px 14px;
  }

  .custom-logo-link img {
    max-width: min(var(--webnif-header-logo-width, 192px), 36vw);
    max-height: 40px;
  }

  .nav-cta {
    gap: 4px;
    padding-inline: 9px;
    font-size: 12px;
    line-height: 1.25;
  }

  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-bottom {
    flex-direction: column;
    gap: 8px;
  }
}
