/* Mobile-responsive + modern-nav overlay for iphonerestored.com.
   Loaded on every page after the recovered Google-Sites "iceberg" theme stylesheet,
   so these rules win by source order without needing !important everywhere.
   Two parts:
     1. .site-nav -- a real, semantic <nav><ul> tab bar (see nav.html fragment /
        every page's own markup) that replaces the old .sites-header-nav div/ul
        soup. Same visual design (gray rounded tabs, blue current/hover highlight,
        #03c link color) as the original, but it's flexbox-native so it wraps
        consistently on any viewport without a separate mobile-only override --
        that inconsistency (8-10 different stale nav variants across the site,
        one even linking Home to a dead external sites.google.com URL) was the
        actual bug being fixed here.
     2. The @media block below still handles the rest of the legacy page body
        (fixed-width tables/images inherited from the old theme) on narrow
        screens -- unchanged from the original mobile-responsive pass. */

.site-nav {
  margin: 0;
  padding: 8px 8px 0;
  background: #fff;
}

.site-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
}

.site-nav li {
  margin: 0;
  list-style: none;
  list-style-type: none;
  list-style-image: none;
}

.site-nav a {
  display: block;
  padding: 4px 10px;
  border-top-left-radius: 3px;
  border-top-right-radius: 3px;
  box-shadow: 0 0 4px #777;
  background: #fff;
  color: #03c;
  text-decoration: none;
  font: 13px Arial, sans-serif;
  white-space: nowrap;
}

.site-nav a:hover,
.site-nav a:focus,
.site-nav a[aria-current="page"] {
  background: #68e;
  color: #fff;
}

.site-nav a[aria-current="page"] {
  font-weight: bold;
}

@media screen and (max-width: 800px) {
  .site-nav ul {
    justify-content: center;
  }
  .site-nav a {
    font-size: 0.85em;
    padding: 5px 8px;
  }
}

@media screen and (max-width: 800px) {

  /* Images: several pages hardcode pixel width="..."/height="..." attributes (e.g.
     iphone-7.html's 320px/158px phone photos) that overflow a narrow viewport.
     max-width caps them at the container width without upscaling anything smaller. */
  img {
    max-width: 100%;
    height: auto;
  }

  /* The two/three-column page layouts (sites-layout-name-two-column on every model
     detail page, sites-layout-name-three-column-hf on the homepage) render as a
     <table class="sites-layout-hbox"><tr><td class="sites-layout-tile">...design.
     Stack the cells vertically instead of side-by-side so nothing gets squeezed. */
  table.sites-layout-hbox,
  table.sites-layout-hbox tbody,
  table.sites-layout-hbox tr {
    display: block;
    width: 100%;
  }
  table.sites-layout-hbox td.sites-layout-tile {
    display: block;
    width: 100% !important;
    box-sizing: border-box;
    text-align: center;
  }

  /* The overall page wrapper and canvas sometimes carry fixed min-widths inherited
     from the desktop theme -- relax those so content can actually shrink to fit. */
  #sites-chrome-everything,
  #sites-chrome-page-wrapper,
  #sites-chrome-main-wrapper,
  #sites-canvas-wrapper,
  #sites-canvas,
  #sites-canvas-main,
  #sites-canvas-main-content {
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  table#sites-chrome-main,
  table#sites-chrome-header {
    width: 100% !important;
  }

  /* PayPal embed + credit-card-logo banners are fixed-width decorative blocks --
     let them shrink with the column instead of pushing it wide. */
  .site-code-embed-container {
    width: 100% !important;
    max-width: 400px;
    margin: 0 auto;
  }
}
