/* ===============================
 *  Galería en el frontend
 * =============================== */

.trex-tour-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 16px;
  position: relative;
}

.trex-tour-gallery__item {
  position: relative;
  flex: 1;
}
.trex-tour-gallery__item:nth-child(2),
.trex-tour-gallery__item:nth-child(3) {
  display: none;
}

.trex-tour-gallery__link {
  display: block;
  position: relative;
  border-radius: 2.5px;
  overflow: hidden;
  border: none !important;
  background: #000;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
  width: 100%;
  height: auto;
}

/* efecto hover suave */
.trex-tour-gallery__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.trex-tour-gallery__link::after {
  content: "⛶";
  position: absolute;
  right: 10px;
  bottom: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.trex-tour-gallery__link:hover .trex-tour-gallery__img,
.trex-tour-gallery__link:focus-visible .trex-tour-gallery__img {
  transform: scale(1.06);
  opacity: 0.92;
}

.trex-tour-gallery__link:hover::after,
.trex-tour-gallery__link:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

/* pequeño margen cuando hay varias galerías seguidas */
.trex-tour-gallery + p {
  margin-top: 0.5rem;
}
@media (min-width: 768px) {
  .trex-tour-gallery {
    padding-left: 34px;
  }
  .trex-tour-gallery__item:nth-child(2),
  .trex-tour-gallery__item:nth-child(3) {
    display: block;
  }
  .trex-tour-gallery:before {
    content: "";
    position: absolute;
    content: "";
    width: 1px;
    height: calc(100% + 32px);
    top: -19px;
    border-left: 2px dashed #15a1f0;
    left: 12px;
  }
}

body.tgd-lb-open {
  overflow: hidden;
}

#tgd-lb {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
#tgd-lb[hidden] {
  display: none;
}

#tgd-lb .tgd-lb__backdrop {
  position: absolute;
  inset: 0;
}

#tgd-lb .tgd-lb__dialog {
  position: relative;
  background: #fff;
  border-radius: 12px;
  max-width: 960px;
  width: 100%;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  font-family: "Inter";
}

#tgd-lb .tgd-lb__close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: #111;
  color: #fff;
  border: 0;
  border-radius: 999px;
  font-size: 22px;
  line-height: 1;
  width: 36px;
  height: 36px;
  cursor: pointer;
  z-index: 1;
}

#tgd-lb .tgd-lb__items {
  position: relative;
}

#tgd-lb .tgd-lb__item {
  display: none;
  margin: 0;
  position: relative;
}
#tgd-lb .tgd-lb__item.is-active {
  display: block;
}

#tgd-lb .tgd-lb__item img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 8px;
}

@keyframes tgd-skeleton {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: 0 0;
  }
}

#tgd-lb .tgd-lb__item::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 8px;
  background: linear-gradient(90deg, #f2f2f2 0%, #e9e9e9 50%, #f2f2f2 100%);
  background-size: 200% 100%;
  animation: tgd-skeleton 1.1s linear infinite;
  opacity: 0;
  pointer-events: none;
}
#tgd-lb .tgd-lb__item.is-loading::before {
  opacity: 1;
}

#tgd-lb .tgd-lb__caption {
  font-size: 0.9rem;
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.45);
  padding: 8px 16px;
}

#tgd-lb .tgd-lb__counter {
  font-weight: 600;
}

#tgd-lb .tgd-lb__text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
}

#tgd-lb .tgd-lb__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
  z-index: 1;
}
#tgd-lb .tgd-lb__prev {
  left: 12px;
}
#tgd-lb .tgd-lb__next {
  right: 12px;
}

@media (max-width: 768px) {
  .trex-tour-gallery__link::after {
    opacity: 1;
    transform: translateY(0);
  }
}