/* ============================================
   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 (.surface_stale_c202) is a descendant of
   .header-bright-55a8 (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.sidebar_7458 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".dropdown_tiny_d2a9" 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.media_d521 so it can't cause
   horizontal overflow anyway. */
.main-eb37,
.box_out_5e5a,
.pattern_8994,
.icon_a29b,
.message_46f9,
.row-hot-1b83,
.gas-e3bf,
.accordion-fluid-d973,
.primary_dim_c299,
.outline-3f86,
.pagination_37d0 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .wide_bdaa {
    padding: 8px 0;
  }
  
  .hover-static-cd9a img {
    height: 28px;
    width: auto;
  }
  
  .search-stale-650b {
    display: none !important;
  }
  
  .component-steel-14bc {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .component-steel-14bc svg {
    width: 14px;
    height: 14px;
  }
  
  .article_motion_eadd {
    padding: 6px;
  }
  
  .accordion-fresh-bd68 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .pattern_8994,
  .box_out_5e5a,
  .icon_a29b,
  .message_46f9,
  .hovered_06d9,
  .main-next-a1e0,
  .hard_1af3,
  .title_7c08,
  .text_2920,
  .purple-90a8,
  .video-soft-a625,
  .grid_9b8a {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .first-5531,
  .lite_33d9 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .avatar-95ad,
  .selected_84f1,
  .tall-ece4,
  .layout-fixed-85b1,
  .title-clean-19b5,
  .carousel-d198,
  .pagination-huge-570a {
    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 */
  .soft_d75b,
  .first_4bc9,
  .last-f0ad,
  .sort-inner-abff,
  .large-7192 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .shade_f68a,
  .tabs-4dba,
  .mask-fresh-9808,
  .chip-plasma-116c {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .banner_soft_4e7d,
  .chip_976a {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .tiny-3ca0,
  .tooltip_dynamic_ec88,
  .image-7e7f,
  .accent-e989 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .fluid-1b10,
  .yellow_aa62,
  .static_d0c8,
  .link_silver_8845,
  .bronze-7fe0,
  .hero_slow_87a8 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .soft_d75b,
  .first_4bc9,
  .sort-inner-abff {
    max-width: none !important;
  }
  
  .dropdown_tiny_d2a9 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .shade_f68a {
    font-size: 1.5rem !important;
  }
  
  .tabs-4dba {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .sidebar-9411,
  .image_rough_71b4 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .mask-fresh-9808 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .white_7a6d {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .highlight-a582 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .soft_d75b,
  .sort-inner-abff {
    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: 11f3 */
.widget-item-n3 {
  padding: 0.3rem;
  font-size: 13px;
  line-height: 1.3;
}
