/* =================================== */
/*        RESET & BASE STYLES          */
/* =================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Roboto', sans-serif;
  line-height: 1.6;
  color: #222;
  padding: 0;
  margin: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Links reset */
a {
  color: inherit;
  text-decoration: none;
}

/* =================================== */
/*          HERO SECTION (HOME)         */
/* =================================== */
.hero-section {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    135deg,
    #8b7355 0%,
    #6b8e6f 30%,
    #d4a574 70%,
    #f5deb3 100%
  );
}

.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 1;
}

.hero-background::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
      circle at 20% 50%,
      rgba(255, 255, 255, 0.08) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 80%,
      rgba(139, 115, 85, 0.2) 0%,
      transparent 50%
    );
  animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

.floating-circle {
  position: absolute;
  background: rgba(212, 165, 116, 0.15);
  border-radius: 50%;
  animation: float 20s infinite ease-in-out;
}

.circle-1 {
  width: 80px;
  height: 80px;
  top: 10%;
  left: 10%;
  animation-delay: 0s;
}

.circle-2 {
  width: 120px;
  height: 120px;
  top: 60%;
  left: 80%;
  animation-delay: 3s;
}

.circle-3 {
  width: 60px;
  height: 60px;
  top: 80%;
  left: 20%;
  animation-delay: 6s;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-30px) rotate(180deg);
  }
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 1100px;
  padding: 40px 20px;
  width: 100%;
  animation: fadeInUp 1s ease-out;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-header {
  text-align: center;
  padding: 0 0 1rem;
}

.hero-title {
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0;
  text-shadow: 2px 4px 20px rgba(0, 0, 0, 0.3);
  letter-spacing: -0.5px;
}

.hero-main {
  text-align: center;
  padding: 0.75rem 0.75rem 2rem;
}

.intro {
  margin: 0 auto;
  max-width: 700px;
}

.hero-text {
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  color: rgba(255, 255, 255, 0.98);
  line-height: 1.7;
  font-weight: 400;
  margin-bottom: 2rem;
  text-shadow: 1px 2px 4px rgba(0, 0, 0, 0.2);
}

.hero-btn {
  display: inline-block;
  padding: 16px 45px;
  background: rgba(255, 255, 255, 0.95);
  color: #6b8e6f;
  text-decoration: none;
  border-radius: 50px;
  font-size: 1.1rem;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  margin-top: 0.5rem;
}

.hero-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.35);
  background: #ffffff;
}

/* container for primary CTAs in the hero */
.hero-cta {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
}

.hero-btn:active {
  transform: translateY(-1px);
}

.buddha-container {
  margin-top: 3rem;
  animation: fadeInScale 1.2s ease-out 0.3s both;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.buddha-img {
  max-width: 500px;
  width: 100%;
  height: auto;
  margin: 0 auto;
  display: block;
  border-radius: 20px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
  transition: transform 0.3s ease;
}

.buddha-img:hover {
  transform: scale(1.02);
}

/* =================================== */
/*    HEADER (LESSONS PAGE ONLY)        */
/* =================================== */
.lessons-page {
  background: linear-gradient(
    135deg,
    #8b7355 0%,
    #6b8e6f 30%,
    #d4a574 70%,
    #f5deb3 100%
  );
  min-height: 100vh;
}

.header {
  background: transparent;
  text-align: center;
  padding: 2rem 1rem 1rem;
  position: relative;
}

.header h1 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  color: #ffffff;
  margin-bottom: 1rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-shadow: 2px 4px 12px rgba(0, 0, 0, 0.3);
}

