/* Lion and Lamp — Narration button styles.
   Renders a warm, gold-accented floating button in the bottom-right of the
   story viewport. Sized generously for kid fingers. Matches the site's
   existing gold/navy palette without introducing new tokens. */

.ll-narration-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 50;
  display: none; /* toggled inline by JS to inline-flex */
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1.25rem;
  border-radius: 9999px;
  background: #e8b84a;
  color: #0a0c14;
  font-family: 'General Sans', 'Helvetica Neue', system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  border: none;
  cursor: pointer;
  box-shadow:
    0 8px 24px rgba(232, 184, 74, 0.35),
    0 2px 6px rgba(0, 0, 0, 0.35);
  transition: transform 180ms cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 180ms cubic-bezier(0.16, 1, 0.3, 1),
              background 180ms cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-tap-highlight-color: transparent;
}

.ll-narration-btn:hover {
  background: #f3c963;
  transform: translateY(-1px);
  box-shadow:
    0 12px 32px rgba(232, 184, 74, 0.45),
    0 3px 8px rgba(0, 0, 0, 0.4);
}

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

.ll-narration-btn:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
}

.ll-narration-btn__icon {
  position: relative;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ll-narration-btn__icon svg {
  position: absolute;
  inset: 0;
  width: 24px;
  height: 24px;
  transition: opacity 160ms ease;
}

/* By default show play icon, hide pause icon */
.ll-narration-btn .ll-icon-play { opacity: 1; }
.ll-narration-btn .ll-icon-pause { opacity: 0; }

/* When playing: swap icons */
.ll-narration-btn.is-playing .ll-icon-play { opacity: 0; }
.ll-narration-btn.is-playing .ll-icon-pause { opacity: 1; }

.ll-narration-btn__label {
  line-height: 1;
  white-space: nowrap;
}

/* Loading state: soft pulse */
@keyframes ll-narration-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.7; }
}
.ll-narration-btn.is-loading {
  animation: ll-narration-pulse 1.2s ease-in-out infinite;
  pointer-events: none;
}

/* Mobile refinements */
@media (max-width: 600px) {
  .ll-narration-btn {
    bottom: 1rem;
    right: 1rem;
    padding: 0.75rem 1.1rem;
    font-size: 0.9rem;
  }
  .ll-narration-btn__icon,
  .ll-narration-btn__icon svg {
    width: 22px;
    height: 22px;
  }
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  .ll-narration-btn,
  .ll-narration-btn__icon svg {
    transition: none;
  }
  .ll-narration-btn.is-loading {
    animation: none;
    opacity: 0.85;
  }
}
