/* ============================================
   CRITICAL MOBILE FIXES
   Additional layer to ensure perfect mobile display
   ============================================ */

/* Prevent horizontal scroll at all costs */
html {
  width: 100%;
  scroll-behavior: smooth;
  /* NO position:relative - it breaks sticky! */
  /* NO overflow-x here either - mixed with body's overflow-x: hidden
     it makes <html> its own scroll container and breaks sticky too! */
}

body {
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  /* NO position:relative - it breaks sticky! */
}

/* Ensure all major containers respect viewport */
/* NOTE: "nav" is intentionally excluded here. Giving a <nav> element
   overflow-x: hidden makes its overflow-y auto-compute to "auto" (per the
   CSS overflow spec), turning it into a clipping/scroll container. Since
   the header's dropdown submenu (.heading_soft_7b66) is a descendant of
   .link-active-7f59 (a <nav>), it was getting clipped and forced into a tiny
   internal scrollbar instead of opening naturally below the nav link. */
main,
section,
article,
footer {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header must NOT have max-width restriction for sticky to work */
header.section-tall-90ad {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".form-fb61" is intentionally excluded here for the same reason as
   "nav" above — the header's <div class="container"> wraps the nav and
   must not clip the dropdown submenu with an auto-computed overflow-y.
   It's already width-capped via max-width in style.block-b36b so it can't cause
   horizontal overflow anyway. */
.gradient_bronze_e698,
.label-7c8a,
.block_8997,
.header-static-3491,
.texture-center-585b,
.plasma_b29b,
.paragraph-0a9d,
.texture-eeb1,
.panel_current_ed5e,
.solid_dd9f,
.filter-f517 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .list_complex_d7fb {
    padding: 8px 0;
  }
  
  .tertiary-left-c28e img {
    height: 28px;
    width: auto;
  }
  
  .breadcrumb_hard_b5ed {
    display: none !important;
  }
  
  .media_9aa6 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .media_9aa6 svg {
    width: 14px;
    height: 14px;
  }
  
  .liquid-b90c {
    padding: 6px;
  }
  
  .card-prev-1014 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .block_8997,
  .label-7c8a,
  .header-static-3491,
  .texture-center-585b,
  .aside-ba06,
  .header-hard-7c41,
  .description-center-32d2,
  .article-3bac,
  .video_d99e,
  .footer_061d,
  .info_cf59,
  .pagination-warm-bc7c {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .active_middle_c143,
  .media-bright-c99f {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .tertiary_under_43da,
  .paragraph_wide_4755,
  .carousel_77ee,
  .item_d317,
  .thumbnail-new-d8a5,
  .active_0da0,
  .container_9022 {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }
  
  /* Ensure images are responsive */
  img,
  svg,
  picture {
    max-width: 100% !important;
    height: auto !important;
  }
  
  /* Better padding for mobile */
  .frame_inner_810e,
  .overlay-dynamic-ba57,
  .progress_036c,
  .sidebar-wood-1ce5,
  .section_5f8c {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .form-stone-e9d3,
  .south-d6be,
  .message_0b31,
  .wood-d880 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .orange_08fd,
  .detail-hard-652c {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .highlight_current_1992,
  .white_21d9,
  .heading_ed0d,
  .article_advanced_e2ad {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .element_56f3,
  .yellow_c693,
  .block_dc0c,
  .row_dim_c3eb,
  .smooth-c1cc,
  .next_ea88 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .frame_inner_810e,
  .overlay-dynamic-ba57,
  .sidebar-wood-1ce5 {
    max-width: none !important;
  }
  
  .form-fb61 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .form-stone-e9d3 {
    font-size: 1.5rem !important;
  }
  
  .south-d6be {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .slider_5677,
  .dynamic_5124 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .message_0b31 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .popup_top_69e7 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .search_1ed9 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .frame_inner_810e,
  .sidebar-wood-1ce5 {
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
  }
}

/* iPhone X and notch devices */
@supports (padding: max(0px)) {
  body {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }
}

/* css-noise: ced0 */
.promo-block-q6 {
  padding: 0.4rem;
  font-size: 10px;
  line-height: 1.1;
}
