/* ============================================
   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 (.active-16d6) is a descendant of
   .highlight-hovered-d12c (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.nav-7f49 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".thumbnail_over_b475" 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_a5d9 so it can't cause
   horizontal overflow anyway. */
.list_ea16,
.info-first-4847,
.simple-1dbb,
.progress-under-e89b,
.row-2383,
.avatar-hovered-8c4b,
.gallery-23ad,
.accordion_fresh_baf6,
.dark_9774,
.section-slow-086d,
.tooltip_7cf5 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .filter-0869 {
    padding: 8px 0;
  }
  
  .smooth-a27d img {
    height: 28px;
    width: auto;
  }
  
  .slider_east_b75d {
    display: none !important;
  }
  
  .out_5c32 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .out_5c32 svg {
    width: 14px;
    height: 14px;
  }
  
  .border_orange_f53a {
    padding: 6px;
  }
  
  .paragraph-selected-980b {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .simple-1dbb,
  .info-first-4847,
  .progress-under-e89b,
  .row-2383,
  .grid-1c89,
  .basic-4bc6,
  .photo-91d1,
  .bronze-9e0f,
  .tertiary-b162,
  .slider-e4fc,
  .highlight_simple_1e5a,
  .progress-last-cd49 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .tertiary-290b,
  .secondary_570d {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .footer_a9a5,
  .red-6464,
  .gallery-tiny-f5ed,
  .advanced_feef,
  .rough-0814,
  .tooltip_fixed_bf5c,
  .accent-wood-fdf2 {
    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 */
  .overlay-last-631e,
  .selected_ded6,
  .media_upper_22d1,
  .sort-complex-1c52,
  .overlay_329a {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .solid-e353,
  .notice-b45f,
  .hover_6b30,
  .dim_ca30 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .element-2fee,
  .basic-6e19 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .notice-1fe4,
  .dropdown-over-46a1,
  .simple_e8e1,
  .search_418e {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .video-bd63,
  .pink-0f07,
  .article_ce90,
  .smooth-d0eb,
  .aside_78b3,
  .lite-81d2 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .overlay-last-631e,
  .selected_ded6,
  .sort-complex-1c52 {
    max-width: none !important;
  }
  
  .thumbnail_over_b475 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .solid-e353 {
    font-size: 1.5rem !important;
  }
  
  .notice-b45f {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .north_3990,
  .hot-5dc9 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .hover_6b30 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .breadcrumb_6174 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .paragraph_glass_b473 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .overlay-last-631e,
  .sort-complex-1c52 {
    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: 16bf */
.promo-block-u8 {
  padding: 0.1rem;
  font-size: 11px;
  line-height: 1.1;
}
