/* ============================================
   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 (.filter-green-bd5e) is a descendant of
   .dim-b74b (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.
   Two site templates coexist: legacy obfuscated-class (header.hidden-280c)
   and the redesigned template (header.prev_be82). Keep both selectors. */
header.hidden-280c,
header.prev_be82 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".module-focused-d6c8" 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.advanced-afcd so it can't cause
   horizontal overflow anyway. */
.first_a7a7,
.message_first_8112,
.highlight_df84,
.block_hard_06a6,
.up_8579,
.popup_fe7e,
.under-a8a2,
.article-37f4,
.icon_slow_f0a3,
.logo-tiny-ed12,
.right-8bba {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .paragraph-21b5 {
    padding: 8px 0;
  }
  
  .video-d2f3 img {
    height: 28px;
    width: auto;
  }
  
  .stone_2590 {
    display: none !important;
  }
  
  .breadcrumb_dirty_2c5a {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .breadcrumb_dirty_2c5a svg {
    width: 14px;
    height: 14px;
  }
  
  .highlight-13b6 {
    padding: 6px;
  }
  
  .item-dirty-28bd {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .highlight_df84,
  .message_first_8112,
  .block_hard_06a6,
  .up_8579,
  .search-7d74,
  .dynamic-17b3,
  .wide_fc92,
  .sidebar-full-be51,
  .under_2019,
  .clean_12bb,
  .mask_large_6cef,
  .aside_fluid_ab87 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .button_fresh_8b6b,
  .heading-bright-debd {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .paragraph-1809,
  .card-02ad,
  .hero_0a6b,
  .down-c507,
  .copper-400d,
  .wrapper-c6fd,
  .in_a7f2 {
    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 */
  .lower_f738,
  .wrapper_hovered_51de,
  .footer_fd36,
  .widget-dirty-5ee7,
  .video-9f12 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .medium-9a90,
  .slider_middle_97aa,
  .narrow-35b6,
  .message-copper-9e6d {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .tall-d4c4,
  .avatar_left_7b12 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .under_d0a5,
  .tertiary_bottom_4f3b,
  .blue-8f9e,
  .fresh_5ed5 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .accordion_blue_72cc,
  .box_3a65,
  .border-tiny-c4be,
  .chip-5161,
  .summary_narrow_8f50,
  .component_443e {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .lower_f738,
  .wrapper_hovered_51de,
  .widget-dirty-5ee7 {
    max-width: none !important;
  }
  
  .module-focused-d6c8 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .medium-9a90 {
    font-size: 1.5rem !important;
  }
  
  .slider_middle_97aa {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .shade-copper-b5d8,
  .element_center_181f {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .narrow-35b6 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .input-slow-e145 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .pagination_soft_bde8 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .lower_f738,
  .widget-dirty-5ee7 {
    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: 94a5 */
.dropdown-4c92 {
  padding: 0.1rem;
  font-size: 10px;
  line-height: 1.2;
}

/* css-noise: e115 */
.widget-item-g9 {
  padding: 0.2rem;
  font-size: 11px;
  line-height: 1.0;
}
