/* UAT-05 Hotfix 05 - final mobile overflow guard.
   Loaded AFTER public/style.css so legacy rules cannot override this layer. */
@media (max-width: 575.98px) {
  html, body {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }
  *, *::before, *::after { box-sizing: border-box !important; }

  /* Public shell */
  body.public-production,
  body.public-body,
  .public-production-nav,
  .public-hero-production,
  .public-footer,
  .public-production-nav .container,
  .public-hero-production .container,
  body.public-body section > .container,
  .public-footer .container {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }
  .public-production-nav .container,
  .public-hero-production .container,
  body.public-body section > .container,
  .public-footer .container {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  body.public-body .row,
  .public-footer .row {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  body.public-body .row > *,
  .public-footer .row > * {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  /* Header: reserve space for the hamburger and allow brand wrapping. */
  .public-production-nav .container {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
  }
  .public-production-brand {
    flex: 1 1 auto !important;
    width: auto !important;
    max-width: calc(100% - 54px) !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    gap: 9px !important;
  }
  .public-production-logo,
  .public-production-logo-fallback {
    width: 46px !important;
    height: 46px !important;
    flex: 0 0 46px !important;
  }
  .public-brand-title {
    display: block !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }
  .public-brand-title strong {
    display: block !important;
    max-width: 100% !important;
    font-size: .76rem !important;
    line-height: 1.25 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
  }
  .public-nav-toggler {
    flex: 0 0 44px !important;
    width: 44px !important;
    margin-left: auto !important;
  }
  #pakPublicNav { width: 100% !important; }

  /* Public hero/content */
  .public-hero-production h1,
  .public-hero-lead,
  .public-eyebrow,
  .public-footer h2,
  .public-footer p,
  .content-card h1,
  .content-card p,
  .content-card .form-text,
  .content-card .small {
    max-width: 100% !important;
    overflow-wrap: anywhere !important;
  }
  .public-hero-production h1 {
    width: 100% !important;
    font-size: 1.55rem !important;
    line-height: 1.15 !important;
  }
  .public-hero-production .d-flex {
    width: 100% !important;
  }
  .public-hero-production .btn {
    max-width: 100% !important;
    white-space: normal !important;
  }
  .public-hero-photo-wrap,
  .public-hero-photo,
  .content-card {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }
  .content-card { overflow: hidden !important; }
  .public-body .content-card .form-control,
  .public-body .content-card .form-select,
  .public-body .content-card textarea {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }
  /* Activation search input group stacks on narrow phones. */
  .public-body .content-card .input-group.input-group-lg {
    display: flex !important;
    flex-wrap: wrap !important;
    width: 100% !important;
  }
  .public-body .content-card .input-group.input-group-lg > .form-control {
    flex: 1 1 100% !important;
    width: 100% !important;
    border-radius: .5rem !important;
  }
  .public-body .content-card .input-group.input-group-lg > .btn {
    flex: 1 1 100% !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-top: 8px !important;
    border-radius: .5rem !important;
  }
  .public-mobile-quick-actions {
    left: 8px !important;
    right: 8px !important;
    width: auto !important;
  }
  .public-mobile-quick-actions a {
    min-width: 0 !important;
    overflow-wrap: anywhere !important;
  }

  /* Auth pages (login/register) */
  body.auth-page {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }
  .auth-shell {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 12px !important;
    margin: 0 !important;
  }
  .auth-card,
  .auth-card.register-card {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 1rem !important;
    border-radius: 16px !important;
  }
  .auth-card *,
  .auth-card.register-card * {
    max-width: 100%;
  }
  .auth-mosque-brand h1,
  .auth-mosque-brand p,
  .auth-card .small,
  .auth-card .form-text,
  .auth-card label {
    overflow-wrap: anywhere !important;
  }
  .auth-card .form-control,
  .auth-card .form-select,
  .auth-card textarea {
    width: 100% !important;
    min-width: 0 !important;
  }
  .auth-card .input-group {
    display: flex !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
    min-width: 0 !important;
  }
  .auth-card .input-group > .form-control {
    width: 1% !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
  }
  .auth-card .input-group > .btn,
  .auth-card .input-group > .input-group-text {
    flex: 0 0 auto !important;
  }
  .auth-card .text-end { text-align: right !important; }
}


/* UAT-05 Hotfix 09 - measured desktop hero gutter fix */
/* CDP Hotfix 08 measured one real horizontal overflow:
   .public-hero-production .container > .row extended 12px beyond the
   desktop client viewport because Bootstrap negative row gutters were
   not absorbed in this production hero composition. */
@media (min-width: 992px) {
  .public-hero-production .container > .row {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}
