/* ==========================================================
   Mexora Marketplace — public mobile polish (2026-09-24)
   Scope: public marketplace pages only.
   - mobile nav always overlays page controls/search
   - tighter vertical rhythm on homepage/service pages
   - safe wrapping for long section titles
   ========================================================== */

@media (max-width: 850px) {
  /* The page search controls use z-index values up to 9999. Keep the
     navigation above every page-local stacking context. */
  body.nav-open::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 19990;
    background: rgba(3, 7, 9, .66);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
  }

  body.nav-open .mx-public-header {
    z-index: 20010;
  }

  .mx-public-mobile-menu {
    z-index: 20020 !important;
    isolation: isolate;
  }

  /* Long headings must never create horizontal overflow/cropping. */
  .market-home .section-title,
  .market-service-page .section-title,
  .market-home .section-title > div,
  .market-service-page .section-title > div {
    min-width: 0;
    max-width: 100%;
  }

  .market-home .section-title h2,
  .market-service-page .section-title h2 {
    max-width: 100%;
    white-space: normal;
    overflow: visible;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;
    line-height: 1.08;
  }
}

@media (max-width: 700px) {
  /* General public content rhythm: the desktop spacing was too generous
     once sections collapse to one column. */
  .market-home > .market-section {
    padding-top: 38px;
    padding-bottom: 18px;
  }

  .market-home > .market-section + .market-section {
    padding-top: 32px;
  }

  .market-home .section-title,
  .market-home .home-section-title {
    margin-bottom: 16px;
  }

  .market-home .home-experts {
    padding-top: 34px;
  }

  .market-home .home-section-title h2,
  .market-home .home-experts .home-section-title h2 {
    font-size: clamp(28px, 8.6vw, 34px);
    line-height: 1.05;
    letter-spacing: -.025em;
  }

  /* Explicitly constrain the experts heading: it is one of the longest
     section labels and was getting clipped on narrow phones. */
  .market-home .home-experts h2 {
    width: 100%;
    font-size: clamp(27px, 8.2vw, 33px);
  }

  .market-home .home-pro-grid {
    margin-top: 0;
  }

  /* Service detail page */
  .market-service-page .service-hero {
    padding: 24px 0 12px;
  }

  .market-service-page .service-hero > .container {
    padding-top: 20px;
    padding-bottom: 22px;
  }

  .market-service-page .service-hero h1 {
    margin-top: 7px;
    margin-bottom: 14px;
    line-height: 1.04;
  }

  .market-service-page .service-hero p {
    margin-top: 0;
    line-height: 1.55;
  }

  .market-service-page .breadcrumbs {
    margin-bottom: 18px;
  }

  .market-service-page .market-search {
    margin-top: 20px;
  }

  .market-service-page .service-facts {
    margin-top: 16px;
  }

  .market-service-page > .market-section {
    padding-top: 34px;
    padding-bottom: 18px;
  }

  .market-service-page > .market-section + .market-section {
    padding-top: 30px;
  }

  .market-service-page .section-title {
    margin-bottom: 16px;
  }

  .market-service-page .section-title h2 {
    font-size: clamp(29px, 8.8vw, 35px);
  }

  .market-service-page .area-chips {
    margin-top: 10px;
    gap: 8px;
  }

  .market-service-page .market-grid,
  .market-service-page .pro-grid,
  .market-service-page .service-list-grid {
    gap: 12px;
  }

  .market-service-page .service-hero-media {
    margin-top: 4px;
    height: 280px;
  }

  /* Keep the end of public pages visually tighter as well. */
  .market-footer {
    margin-top: 48px;
  }
}

@media (max-width: 430px) {
  .market-home .home-section-title h2,
  .market-home .home-experts .home-section-title h2,
  .market-service-page .section-title h2 {
    font-size: 29px;
  }

  .market-service-page .service-hero h1 {
    font-size: 36px;
  }

  .market-service-page .service-hero-media {
    height: 245px;
  }
}

/* ==========================================================
   Footer completeness on tablet/mobile (2026-09-24)
   The base stylesheet intentionally hid Legal below 1000px and
   Mexora + Legal below 480px. Keep every desktop footer section
   accessible on smaller screens and only change the layout.
   ========================================================== */
@media (max-width: 1000px) {
  .market-footer .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 34px;
  }

  .market-footer .footer-grid > div {
    display: grid !important;
    min-width: 0;
  }

  .market-footer .footer-grid > div:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 700px) {
  .market-footer {
    margin-top: 42px;
  }

  .market-footer .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 24px 26px;
    padding: 28px 0 24px;
  }

  .market-footer .footer-grid > div:first-child {
    grid-column: 1 / -1;
    padding-bottom: 4px;
  }

  .market-footer .footer-grid strong {
    margin-bottom: 3px;
  }

  .market-footer .footer-grid a:not(.brand) {
    line-height: 1.45;
    padding: 2px 0;
  }

  .market-footer .footer-bottom {
    padding: 18px 0 4px;
    line-height: 1.5;
  }
}

@media (max-width: 560px) {
  .market-footer {
    margin-top: 34px;
  }

  /* Two columns instead of one: the four groups stacked vertically made the
     footer ~966px tall, about 11% of the page. */
  .market-footer .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 18px 18px;
    padding: 22px 0 16px;
  }

  .market-footer .footer-grid > div,
  .market-footer .footer-grid > div:nth-child(n+3),
  .market-footer .footer-grid > div:last-child {
    display: grid !important;
    grid-column: auto;
  }

  /* the brand line spans the full width, links below share two columns */
  .market-footer .footer-grid > div:first-child {
    grid-column: 1 / -1;
    padding: 0 0 2px;
  }

  .market-footer .footer-grid > div:nth-child(n+2) {
    border-top: 0;
    padding: 0;
  }

  .market-footer .footer-grid p {
    margin: 6px 0 0;
    font-size: 13px;
    line-height: 1.5;
    max-width: 34rem;
  }

  .market-footer .footer-grid strong {
    font-size: 11.5px;
    letter-spacing: .06em;
    text-transform: uppercase;
    margin-bottom: 5px;
  }

  /* min-height:30px per link was the main driver of the height */
  .market-footer .footer-grid a:not(.brand) {
    min-height: 0;
    display: block;
    padding: 3px 0;
    font-size: 13.5px;
    line-height: 1.35;
  }

  .market-footer .footer-bottom {
    margin-top: 14px;
    padding: 12px 0 0;
    font-size: 12px;
    text-align: center;
  }
}

@media (max-width: 380px) {
  .market-footer .footer-grid {
    gap: 16px 12px;
    padding: 20px 0 14px;
  }

  .market-footer .footer-grid a:not(.brand) {
    font-size: 13px;
    padding: 2px 0;
  }
}
