/* ── Overlay Header ──────────────────────────────────── */

.to-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 0;
  flex-shrink: 0;
}

.to-back {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--teal-dark);
  cursor: pointer;
  padding: 8px 4px 8px 0;
  -webkit-tap-highlight-color: transparent;
}

.to-back svg { width: 18px; height: 18px; }

.to-counter {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 8px 4px;
}

.to-ref {
  padding: 0 24px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
}

.to-ref-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 0 0;
  background: none;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.to-ref-text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dark);
}

.to-ref-chevron {
  width: 16px;
  height: 16px;
  color: var(--text-soft);
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

.to-ref-toggle.open .to-ref-chevron {
  transform: rotate(180deg);
}

.to-ref-expand {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.to-ref-expand.open {
  max-height: 500px;
}

.to-ref-card {
  margin-top: 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  overflow: hidden;
}

.to-ref-arabic-wrap {
  background: linear-gradient(135deg, #0A0F1E 0%, #0F2044 70%, #0D3B6E 100%);
  padding: 16px 18px;
}

.to-ref-arabic {
  font-family: 'Amiri', serif;
  font-size: 1.375rem;
  line-height: 2.2;
  color: rgba(255,255,255,0.95);
  text-align: right;
  direction: rtl;
  margin: 0;
}

.to-ref-translation {
  font-size: 0.8125rem;
  font-style: italic;
  line-height: 1.75;
  color: var(--text-mid);
  margin: 0;
  padding: 12px 18px;
  background: #fff;
}

.to-ref-divider {
  height: 1px;
  background: var(--border);
  margin-top: 12px;
}


/* ── Carousel ────────────────────────────────────────── */

.to-carousel {
  flex: 1;
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  min-height: 40vh;                        /* prevent collapse when overlay scrolls */
}

.to-carousel::-webkit-scrollbar { display: none; }

.to-slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  padding: 24px 20px 20px;
  overflow-y: auto;
  scrollbar-width: none;
}

.to-slide::-webkit-scrollbar { display: none; }


/* ── Summary Card ────────────────────────────────────── */

.to-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
  padding: 32px 24px 24px;
}

.to-label-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 32px;
}

.to-label-line {
  flex: 1;
  height: 1px;
  background: var(--border);
  max-width: 36px;
}

.to-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal-dark);
  white-space: nowrap;
}

.to-text {
  font-size: 1rem;
  line-height: 1.9;
  color: var(--text-dark);
  text-align: center;
  max-width: 330px;
  margin: 0 auto;
}

.to-source {
  font-size: 0.6875rem;
  color: var(--text-soft);
  text-align: center;
  margin-top: auto;
  padding-top: 36px;
  letter-spacing: 0.02em;
}


/* ── Dots + Swipe Hint ───────────────────────────────── */

.to-dots-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 0 8px;
  flex-shrink: 0;
}

.to-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.to-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.25s ease, transform 0.25s ease;
}

.to-dot.active {
  background: var(--teal-dark);
  transform: scale(1.2);
}

.to-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 0 0;
  font-size: 0.6875rem;
  color: var(--text-soft);
  white-space: nowrap;
  opacity: 1;
  transition: opacity 0.6s ease;
}

.to-hint.faded { opacity: 0; height: 0; padding: 0; overflow: hidden; }

.to-hint svg {
  width: 12px;
  height: 12px;
  animation: hintBounce 1.4s ease infinite;
}

@keyframes hintBounce {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(3px); }
}


/* ── Baca Tafsir Lengkap (inside overlay) ────────────── */

.to-full-section {
  flex-shrink: 0;
  padding: 8px 24px 32px;
  padding-bottom: max(32px, env(safe-area-inset-bottom));
}

.to-full-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 14px 16px;
  background: var(--teal-light);
  border: 1.5px solid rgba(10,92,122,0.15);
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--teal-dark);
  cursor: pointer;
  transition: background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.to-full-btn:active { background: rgba(0,0,0,0.02); }

.to-full-btn svg {
  width: 14px;
  height: 14px;
  transition: transform 0.25s ease;
}

.to-full-btn.expanded svg { transform: rotate(180deg); }

.to-full-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.to-full-content.expanded {
  max-height: 8000px;
  overflow-y: auto;
}

/* ── Tafsir Lengkap Accordion Items ───────────────────── */
.tfl-item {
  margin-top: 12px;
  border-radius: var(--radius-sm);
  background: #fff;
  border: 1.5px solid var(--border);
  overflow: hidden;
}

.tfl-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-dark);
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}

.tfl-toggle svg {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  color: var(--text-soft);
  transition: transform 0.25s ease;
}

.tfl-toggle.open svg {
  transform: rotate(180deg);
}

.tfl-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.tfl-answer.open {
  max-height: 8000px;
}

.tfl-body {
  padding: 0 16px 16px;
  font-size: 0.8125rem;
  line-height: 1.85;
  color: var(--text-mid);
}

/* Override vc-tafsir-md sizes for overlay context */
.tfl-body.vc-tafsir-md h2 { font-size: 0.8125rem; margin: 12px 0 4px; }
.tfl-body.vc-tafsir-md h3 { font-size: 0.75rem; margin: 10px 0 3px; }
.tfl-body.vc-tafsir-md p  { font-size: 0.8125rem; line-height: 1.85; margin-bottom: 6px; }
.tfl-body.vc-tafsir-md blockquote { margin: 8px 0; padding: 8px 12px; }


