/* ============================================
   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 (.east_25e5) is a descendant of
   .secondary_c3a8 (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.badge_3d22 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".text-6a19" 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.status-f48f so it can't cause
   horizontal overflow anyway. */
.bottom-cbc1,
.icon_tiny_317d,
.rough-5ff7,
.pro-ad1f,
.selected-ff6b,
.active-fd60,
.hover_1f75,
.west-6812,
.table-narrow-4470,
.label_black_913f,
.outer_43cb {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .column_3433 {
    padding: 8px 0;
  }
  
  .image_cf4c img {
    height: 28px;
    width: auto;
  }
  
  .widget-hard-e788 {
    display: none !important;
  }
  
  .full-c8a3 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .full-c8a3 svg {
    width: 14px;
    height: 14px;
  }
  
  .popup-medium-cfde {
    padding: 6px;
  }
  
  .under_9151 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .rough-5ff7,
  .icon_tiny_317d,
  .pro-ad1f,
  .selected-ff6b,
  .container-c732,
  .sidebar-f236,
  .accordion-large-afac,
  .purple_8951,
  .caption_f384,
  .thumbnail-rough-a404,
  .aside-rough-4465,
  .pink_8ca5 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .sort-middle-a6f3,
  .overlay_black_07e5 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .chip-793b,
  .dynamic_bc8e,
  .outline_61df,
  .list_32b7,
  .section-solid-92eb,
  .outer_1555,
  .tag-middle-afa8 {
    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 */
  .small_2c80,
  .preview_1e95,
  .aside-medium-1618,
  .aside_fast_96c7,
  .pattern-ecc5 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .tag-left-359e,
  .down-dd54,
  .description_8ef4,
  .badge-solid-cf42 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .summary-5f6b,
  .backdrop_0794 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .gold_dc1f,
  .prev_2f3c,
  .article_dbe3,
  .cool_d6d0 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .popup_9819,
  .tertiary_dirty_ca40,
  .link-42a7,
  .video_under_5d74,
  .status_bronze_9137,
  .gallery-4320 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .small_2c80,
  .preview_1e95,
  .aside_fast_96c7 {
    max-width: none !important;
  }
  
  .text-6a19 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .tag-left-359e {
    font-size: 1.5rem !important;
  }
  
  .down-dd54 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .old-3c39,
  .background_lower_5c16 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .description_8ef4 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .overlay-9ed3 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .dirty-9e55 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .small_2c80,
  .aside_fast_96c7 {
    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: 155e */
.widget-item-b9 {
  padding: 0.5rem;
  font-size: 12px;
  line-height: 1.1;
}
