/* Dramatized audio switch (public/js/drama-mode.js). Gold-on-moss look, shimmer sweep, calm when reduced motion is on. */
.thf-drama-cta {
  --drama-gold: #d9b45a;
  --drama-gold-hi: #f6e2a4;
  --drama-moss: #1f3a2c;
  --drama-moss-deep: #11231a;
  margin: 0 0 14px;
}

.thf-drama-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 18px;
  border: 1px solid rgba(217, 180, 90, .75);
  border-radius: 14px;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(246, 226, 164, .22), transparent 55%),
    linear-gradient(135deg, var(--drama-moss) 0%, var(--drama-moss-deep) 100%);
  color: #fbf6e8;
  text-align: left;
  font: inherit;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  box-shadow: 0 0 0 0 rgba(217, 180, 90, .45), 0 6px 22px rgba(17, 35, 26, .35);
  animation: thf-drama-glow 3.2s ease-in-out infinite;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.thf-drama-btn:hover { transform: translateY(-1px); border-color: var(--drama-gold-hi); }
.thf-drama-btn:active { transform: translateY(0); }
.thf-drama-btn:focus-visible { outline: 3px solid var(--drama-gold-hi); outline-offset: 3px; }

/* the moving glint */
.thf-drama-btn__shine {
  position: absolute;
  inset: -40% auto -40% -30%;
  width: 28%;
  background: linear-gradient(100deg, transparent 0%, rgba(255, 244, 205, .0) 20%, rgba(255, 244, 205, .55) 50%, rgba(255, 244, 205, 0) 80%, transparent 100%);
  transform: skewX(-18deg) translateX(-120%);
  animation: thf-drama-shine 3.6s ease-in-out infinite;
  z-index: -1;
  pointer-events: none;
}

