/* ============================================
   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 (.gradient-8e60) is a descendant of
   .narrow_798c (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.
   Two site templates coexist: legacy obfuscated-class (header.info-d86d)
   and the redesigned template (header.texture_hard_bfc7). Keep both selectors. */
header.info-d86d,
header.texture_hard_bfc7 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".focus_large_9816" 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.image-plasma-00b3 so it can't cause
   horizontal overflow anyway. */
.modal_05d1,
.purple_4f85,
.highlight_brown_978d,
.content-dark-97d2,
.section-7da3,
.secondary-4a77,
.module_dc6c,
.summary-2e62,
.mask-e3f3,
.pro-da8b,
.bright_2b7f {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .motion_7e19 {
    padding: 8px 0;
  }
  
  .content_2204 img {
    height: 28px;
    width: auto;
  }
  
  .right_6af1 {
    display: none !important;
  }
  
  .detail_south_84d6 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .detail_south_84d6 svg {
    width: 14px;
    height: 14px;
  }
  
  .hard_0cc7 {
    padding: 6px;
  }
  
  .icon-purple-1207 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .highlight_brown_978d,
  .purple_4f85,
  .content-dark-97d2,
  .section-7da3,
  .next_ed10,
  .shadow-medium-dbba,
  .info-fixed-fbe7,
  .picture_complex_32cb,
  .mask_iron_d106,
  .south_b4fc,
  .highlight_wood_0492,
  .accordion-4bf0 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .fresh-6600,
  .banner-in-f12e {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .fast-2f85,
  .carousel-plasma-4b7a,
  .popup_0565,
  .card_bf31,
  .outer_e352,
  .sidebar_dim_d1f8,
  .focused_aadb {
    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 */
  .menu_smooth_b58c,
  .mask_13bc,
  .summary-1ab0,
  .logo_dd5e,
  .table_selected_fa58 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .button_b02d,
  .pro-d731,
  .texture_tiny_731a,
  .medium-b113 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .container-top-267f,
  .north_da2f {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .tertiary_8db3,
  .texture-7130,
  .logo-fixed-6508,
  .container_basic_fd59 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .video_29fc,
  .purple-102c,
  .sidebar-over-cf40,
  .stale_36d5,
  .box_e6eb,
  .sort_7d8f {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .menu_smooth_b58c,
  .mask_13bc,
  .logo_dd5e {
    max-width: none !important;
  }
  
  .focus_large_9816 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .button_b02d {
    font-size: 1.5rem !important;
  }
  
  .pro-d731 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .hidden_e429,
  .hidden_last_f8aa {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .texture_tiny_731a {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .link-glass-88a1 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .photo_dc55 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .menu_smooth_b58c,
  .logo_dd5e {
    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: 94a5 */
.table_basic_e780 {
  padding: 0.1rem;
  font-size: 10px;
  line-height: 1.2;
}

/* css-noise: 8c55 */
.ghost-box-e2 {
  padding: 0.2rem;
  font-size: 11px;
  line-height: 1.1;
}
