/* ============================================
   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 (.focused_0706) is a descendant of
   .card-345c (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.wide_8115 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".focused-a9de" 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.out_d150 so it can't cause
   horizontal overflow anyway. */
.paragraph-wide-72cb,
.silver_d2b5,
.north_54c4,
.prev-5133,
.popup_104f,
.disabled-lite-a7c6,
.badge-up-bdad,
.article-top-cbb0,
.avatar_89d7,
.element-simple-2463,
.focus-glass-0752 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .shadow-brown-5a32 {
    padding: 8px 0;
  }
  
  .banner_stone_5173 img {
    height: 28px;
    width: auto;
  }
  
  .picture-tall-7bf9 {
    display: none !important;
  }
  
  .section-up-a60a {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .section-up-a60a svg {
    width: 14px;
    height: 14px;
  }
  
  .gallery-665a {
    padding: 6px;
  }
  
  .main_action_1d49 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .north_54c4,
  .silver_d2b5,
  .prev-5133,
  .popup_104f,
  .frame_dim_49e4,
  .hidden_complex_958c,
  .table-thick-d217,
  .left_585b,
  .over-dfa9,
  .block-hard-aaa4,
  .center_b653,
  .modal-d0a3 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .tertiary-fixed-2c01,
  .stone_8189 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .paper_97c6,
  .caption_fast_d0c7,
  .over_f52c,
  .secondary-43e5,
  .notification-smooth-8335,
  .breadcrumb_f219,
  .item-1a5f {
    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 */
  .complex_9cb7,
  .clean-80f4,
  .advanced_b6c2,
  .pressed_fcdd,
  .shade_in_19fb {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .badge_d2e1,
  .message_7f32,
  .footer_6ab8,
  .active_6871 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .thumbnail_slow_849d,
  .preview_a93e {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .purple_b0b9,
  .medium-73cd,
  .element_a893,
  .medium-e197 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .paper_d34d,
  .thumbnail_150e,
  .column-8a0b,
  .bronze_f58a,
  .wood_3d33,
  .modal-2160 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .complex_9cb7,
  .clean-80f4,
  .pressed_fcdd {
    max-width: none !important;
  }
  
  .focused-a9de {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .badge_d2e1 {
    font-size: 1.5rem !important;
  }
  
  .message_7f32 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .tall-bda2,
  .article-b77d {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .footer_6ab8 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .accordion-9943 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .backdrop-6ab2 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .complex_9cb7,
  .pressed_fcdd {
    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: 8299 */
.shadow-element-m8 {
  padding: 0.3rem;
  font-size: 12px;
  line-height: 1.0;
}
