/*
 * LFM mobile responsive QA guardrails.
 * Keep this deliberately small: these rules contain legacy content overflow
 * while page-specific redesign work stays elsewhere.
 */

@media (max-width: 767px) {
  html,
  body {
    max-width: 100%;
    overflow-x: clip;
  }

  #main-content,
  #page-container,
  .entry-content,
  .et-l,
  .et_pb_section,
  .et_pb_row,
  .et_pb_column,
  .et_pb_module {
    max-width: 100%;
    box-sizing: border-box;
  }

  .entry-content iframe,
  .et-l iframe,
  .et_pb_post_content iframe,
  .et_pb_module iframe,
  iframe.wp-embedded-content,
  .wp-embedded-content {
    max-width: 100% !important;
    box-sizing: border-box;
  }

  iframe.wp-embedded-content,
  .wp-embedded-content {
    display: block !important;
    width: calc(100vw - 48px) !important;
    max-width: 100% !important;
    margin-right: auto;
    margin-left: auto;
  }

  .entry-content table,
  .et-l table,
  .et_pb_text table,
  .et_pb_code table,
  table.table,
  table.table-striped,
  table.table-bordered {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
  }

  .entry-content table th,
  .entry-content table td,
  .et-l table th,
  .et-l table td {
    min-width: 120px;
  }

  table.table,
  table.table-striped,
  table.table-bordered {
    table-layout: fixed;
    border-collapse: collapse;
  }

  table.table th,
  table.table td,
  table.table-striped th,
  table.table-striped td,
  table.table-bordered th,
  table.table-bordered td {
    min-width: 0 !important;
    padding: 8px 6px;
    overflow-wrap: anywhere;
    word-break: normal;
    font-size: 13px;
    line-height: 1.35;
  }

  .lfm-thankyou-blog-label {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 14px;
    border-radius: 999px;
    background: #761ee8;
    color: #fff;
    font: 700 12px/1.2 Quicksand, Montserrat, sans-serif;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  body.home #page-container #main-content .lfm-home-v2 .lfm-featured-work-shortcode {
    margin-top: 56px !important;
    width: min(320px, calc(100vw - 40px)) !important;
    max-width: min(320px, calc(100vw - 40px)) !important;
  }

  body.home #page-container #main-content .lfm-home-v2 .lfm-featured-work,
  body.home #page-container #main-content .lfm-home-v2 .lfm-featured-work-root,
  body.home #page-container #main-content .lfm-home-v2 .lfm-featured-work__grid {
    width: min(304px, calc(100vw - 48px)) !important;
    max-width: min(304px, calc(100vw - 48px)) !important;
  }

  body.home #page-container #main-content .lfm-home-v2 .lfm-featured-work__grid {
    gap: 8px !important;
  }

  body.home #page-container #main-content .lfm-home-v2 .lfm-featured-work__card,
  body.home #page-container #main-content .lfm-home-v2 .lfm-featured-work__card:first-child,
  body.home #page-container #main-content .lfm-home-v2 .lfm-featured-work__card:nth-child(2),
  body.home #page-container #main-content .lfm-home-v2 .lfm-featured-work__card:nth-child(3),
  body.home #page-container #main-content .lfm-home-v2 .lfm-featured-work__card:nth-child(4) {
    width: 140px !important;
    height: 140px !important;
    flex-basis: 140px !important;
  }

  .lfm-audioad-quiet-hero__proof {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    max-width: 320px !important;
    margin: 22px auto 0 !important;
  }

  .lfm-audioad-quiet-hero__proof span {
    display: flex !important;
    align-items: center;
    min-height: 34px;
    padding: 7px 13px !important;
    border: 1px solid rgba(118, 30, 232, 0.14);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.74);
    color: #4f465b !important;
    line-height: 1.2 !important;
    text-shadow: none !important;
    box-shadow: 0 10px 24px rgba(49, 30, 73, 0.08);
  }

  #wp-voices .lfm-avatar-wrap {
    display: grid !important;
    place-items: center;
    border-radius: 19px;
    background:
      radial-gradient(circle at 68% 24%, rgba(255, 255, 255, 0.32), transparent 26%),
      linear-gradient(135deg, #761ee8, #20d4f7) !important;
    box-shadow: 0 10px 24px rgba(30, 19, 46, 0.14);
  }

  #wp-voices .lfm-avatar {
    background:
      radial-gradient(circle at 70% 22%, rgba(255, 255, 255, 0.32), transparent 25%),
      linear-gradient(135deg, #761ee8, #20d4f7) !important;
  }

  #wp-voices .lfm-avatar-fallback {
    display: grid !important;
    place-items: center !important;
    color: #fff !important;
    font-weight: 900 !important;
  }

  body.single-product.et-tb-has-header #page-container .et-l--header,
  body.single-product.et-tb-has-header #page-container .et-l--header .et_pb_section,
  body.single-product.et-tb-has-header #page-container .et-l--header .et_pb_row,
  body.single-product.et-tb-has-header #page-container .et-l--header .et_pb_column,
  body.single-product.et-tb-has-header #page-container .et-l--header .et_pb_module,
  body.single-product.et-tb-has-header #page-container .et-l--header .et_pb_menu,
  body.single-product.et-tb-has-header #page-container .et-l--header .et_pb_image,
  body.single-product.et-tb-has-header #page-container .et-l--header .et_pb_image_wrap {
    background: transparent !important;
  }

  body.single-product.et-tb-has-header #page-container .et-l--header {
    background: #0f0f10 !important;
  }

  body.single-product.et-tb-has-header #page-container .et-l--header .lfm-tb-header {
    background: #151515 !important;
  }

  body.single-product.et-tb-has-header #page-container .et-l--header .lfm-tb-header-row,
  body.single-product.et-tb-has-header #page-container .et-l--header .lfm-tb-header .et_pb_row {
    background: transparent !important;
  }
}

