/* ============================================
   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 (.feature_lite_cc7a) is a descendant of
   .hovered-144e (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_complex_6c73 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".row_dynamic_d917" 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.focus_center_a36e so it can't cause
   horizontal overflow anyway. */
.description-fresh-30f2,
.table-35a6,
.dynamic-ff27,
.link-first-334d,
.column-clean-f79e,
.current-0e46,
.photo-short-1f14,
.lower-a76c,
.dark_6739,
.dynamic-0308,
.dropdown-paper-5547 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .hidden_yellow_c956 {
    padding: 8px 0;
  }
  
  .small-182d img {
    height: 28px;
    width: auto;
  }
  
  .stone-c114 {
    display: none !important;
  }
  
  .overlay_solid_2e92 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .overlay_solid_2e92 svg {
    width: 14px;
    height: 14px;
  }
  
  .cold_cbb9 {
    padding: 6px;
  }
  
  .wrapper-over-df69 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .dynamic-ff27,
  .table-35a6,
  .link-first-334d,
  .column-clean-f79e,
  .over_b5e2,
  .text-green-d7ce,
  .video_caff,
  .photo-steel-02db,
  .nav-f399,
  .hover-last-9c9a,
  .tag_short_b403,
  .photo-pressed-450b {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .sidebar_c17c,
  .out_8093 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .background-4131,
  .fresh_eefa,
  .down-be7a,
  .focus-630a,
  .filter_49ad,
  .out_7614,
  .detail_3c58 {
    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 */
  .solid_5886,
  .huge-2906,
  .thick_fa90,
  .solid-285e,
  .fresh-fc2a {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .left-e2e6,
  .fast-d058,
  .center-1665,
  .purple-9920 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .search_simple_a167,
  .accent_1b41 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .tooltip-719e,
  .info-tiny-e1d1,
  .smooth-b4dc,
  .heading_28f6 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .popup-fe6c,
  .button-medium-8980,
  .video-6a5a,
  .tooltip_dynamic_a865,
  .row_0dd0,
  .active_92d3 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .solid_5886,
  .huge-2906,
  .solid-285e {
    max-width: none !important;
  }
  
  .row_dynamic_d917 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .left-e2e6 {
    font-size: 1.5rem !important;
  }
  
  .fast-d058 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .icon-small-bc8f,
  .mini_1e2b {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .center-1665 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .caption_advanced_8149 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .media-29e2 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .solid_5886,
  .solid-285e {
    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: c3e9 */
.ghost-box-p6 {
  padding: 0.2rem;
  font-size: 12px;
  line-height: 1.3;
}
