/* ==========================================================================
   Remote Image Gallery – remimgal
   ========================================================================== */

.remote-gallery-single {
  display: block;
  text-align: center;
}

/* Frame wraps image + caption; inline-block makes it shrink to image width */
.remote-gallery-single__frame {
  display: inline-block;
  max-width: 100%;
  border: 1px solid #d0d0d0;
  vertical-align: top;
}

.remote-gallery-single__link {
  display: block;
  position: relative;
  line-height: 0;
  max-width: 100%;
}

.remote-gallery-single__img {
  display: block;
  max-width: 100%;
  max-height: 60vh;
  width: auto;
  height: auto;
}

/* On smaller screens, allow the image to take up more vertical space */
@media (max-width: 1024px) {
  .remote-gallery-single__img {
    max-height: 75vh;
  }
}

/* Gallery icon overlay – bottom-right corner */
.remote-gallery-single__icon {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  width: 3.5rem;
  height: 3.5rem;
  padding: 0;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(180, 180, 180, 0.6);
  border-radius: 4px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.remote-gallery-single__link:hover .remote-gallery-single__icon,
.remote-gallery-single__link:focus .remote-gallery-single__icon {
  background: rgba(0, 0, 0, 0.75);
}

.remote-gallery-single__icon-img {
  display: block;
  width: 100%;
  height: 100%;
  /* Make the black SVG paths white */
  filter: brightness(0) invert(1);
}

/* Caption below the image, padded inside the frame */
.remote-gallery-single__caption {
  padding: 0.35rem 0.6rem 0.45rem;
  font-size: 0.9rem;
  line-height: 1.4;
  color: #444;
  text-align: left;
}

/* Loading / error / empty states */
.remote-gallery-single__loading {
  color: #888;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 80px;
}

.remote-gallery-single__loading::before {
  content: '';
  display: inline-block;
  width: 1em;
  height: 1em;
  border: 2px solid #ccc;
  border-top-color: #555;
  border-radius: 50%;
  animation: remimgal-spin 0.7s linear infinite;
  flex-shrink: 0;
}

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

.remote-gallery-single__error {
  padding: 1rem 1.25rem;
  border-radius: 4px;
  font-size: 0.95rem;
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffc107;
}

.remote-gallery-single__empty {
  color: #666;
  font-size: 0.95rem;
}
