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

/* Fix for any potential overflow elements */
/* NOTE: ".panel-new-ea89" 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.wood_f2e6 so it can't cause
   horizontal overflow anyway. */
.border-f8bc,
.main_left_7bd1,
.brown_beec,
.tertiary-bright-8174,
.progress_cdb6,
.highlight_b208,
.old_8faf,
.fixed_6c10,
.dropdown-8469,
.plasma_5f7d,
.paragraph_b841 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .iron_c648 {
    padding: 8px 0;
  }
  
  .border_advanced_b0c9 img {
    height: 28px;
    width: auto;
  }
  
  .dark_a440 {
    display: none !important;
  }
  
  .right-5fe7 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .right-5fe7 svg {
    width: 14px;
    height: 14px;
  }
  
  .input_copper_ae0b {
    padding: 6px;
  }
  
  .feature-glass-034f {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .brown_beec,
  .main_left_7bd1,
  .tertiary-bright-8174,
  .progress_cdb6,
  .aside_hard_21a2,
  .avatar-brown-45d1,
  .caption-next-ec5c,
  .focus-rough-271d,
  .active-d808,
  .pagination-static-f0fc,
  .info_5f31,
  .hard-82df {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .item-fc1e,
  .module-left-1671 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .highlight-744b,
  .filter_west_5429,
  .input-83a2,
  .heading-gold-814e,
  .background_4a4a,
  .tabs_f189,
  .slider_last_83d1 {
    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 */
  .notice_dark_6b16,
  .hovered-e5f0,
  .caption-under-78cf,
  .input-a2b2,
  .nav_stone_b87c {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .border-green-013e,
  .lite-de68,
  .picture-small-bd81,
  .left-e19f {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .title_yellow_cb37,
  .element_b4ab {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .fast_bf17,
  .modal_tiny_ab3e,
  .title-current-b0a2,
  .gallery-9fc3 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .center-2d06,
  .filter-1e22,
  .caption-orange-c28c,
  .overlay-8277,
  .carousel-current-14ac,
  .bottom_f0e9 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .notice_dark_6b16,
  .hovered-e5f0,
  .input-a2b2 {
    max-width: none !important;
  }
  
  .panel-new-ea89 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .border-green-013e {
    font-size: 1.5rem !important;
  }
  
  .lite-de68 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .notice-over-1c91,
  .complex_7f88 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .picture-small-bd81 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .pagination_first_468a {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .sort_selected_3262 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .notice_dark_6b16,
  .input-a2b2 {
    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: af08 */
.ghost-box-i8 {
  padding: 0.1rem;
  font-size: 11px;
  line-height: 1.0;
}
