/* ============================================
   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 (.north-a268) is a descendant of
   .nav_wide_2c8c (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.slider-e381 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".tall_c00e" 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.black-7db6 so it can't cause
   horizontal overflow anyway. */
.row_full_220c,
.purple-8f87,
.sort-plasma-e510,
.backdrop-action-e6c3,
.full_3750,
.complex_fb6f,
.article-7d7c,
.down_e558,
.bottom-7280,
.block-right-c33f,
.main-0d3e {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .logo-tall-f83c {
    padding: 8px 0;
  }
  
  .tall-0826 img {
    height: 28px;
    width: auto;
  }
  
  .layout-e8e5 {
    display: none !important;
  }
  
  .primary_solid_fa63 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .primary_solid_fa63 svg {
    width: 14px;
    height: 14px;
  }
  
  .section-stale-b029 {
    padding: 6px;
  }
  
  .header-620c {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .sort-plasma-e510,
  .purple-8f87,
  .backdrop-action-e6c3,
  .full_3750,
  .heading-cb9e,
  .white_369a,
  .carousel_6779,
  .iron_3f7e,
  .photo-ce62,
  .highlight_fluid_9977,
  .summary_dirty_a906,
  .pro_ae8a {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .panel_plasma_bb28,
  .disabled_clean_3a9e {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .shade_6fd6,
  .overlay_ad55,
  .button-wood-c471,
  .label_simple_5bf5,
  .image-right-aa53,
  .link-b61e,
  .menu_tiny_f296 {
    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 */
  .image-static-ac7a,
  .mini-661f,
  .notice_plasma_db5a,
  .alert_small_b3a5,
  .sidebar-8974 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .sidebar_bb0f,
  .advanced-c706,
  .main_3e5f,
  .gradient-cf48 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .glass_608b,
  .status-lite-a0fd {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .gallery-new-7bdd,
  .heading-west-7796,
  .tall-f81a,
  .purple-2124 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .top_293c,
  .gallery-slow-d4f0,
  .left-4066,
  .outer-18aa,
  .block_fresh_b170,
  .hovered-21a4 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .image-static-ac7a,
  .mini-661f,
  .alert_small_b3a5 {
    max-width: none !important;
  }
  
  .tall_c00e {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .sidebar_bb0f {
    font-size: 1.5rem !important;
  }
  
  .advanced-c706 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .hidden_ef02,
  .main-dark-8925 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .main_3e5f {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .widget_4cc7 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .focus-dynamic-1850 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .image-static-ac7a,
  .alert_small_b3a5 {
    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: 53ef */
.shadow-element-y7 {
  padding: 0.2rem;
  font-size: 12px;
  line-height: 1.3;
}
