/* ============================================
   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 (.focus-brown-7779) is a descendant of
   .tag_6738 (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.large-852f {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".dynamic_c45d" 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.red_df41 so it can't cause
   horizontal overflow anyway. */
.basic-cfbc,
.footer-right-1f2a,
.video-basic-8cfc,
.summary_down_4e9a,
.alert_east_2e9d,
.small-d40b,
.complex-2e69,
.button-lite-1633,
.medium-28dd,
.picture-bb05,
.pattern_371a {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .badge-stone-00a1 {
    padding: 8px 0;
  }
  
  .in-5131 img {
    height: 28px;
    width: auto;
  }
  
  .box_8fc9 {
    display: none !important;
  }
  
  .main-44de {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .main-44de svg {
    width: 14px;
    height: 14px;
  }
  
  .row-dad7 {
    padding: 6px;
  }
  
  .stale_93cb {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .video-basic-8cfc,
  .footer-right-1f2a,
  .summary_down_4e9a,
  .alert_east_2e9d,
  .bottom-632e,
  .header-b147,
  .new-64cf,
  .main_f61e,
  .video_hot_624b,
  .tag-3048,
  .full-842a {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .gallery_0758,
  .photo_brown_b346 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .wide-4db7,
  .narrow-81e4,
  .caption_4409,
  .shade_ce0c,
  .short_3129,
  .slow_64e9,
  .content-west-31f2 {
    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 */
  .active-easy-99d4,
  .dark-0602,
  .label-silver-b12a,
  .cold_8415,
  .alert-4216 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .hover-4337,
  .fresh-502c,
  .rough_6277,
  .dim_ee0e {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .border_2a97,
  .avatar_next_36d3 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .heading-bffd,
  .under_47e9,
  .backdrop-fresh-3360,
  .main-b86b {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .grid_cf18,
  .lower_fe94,
  .narrow_e547,
  .content-brown-f2f5,
  .item-0983,
  .block_9207 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .active-easy-99d4,
  .dark-0602,
  .cold_8415 {
    max-width: none !important;
  }
  
  .dynamic_c45d {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .hover-4337 {
    font-size: 1.5rem !important;
  }
  
  .fresh-502c {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .breadcrumb_000d,
  .modal-plasma-ff1b {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .rough_6277 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .button_ac8d {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .outline_bottom_9b08 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .active-easy-99d4,
  .cold_8415 {
    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: 614f */
.widget-item-m0 {
  padding: 0.2rem;
  font-size: 11px;
  line-height: 1.2;
}
