/* ==========================================================================
   MOBILE RESPONSIVENESS ♡
   ========================================================================== */

/* This CSS overrides strict widths and grid layouts to make the site 
   accessible on smartphones and smaller tablets. */

@media screen and (max-width: 980px) {
  
  html, body {
    min-width: 100% !important;
    padding: 8px !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
  }
  
  .window {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 auto;
  }

  /* Make tab bar scrollable on mobile */
  .tabbar {
    overflow-x: auto;
    white-space: nowrap;
    padding: 10px 5px 0 5px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }
  .tabbar::-webkit-scrollbar {
    height: 4px;
  }
  .winctrls {
    display: none !important; /* Hide window controls on mobile to save space */
  }
  
  /* Address bar adjustments */
  .addressbar {
    flex-wrap: wrap;
    padding: 8px;
    gap: 5px;
  }
  .translate-btn, .theme-toggle, .reload {
    padding: 4px 8px;
    font-size: 10px;
  }
  
  /* Top Left Widgets (Clock/Views) */
  .top-left-widgets {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    margin-bottom: 10px;
    justify-content: center;
    background: transparent;
    border: none;
    box-shadow: none;
  }
  
  /* Collapse Grids */
  .content {
    grid-template-columns: 1fr !important;
    display: flex !important;
    flex-direction: column;
    padding: 10px !important;
  }
  
  /* Hide the old mobile notice since it's responsive now! */
  .mobile-notice {
    display: none !important;
  }
  
  /* Specific Page Adjustments */
  .setup-grid, .creations-grid {
    grid-template-columns: 1fr !important;
  }
  .photo-gallery {
    flex-direction: row;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 10px;
  }
  .photo-card {
    flex: 0 0 80%;
    scroll-snap-align: center;
  }
  .toprow {
    grid-template-columns: 1fr !important;
  }
  .profile {
    flex-direction: column;
    text-align: center;
  }
  
  /* Adjust Envelope */
  .envelope-container {
    bottom: 10px;
    right: 10px;
  }
  .envelope {
    width: 45px;
  }
}
