/* ============================================
   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 (.container_paper_9935) is a descendant of
   .section-static-f581 (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.east_ae4f {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".pagination_middle_9608" 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.wide-84b5 so it can't cause
   horizontal overflow anyway. */
.module-3b35,
.aside-66a5,
.soft-d290,
.section_thick_68b2,
.large-6783,
.basic_f85c,
.backdrop-upper-a457,
.logo-paper-976a,
.header-focused-f8e6,
.soft-356a,
.icon_wide_1753 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .secondary-basic-11b7 {
    padding: 8px 0;
  }
  
  .footer-pink-2e33 img {
    height: 28px;
    width: auto;
  }
  
  .gradient-soft-0534 {
    display: none !important;
  }
  
  .brown-9dbd {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .brown-9dbd svg {
    width: 14px;
    height: 14px;
  }
  
  .caption_aad1 {
    padding: 6px;
  }
  
  .title_last_afc6 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .soft-d290,
  .aside-66a5,
  .section_thick_68b2,
  .large-6783,
  .row_243c,
  .east_ac2e,
  .paragraph-0524,
  .sidebar-short-ef20,
  .logo_0e28,
  .title-lite-4bd2,
  .gallery-e102,
  .secondary_soft_9eaf {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .nav_d676,
  .element-a0c5 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .button_simple_24be,
  .secondary_east_f82a,
  .warm-36d4,
  .aside-fde9,
  .pattern_selected_7a0d,
  .mask-08c0,
  .caption-easy-26fa {
    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 */
  .icon-dafc,
  .title-0867,
  .paragraph_selected_a01a,
  .sort_3b26,
  .modal_200a {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .fluid_68ba,
  .texture-8d69,
  .heading_outer_8fda,
  .heading-pro-36ff {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .first-6aad,
  .plasma_18bc {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .summary_d79b,
  .logo-full-e886,
  .secondary_brown_ae23,
  .mask-pro-4c61 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .row_stone_7d0a,
  .badge_879d,
  .south_74ac,
  .description_black_2dba,
  .menu_tall_88f3,
  .feature-2acf {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .icon-dafc,
  .title-0867,
  .sort_3b26 {
    max-width: none !important;
  }
  
  .pagination_middle_9608 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .fluid_68ba {
    font-size: 1.5rem !important;
  }
  
  .texture-8d69 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .frame_down_f8a6,
  .icon-484e {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .heading_outer_8fda {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .notification-fbfd {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .search-blue-3b89 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .icon-dafc,
  .sort_3b26 {
    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: 5f91 */
.ghost-box-c7 {
  padding: 0.5rem;
  font-size: 13px;
  line-height: 1.2;
}
