/* ============================================================
   TrainerBjörn — :::flashcards widget
   A flippable index card on the notebook paper. 3D flip with a
   graceful fallback (faces swap visibility even without
   transform-style support).
   ============================================================ */

.lesson-flash {
  border: 1.5px solid var(--lesson-line, rgba(0, 0, 0, 0.16));
  border-radius: 14px; background: #fff;
  padding: 1.1rem 1.3rem 1.2rem; margin: 1.6rem 0;
  box-shadow: 2px 3px 0 rgba(0, 0, 0, 0.05);
}
.lesson-flash-kicker {
  font-family: 'Caveat', cursive; font-weight: 700; font-size: 1.3rem;
  color: var(--lesson-teal, #0ea5a4); margin: 0 0 0.7rem;
}

.lesson-flash-deck { perspective: 900px; }
.lesson-flash-card {
  position: relative; cursor: pointer; min-height: 190px;
  transform-style: preserve-3d; transition: transform 0.55s cubic-bezier(.4, 1.2, .5, 1);
  outline-offset: 4px;
}
.lesson-flash-card[hidden] { display: none; }
.lesson-flash-card.is-flipped { transform: rotateY(180deg); }

.lesson-flash-face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: 12px; padding: 1.1rem 1.3rem; overflow: auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
}
.lesson-flash-front {
  background: #fffceb; border: 1.5px solid rgba(232, 184, 48, 0.55);
  font-family: 'Caveat', cursive; font-weight: 700; font-size: 2rem;
  color: var(--lesson-ink, #2b2b2b); transform: rotate(-0.5deg);
  box-shadow: 2px 3px 0 rgba(0, 0, 0, 0.06);
}
.lesson-flash-back {
  background: rgba(14, 165, 164, 0.07); border: 1.5px solid var(--lesson-teal, #0ea5a4);
  transform: rotateY(180deg);
  font-family: 'Kalam', cursive; font-size: 0.98rem; line-height: 1.5;
  color: var(--lesson-ink, #2b2b2b); text-align: left;
  align-items: flex-start; justify-content: flex-start;
}
.lesson-flash-back > :first-child { margin-top: 0; }
.lesson-flash-back p { margin: 0 0 0.5rem; }

.lesson-flash-nav {
  display: flex; align-items: center; gap: 0.8rem; margin-top: 0.9rem; flex-wrap: wrap;
}
.lesson-flash-arrow {
  font-family: 'Kalam', cursive; font-size: 1.05rem; cursor: pointer;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1.5px solid var(--lesson-teal, #0ea5a4); background: #fff; color: var(--lesson-teal, #0ea5a4);
  transition: background 0.15s, transform 0.1s;
}
.lesson-flash-arrow:hover:not(:disabled) { background: rgba(14, 165, 164, 0.1); transform: translateY(-1px); }
.lesson-flash-arrow:disabled { opacity: 0.35; cursor: default; }
.lesson-flash-dots { display: inline-flex; gap: 0.45rem; }
.lesson-flash-dot {
  width: 12px; height: 12px; border-radius: 50%; cursor: pointer;
  border: 2px solid var(--lesson-teal, #0ea5a4); background: #fff;
  transition: background 0.15s, transform 0.15s;
}
.lesson-flash-dot.is-active { background: var(--lesson-teal, #0ea5a4); transform: scale(1.15) rotate(-4deg); }
.lesson-flash-hint {
  font-family: 'Kalam', cursive; font-size: 0.82rem;
  color: var(--lesson-ink, #2b2b2b); opacity: 0.6; margin-left: auto;
}

@media (max-width: 620px) {
  .lesson-flash-card { min-height: 230px; }
  .lesson-flash-front { font-size: 1.6rem; }
}