.thf-drama-btn__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--drama-gold-hi), var(--drama-gold) 60%, #9c7a2c 100%);
  color: var(--drama-moss-deep);
  font-size: 18px;
  box-shadow: 0 0 14px rgba(246, 226, 164, .55);
  animation: thf-drama-twinkle 2.4s ease-in-out infinite;
}
.thf-drama-btn__text { display: grid; gap: 2px; min-width: 0; flex: 1; }
.thf-drama-btn__title {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: .01em;
  background: linear-gradient(90deg, #fff7dc, var(--drama-gold-hi), #fff7dc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.thf-drama-btn__sub { font-size: .82rem; color: rgba(251, 246, 232, .78); }
.thf-drama-btn__badge {
  flex: none;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--drama-gold);
  color: var(--drama-moss-deep);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .08em;
}
.thf-drama-btn.is-loading { cursor: progress; opacity: .85; }
.thf-drama-btn.is-loading .thf-drama-btn__icon { animation: thf-drama-spin 1s linear infinite; }

/* switched on */
.thf-drama-on .thf-drama-btn {
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(246, 226, 164, .28), transparent 55%),
    linear-gradient(135deg, #3b2a12 0%, #1a130a 100%);
  border-color: var(--drama-gold-hi);
}
.thf-drama-on .thf-drama-btn__badge { background: #fbf6e8; }
.thf-drama-on .thf-drama-btn__badge::after { content: ""; }
.thf-drama-cta.just-on .thf-drama-btn { animation: thf-drama-burst .9s ease-out 1, thf-drama-glow 3.2s ease-in-out .9s infinite; }

/* the player and transcript take on the drama palette */
.thf-drama-on #audioPlayerCustom { filter: sepia(.25) saturate(1.2); }
.thf-drama-on .audio-section-label { color: #f6e2a4; }
.thf-drama-on #transcriptCustom {
  background: linear-gradient(180deg, #17301f, #0f2016);
  color: #ece6d2;
  border-color: rgba(217, 180, 90, .45);
  border-radius: 12px;
  transition: background .6s ease;
}
.thf-drama-on #transcriptCustom .word-custom { color: #ece6d2; }
.thf-drama-on #transcriptCustom .word-custom.thf-drama-voice { color: #f1d48a; }
.thf-drama-on #transcriptCustom .word-custom.active { background: rgba(217, 180, 90, .4); color: #fff; }
.thf-drama-on .audio-player-content-custom {
  background: linear-gradient(135deg, #1f3a2c 0%, #11231a 100%);
  box-shadow: 0 0 0 1px rgba(217, 180, 90, .6), 0 8px 28px rgba(0, 0, 0, .45);
  transition: background .6s ease, box-shadow .6s ease;
}
.thf-drama-on .player-title-custom { color: #f6e2a4; }
.thf-drama-on .audio-player-sticky-custom { background: transparent; }

@keyframes thf-drama-shine {
  0%, 35% { transform: skewX(-18deg) translateX(-120%); }
  75%, 100% { transform: skewX(-18deg) translateX(520%); }
}
@keyframes thf-drama-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(217, 180, 90, .0), 0 6px 22px rgba(17, 35, 26, .35); }
  50% { box-shadow: 0 0 22px 2px rgba(217, 180, 90, .45), 0 6px 22px rgba(17, 35, 26, .35); }
}
@keyframes thf-drama-twinkle {
  0%, 100% { transform: scale(1) rotate(0); }
  50% { transform: scale(1.08) rotate(12deg); }
}
@keyframes thf-drama-burst {
  0% { box-shadow: 0 0 0 0 rgba(246, 226, 164, .9); }
  100% { box-shadow: 0 0 0 26px rgba(246, 226, 164, 0); }
}
@keyframes thf-drama-spin { to { transform: rotate(360deg); } }

@media (max-width: 480px) {
  .thf-drama-btn { padding: 12px 14px; gap: 10px; }
  .thf-drama-btn__icon { width: 32px; height: 32px; font-size: 15px; }
  .thf-drama-btn__title { font-size: .98rem; }
  .thf-drama-btn__badge { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .thf-drama-btn, .thf-drama-btn__shine, .thf-drama-btn__icon, .thf-drama-cta.just-on .thf-drama-btn { animation: none; }
  .thf-drama-btn__shine { display: none; }
}

/* ---- Books shelf (David Bercot page): glowing cover, NEW badge, Dramatize button ---- */
.tp .tp-book--drama .thf-drama-cover {
  position: relative;
  display: block;
  border-radius: 10px;
  box-shadow: 0 0 0 2px rgba(217, 180, 90, .85), 0 0 18px 4px rgba(246, 226, 164, .45);
  animation: thf-drama-cover-glow 2.8s ease-in-out infinite;
}
.tp .tp-book--drama .thf-drama-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 244, 205, .45) 50%, transparent 70%);
  background-size: 250% 100%;
  animation: thf-drama-cover-sweep 3.6s ease-in-out infinite;
  pointer-events: none;
}
.tp .thf-drama-new {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  padding: 4px 9px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f6e2a4, #d9b45a);
  color: #11231a;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .35);
}
.tp .thf-drama-mini {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid rgba(217, 180, 90, .9);
  background: linear-gradient(135deg, #1f3a2c, #11231a);
  color: #f6e2a4;
  font-weight: 700;
  box-shadow: 0 0 12px rgba(217, 180, 90, .4);
  animation: thf-drama-glow 3.2s ease-in-out infinite;
}
.tp .thf-drama-mini:hover { color: #fff7dc; border-color: #f6e2a4; }
.thf-drama-mini__shine {
  position: absolute;
  inset: -40% auto -40% -30%;
  width: 35%;
  background: linear-gradient(100deg, transparent, rgba(255, 244, 205, .6), transparent);
  transform: skewX(-18deg) translateX(-120%);
  animation: thf-drama-shine 3.6s ease-in-out infinite;
  z-index: -1;
  pointer-events: none;
}
@keyframes thf-drama-cover-glow {
  0%, 100% { box-shadow: 0 0 0 2px rgba(217, 180, 90, .75), 0 0 10px 2px rgba(246, 226, 164, .25); }
  50% { box-shadow: 0 0 0 2px rgba(246, 226, 164, 1), 0 0 26px 8px rgba(246, 226, 164, .55); }
}
@keyframes thf-drama-cover-sweep {
  0%, 40% { background-position: 150% 0; }
  80%, 100% { background-position: -50% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .tp .tp-book--drama .thf-drama-cover, .tp .tp-book--drama .thf-drama-cover::after,
  .tp .thf-drama-mini, .thf-drama-mini__shine { animation: none; }
}

/* The site's dark theme restyles every button inside .audio-player-sticky-custom and the transcript
   (html[data-theme="dark"] ...). The drama switch keeps its own look in both themes. */
html .thf-drama-cta .thf-drama-btn {
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(246, 226, 164, .22), transparent 55%),
    linear-gradient(135deg, #1f3a2c 0%, #11231a 100%) !important;
  color: #fbf6e8 !important;
  border: 1px solid rgba(217, 180, 90, .75) !important;
  border-radius: 14px !important;
  padding: 14px 18px !important;
}
html.thf-drama-on .thf-drama-cta .thf-drama-btn {
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(246, 226, 164, .28), transparent 55%),
    linear-gradient(135deg, #3b2a12 0%, #1a130a 100%) !important;
  border-color: #f6e2a4 !important;
}
html.thf-drama-on #transcriptCustom {
  background: linear-gradient(180deg, #17301f, #0f2016) !important;
  border: 1px solid rgba(217, 180, 90, .45) !important;
}
html.thf-drama-on #transcriptCustom .word-custom { color: #ece6d2 !important; }
html.thf-drama-on #transcriptCustom .word-custom.thf-drama-voice { color: #f1d48a !important; }
html.thf-drama-on #transcriptCustom .word-custom.active { background: rgba(217, 180, 90, .45) !important; color: #fff !important; }
html.thf-drama-on .audio-player-content-custom {
  background: linear-gradient(135deg, #1f3a2c 0%, #11231a 100%) !important;
  box-shadow: 0 0 0 1px rgba(217, 180, 90, .6), 0 8px 28px rgba(0, 0, 0, .45) !important;
}
@media (max-width: 480px) { html .thf-drama-cta .thf-drama-btn { padding: 12px 14px !important; } }
/* The shelf's .tp-btn colours win otherwise; the Dramatize button must stand out. */
.tp a.tp-btn.thf-drama-mini, .tp a.tp-btn.thf-drama-mini:visited {
  background: linear-gradient(135deg, #1f3a2c, #11231a) !important;
  color: #f6e2a4 !important;
  border: 1px solid rgba(217, 180, 90, .95) !important;
}
.tp a.tp-btn.thf-drama-mini:hover { color: #fff7dc !important; border-color: #f6e2a4 !important; }

/* ---- Course front page (course_catalog/course.php): glowing preview image, NEW tag, Dramatize buttons ---- */
a.thf-drama-btn, a.thf-drama-btn:hover, a.thf-drama-btn:focus, a.thf-drama-btn:visited { text-decoration: none !important; color: #fbf6e8 !important; }
.thf-drama-cta--card { margin: 12px 0 0; }
.thf-drama-cta--card .thf-drama-btn { justify-content: center; }
.thf-drama-cta--card .thf-drama-btn__text { flex: none; text-align: left; }
.thf-drama-cta--banner { margin: 28px 0 6px; }
.thf-drama-cover-lg {
  position: relative;
  border-radius: 12px;
  overflow: visible !important;
  box-shadow: 0 0 0 3px rgba(217, 180, 90, .9), 0 0 22px 6px rgba(246, 226, 164, .45);
  animation: thf-drama-cover-glow 2.8s ease-in-out infinite;
}
.thf-drama-cover-lg::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 244, 205, .45) 50%, transparent 70%);
  background-size: 250% 100%;
  animation: thf-drama-cover-sweep 3.6s ease-in-out infinite;
  pointer-events: none;
  z-index: 2;
}
.thf-drama-new--lg {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 3;
  padding: 6px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f6e2a4, #d9b45a);
  color: #11231a;
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .4);
}
@media (prefers-reduced-motion: reduce) {
  .thf-drama-cover-lg, .thf-drama-cover-lg::after { animation: none; }
}

/* ---- Course lists (course_catalog/index.php): the dramatized course card glows ---- */
.course-card.thf-drama-card {
  /* no !important: the pulsing animation must be able to drive box-shadow */
  border-color: rgba(217, 180, 90, .95) !important;
  animation: thf-drama-card-glow 2.8s ease-in-out infinite;
}
.course-card.thf-drama-card .course-image-container { position: relative; overflow: hidden; }
.course-card.thf-drama-card .course-image-container::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 244, 205, .45) 50%, transparent 70%);
  background-size: 250% 100%;
  animation: thf-drama-cover-sweep 3.6s ease-in-out infinite;
  pointer-events: none;
  z-index: 2;
}
.thf-drama-new--card {
  position: absolute;
  bottom: 10px;
  left: 10px;
  z-index: 3;
  padding: 5px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f6e2a4, #d9b45a);
  color: #11231a;
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .4);
}
@media (prefers-reduced-motion: reduce) {
  .course-card.thf-drama-card, .course-card.thf-drama-card .course-image-container::after { animation: none; }
}

