/* ============================================
   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 (.preview_fluid_7468) is a descendant of
   .text_dark_409a (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.gallery_da57 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".dropdown_ca79" 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.card_ffd6 so it can't cause
   horizontal overflow anyway. */
.header-active-add6,
.article_blue_fa01,
.highlight_small_d2c5,
.dirty_7072,
.search-mini-7f2a,
.header-9237,
.detail-warm-58ca,
.table_f579,
.light_efca,
.picture-b41c,
.icon-83f4 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .wide_5e53 {
    padding: 8px 0;
  }
  
  .paper_bff9 img {
    height: 28px;
    width: auto;
  }
  
  .down-df77 {
    display: none !important;
  }
  
  .accordion-gas-13f4 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .accordion-gas-13f4 svg {
    width: 14px;
    height: 14px;
  }
  
  .next-2cd1 {
    padding: 6px;
  }
  
  .selected-2273 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .highlight_small_d2c5,
  .article_blue_fa01,
  .dirty_7072,
  .search-mini-7f2a,
  .widget-top-59a4,
  .photo-brown-e1ca,
  .widget_active_c75f,
  .grid-motion-bff9,
  .light-83ac,
  .menu-white-8ff7,
  .inner-cfe4,
  .sidebar_416a {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .box-center-ad86,
  .tertiary-564c {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .old_ea7b,
  .detail_hovered_9096,
  .picture_basic_37a6,
  .content-solid-3ab6,
  .row-b6a5,
  .nav-glass-73a8,
  .gallery_clean_8cc8 {
    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 */
  .advanced_ea99,
  .black_977c,
  .background_af09,
  .accordion_ddc1,
  .fast-2906 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .picture_in_06cf,
  .prev_b61c,
  .row_old_52df,
  .old-81a9 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .module-motion-65d9,
  .black_833c {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .message-fluid-b278,
  .surface_tiny_8c1a,
  .row-8f5f,
  .feature-ae6d {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .frame-under-e0ec,
  .glass_aada,
  .static_817f,
  .gas_139b,
  .inner-40d4,
  .footer_iron_8520 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .advanced_ea99,
  .black_977c,
  .accordion_ddc1 {
    max-width: none !important;
  }
  
  .dropdown_ca79 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .picture_in_06cf {
    font-size: 1.5rem !important;
  }
  
  .prev_b61c {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .header-6d35,
  .pattern-b82d {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .row_old_52df {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .heading_pro_6fc5 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .wide-2fc1 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .advanced_ea99,
  .accordion_ddc1 {
    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: d66b */
.ghost-box-r8 {
  padding: 0.3rem;
  font-size: 12px;
  line-height: 1.1;
}
