/**
 * BiznizCard — public marketing & light transactional pages
 * Load after css/navbar.css (and page-specific CSS if any).
 * Loaded on marketing pages and most shells that include the site header/footer.
 */

/* Stable mobile font sizing (iOS / Android) */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* Skip-to-content & in-page anchors: offset sticky header */
html {
  scroll-padding-top: max(5rem, calc(var(--nav-height, 88px) + env(safe-area-inset-top, 0px) + 0.5rem));
}

main#main-content,
main[id="main-content"] {
  scroll-margin-top: max(5rem, calc(var(--nav-height, 88px) + env(safe-area-inset-top, 0px) + 0.5rem));
}

main iframe,
main video,
main embed,
main object {
  max-width: 100%;
}

main iframe[src*="youtube.com"],
main iframe[src*="youtu.be"] {
  aspect-ratio: 16 / 9;
  height: auto;
  border: 0;
}

main,
.site-footer {
  min-width: 0;
}

/* Prevent accidental horizontal page drift on mobile. */
html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

main pre {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
  .site-footer .footer-nav a {
    min-height: 44px;
    padding: 0.4rem 0;
    box-sizing: border-box;
  }

  .site-footer .footer-social__btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  .site-header .profile-trigger {
    min-height: 44px;
  }

  .contact-page .contact-form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  .contact-page .contact-form textarea {
    min-height: 44px;
    box-sizing: border-box;
  }

  .contact-page .contact-form textarea {
    min-height: 7.5rem;
  }

  .auth-card input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  .auth-card select {
    min-height: 44px;
    box-sizing: border-box;
  }

  .auth-card .social-btn {
    min-height: 44px;
    touch-action: manipulation;
  }

  .auth-card button.tab {
    min-height: 44px;
  }

  .auth-card .reset-btn {
    min-height: 44px;
  }

  .auth-card .link-btn {
    min-height: 44px;
    padding: 0.5rem 0.35rem;
    box-sizing: border-box;
  }
}

@media (max-width: 480px) {
  .ps-actions,
  .pc-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .ps-actions a,
  .pc-actions a {
    width: 100%;
    text-align: center;
  }
}

/* --------- Accessibility & cross-page UX (loads with navbar on most pages) --------- */

:root {
  --focus-ring: 2px solid #4f46e5;
  --focus-ring-offset: 2px;
}

/* Visible keyboard focus — does not replace component-specific styling */
:where(a, button, input:not([type="hidden"]), textarea, select, summary, [role="tab"]):focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-ring-offset);
}

/* Safe area for notched phones */
body {
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
}

img,
video {
  height: auto;
  max-width: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto !important;
  }
}

@media (max-width: 820px) {
  html,
  body {
    overflow-x: clip;
  }

  #site-header,
  #site-header .header-inner--unified,
  #site-header .site-nav-panel {
    max-width: 100vw;
  }

  .site-nav-panel .site-nav__link,
  .site-nav-panel .nav-cta,
  .site-nav-panel .nav-btn-ghost {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    box-sizing: border-box;
  }

  /* Drawer controls: reliable taps */
  .nav-toggle-btn,
  .nav-drawer-close-btn,
  .site-header .panel-theme-switch__btn {
    touch-action: manipulation;
  }
}
