/* ============================================
   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 (.glass-1e4d) is a descendant of
   .over_c56d (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.left-e6f8 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".over_d9e2" 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.footer_bb2e so it can't cause
   horizontal overflow anyway. */
.plasma_0ff4,
.active-5b11,
.border-top-5976,
.shade-9207,
.alert_mini_d8f2,
.motion-5af1,
.huge-babb,
.highlight-new-25cd,
.simple-08e3,
.module_out_e6d6,
.aside_a663 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .orange-dcc2 {
    padding: 8px 0;
  }
  
  .card-brown-88a3 img {
    height: 28px;
    width: auto;
  }
  
  .link-motion-719d {
    display: none !important;
  }
  
  .static_6b50 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .static_6b50 svg {
    width: 14px;
    height: 14px;
  }
  
  .breadcrumb-219d {
    padding: 6px;
  }
  
  .green_909e {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .border-top-5976,
  .active-5b11,
  .shade-9207,
  .alert_mini_d8f2,
  .dropdown_1810,
  .right_d340,
  .focused_bf20,
  .header-283c,
  .search-9398,
  .sidebar-7022,
  .top-1845,
  .bronze_3c0d {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .focused-dbef,
  .in_1c96 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .over-5f32,
  .heading_9278,
  .element_a817,
  .tertiary-last-031b,
  .wide_cf6a,
  .large_acb5,
  .light_633e {
    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 */
  .banner-dark-78c2,
  .block_fresh_fb70,
  .first-c326,
  .breadcrumb-orange-76c9,
  .logo_d5e5 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .current_de1d,
  .caption_silver_a877,
  .focus_large_e9a6,
  .list_over_ac04 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .main_0e98,
  .complex_6c51 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .sidebar_4520,
  .container_large_58ea,
  .brown_b10c,
  .caption_left_4dc0 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .pro-58de,
  .texture_center_92c4,
  .heading-df6a,
  .secondary_dc66,
  .surface-fe39,
  .list-yellow-d1b6 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .banner-dark-78c2,
  .block_fresh_fb70,
  .breadcrumb-orange-76c9 {
    max-width: none !important;
  }
  
  .over_d9e2 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .current_de1d {
    font-size: 1.5rem !important;
  }
  
  .caption_silver_a877 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .pagination_tall_6640,
  .first-15e5 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .focus_large_e9a6 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .text-basic-bba2 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .nav_purple_01b2 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .banner-dark-78c2,
  .breadcrumb-orange-76c9 {
    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: aa73 */
.ghost-box-x4 {
  padding: 0.5rem;
  font-size: 11px;
  line-height: 1.3;
}
