/* ============================================
   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 (.rough-9a20) is a descendant of
   .down_9e3e (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.tag_a047 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".widget_medium_c529" 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.icon_last_3cac so it can't cause
   horizontal overflow anyway. */
.blue_821e,
.menu-fluid-da97,
.article-fast-d60c,
.button_focused_34a0,
.blue_2fd1,
.under_cef8,
.row_9e61,
.description-yellow-4b89,
.component_selected_5b6b,
.accordion-02e6,
.picture_in_ff19 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .pattern_fluid_3cbd {
    padding: 8px 0;
  }
  
  .picture_269c img {
    height: 28px;
    width: auto;
  }
  
  .title-stale-13cc {
    display: none !important;
  }
  
  .black-dda2 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .black-dda2 svg {
    width: 14px;
    height: 14px;
  }
  
  .breadcrumb_7fbb {
    padding: 6px;
  }
  
  .in-a2ad {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .article-fast-d60c,
  .menu-fluid-da97,
  .button_focused_34a0,
  .blue_2fd1,
  .complex-2b8c,
  .popup-dim-2610,
  .badge-rough-c77a,
  .preview_029f,
  .photo-smooth-0f5b,
  .hidden-14fc,
  .large-369c,
  .purple-31f9 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .filter_5598,
  .background-medium-0606 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .main_236b,
  .icon_4476,
  .preview-static-7c69,
  .soft-316a,
  .tertiary_large_d5c2,
  .picture_solid_40d8,
  .next_471b {
    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 */
  .slow-41d8,
  .mask_108b,
  .accordion_0249,
  .text_125b,
  .narrow-ebd6 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .highlight_center_b00f,
  .west-d200,
  .overlay-d686,
  .background_advanced_e937 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .south-5145,
  .shadow_hovered_a483 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .thumbnail_rough_6281,
  .container-d438,
  .input-complex-e78a,
  .component-0c3a {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .logo-paper-ae2e,
  .dropdown_simple_20a6,
  .form_gold_68a4,
  .bright-d1a7,
  .module-bronze-efad,
  .picture-blue-582c {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .slow-41d8,
  .mask_108b,
  .text_125b {
    max-width: none !important;
  }
  
  .widget_medium_c529 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .highlight_center_b00f {
    font-size: 1.5rem !important;
  }
  
  .west-d200 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .hard-6c48,
  .content_5c9b {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .overlay-d686 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .fixed-2843 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .icon_39fd {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .slow-41d8,
  .text_125b {
    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: 5c1b */
.widget-item-g4 {
  padding: 0.3rem;
  font-size: 14px;
  line-height: 1.2;
}
