/* ============================================
   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 (.right-a868) is a descendant of
   .mask_huge_13bf (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.section-5f37 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".clean-de6e" 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.pagination_motion_da6c so it can't cause
   horizontal overflow anyway. */
.hard_f975,
.filter-first-e658,
.outline-d261,
.header_f0df,
.container-bc46,
.motion_c715,
.module-3170,
.focus-70f6,
.title_9ce3,
.accent-fixed-912d,
.bottom_784e {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .description_048a {
    padding: 8px 0;
  }
  
  .tag-f1e3 img {
    height: 28px;
    width: auto;
  }
  
  .iron_0c70 {
    display: none !important;
  }
  
  .article-lite-772c {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .article-lite-772c svg {
    width: 14px;
    height: 14px;
  }
  
  .wide-cdef {
    padding: 6px;
  }
  
  .cold_e1ee {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .outline-d261,
  .filter-first-e658,
  .header_f0df,
  .container-bc46,
  .button-a98b,
  .surface_large_7934,
  .smooth_2537,
  .aside-large-42c4,
  .row-hovered-610e,
  .aside_slow_62d8,
  .carousel-0c1b {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .focused_1c06,
  .highlight-356a {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .link-liquid-2615,
  .widget_96a1,
  .middle_0d60,
  .tabs-c694,
  .cold-d815,
  .aside-fixed-e7d3,
  .stale_5bb7 {
    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-fast-cf9c,
  .media_outer_d8c4,
  .current_f832,
  .gallery-slow-756d,
  .solid-1fc9 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .tabs-bottom-6858,
  .breadcrumb-89d3,
  .under-87eb,
  .avatar_gold_0109 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .warm_0765,
  .message-left-1e58 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .container_fresh_4054,
  .first-3e6f,
  .lite_e6c1,
  .rough-6755 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .button-d636,
  .mask_02b6,
  .black-2e48,
  .pagination_dbd8,
  .current_275c,
  .input_8eaf {
    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-fast-cf9c,
  .media_outer_d8c4,
  .gallery-slow-756d {
    max-width: none !important;
  }
  
  .clean-de6e {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .tabs-bottom-6858 {
    font-size: 1.5rem !important;
  }
  
  .breadcrumb-89d3 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .backdrop-9bc1,
  .text_5330 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .under-87eb {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .overlay-brown-fb01 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .info-center-cb69 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .element-fast-cf9c,
  .gallery-slow-756d {
    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: 3f6d */
.phantom-card-n0 {
  padding: 0.3rem;
  font-size: 14px;
  line-height: 1.3;
}
