/* =============================
   🎞️ SLIDESHOW COMPLETO
   ============================= */

/* ---------- BASE ---------- */
* {
  box-sizing: border-box;
}

.slideshow-container {
  width: 650px;
  height: 500px;
  max-width: 100vw;
  max-height: 80vh;
  position: relative;
  margin: auto;
  background: var(--content-background-color);
  border: var(--border);
  border-radius: var(--round-borders);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* ---------- SLIDES ---------- */
.mySlides {
  display: none;
  width: 100%;
  height: 100%;
  position: relative;
  text-align: center;
}

.mySlides.active {
  display: block;
}

/* Imagen — nunca recortada */
.mySlides img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
  border-radius: var(--round-borders);
  transition: transform 0.3s ease, opacity 0.3s ease;
  background-color: var(--content-background-color); /* fondo visible si sobra espacio */
}

/* ---------- CAPTION ---------- */
.text {
  color: var(--text-color);
  font-size: var(--font-size);
  padding: 8px 12px;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 39px;
  width: 100%;
  background: rgba(255, 255, 255, 0.85);
  text-align: center;
  font-family: var(--font);
  border-bottom-left-radius: var(--round-borders);
  border-bottom-right-radius: var(--round-borders);
  z-index: 9;
  box-sizing: border-box;
}

/* ---------- DOTS ---------- */
.slider-dots-container {
  width: 100%;
  position: absolute;
  left: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
  background: rgba(255, 255, 255, 0.85);
  padding: 5px 0;
}

.dot {
  cursor: pointer;
  height: 15px;
  width: 15px;
  margin: 0 5px;
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 50%;
  display: inline-block;
  transition: background-color 0.6s ease;
}

.dot.active {
  background-color: var(--text-color);
}

/* ---------- BOTONES ---------- */
.prev,
.next {
  cursor: pointer;
  position: absolute;
  top: 50%;
  padding: 16px;
  margin-top: -22px;
  color: var(--text-color);
  font-weight: bold;
  font-size: 18px;
  border-radius: var(--round-borders);
  background-color: var(--content-background-color);
  transition: 0.6s ease;
  z-index: 12;
}

.next {
  right: 0;
}

.prev {
  left: 0;
}

.prev:hover,
.next:hover {
  background-color: var(--link-color);
  color: var(--content-background-color);
}

/* ---------- NUMERACIÓN ---------- */
.numbertext {
  color: var(--text-color);
  font-size: calc(var(--font-size) * 0.9);
  padding: 8px 12px;
  position: absolute;
  top: 0;
  z-index: 11;
}

/* ---------- ANIMACIONES ---------- */
.fade {
  animation-name: fade;
  animation-duration: 1.5s;
}

@keyframes fade {
  from {
    opacity: 0.4;
  }
  to {
    opacity: 1;
  }
}

/* ---------- RESPONSIVE DESIGN ---------- */

/* 📱 Tablets */
@media screen and (max-width: 900px) {
  .slideshow-container {
    width: 90vw;
    height: 60vh;
  }

  .text {
    font-size: calc(var(--font-size) * 0.9);
    padding: 6px 10px;
  }

  .prev,
  .next {
    font-size: 16px;
    padding: 12px;
  }

  .dot {
    height: 12px;
    width: 12px;
    margin: 0 3px;
  }
}

/* 📲 Teléfonos */
@media screen and (max-width: 600px) {
  .slideshow-container {
    width: 100%;
    height: 55vh;
    border-radius: 0;
  }

  .text {
    font-size: calc(var(--font-size) * 0.8);
    padding: 5px 8px;
    bottom: 32px;
  }

  .slider-dots-container {
    padding: 4px 0;
  }

  .dot {
    height: 10px;
    width: 10px;
  }

  .prev,
  .next {
    font-size: 14px;
    padding: 10px;
    background-color: var(--content-background-color);
    color: var(--text-color);
  }

  .prev:hover,
  .next:hover {
    background-color: var(--link-color);
  }

.mySlides img {
    max-width: 100%;
    max-height: 100%;
  }
}

/* =================================== */
/* THEME-SPECIFIC STYLES */
/* =================================== */

/* ------------------ LIGHT MODE ------------------ */
html.light-mode .text {
  color: var(--text-color);
}

html.light-mode .dot.active {
  background-color: var(--text-color);
}

/* ------------------ DARK MODE ------------------ */
html.dark-mode .text,
html.dark-mode .slider-dots-container {
  background: rgba(24, 24, 24, 0.85);
}

html.dark-mode .text {
  color: var(--text-color);
}

html.dark-mode .dot {
  background-color: rgba(255, 255, 255, 0.4);
}

html.dark-mode .dot.active {
  background-color: var(--text-color);
}