/* ============================================
   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 (.photo-solid-426c) is a descendant of
   .stale-9ea6 (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.pattern_36dc {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".info-7f61" 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.light-4700 so it can't cause
   horizontal overflow anyway. */
.banner_hard_00d8,
.new-ea3f,
.element_e7de,
.item_thick_54c5,
.highlight_orange_2aff,
.filter-51a4,
.alert_1fa8,
.feature-current-c138,
.background_current_0fe4,
.bronze_6a73,
.table-8449 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .notice_active_d06c {
    padding: 8px 0;
  }
  
  .column_83b4 img {
    height: 28px;
    width: auto;
  }
  
  .huge-35e3 {
    display: none !important;
  }
  
  .grid-4d08 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .grid-4d08 svg {
    width: 14px;
    height: 14px;
  }
  
  .detail_26ed {
    padding: 6px;
  }
  
  .blue-c568 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .element_e7de,
  .new-ea3f,
  .item_thick_54c5,
  .highlight_orange_2aff,
  .complex-a4d3,
  .stone-6b9f,
  .gold_f31f,
  .yellow-a5c3,
  .element_wide_eb07,
  .table_mini_9c73,
  .gradient_04e7,
  .solid-87ac {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .gradient_af4b,
  .background_2c41 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .new-7f76,
  .narrow-68ce,
  .disabled-wide-d0db,
  .tooltip_6934,
  .widget_out_c318,
  .module-0cdd,
  .media-pink-dbb5 {
    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 */
  .tag-last-48fd,
  .column-5d60,
  .chip-light-16c4,
  .sidebar_9851,
  .section_81ff {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .picture-c285,
  .popup-2997,
  .heading_stale_9f4a,
  .shade_tiny_30b0 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .shade_4653,
  .medium_6a57 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .title_065e,
  .message_selected_cf31,
  .stone_59ac,
  .dropdown_up_03c1 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .breadcrumb_0181,
  .nav_dark_ab31,
  .east_87eb,
  .accordion_01e9,
  .highlight-small-f390,
  .rough-e585 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .tag-last-48fd,
  .column-5d60,
  .sidebar_9851 {
    max-width: none !important;
  }
  
  .info-7f61 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .picture-c285 {
    font-size: 1.5rem !important;
  }
  
  .popup-2997 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .article_black_97d3,
  .aside_d086 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .heading_stale_9f4a {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .search-focused-3e7f {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .preview-small-02e8 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .tag-last-48fd,
  .sidebar_9851 {
    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: 0a8c */
.ghost-box-a7 {
  padding: 0.3rem;
  font-size: 10px;
  line-height: 1.0;
}
