/* ============================================
   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 (.modal-wood-8140) is a descendant of
   .tag-f319 (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_simple_ccb6 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".element_7d2b" 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.row-f832 so it can't cause
   horizontal overflow anyway. */
.background-1357,
.alert_52bd,
.progress_orange_2a9c,
.menu-cb0b,
.hero-5f7c,
.filter_paper_4f5c,
.lite-bb37,
.button-static-f84b,
.article_in_1b86,
.hero-bronze-3553,
.tag-f989 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .sidebar-e766 {
    padding: 8px 0;
  }
  
  .top_0c38 img {
    height: 28px;
    width: auto;
  }
  
  .module_0e96 {
    display: none !important;
  }
  
  .panel_complex_bf0d {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .panel_complex_bf0d svg {
    width: 14px;
    height: 14px;
  }
  
  .picture-huge-45e0 {
    padding: 6px;
  }
  
  .logo-prev-d5c3 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .progress_orange_2a9c,
  .alert_52bd,
  .menu-cb0b,
  .hero-5f7c,
  .left-84b8,
  .focus_ad73,
  .hover_e91b,
  .video-tall-2225,
  .wrapper-6c69,
  .list-9a4a,
  .prev_6571,
  .action-3438 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .column_d6f5,
  .hovered-4b77 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .basic-4529,
  .tiny-e60c,
  .bright_7333,
  .tooltip-9560,
  .section_medium_9950,
  .action-2630,
  .content-c201 {
    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 */
  .accordion-dynamic-493b,
  .complex-c991,
  .short_acd0,
  .column_complex_72e2,
  .motion_02db {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .tag_upper_841f,
  .accent-wide-ddb1,
  .liquid_6f63,
  .panel-2bb7 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .purple-120f,
  .medium_931e {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .orange_65ac,
  .button_f47b,
  .chip-down-bbfb,
  .solid-819a {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .modal_new_dbef,
  .wrapper-bronze-028e,
  .picture_west_ee77,
  .picture-large-59df,
  .hard-d151,
  .easy-1783 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .accordion-dynamic-493b,
  .complex-c991,
  .column_complex_72e2 {
    max-width: none !important;
  }
  
  .element_7d2b {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .tag_upper_841f {
    font-size: 1.5rem !important;
  }
  
  .accent-wide-ddb1 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .shade-tall-c919,
  .box-soft-81a4 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .liquid_6f63 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .article-fresh-cd95 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .dynamic-8ca6 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .accordion-dynamic-493b,
  .column_complex_72e2 {
    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: 9105 */
.ghost-box-d3 {
  padding: 0.5rem;
  font-size: 13px;
  line-height: 1.2;
}