/* Codex 2026-06-16: keep the homepage first view and demo rail lighter on phones. */
@media (max-width: 767px) {
  body.home #page-container #main-content .lfm-home-v2.lfm-home-hero,
  body.home #page-container #et-main-area #main-content .lfm-home-v2.lfm-home-hero {
    padding-top: 42px !important;
    padding-bottom: 56px !important;
  }

  body.home #page-container #main-content .lfm-home-v2 .lfm-home-hero-copy .lfm-hero-kicker,
  body.home #page-container #et-main-area #main-content .lfm-home-v2 .lfm-home-hero-copy .lfm-hero-kicker {
    margin-bottom: 12px !important;
    font-size: 14px !important;
  }

  body.home #page-container #main-content .lfm-home-v2 .lfm-home-hero-copy h1,
  body.home #page-container #et-main-area #main-content .lfm-home-v2 .lfm-home-hero-copy h1 {
    max-width: 360px !important;
    font-size: clamp(37px, 10.2vw, 43px) !important;
    line-height: 1.03 !important;
  }

  body.home #page-container #main-content .lfm-home-v2 .lfm-home-hero-copy p:not(.lfm-hero-kicker),
  body.home #page-container #et-main-area #main-content .lfm-home-v2 .lfm-home-hero-copy p:not(.lfm-hero-kicker) {
    max-width: 340px !important;
    margin-top: 18px !important;
    margin-bottom: 22px !important;
    font-size: 16px !important;
    line-height: 1.46 !important;
  }

  body.home #page-container #main-content .lfm-home-v2 .et_pb_button.lfm-home-primary,
  body.home #page-container #main-content .lfm-home-v2 .et_pb_button.lfm-home-secondary,
  body.home #page-container #et-main-area #main-content .lfm-home-v2 .et_pb_button.lfm-home-primary,
  body.home #page-container #et-main-area #main-content .lfm-home-v2 .et_pb_button.lfm-home-secondary {
    min-height: 52px !important;
    margin-bottom: 10px !important;
    font-size: 15px !important;
  }

  body.home #page-container #main-content .lfm-home-v2 .lfm-home-hero-art-col,
  body.home #page-container #et-main-area #main-content .lfm-home-v2 .lfm-home-hero-art-col {
    margin-top: 30px !important;
  }

  body.home #page-container #main-content .lfm-home-v2 .lfm-featured-work-shortcode,
  body.home #page-container #et-main-area #main-content .lfm-home-v2 .lfm-featured-work-shortcode {
    margin-top: 34px !important;
  }

  body.home #page-container #main-content .lfm-home-audio .lfm-home-audio-panel,
  body.home #page-container #et-main-area #main-content .lfm-home-audio .lfm-home-audio-panel {
    width: min(100% - 20px, 420px) !important;
    padding: 24px 16px 26px !important;
    border-radius: 22px !important;
  }

  body.home #page-container #main-content .lfm-home-audio .lfm-audio-heading h2,
  body.home #page-container #et-main-area #main-content .lfm-home-audio .lfm-audio-heading h2 {
    max-width: 330px !important;
    margin-bottom: 9px !important;
    font-size: clamp(32px, 8.8vw, 37px) !important;
    line-height: 1.02 !important;
  }

  body.home #page-container #main-content .lfm-home-audio .lfm-audio-heading p,
  body.home #page-container #et-main-area #main-content .lfm-home-audio .lfm-audio-heading p {
    max-width: 330px !important;
    margin-bottom: 14px !important;
    font-size: 15px !important;
    line-height: 1.4 !important;
  }

  body.home #page-container #main-content .lfm-home-audio .category-navbar,
  body.home #page-container #et-main-area #main-content .lfm-home-audio .category-navbar {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    overflow-x: auto !important;
    margin: 0 0 14px !important;
    padding: 0 0 8px !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  body.home #page-container #main-content .lfm-home-audio .category-navbar::-webkit-scrollbar,
  body.home #page-container #et-main-area #main-content .lfm-home-audio .category-navbar::-webkit-scrollbar {
    display: none;
  }

  body.home #page-container #main-content .lfm-home-audio .category-navbar button,
  body.home #page-container #main-content .lfm-home-audio .category-navbar a,
  body.home #page-container #et-main-area #main-content .lfm-home-audio .category-navbar button,
  body.home #page-container #et-main-area #main-content .lfm-home-audio .category-navbar a {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
  }

  body.home #page-container #main-content .lfm-home-audio .audio-album-grid,
  body.home #page-container #main-content .lfm-home-audio .category-grid.audio-album-grid,
  body.home #page-container #et-main-area #main-content .lfm-home-audio .audio-album-grid,
  body.home #page-container #et-main-area #main-content .lfm-home-audio .category-grid.audio-album-grid {
    display: flex !important;
    gap: 10px !important;
    width: auto !important;
    margin: 0 -16px !important;
    padding: 0 16px 6px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  body.home #page-container #main-content .lfm-home-audio .audio-album-cell.lfm-demo-card,
  body.home #page-container #et-main-area #main-content .lfm-home-audio .audio-album-cell.lfm-demo-card {
    flex: 0 0 clamp(132px, 38vw, 152px) !important;
    width: clamp(132px, 38vw, 152px) !important;
    min-width: clamp(132px, 38vw, 152px) !important;
    opacity: 1 !important;
    transform: none !important;
    scroll-snap-align: start;
  }

  body.home #page-container #main-content .lfm-home-audio .audio-album-cell.lfm-demo-card .card-after,
  body.home #page-container #et-main-area #main-content .lfm-home-audio .audio-album-cell.lfm-demo-card .card-after {
    height: clamp(132px, 38vw, 152px) !important;
    min-height: 0 !important;
    border-radius: 14px !important;
  }

  body.home #page-container #main-content .lfm-home-audio .audio-album-cell.lfm-demo-card .card-after-image,
  body.home #page-container #et-main-area #main-content .lfm-home-audio .audio-album-cell.lfm-demo-card .card-after-image {
    height: 100% !important;
    min-height: 0 !important;
  }

  /* Local/staging browsers can resolve as an unknown region, leaving the
     regional demo shortcode hidden and the homepage audio module blank. */
  body.home.lfm-country-unknown #page-container #main-content .lfm-home-audio .lfm-regional-content-item.lfm-show-us,
  body.home.lfm-country-unknown #page-container #et-main-area #main-content .lfm-home-audio .lfm-regional-content-item.lfm-show-us {
    display: block !important;
  }

  body.home.lfm-country-unknown #page-container #main-content .lfm-home-audio .lfm-regional-content-item:not(.lfm-show-us),
  body.home.lfm-country-unknown #page-container #et-main-area #main-content .lfm-home-audio .lfm-regional-content-item:not(.lfm-show-us) {
    display: none !important;
  }

  body.home #page-container #main-content .lfm-home-audio .lfm-regional-content-item.lfm-show-nz .audio-grid-vue-root,
  body.home #page-container #main-content .lfm-home-audio .lfm-regional-content-item.lfm-show-nz .lfm-audio-grid-v2,
  body.home #page-container #main-content .lfm-home-audio .lfm-regional-content-item.lfm-show-nz .lfm-audio-album-shell,
  body.home #page-container #et-main-area #main-content .lfm-home-audio .lfm-regional-content-item.lfm-show-nz .audio-grid-vue-root,
  body.home #page-container #et-main-area #main-content .lfm-home-audio .lfm-regional-content-item.lfm-show-nz .lfm-audio-grid-v2,
  body.home #page-container #et-main-area #main-content .lfm-home-audio .lfm-regional-content-item.lfm-show-nz .lfm-audio-album-shell {
    width: 100% !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  body.home #page-container #main-content .lfm-home-audio .audio-grid-vue-root.lfm-motion-reveal,
  body.home #page-container #et-main-area #main-content .lfm-home-audio .audio-grid-vue-root.lfm-motion-reveal {
    opacity: 1 !important;
    transform: none !important;
  }

  body.home #page-container #main-content .lfm-home-audio .audio-album-cell.lfm-demo-card,
  body.home #page-container #et-main-area #main-content .lfm-home-audio .audio-album-cell.lfm-demo-card {
    flex-basis: clamp(124px, 34vw, 140px) !important;
    width: clamp(124px, 34vw, 140px) !important;
    min-width: clamp(124px, 34vw, 140px) !important;
  }

  body.home #page-container #main-content .lfm-home-audio .audio-album-cell.lfm-demo-card .card-after,
  body.home #page-container #et-main-area #main-content .lfm-home-audio .audio-album-cell.lfm-demo-card .card-after {
    height: clamp(124px, 34vw, 140px) !important;
  }

  body.home #page-container #main-content .lfm-home-products .lfm-motion-reveal,
  body.home #page-container #main-content .lfm-home-products .lfm-motion-card,
  body.home #page-container #et-main-area #main-content .lfm-home-products .lfm-motion-reveal,
  body.home #page-container #et-main-area #main-content .lfm-home-products .lfm-motion-card {
    opacity: 1 !important;
    transform: none !important;
  }
}
