/* ============================================
   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 (.section-wide-f3a1) is a descendant of
   .outline-warm-0a17 (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.search_blue_8d0b {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".sort_blue_9fb2" 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.accent-25fd so it can't cause
   horizontal overflow anyway. */
.table_light_5549,
.button_4ab8,
.badge_e971,
.module_steel_5ec7,
.photo_pink_fbc3,
.action-2bab,
.bottom_b4ca,
.feature-9b2a,
.feature-03e6,
.video_d903,
.picture-paper-417b {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .nav-215a {
    padding: 8px 0;
  }
  
  .green-03af img {
    height: 28px;
    width: auto;
  }
  
  .frame_wide_ce75 {
    display: none !important;
  }
  
  .nav_e97a {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .nav_e97a svg {
    width: 14px;
    height: 14px;
  }
  
  .tertiary_lower_b060 {
    padding: 6px;
  }
  
  .texture_9182 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .badge_e971,
  .button_4ab8,
  .module_steel_5ec7,
  .photo_pink_fbc3,
  .over-5e50,
  .media-first-43c5,
  .video_under_d8a5,
  .block_f14a,
  .picture-focused-1318,
  .info_cool_bc84,
  .photo_upper_e314,
  .tall-04ee {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .frame_hot_597e,
  .module-west-4fda {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .tertiary-motion-571d,
  .hidden-action-3862,
  .carousel-cold-9635,
  .slider-ba90,
  .focus-d8d2,
  .cool_4a6f,
  .soft-3823 {
    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 */
  .pro-21e0,
  .title_center_8c0d,
  .left_b61c,
  .tag-6037,
  .heading-755f {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .title_focused_721d,
  .bronze_6fb6,
  .selected_7eba,
  .container_focused_752d {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .tooltip-bright-2580,
  .pro_fc09 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .dim_dadf,
  .motion-1519,
  .photo_bright_8b84,
  .grid_b10c {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .complex_5512,
  .focused-6e03,
  .status-steel-5d57,
  .form-liquid-2854,
  .glass-25af,
  .logo-iron-f0d9 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .pro-21e0,
  .title_center_8c0d,
  .tag-6037 {
    max-width: none !important;
  }
  
  .sort_blue_9fb2 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .title_focused_721d {
    font-size: 1.5rem !important;
  }
  
  .bronze_6fb6 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .chip_easy_853a,
  .iron-86b4 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .selected_7eba {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .grid-hard-305c {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .card_large_3479 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .pro-21e0,
  .tag-6037 {
    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: 10a0 */
.widget-item-q1 {
  padding: 0.2rem;
  font-size: 12px;
  line-height: 1.0;
}
