/* all mobiles and tablets */
@media (-moz-touch-enabled), (pointer:coarse), (hover:none) {
  .mobile-only { display: inline-block; }
  .desktop-only { display: none!important; }
  input { -webkit-appearance: none; }

  .mobile-popup-close-btn {
    position: absolute;
    top: 12vmin;
    right: 12vmin;
    width: 20px;
    height: 20px;
    background-image: url("../images/close-icon.png");
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
  }

  #controls-wrap-mobile {
    display: inline-flex;
    position: absolute;
    top: 6px;
    left: 0;
    right: 0;
    margin-left: auto;
    margin-right: auto;
    height: 36px;
    width: 120px;
    justify-content:center;
  }

  .popup-content {
    text-align: justify;
  }
}

/* all mobiles and tablets */
@media (-moz-touch-enabled), (pointer:coarse), (hover:none)
  and (orientation : portrait) {
  #hotspot-grid-1,
  #hotspot-grid-2,
  #hotspot-grid-15,
  #hotspot-grid-18,
  #hotspot-grid-22 { grid-template-columns: 1fr!important; }

  #hotspot-grid-15 div:nth-child(1) { order: 1;}
  #hotspot-grid-15 div:nth-child(2) { display: none; }
  #hotspot-grid-15 div:nth-child(3) { order: 3;}
  #hotspot-grid-15 div:nth-child(4) { order: 2;}
  #hotspot-grid-15 div:nth-child(5) {display: none;}
  #hotspot-grid-15 div:nth-child(6) { order: 4;}
}

/* possibly all phones, no tablets */
@media only screen and (max-width: 820px) {
  body { margin: 0; }
}

/* iPhone X */
@media only screen
and (min-device-width : 375px)
and (max-device-width : 812px)
and (-webkit-device-pixel-ratio : 3)
and (orientation : landscape) {
  #splash h2 { margin-bottom: 2em!important; }
  #gallery .popup-content { width: 44vmax; }
  #gallery-thumbs { grid-column-gap: 10vmin; }
  .popup-content { font-size: 0.8em; }

  .social-btn {
    width: 8vh!important;
    height: 8vh!important;
  }

  .pano-btn {
    width: 6vh!important;
    height: 12vh!important;
  }
}

@media only screen
and (min-device-width : 375px)
and (max-device-width : 812px)
and (-webkit-device-pixel-ratio : 3)
and (orientation : portrait) {
}

/* Samsung S8 */
@media only screen
and (device-width : 360px)
and (orientation : portrait) {
}

@media only screen
and (device-height : 360px)
and (orientation : landscape) {

  #version-switch { bottom: 72px!important; }
  footer { height: 66px!important; }
  .control {
    height: 36px!important;
    width: 36px!important;
  }
}

/* iPhone 8 */
@media only screen
    and (device-width : 375px)
    and (device-height : 667px)
    and (-webkit-device-pixel-ratio : 2) {
}

/* iPhone 8 Plus */
@media only screen
    and (device-width : 414px)
    and (device-height : 736px)
    and (-webkit-device-pixel-ratio : 3) {
}

/* iphone 6 and friends */
@media only screen and (max-width: 720px) and (orientation: portrait)  {
  h2 { font-size: 1.3em; }

  header {
    top: 2vmax;
    left: 3vmax;
    height: 8vmax;
  }

  .popup-content { width: 90vw; }
  .version-select { width: 24vmin; }
  #splash-btn-container { width: 100%; }

  #version-switch {
    right: 12px;
    bottom: 60px;
    font-size: 0.8em;
  }
  footer { height: 54px; }
  #navigation, #current-pano {
    bottom: 10px;
    font-weight: bold;
  }
  #current-pano { left: 12px; }
  #navigation   { right: 12px; }
  #info-btn, #navigate-btn {
    width:  32px;
    height: 32px;
  }

  #credits {
    padding-bottom: 2px;
    font-size: 9px;
  }

  #navigation, #current-pano { font-size: 0.8em; }

  .control {
    height: 28px;
    width: 28px;
  }
}

@media only screen and (max-width: 720px) and (orientation: landscape)  {
  #splash-btn-container { width: 100%; }
  .version-select {
    height: 20vmin;
    width: 40vmin;
  }

  #gallery .popup-content { width: 44vmax; }
  #gallery-thumbs { grid-column-gap: 10vmin; }
  .popup-content { font-size: 0.8em; }

  #version-switch {
    right: 12px;
    bottom: 72px;
    font-size: 0.8em;
  }
  footer { height: 68px; }
  .control {
    height: 36px;
    width: 36px;
  }
}

/* ipad */
@media only screen
  and (min-device-width : 768px)
  and (max-device-width : 1024px)
{
  #splash-btn-container { width: 100%; }
  #splash h2 { margin-bottom: 4em; }
  #splash p { font-size: 1.2em; }

  header {
    top: 18px;
    left: 32px;
  }
  #version-switch {
    right: 12px;
    bottom: 60px;
  }
  footer { height: 54px; }
  #navigation, #current-pano {
    bottom: 10px;
    font-weight: bold;
  }
  #current-pano { left: 12px; }
  #navigation   { right: 12px; }
  #info-btn, #navigate-btn {
    width:  32px;
    height: 32px;
  }

  .pano-btn {
    width: 3vh;
    height: 6vh;
  }

  .social-btn {
    width: 4.5vh;
    height: 4.5vh;
  }
  #social-wrap { bottom: 62.5vh; }

  .control {
    height: 28px;
    width: 28px;
  }
}

@media only screen
  and (min-device-width : 768px)
  and (max-device-width : 1024px)
  and (orientation : portrait) {
  #splash-btn-container { justify-content: space-between; }
}

@media only screen
  and (min-device-width : 768px)
  and (max-device-width : 1024px)
  and (orientation : landscape) {
}
