/* ============================================================
   Skeleton Loading — Plaenge Chile
   Aplica-se a qualquer contêiner com classe .img-skeleton
   e ao elemento .fotoGaleria / .fotoLugarInteres com bg-image.
   ============================================================ */

@keyframes skeleton-shimmer {
  0%   { background-position: -800px 0; }
  100% { background-position:  800px 0; }
}

/* Contêiner genérico (figure, div, span...) */
.img-skeleton {
  position: relative;
  overflow: hidden;
  background: #e8e8e8;
}

.img-skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0)   0%,
    rgba(255,255,255,0.55) 50%,
    rgba(255,255,255,0)   100%
  );
  background-size: 800px 100%;
  animation: skeleton-shimmer 1.4s infinite linear;
  pointer-events: none;
  z-index: 1;
}

/* Ocultar imagem enquanto carrega (evita flash de alt-text) */
.img-skeleton > img,
.img-skeleton img:first-of-type {
  opacity: 0;
  transition: opacity 0.35s ease;
}

/* Quando removemos a classe, imagem aparece suavemente */
.img-skeleton-done > img,
.img-skeleton-done img:first-of-type {
  opacity: 1;
}

/* Fundo bg-image (fotoGaleria, fotoLugarInteres) */
.fotoGaleria.img-skeleton,
.fotoLugarInteres.img-skeleton {
  background-color: #e8e8e8 !important;
  background-image: none !important;
}

/* iframe placeholder (vídeos YouTube/Vimeo) */
.iframe-skeleton {
  position: relative;
  overflow: hidden;
  background: #d8d8d8;
  min-height: 200px;
}

.iframe-skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0)   0%,
    rgba(255,255,255,0.45) 50%,
    rgba(255,255,255,0)   100%
  );
  background-size: 800px 100%;
  animation: skeleton-shimmer 1.4s infinite linear;
  pointer-events: none;
  z-index: 1;
}

.iframe-skeleton > iframe {
  opacity: 0;
  transition: opacity 0.35s ease;
  width: 100%;
  height: 100%;
}

.iframe-skeleton-done > iframe {
  opacity: 1;
}

/* Opera: figure já tem aspect-ratio via slick */
figure.img-skeleton {
  display: block; /* garante que position:relative funcione */
}
