/* ============================================
   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-purple-fc96) is a descendant of
   .green_b5a8 (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.dark_d5ee)
   and the redesigned template (header.content-hovered-8ba8). Keep both selectors. */
header.dark_d5ee,
header.content-hovered-8ba8 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".picture-gold-d8bd" 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.section_dec3 so it can't cause
   horizontal overflow anyway. */
.description_1c5e,
.alert_wide_e2bc,
.card_529d,
.picture_next_7674,
.block_yellow_83f8,
.advanced_39fb,
.tooltip-first-1fb5,
.prev_6dd1,
.banner_easy_309e,
.selected-9b1f,
.hero_under_81bc {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .out_b191 {
    padding: 8px 0;
  }
  
  .advanced_2a4f img {
    height: 28px;
    width: auto;
  }
  
  .filter-ba6b {
    display: none !important;
  }
  
  .next_ab57 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .next_ab57 svg {
    width: 14px;
    height: 14px;
  }
  
  .sort-30b2 {
    padding: 6px;
  }
  
  .pro-b999 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .card_529d,
  .alert_wide_e2bc,
  .picture_next_7674,
  .block_yellow_83f8,
  .gradient_large_6595,
  .basic-5a9a,
  .tooltip_6010,
  .content-4d1f,
  .gas_b8a7,
  .summary-48d8,
  .hidden_out_668e,
  .pattern-d34e {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .focus_228c,
  .menu-5563 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .orange-d7a3,
  .section-dynamic-d563,
  .thumbnail_b00d,
  .photo_3376,
  .breadcrumb_soft_ee90,
  .last_5c2a,
  .message-478a {
    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 */
  .gallery_light_0b20,
  .status_under_db8e,
  .gradient_small_a738,
  .accordion-bronze-8271,
  .sort-b837 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .container-first-4532,
  .hidden_a266,
  .active_slow_e042,
  .carousel-narrow-c52a {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .black-9d26,
  .chip-4731 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .dropdown-full-b0dc,
  .mini_2e72,
  .narrow-d05c,
  .overlay_focused_bc2d {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .active_0c2a,
  .shadow_08ce,
  .highlight_pro_9593,
  .block_cool_2978,
  .active_8903,
  .first-ca8e {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .gallery_light_0b20,
  .status_under_db8e,
  .accordion-bronze-8271 {
    max-width: none !important;
  }
  
  .picture-gold-d8bd {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .container-first-4532 {
    font-size: 1.5rem !important;
  }
  
  .hidden_a266 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .in-d0ca,
  .mini_fcb9 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .active_slow_e042 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .video_light_0e73 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .blue_2960 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .gallery_light_0b20,
  .accordion-bronze-8271 {
    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 */
.pattern_steel_45b3 {
  padding: 0.1rem;
  font-size: 10px;
  line-height: 1.2;
}

/* css-noise: 50d7 */
.widget-item-j0 {
  padding: 0.1rem;
  font-size: 12px;
  line-height: 1.2;
}
