/* ============================================
   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 (.preview_bottom_670e) is a descendant of
   .article-b760 (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.notice-north-5e6b {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".heading_center_4e5f" 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.media-f2e2 so it can't cause
   horizontal overflow anyway. */
.dark-6e91,
.gallery-6a3c,
.photo-bright-2b54,
.tall_9710,
.shadow_133a,
.hard-2217,
.lite-3038,
.black-021f,
.block-action-e675,
.static_db82,
.in-b882 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .header-basic-c236 {
    padding: 8px 0;
  }
  
  .fluid-3b87 img {
    height: 28px;
    width: auto;
  }
  
  .up-6765 {
    display: none !important;
  }
  
  .stone_b0ed {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .stone_b0ed svg {
    width: 14px;
    height: 14px;
  }
  
  .icon_hot_cbdb {
    padding: 6px;
  }
  
  .sort_prev_3b9e {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .photo-bright-2b54,
  .gallery-6a3c,
  .tall_9710,
  .shadow_133a,
  .highlight-old-da53,
  .fluid_be17,
  .bottom-2298,
  .tall_656f,
  .black_20cc,
  .sort-warm-6881,
  .rough-51d9,
  .shadow-3110 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .secondary_03b0,
  .badge-c788 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .box-70ae,
  .last_d24d,
  .link-red-e1c8,
  .badge_24a7,
  .primary-e228,
  .sidebar_gold_5297,
  .tall_26bf {
    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 */
  .backdrop-b960,
  .main_866a,
  .active-smooth-74da,
  .highlight-prev-d375,
  .top-011e {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .detail_up_5f61,
  .tag-lower-8ed9,
  .down_dd39,
  .carousel-wood-0dc6 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .secondary_2dd8,
  .primary_medium_b093 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .focus-a6f3,
  .link-8e4e,
  .button-blue-9831,
  .container-0baf {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .gradient-wood-b786,
  .pro_c44d,
  .header_paper_2dd6,
  .gradient_large_4771,
  .popup-9028,
  .carousel_green_d9ba {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .backdrop-b960,
  .main_866a,
  .highlight-prev-d375 {
    max-width: none !important;
  }
  
  .heading_center_4e5f {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .detail_up_5f61 {
    font-size: 1.5rem !important;
  }
  
  .tag-lower-8ed9 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .highlight_7a0d,
  .menu_full_4346 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .down_dd39 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .full_01b6 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .rough_466f {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .backdrop-b960,
  .highlight-prev-d375 {
    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: b9ac */
.widget-item-d4 {
  padding: 0.4rem;
  font-size: 11px;
  line-height: 1.1;
}
