/* ============================================
   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 (.notice_in_810d) is a descendant of
   .disabled-8bc6 (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.banner-under-ccf4 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".progress_5d92" 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.sort_42fc so it can't cause
   horizontal overflow anyway. */
.focused_de96,
.caption-767e,
.active_active_fb29,
.footer_hard_57c1,
.highlight-fresh-01c0,
.next-f262,
.overlay_c748,
.search-next-a105,
.static-8269,
.first_1c92,
.article-mini-184b {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .blue-dc30 {
    padding: 8px 0;
  }
  
  .prev_6f67 img {
    height: 28px;
    width: auto;
  }
  
  .gallery_b25f {
    display: none !important;
  }
  
  .heading_under_7e1a {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .heading_under_7e1a svg {
    width: 14px;
    height: 14px;
  }
  
  .under_6366 {
    padding: 6px;
  }
  
  .breadcrumb_paper_27b4 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .active_active_fb29,
  .caption-767e,
  .footer_hard_57c1,
  .highlight-fresh-01c0,
  .advanced-3845,
  .paper_949f,
  .caption_d11d,
  .aside_a605,
  .tiny_4c87,
  .shadow-medium-3b90,
  .gallery_0145,
  .easy_4ae7 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .content-glass-9181,
  .column_301a {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .title-4d28,
  .huge_07db,
  .active_a630,
  .active-small-78ca,
  .nav-6309,
  .pressed-e11e,
  .notification-2f10 {
    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 */
  .element_middle_f5d7,
  .gas-7bf2,
  .outline-wood-5ae0,
  .mask-bbb7,
  .photo-9153 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .box_pink_7bc3,
  .hovered-1592,
  .medium_7a43,
  .video-complex-743c {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .shadow-out-3ae1,
  .accent-3e50 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .focus-fixed-faf0,
  .disabled-b5a1,
  .gradient_429f,
  .full_a84e {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .tooltip_b350,
  .dropdown-398d,
  .orange_c5cd,
  .over_7c79,
  .over_0800,
  .west_dc68 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .element_middle_f5d7,
  .gas-7bf2,
  .mask-bbb7 {
    max-width: none !important;
  }
  
  .progress_5d92 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .box_pink_7bc3 {
    font-size: 1.5rem !important;
  }
  
  .hovered-1592 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .outline-narrow-5544,
  .slider-c22b {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .medium_7a43 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .sidebar_brown_8457 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .new_778e {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .element_middle_f5d7,
  .mask-bbb7 {
    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: 034d */
.ghost-box-k9 {
  padding: 0.3rem;
  font-size: 14px;
  line-height: 1.3;
}
