@charset "utf-8";
/* ================= SLIDESHOW CORE ================= */

.slideshow {
  position: relative;
  max-width: 100%;
  margin: 2rem auto;
  user-select: none;
	  display: flex;
  flex-direction: column;
  align-items: center;   /* THIS IS THE KEY */
}

.slide-frame {
  overflow: hidden;
  border-radius: 8px;
	  position: relative;
}

.slide-img {
  width: 100%;
  height: auto;
  display: block;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.slide-img.loaded {
  opacity: 1;
}
/* ================= CAPTIONS ================= */
/* ================= CAPTIONS – FINAL FIX ================= */

.slide-caption {
  position: relative;
  max-width: 46rem;
  width: 100%;
 /* === max-width: 100%;  --*/

  font-size: clamp(1.05rem, 1.6vw, 1.35rem);
  line-height: 1.45;

  font-weight: 500;
  color: #8a6b1f;
  margin: 0 auto;
  padding: 1rem 1rem 0.8rem;

  box-sizing: border-box;

  display: block;

  text-align: center !important;

  clear: both;
}

/* Inner centering guard */
.slide-caption > * {
  display: block;
  margin-left: auto;
  margin-right: auto;
  text-align: center !important;
}

/* Main caption */
.caption-main {
  max-width: 44rem;
 margin: 0.4rem auto 0;

  font-size: 0.95rem;
  font-weight: 500;
  color: #8a6b1f;
	white-space: pre-line;
}

/* Sanskrit sub-caption */
.caption-sub {
  max-width: 44rem;
  margin: 0.3rem auto 0;

  font-family:
    "Noto Serif Devanagari",
    "Sahitya",
    "Kalimati",
    serif;

  font-size: clamp(0.95rem, 1.3vw, 1.15rem);
  line-height: 1.6;

  color: #4a6fa5;
  letter-spacing: 0.02em;
}

.slideshow.emphasis .caption-main {
  font-size: clamp(1.2rem, 2vw, 1.6rem);
}


/* ================= CONTROLS ================= */

/* ================= NAVIGATION ARROWS ================= */

.slideshow button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);

  width: 44px;
  height: 44px;
  border-radius: 50%;

  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(4px);

  border: 1px solid rgba(138,107,31,0.35);
  color: #8a6b1f;

  font-size: 1.8rem;
  line-height: 1;

  cursor: pointer;
  z-index: 5;

  box-shadow:
    0 4px 12px rgba(0,0,0,0.18);
}

.slideshow button:hover {
  background: rgba(255,255,255,0.9);
}

.prev { left: 0.75rem; }
.next { right: 0.75rem; }

/* ================= PROGRESS RING ================= */

.progress-ring {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  width: 34px;
  height: 34px;

  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.35s ease, transform 0.35s ease;

  pointer-events: none;
}

/* Ring visible only while running */
.slideshow.ring-active .progress-ring {
  opacity: 0.9;
  transform: scale(1);
}

.progress-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-bg {
  fill: none;
  stroke: rgba(200,180,120,0.25);
  stroke-width: 3;
}

.ring-progress {
  fill: none;
  stroke: #c9a24d;
  stroke-width: 3;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
}

/* ================= PAUSE STATE ================= */

.slideshow.paused .ring-progress {
  opacity: 0.4;
}

.slideshow:not([data-autoplay="true"]) .progress-ring {
  display: none;
}
/* ================= IMAGE–CAPTION DIVIDER ================= */
.slide-frame::after {
  content: "";
  display: block;
  width: 60%;
  height: 1px;
  margin: 0.75rem auto 0.5rem;

  background: linear-gradient(
    to right,
    transparent,
    rgba(138,107,31,0.6),
    transparent
  );
}
/* ================= BREATHING HALO ================= */

.breathing-halo {
  position: absolute;
  left: 50%;
  bottom: 1.2rem;
  transform: translateX(-50%);

  width: 42px;
  height: 42px;
  border-radius: 50%;

  opacity: 0;
  pointer-events: none;

  background: radial-gradient(
    circle,
    rgba(201,162,77,0.35) 0%,
    rgba(201,162,77,0.25) 35%,
    rgba(201,162,77,0.15) 55%,
    rgba(201,162,77,0.05) 70%,
    transparent 75%
  );

  filter: blur(1px);
  transform-origin: center;
  transition: opacity 0.4s ease;
}

/* Visible only during autoplay */
.slideshow.halo-active .breathing-halo {
  opacity: 1;
  animation: halo-breathe var(--halo-speed, 6s) ease-in-out infinite;
}

/* Pause state */
.slideshow.paused .breathing-halo {
  animation-play-state: paused;
  opacity: 0.35;
}

/* Breathing animation */
@keyframes halo-breathe {
  0% {
    transform: translateX(-50%) scale(0.9);
    opacity: 0.35;
  }
  50% {
    transform: translateX(-50%) scale(1.15);
    opacity: 0.7;
  }
  100% {
    transform: translateX(-50%) scale(0.9);
    opacity: 0.35;
  }
}

/* ================= PORTRAIT SLIDESHOW HEIGHT CONTROL ================= */

.slideshow.portrait .slide-frame {
  max-height: 60vh;          /* desktop default 55–70vh   */
  width: 100%;
}

.slideshow.portrait .slide-img {
  max-height: 60vh;
  width: auto;
  height: auto;

  margin-left: auto;
  margin-right: auto;

  object-fit: contain;
}
@media (max-width: 768px) {
  .slideshow.portrait .slide-frame {
    max-height: 55vh;
  }

  .slideshow.portrait .slide-img {
    max-height: 55vh;
  }
}
/* Tablet / small desktop */
@media (max-width: 1200px) {
  .slideshow.portrait .slide-frame {
    max-height: 62vh;
  }
}

/* Tablet portrait */
@media (max-width: 900px) {
  .slideshow.portrait .slide-frame {
    max-height: 58vh;
  }
}

/* Mobile */
@media (max-width: 600px) {
  .slideshow.portrait .slide-frame {
    max-height: 52vh;
  }
}

.slideshow.portrait .slide-img {
  max-height: inherit;
  width: auto;
  height: auto;

  margin: 0 auto;
  display: block;

  object-fit: contain;
}




/* ================= PORTRAIT BACKGROUND MATTE ================= */

.slideshow.portrait .slide-frame {
  background:
    radial-gradient(
      ellipse at center,
      rgba(240,236,225,0.9) 0%,
      rgba(240,236,225,0.6) 40%,
      rgba(240,236,225,0.25) 65%,
      rgba(240,236,225,0.1) 80%,
      transparent 100%
    );

  padding: 1.5rem 1.5rem 2rem;
  box-sizing: border-box;
}

/* Mobile: tighter padding */
@media (max-width: 600px) {
  .slideshow.portrait .slide-frame {
    padding: 0.9rem 0.8rem 1.2rem;
  }
}
