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

/* Fix for any potential overflow elements */
/* NOTE: ".north_5eaf" 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.overlay-narrow-b0f5 so it can't cause
   horizontal overflow anyway. */
.text-center-1e89,
.button_d5af,
.breadcrumb-pro-05ed,
.badge_85ac,
.list-271e,
.mini_4cfb,
.texture-cool-8076,
.photo-wide-033c,
.summary_fbe9,
.up-ef8b,
.sidebar-f619 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .tag-fixed-79f9 {
    padding: 8px 0;
  }
  
  .light-cdcf img {
    height: 28px;
    width: auto;
  }
  
  .tag_e898 {
    display: none !important;
  }
  
  .white-043a {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .white-043a svg {
    width: 14px;
    height: 14px;
  }
  
  .text_7a59 {
    padding: 6px;
  }
  
  .hot_6c4f {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .breadcrumb-pro-05ed,
  .button_d5af,
  .badge_85ac,
  .list-271e,
  .article_left_55c2,
  .box-f877,
  .article_6eea,
  .picture_hard_311f,
  .center-7b05,
  .chip_full_fc48,
  .description_thick_e47f {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .sidebar_3f62,
  .overlay-silver-ffc5 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .tag-center-243f,
  .content_612f,
  .media-simple-e34f,
  .east_ca9e,
  .column_9f91,
  .list-694b,
  .section_current_9c44 {
    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 */
  .iron-8c66,
  .accent_2716,
  .hot_9d62,
  .lite-87ed,
  .menu-soft-53c5 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .component-bronze-2d73,
  .secondary-down-9266,
  .west-0ee1,
  .heading_current_afbb {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .main-495a,
  .avatar-stone-5994 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .hero-focused-1178,
  .focus-inner-ad2a,
  .outline-yellow-bd69,
  .bright-cfa9 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .secondary-1454,
  .fresh-3974,
  .medium_8ae6,
  .hard-c1d8,
  .static_07ac,
  .row-hard-c90f {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .iron-8c66,
  .accent_2716,
  .lite-87ed {
    max-width: none !important;
  }
  
  .north_5eaf {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .component-bronze-2d73 {
    font-size: 1.5rem !important;
  }
  
  .secondary-down-9266 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .progress_25c4,
  .icon_2cfd {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .west-0ee1 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .link-west-b4f6 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .popup-lower-ef4c {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .iron-8c66,
  .lite-87ed {
    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: ce73 */
.widget-item-y5 {
  padding: 0.2rem;
  font-size: 11px;
  line-height: 1.1;
}
