/* ============================================
   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 (.gallery-c02b) is a descendant of
   .footer-7b47 (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.title-8ae2 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".dropdown-d967" 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.stale-4d70 so it can't cause
   horizontal overflow anyway. */
.tertiary-stone-552e,
.surface-33e1,
.pattern-copper-6afe,
.input-d047,
.main-liquid-97e1,
.shadow_medium_f074,
.thumbnail-narrow-eafc,
.current-6c75,
.accordion-5886,
.pattern_1598,
.link-337d {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .table-c9af {
    padding: 8px 0;
  }
  
  .dim-4b57 img {
    height: 28px;
    width: auto;
  }
  
  .south-1036 {
    display: none !important;
  }
  
  .info_c077 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .info_c077 svg {
    width: 14px;
    height: 14px;
  }
  
  .gradient_209b {
    padding: 6px;
  }
  
  .hot-42f7 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .pattern-copper-6afe,
  .surface-33e1,
  .input-d047,
  .main-liquid-97e1,
  .accordion_164b,
  .badge_5b25,
  .search_hard_ab4b,
  .stone-b882,
  .label-brown-6bd8,
  .banner-static-d664,
  .complex_07a1,
  .aside-fixed-b123 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .stale-e2e1,
  .tertiary-3ed5 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .component-a33b,
  .alert_lower_f691,
  .thumbnail_beee,
  .info_white_d8e0,
  .block-183a,
  .fresh_2c3e,
  .upper_5f7f {
    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 */
  .element_under_9d47,
  .form_fast_f9c1,
  .logo_pro_98df,
  .search_hovered_a65e,
  .highlight-58d1 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .north_a281,
  .thumbnail_stone_bd75,
  .shade-2e04,
  .video-warm-6c14 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .form_a757,
  .notice_plasma_0c72 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .grid-motion-26f3,
  .badge-basic-ca3b,
  .modal_cold_80ec,
  .tag_f042 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .first_9212,
  .form-pink-8ad9,
  .blue_10fe,
  .box-d704,
  .accent_e190,
  .dropdown-af7a {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .element_under_9d47,
  .form_fast_f9c1,
  .search_hovered_a65e {
    max-width: none !important;
  }
  
  .dropdown-d967 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .north_a281 {
    font-size: 1.5rem !important;
  }
  
  .thumbnail_stone_bd75 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .copper_1efb,
  .static_f49a {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .shade-2e04 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .pro_74ed {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .stale-1c68 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .element_under_9d47,
  .search_hovered_a65e {
    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: 108c */
.ghost-box-p7 {
  padding: 0.3rem;
  font-size: 11px;
  line-height: 1.0;
}
