/* ============================================
   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 (.main-74bc) is a descendant of
   .highlight_5b1a (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.east-f41e {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".full-e741" 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.column-5cf4 so it can't cause
   horizontal overflow anyway. */
.media-light-2fe0,
.bottom_48bb,
.brown_a85c,
.widget_in_f4f6,
.module-full-1777,
.east-3ffe,
.aside-brown-36ed,
.up-66bb,
.stale-0c7a,
.alert_active_205d,
.dim-bd4d {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .module-bronze-7ee9 {
    padding: 8px 0;
  }
  
  .item_full_5a0a img {
    height: 28px;
    width: auto;
  }
  
  .pagination_eb64 {
    display: none !important;
  }
  
  .feature-7ff3 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .feature-7ff3 svg {
    width: 14px;
    height: 14px;
  }
  
  .box-1ea7 {
    padding: 6px;
  }
  
  .hero_dynamic_07ce {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .brown_a85c,
  .bottom_48bb,
  .widget_in_f4f6,
  .module-full-1777,
  .highlight-in-0748,
  .shadow_easy_e803,
  .section-easy-1a8a,
  .detail-edf9,
  .photo-dbca,
  .hero-upper-8e98,
  .widget_3874 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .secondary-focused-208b,
  .accent_easy_5b1a {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .red_885c,
  .west_15ad,
  .pagination-0925,
  .card-middle-fd2c,
  .tooltip_dirty_40c5,
  .section_981a,
  .hero_640b {
    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 */
  .caption-ba38,
  .active_2f24,
  .alert-solid-ed34,
  .progress_8943,
  .left-1b94 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .message_paper_1b38,
  .highlight-black-29bb,
  .static_4eb7,
  .tabs_27ac {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .article-basic-fe80,
  .feature-a858 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .glass_363b,
  .steel_a70f,
  .form-easy-fccf,
  .search-4c31 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .dropdown_9297,
  .backdrop_hard_0915,
  .thumbnail_thick_e7d9,
  .advanced_90b7,
  .pressed_1676,
  .logo_current_9351 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .caption-ba38,
  .active_2f24,
  .progress_8943 {
    max-width: none !important;
  }
  
  .full-e741 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .message_paper_1b38 {
    font-size: 1.5rem !important;
  }
  
  .highlight-black-29bb {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .over-39eb,
  .selected_e83d {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .static_4eb7 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .dynamic_ca2b {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .tabs_static_7be0 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .caption-ba38,
  .progress_8943 {
    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: 0e5b */
.ghost-box-l8 {
  padding: 0.2rem;
  font-size: 11px;
  line-height: 1.0;
}
