/* ===============================
 *  Placeholder dentro de CKEditor
 * =============================== */

.ck-content .trex-gallery-tour-day-placeholder{
  display:flex;
  align-items:center;
  gap:12px;
  padding:12px 16px;
  margin:12px 0;
  border-radius:999px;

  border:1px solid rgba(21,161,240,.55);
  background:linear-gradient(90deg, rgba(21,161,240,.16), rgba(255,255,255,1));
  box-shadow:0 6px 18px rgba(21,161,240,.10), 0 2px 6px rgba(0,0,0,.06);

  font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  font-size:13px;
  color:#0f2230;
  position:relative;
}

.ck-content .trex-gallery-tour-day-placeholder::before{
  content:"";
  width:12px;
  height:12px;
  border-radius:999px;
  background:#15a1f0;
  box-shadow:0 0 0 5px rgba(21,161,240,.20);
  flex:0 0 auto;
}

.ck-content .trex-gallery-tour-day-placeholder::after{
  content:"GALLERY";
  margin-left:auto;
  padding:5px 10px;
  border-radius:999px;
  font-size:11px;
  font-weight:700;
  letter-spacing:.10em;
  text-transform:uppercase;
  color:#0b5f91;
  background:rgba(21,161,240,.12);
  border:1px solid rgba(21,161,240,.35);
}

.ck-content .trex-gallery-tour-day-placeholder__inner{
  flex:1 1 auto;
  min-width:0;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  line-height:1.2;
  font-weight:700;
}

.ck-content .trex-gallery-tour-day-placeholder.ck-widget_selected{
  border-color:rgba(21,161,240,.95);
  box-shadow:0 0 0 3px rgba(21,161,240,.22), 0 10px 26px rgba(21,161,240,.16), 0 3px 10px rgba(0,0,0,.08);
}

.ck-content .trex-gallery-tour-day-placeholder .ck-widget__type-around{
  margin-left:10px;
}


/* ===============================
 *  Galería en el frontend
 * =============================== */

.trex-tour-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0 16px;
    padding-left: 34px !important;
    position: relative;
}
.trex-tour-gallery:before {
    content: '';
    position: absolute;
    content: '';
    width: 1px;
    height: calc(100% + 32px);
    top: -19px;
    border-left: 2px dashed #15a1f0;
    left: 12px;
}

.trex-tour-gallery__item {
  position: relative;
  flex: 1;
}

@media (max-width: 900px) {
  .trex-tour-gallery__item {
    flex-basis: calc(50% - 10px);
    max-width: calc(50% - 10px);
  }
}

@media (max-width: 560px) {
  .trex-tour-gallery__item {
    flex-basis: 100%;
    max-width: 100%;
  }
}

.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;
}

/* --------------------------------------------- */
/* Grid basica de la galeria por dia            */
/* --------------------------------------------- */

.trex-gallery-tour-day__images {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.trex-gallery-tour-day__image-link {
  display: block;
  text-decoration: none;
}

.trex-gallery-tour-day__image-inner {
  display: block;
  overflow: hidden;
  border-radius: 4px;
}

.trex-gallery-tour-day__image {
  display: block;
  max-width: 100%;
  height: auto;
}

/* --------------------------------------------- */
/* Lightbox propio TreXperience                  */
/* --------------------------------------------- */

/* Overlay general */
.trex-lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 10000;
}

.trex-lightbox-overlay.is-active {
  display: flex;
}

/* Contenedor blanco del lightbox */
.trex-lightbox-inner {
  position: relative;
  background: #111;
  border-radius: 4px;
  max-width: 1200px;
  width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}

/* Wrapper de la imagen para mantener proporción */
.trex-lightbox-image-wrapper {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #000;
}

/* Imagen adaptativa: respeta la altura de la ventana */
.trex-lightbox-img {
  max-width: 100%;
  max-height: calc(100vh - 160px);
  width: auto;
  height: auto;
  display: block;
}

/* Caption */
.trex-lightbox-caption {
  padding: 10px 20px 16px;
  font-size: 14px;
  text-align: center;
  color: #fff;
  background: #111;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Botón de cierre (X) */
.trex-lightbox-close {
  position: absolute;
  top: 10px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  outline: none;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.trex-lightbox-close:hover,
.trex-lightbox-close:focus {
  background: rgba(255, 255, 255, 0.96);
  color: #000;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6);
}

/* Flechas de navegación */
.trex-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  outline: none;
  user-select: none;
}

.trex-lightbox-prev {
  left: 18px;
}

.trex-lightbox-next {
  right: 18px;
}

.trex-lightbox-nav:hover,
.trex-lightbox-nav:focus {
  background: rgba(255, 255, 255, 0.96);
  color: #000;
}

/* Evitar scroll del body cuando el lightbox está abierto (opcional) */
body.trex-lightbox-open {
  overflow: hidden;
}

/* Un poco más amable en mobile */
@media (max-width: 768px) {
  .trex-lightbox-overlay {
    padding: 10px;
  }

  .trex-lightbox-inner {
    max-width: 100%;
  }

  .trex-lightbox-img {
    max-height: calc(100vh - 130px);
  }

  .trex-lightbox-nav {
    width: 36px;
    height: 36px;
    font-size: 22px;
  }

  .trex-lightbox-prev {
    left: 10px;
  }

  .trex-lightbox-next {
    right: 10px;
  }

  .trex-lightbox-close {
    top: 8px;
    right: 10px;
  }
}
