/* Foxus responsive and usability refinements — loaded after the theme styles. */

html,
body {
  max-width: 100%;
  overflow-x: clip;
}

img,
video,
svg,
iframe {
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
}

.foxus-nav,
.foxus-nav * {
  box-sizing: border-box;
}

.admin-bar .foxus-nav {
  top: 32px;
}

.foxus-nav__inner,
.foxus-hero__inner,
.foxus-section__inner,
.foxus-footer__inner {
  min-width: 0;
}

.foxus-nav a,
.foxus-nav button,
.foxus-button,
.foxus-btn {
  min-height: 44px;
}

.foxus-hero {
  min-height: max(640px, 100svh);
  padding-top: max(96px, calc(72px + env(safe-area-inset-top)));
  padding-bottom: max(48px, env(safe-area-inset-bottom));
}

.admin-bar .foxus-hero {
  padding-top: max(128px, calc(104px + env(safe-area-inset-top)));
}

.foxus-hero__content,
.foxus-hero__copy,
.foxus-portal-preview,
.foxus-portal-preview * {
  min-width: 0;
}

.foxus-hero h1,
.foxus-page-hero h1 {
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.foxus-hero p,
.foxus-page-hero p,
.foxus-section p {
  overflow-wrap: break-word;
}

.foxus-portal-preview {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.foxus-portal-preview table,
.foxus-content table,
.entry-content table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.entry-content,
.foxus-content {
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .foxus-nav__menu,
  .foxus-nav__links {
    max-height: calc(100svh - 84px - env(safe-area-inset-top));
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .foxus-hero {
    min-height: max(620px, 100svh);
  }

  .foxus-hero__inner,
  .foxus-section__inner {
    width: min(100% - 40px, 1200px);
  }

  .foxus-footer__inner {
    width: min(100% - 40px, 1200px);
  }
}

@media (max-width: 782px) {
  .admin-bar .foxus-nav {
    top: 46px;
  }

  .admin-bar .foxus-hero {
    padding-top: max(138px, calc(118px + env(safe-area-inset-top)));
  }
}

@media (max-width: 600px) {
  #wpadminbar {
    position: fixed;
  }

  .foxus-hero {
    min-height: auto;
    padding-top: max(110px, calc(86px + env(safe-area-inset-top)));
    padding-bottom: 64px;
  }

  .foxus-hero__inner,
  .foxus-section__inner,
  .foxus-footer__inner {
    width: min(100% - 30px, 1200px);
  }

  .foxus-hero h1,
  .foxus-page-hero h1 {
    font-size: clamp(2.5rem, 14vw, 4.5rem);
    line-height: .92;
  }

  .foxus-hero__actions,
  .foxus-page-hero__actions {
    align-items: stretch;
    width: 100%;
  }

  .foxus-hero__actions a,
  .foxus-page-hero__actions a {
    justify-content: center;
    width: 100%;
  }

  .foxus-portal-preview {
    border-radius: 16px;
  }

  .foxus-portal-preview__body,
  .foxus-portal-preview__content {
    padding: 16px;
  }

  .foxus-footer__nav {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}

@media (max-width: 380px) {
  .foxus-hero__inner,
  .foxus-section__inner,
  .foxus-footer__inner {
    width: min(100% - 24px, 1200px);
  }

  .foxus-hero h1,
  .foxus-page-hero h1 {
    font-size: clamp(2.2rem, 13vw, 3.25rem);
  }
}


/* Match the active Foxus Studio homepage structure. */
.foxus-hero-copy,
.foxus-story-grid,
.foxus-heading-row,
.foxus-card-grid,
.foxus-portal,
.foxus-portal-window,
.foxus-window-body,
.foxus-window-body > section,
.foxus-trial,
.foxus-footer,
.foxus-content-inner,
.foxus-entry-content {
  min-width: 0;
}

.foxus-portal-window {
  width: 100%;
  max-width: 100%;
}

.foxus-entry-content {
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .foxus-menu {
    max-height: calc(100svh - 74px - env(safe-area-inset-top));
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

@media (max-width: 600px) {
  .foxus-hero-copy {
    width: calc(100% - 30px);
  }

  .foxus-actions {
    align-items: stretch;
    width: 100%;
  }

  .foxus-portal-window {
    border-radius: 16px;
  }

  .foxus-window-body > section {
    padding: 18px;
  }

  .foxus-footer nav {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}