@keyframes thf-drama-card-glow {
  0%, 100% { box-shadow: 0 0 0 2px rgba(217, 180, 90, .8), 0 0 14px 3px rgba(246, 200, 90, .35); }
  50% { box-shadow: 0 0 0 3px rgba(246, 226, 164, 1), 0 0 34px 12px rgba(246, 200, 90, .65); }
}
/* course page: glow the whole preview card (its image box clips an inner glow) */
.course-preview-card:has(.thf-drama-cover-lg) {
  border-color: rgba(217, 180, 90, .95) !important;
  animation: thf-drama-card-glow 2.8s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) { .course-preview-card:has(.thf-drama-cover-lg) { animation: none; } }

/* After it is switched on, the switch shrinks to a small pill on the right ("✦ Dramatized · Original"). */
.thf-drama-cta.is-compact { display: flex; justify-content: flex-end; margin: 0 0 8px; }
html .thf-drama-cta.is-compact .thf-drama-btn {
  width: auto !important;
  padding: 5px 12px 5px 6px !important;
  gap: 8px;
  border-radius: 999px !important;
  animation: none;
  box-shadow: 0 0 10px rgba(217, 180, 90, .35);
}
.thf-drama-cta.is-compact .thf-drama-btn__icon { width: 22px; height: 22px; font-size: 11px; animation: none; }
.thf-drama-cta.is-compact .thf-drama-btn__text, .thf-drama-cta.is-compact .thf-drama-btn__badge, .thf-drama-cta.is-compact .thf-drama-btn__shine { display: none; }
.thf-drama-cta.is-compact .thf-drama-btn::after {
  content: attr(data-short);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .02em;
  color: #f6e2a4;
  white-space: nowrap;
}
.thf-drama-cta.is-compact .thf-drama-btn:hover::after { color: #fff7dc; }
