/* ============================================
   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 (.photo-hot-f40d) is a descendant of
   .menu-ee75 (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.article_41ea {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".full-bcff" 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.gold_f481 so it can't cause
   horizontal overflow anyway. */
.old-c06e,
.last-8774,
.title-f6b4,
.item_0f61,
.description-c571,
.frame_eb83,
.info_brown_295f,
.info_wood_9a3a,
.inner_ec52,
.panel-36c5,
.slider_9399 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .wide_1398 {
    padding: 8px 0;
  }
  
  .image_under_418e img {
    height: 28px;
    width: auto;
  }
  
  .backdrop_lite_b712 {
    display: none !important;
  }
  
  .progress-black-6475 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .progress-black-6475 svg {
    width: 14px;
    height: 14px;
  }
  
  .brown_9c3c {
    padding: 6px;
  }
  
  .section-orange-3e06 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .title-f6b4,
  .last-8774,
  .item_0f61,
  .description-c571,
  .cold_0f94,
  .gallery-lite-b595,
  .button_green_6fbc,
  .avatar_top_5777,
  .message_e78a,
  .background-b668,
  .active_335c,
  .aside_764e {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .paper_5678,
  .carousel-hard-444a {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .surface_5572,
  .prev-cb9b,
  .texture_old_c0ab,
  .black-4454,
  .logo_2ee7,
  .menu_8438,
  .dim_e135 {
    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 */
  .text_42a3,
  .orange_b575,
  .slider-west-b12e,
  .summary-994c,
  .mini_057c {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .tag-orange-0207,
  .overlay-7df3,
  .tooltip_f50e,
  .paragraph-0d89 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .under_fc23,
  .primary-north-7b9b {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .light_8239,
  .chip-c3bd,
  .layout_red_01ce,
  .pattern-10da {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .link-hovered-5d18,
  .text_center_2952,
  .surface_6e3f,
  .brown-27f1,
  .notification-bottom-e2d4,
  .photo_6ba1 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .text_42a3,
  .orange_b575,
  .summary-994c {
    max-width: none !important;
  }
  
  .full-bcff {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .tag-orange-0207 {
    font-size: 1.5rem !important;
  }
  
  .overlay-7df3 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .first_26f8,
  .header_1906 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .tooltip_f50e {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .shadow-bronze-b965 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .title-979a {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .text_42a3,
  .summary-994c {
    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: cf0b */
.ghost-box-b8 {
  padding: 0.1rem;
  font-size: 12px;
  line-height: 1.1;
}
