/* Loading wheel for bike and inspector photos.
   Driven by static/photo-loader.js, which adds these classes to the element
   that holds each photo (tile, slide, thumbnail, lightbox stage) while the
   photo downloads. Self-contained (own colours, "tab-ph-" prefix) so it works
   the same on marketing.css, style.css and partner.css pages. */

.tab-ph-rel { position: relative; }

/* Hide the half-drawn image (and its alt text) until it has arrived. */
.tab-ph-loading > img.tab-ph-img,
.tab-ph-failed > img.tab-ph-img { opacity: 0; }
img.tab-ph-img { transition: opacity .25s ease; }

.tab-ph-loading::before,
.shot-tile.is-busy::before {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 30px; height: 30px;
  margin: -15px 0 0 -15px;
  border-radius: 50%;
  border: 3px solid rgba(128, 128, 128, .25);
  border-top-color: #2E7D4F;
  animation: tab-ph-spin .8s linear infinite;
  z-index: 2;
  pointer-events: none;
}

.tab-ph-failed::before {
  content: "Photo unavailable";
  position: absolute;
  top: 50%; left: 0; right: 0;
  transform: translateY(-50%);
  text-align: center;
  font: 500 12px/1.3 'Inter', sans-serif;
  color: #8A8577;
  pointer-events: none;
}

/* Uploading a photo slot: the tile already dims (style.css); add the wheel. */
.shot-tile.is-busy { position: relative; }

@keyframes tab-ph-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .tab-ph-loading::before,
  .shot-tile.is-busy::before { animation-duration: 2.4s; }
}