.header .btn {
  background: rgba(255, 255, 255, 0.95);
  color: #6b8e6f;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.header .btn:hover {
  background: #ffffff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* =================================== */
/*            FOOTER                    */
/* =================================== */
.footer {
  background: rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
  text-align: center;
  padding: 1.5rem 1rem;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  margin-top: auto;
}

/* =================================== */
/*         MAIN (LESSONS PAGE)          */
/* =================================== */
.main {
  background: transparent;
  text-align: center;
  padding: 0.75rem 0.75rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

.btn {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.95);
  color: #6b8e6f;
  text-decoration: none;
  border-radius: 999px;
  transition: background 0.18s ease, transform 0.12s ease;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.btn:active {
  transform: translateY(0);
}

.btn:hover {
  background: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.back-btn {
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

/* =================================== */
/*          LESSON PAGE STYLES          */
/* =================================== */
details {
  margin: 0.9rem 0;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  transition: box-shadow 0.25s ease, transform 0.2s ease;
}

details:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  transform: translateY(-2px);
}

summary {
  font-weight: 700;
  cursor: pointer;
  padding: 1.1rem 1.2rem;
  font-size: 1.05rem;
  background: linear-gradient(
    180deg,
    rgba(212, 165, 116, 0.3) 0%,
    rgba(139, 115, 85, 0.2) 100%
  );
  color: #2f3b2f;
  outline: none;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

details[open] summary {
  background: rgba(212, 165, 116, 0.4);
}

/* =================================== */
/*             SLIDES STACK             */
/* =================================== */
.slides {
  padding: 0.9rem 0 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transform-origin: top;
  transform: scaleY(0.98) translateY(-4px);
  opacity: 0;
  transition: transform 920ms cubic-bezier(0.22, 0.9, 0.33, 1),
    opacity 820ms ease;
}

.slides img {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  touch-action: manipulation;
  opacity: 0;
  transform: scale(0.996);
  transition: opacity 920ms ease, transform 920ms ease;
}

.slides.js-open img {
  opacity: 1;
  transform: none;
}

.slides .slide-link {
  display: block;
  width: 100%;
}

.slides img:focus {
  outline: 3px solid rgba(107, 142, 111, 0.4);
  transform: none;
}

.slides img:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

/* =================================== */
/*          FULLSCREEN LIGHTBOX         */
/* =================================== */
.lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  cursor: zoom-out;
  padding: 8px;
  box-sizing: border-box;
}

.lightbox-overlay .lightbox-img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
}

.lightbox-controls {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
  transform: translateY(-50%);
}

.lightbox-btn {
  background: rgba(255, 255, 255, 0.06);
  border: none;
  color: white;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 8px;
  font-size: 20px;
  pointer-events: auto;
  backdrop-filter: blur(4px);
  cursor: pointer;
  transition: background 0.2s ease;
}

.lightbox-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.lightbox-close {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border: none;
  pointer-events: auto;
  cursor: pointer;
  transition: background 0.2s ease;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.12);
}

.sr-only {
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

/* =================================== */
/*             RESPONSIVE               */
/* =================================== */
@media (max-width: 768px) {
  .hero-section {
    min-height: auto;
    padding: 60px 0;
  }

  .hero-title {
    margin-bottom: 1rem;
  }

  .hero-text {
    margin-bottom: 1.5rem;
  }

  .hero-btn {
    padding: 14px 35px;
    font-size: 1rem;
  }

  .buddha-container {
    margin-top: 2rem;
  }

  .buddha-img {
    max-width: 320px;
    border-radius: 16px;
  }
}

@media (max-width: 600px) {
  .header h1 {
    font-size: 1.3rem;
  }

  .btn {
    padding: 10px 20px;
  }

  .buddha-img {
    max-width: 280px;
  }

  .slides img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
  }

  .lightbox-controls {
    display: none;
  }

  summary {
    padding: 0.9rem 1rem;
    font-size: 0.95rem;
  }
}

/* Use a JS-driven class to control the open state */
.slides.js-open {
  transform: none;
  opacity: 1;
}

/* Respect user's reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  .slides,
  .slides img,
  .hero-content,
  .buddha-container,
  .hero-background::before,
  .floating-circle {
    animation: none !important;
    transition: none !important;
  }
  .testimonial blockquote > p {
    transition: none !important;
  }
}

/* Gentle stagger for slide images */
.slides a:nth-child(1) img {
  transition-delay: 0ms;
}
.slides a:nth-child(2) img {
  transition-delay: 120ms;
}
.slides a:nth-child(3) img {
  transition-delay: 240ms;
}
.slides a:nth-child(4) img {
  transition-delay: 360ms;
}
.slides a:nth-child(5) img {
  transition-delay: 480ms;
}
.slides a:nth-child(6) img {
  transition-delay: 600ms;
}
.slides a:nth-child(7) img {
  transition-delay: 720ms;
}
.slides a:nth-child(8) img {
  transition-delay: 840ms;
}

/* Large screen tweaks */
@media (min-width: 900px) {
  .header h1 {
    font-size: 2rem;
  }
  .slides {
    gap: 1.5rem;
  }
}

/* Testimonials */
.testimonials {
  padding: 2.2rem 1rem;
  background: linear-gradient(180deg, #fbfbfb 0%, #f6f6f4 100%);
  margin-top: 2rem;
}
.testimonials .container {
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
}
.testimonials-title {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: #2f3b2f;
}
.testimonials-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
.testimonial {
  background: white;
  padding: 1rem 1.1rem;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
  font-style: italic;
}
.testimonial .cite {
  margin-top: 0.75rem;
  font-style: normal;
  font-weight: 700;
  color: #555;
}

@media (min-width: 700px) {
  .testimonials-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Slider styles */
.testimonial-slider {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  margin-top: 1rem;
}
.slider-viewport {
  width: 100%;
  max-width: 720px;
  overflow: hidden;
}
.slider-track {
  display: flex;
  gap: 16px;
  transition: transform 520ms cubic-bezier(0.22, 0.9, 0.33, 1);
  transform: translateX(0); /* ensure neutral start to avoid initial offset */
  will-change: transform;
}
.testimonial {
  flex: 0 0 calc(100% - 16px); /* leave space for the track gap */
  max-width: calc(100% - 16px);
  box-sizing: border-box;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 1rem;
}
.testimonial img.avatar {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px; /* small visual offset so avatar lines with first line of text */
  display: block; /* ensure predictable layout and no inline-image gaps */
}
.testimonial blockquote > p {
  margin: 0 0 0.5rem 0;
  padding-right: 18px; /* keep text away from right edge */
  color: #333;
  font-size: 1rem;
  line-height: 1.6;
}
.slider-btn {
  background: transparent;
  border: none;
  font-size: 18px;
  padding: 8px 10px;
  cursor: pointer;
}
.slider-dots {
  margin-top: 0.75rem;
  display: flex;
  justify-content: center;
  gap: 8px;
}
.slider-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ddd;
  cursor: pointer;
}
.slider-dot.active {
  background: #6a9c78;
}

@media (min-width: 700px) {
  .testimonial {
    flex: 0 0 calc(50% - 10px); /* two columns + 20px gap -> widths sum to 100% */
    max-width: calc(50% - 10px);
  }
  .slider-track {
    gap: 20px;
  }
}

/* Read-more collapse: animate max-height for smooth expand/collapse */
.testimonial blockquote > p {
  max-height: 2000px; /* large default */
  overflow: hidden;
  padding-bottom: 1.1rem; /* space so the read-more button sits below */
  transition: max-height 520ms cubic-bezier(0.22, 0.9, 0.33, 1);
}
.testimonial blockquote > p.collapsed {
  max-height: 120px;
}
.read-more-btn {
  display: inline-block;
  margin-top: 0.5rem;
  background: transparent;
  border: none;
  color: #6a9c78;
  font-weight: 700;
  cursor: pointer;
  padding: 0; /* keep it compact */
}

/* Calendar page styles */
.calendar-section {
  max-width: 1100px;
  margin: 1rem auto;
  padding: 0 1rem;
}
.calendar-viewport {
  position: relative;
  padding-top: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  margin-top: 18px; /* spacing under heading */
}
.calendar-iframe {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Make the embedded calendar taller on small screens for better readability */
@media (max-width: 600px) {
  .calendar-viewport {
    padding-top: 100%; /* 1:1 on small screens for extra vertical room */
  }
}

/* Fix testimonials for very narrow/folded screens (e.g., Z Fold small pane) */
@media (max-width: 420px) {
  .testimonial {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 12px;
  }
  .testimonial img.avatar {
    width: 56px;
    height: 56px;
    margin-top: 0;
  }
  .testimonial blockquote > p {
    padding-right: 0; /* remove right padding so text doesn't get clipped */
    line-height: 1.7;
    font-size: 0.98rem;
  }
}

/* Touch feedback */
.slider-viewport {
  touch-action: pan-y;
}
.slider-track {
  -webkit-user-select: none;
  user-select: none;
}

/* Add: stronger touch/overscroll handling for testimonial/carousel containers */
.testimonials,
.carousel,
.testimonial-list {
  /* allow the user to scroll vertically without the browser treating gesture as horizontal swipe */
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain; /* prevent parent from stealing scroll gestures */
}

/* If you're using CSS scroll-snap for horizontal slides, make it less aggressive on small screens */
@media (max-width: 700px) {
  .testimonials,
  .carousel,
  .testimonial-list {
    scroll-snap-type: none; /* allow natural vertical scroll to not snap to next item */
  }
}

/* Optional: if you use :target anchors that shift layout, neutralize jump */
:target {
  scroll-margin-top: 0; /* minimize layout shift when linking to anchors */
}
