/* ============================================================
   Everyday French — Podcast Article Styles + Exercise Widgets
   Applied on posts with body class .ef-podcast

   Palette matches the site's Elementor kit globals (primary #733428,
   secondary #FFF0EE, accent #6E5C2E) instead of the generic blue/slate
   scale these widgets started with.

   Note: every `:hover` rule on a <button> element MUST set `color`
   explicitly, even if it's the same as the base color. The theme's
   generic `button:hover{color:#fff}` rule (theme.css) has higher CSS
   specificity than a plain class selector, so if a hover rule only
   changes `background` and leaves `color` unset, the browser falls back
   to the theme's rule for that property — white text on our light hover
   backgrounds. Explicit `color` in every hover rule avoids that.
   ============================================================ */

/* The --ef-* tokens are defined once, in assets/ef-tokens.css, which this
   stylesheet declares as a dependency. They used to be redeclared here as bare
   hex, which — same specificity, later load — quietly overrode the theme's
   mapping and left episode pages light in dark mode. Don't redeclare them. */

/* ----------------------------------------------------------
   1. Article layout
   ---------------------------------------------------------- */
.ef-podcast .entry-content,
.ef-podcast .elementor-widget-theme-post-content .elementor-widget-container {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.ef-podcast .entry-content > * {
  margin-top: 0;
  margin-bottom: 1.25rem;
}

.ef-podcast .entry-content h2 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--ef-primary);
  border-bottom: 2px solid var(--ef-tint);
  padding-bottom: 0.45rem;
  margin-top: 2.25rem;
  margin-bottom: 1rem;
}

/* ----------------------------------------------------------
   1b. Episode hero (intro + meta badge + listen/read/exercise guide)
   ---------------------------------------------------------- */
.ef-podcast .ef-episode-hero {
  margin-bottom: 2.25rem;
}
.ef-podcast .ef-episode-title {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ef-primary-dark);
  margin: 0 0 0.6rem;
}
.ef-podcast .ef-episode-meta {
  margin: 0 0 0.6rem;
}
.ef-podcast .ef-episode-meta__pill {
  display: inline-block;
  background: var(--ef-tint);
  color: var(--ef-primary-dark);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 3px 12px;
  border-radius: 20px;
  margin-right: 6px;
}
.ef-podcast .ef-episode-intro {
  font-size: 1.08rem;
  line-height: 1.7;
  color: var(--ef-text);
  margin: 0 0 0.75rem;
}
.ef-podcast .ef-episode-intro--zh {
  font-size: 0.97rem;
  color: var(--ef-text-subtle);
}
/* ----------------------------------------------------------
   1c. "In this episode" jump-nav
   ---------------------------------------------------------- */
.ef-podcast .ef-episode-nav {
  border: 1.5px solid var(--ef-border);
  border-radius: 10px;
  background: var(--ef-bg-soft);
  padding: 14px 18px;
  margin: 0 0 1.5rem;
}
.ef-podcast .ef-episode-nav__label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ef-text-muted);
  margin: 0 0 8px;
}
.ef-podcast .entry-content .ef-episode-nav ul {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  list-style: none;
  gap: 8px 18px;
  padding: 0;
  margin: 0;
  background: none;
}
.ef-podcast .entry-content .ef-episode-nav ul li {
  background: none;
  border-left: none;
  border-radius: 0;
  padding: 0;
  line-height: 1.4;
  font-size: inherit;
}
.ef-podcast .ef-episode-nav a {
  color: var(--ef-text-subtle);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.14s ease;
}
.ef-podcast .ef-episode-nav a:hover {
  color: var(--ef-primary);
}
.ef-podcast .entry-content h2[id] {
  scroll-margin-top: 90px;
}

/* ----------------------------------------------------------
   2. Spotify embed
   ---------------------------------------------------------- */
.ef-podcast .wp-block-embed__wrapper {
  display: flex;
  justify-content: center;
}
.ef-podcast .wp-block-embed__wrapper iframe {
  border-radius: 12px;
  max-width: 100%;
}

/* ----------------------------------------------------------
   3. Vocabulary cards
   ---------------------------------------------------------- */
.ef-podcast .entry-content ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ef-podcast .entry-content ul li {
  background: var(--ef-bg-soft);
  border-left: 4px solid var(--ef-primary);
  border-radius: 0 10px 10px 0;
  padding: 12px 16px;
  line-height: 1.65;
  font-size: 0.95rem;
}
.ef-podcast .entry-content ul li strong:first-child {
  display: inline-block;
  color: var(--ef-primary-dark);
  margin-bottom: 2px;
}
.ef-podcast .entry-content ul li small {
  display: block;
  margin-top: 5px;
  color: var(--ef-text-muted);
  font-size: 0.85rem;
}

/* ----------------------------------------------------------
   4. Collapsible transcription
   ---------------------------------------------------------- */
.ef-transcript-wrap {
  border: 1.5px solid var(--ef-border);
  border-radius: 10px;
  overflow: hidden;
  margin: 0.5rem 0 1.5rem;
}

.ef-transcript-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ef-text-subtle);
  background: var(--ef-bg-soft);
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.ef-transcript-toggle::-webkit-details-marker { display: none; }
.ef-transcript-toggle::before {
  content: '▶';
  font-size: 0.7em;
  transition: transform 0.2s;
  display: inline-block;
}
.ef-transcript-wrap[open] .ef-transcript-toggle::before {
  transform: rotate(90deg);
}
.ef-transcript-toggle:hover { background: var(--ef-border-light); }

.ef-transcript {
  padding: 16px 20px;
  font-size: 0.93rem;
  line-height: 1.85;
  color: var(--ef-text);
  border-top: 1px solid var(--ef-border);
}

.ef-transcript p { margin: 0 0 0.9rem; }
.ef-transcript p:last-child { margin-bottom: 0; }

mark.ef-highlight {
  background: var(--note-bg, #fef9c3);
  color: var(--note-ink, #78350f);
  border-radius: 3px;
  padding: 1px 3px;
  font-weight: 600;
  font-style: normal;
}

/* ----------------------------------------------------------
   5. Shared widget shell
   ---------------------------------------------------------- */
.ef-comprehension,
.ef-fillblank,
.ef-truefalse,
.ef-typeit,
.ef-reorder,
.ef-match {
  background: var(--surface, #fff);
  border: 1.5px solid var(--ef-border);
  border-radius: 14px;
  padding: 24px 28px;
  margin: 1rem 0;
  box-shadow: 0 1px 4px rgba(115,52,40,.08);
}

.ef-widget__tip {
  font-size: 0.82rem;
  color: var(--ef-text-muted);
  font-style: italic;
  margin: 0 0 16px;
}

/* Shared score + retry */
.ef-comp__results,
.ef-fb__results,
.ef-tf__results,
.ef-ti__results {
  margin-top: 16px;
  text-align: center;
  padding-top: 16px;
  border-top: 1px solid var(--ef-border-light);
}
.ef-comp__score,
.ef-fb__score,
.ef-tf__score,
.ef-ti__score {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ef-primary);
  margin-bottom: 10px;
}
.ef-comp__retry,
.ef-fb__retry,
.ef-tf__retry,
.ef-ti__retry {
  display: inline-block;
  padding: 7px 20px;
  background: var(--ef-border-light);
  border: 1.5px solid var(--ef-border);
  border-radius: 8px;
  font-size: 0.87rem;
  cursor: pointer;
  color: var(--ef-text-subtle);
  transition: background 0.14s;
}
.ef-comp__retry:hover,
.ef-fb__retry:hover,
.ef-tf__retry:hover,
.ef-ti__retry:hover { background: var(--ef-tint-strong); color: var(--ef-text-subtle); }

/* Shared submit / check buttons */
.ef-comp__submit,
.ef-fb__check,
.ef-tf__check,
.ef-ti__check {
  display: block;
  width: 100%;
  margin-top: 18px;
  padding: 11px 16px;
  background: var(--ef-primary);
  color: var(--on-fill, #fff);
  border: none;
  border-radius: 9px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.14s;
}
.ef-comp__submit:hover,
.ef-fb__check:hover,
.ef-tf__check:hover,
.ef-ti__check:hover { background: var(--ef-primary-dark); color: var(--on-fill, #fff); }

/* ----------------------------------------------------------
   6. MCQ widget
   ---------------------------------------------------------- */
.ef-comp__question { margin-bottom: 22px; }
.ef-comp__question:last-of-type { margin-bottom: 0; }
.ef-comp__question + .ef-comp__question {
  padding-top: 18px;
  border-top: 1px solid var(--ef-border-light);
}
.ef-comp__q-text {
  font-weight: 600;
  color: var(--ef-text);
  margin: 0 0 10px;
  line-height: 1.5;
  font-size: 0.97rem;
}
.ef-comp__options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ef-comp__option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  background: var(--ef-bg-soft);
  border: 1.5px solid var(--ef-border);
  border-radius: 9px;
  cursor: pointer;
  font-size: 0.92rem;
  color: var(--ef-text);
  transition: background 0.14s, border-color 0.14s;
  line-height: 1.45;
}
.ef-comp__option:hover:not(:disabled) {
  background: var(--ef-secondary);
  border-color: var(--ef-tint-strong);
  color: var(--ef-primary);
}
.ef-comp__option--selected {
  background: var(--ef-tint) !important;
  border-color: var(--ef-primary) !important;
  color: var(--ef-primary) !important;
  font-weight: 500;
}
.ef-comp__option--correct {
  background: var(--ef-correct-bg) !important;
  border-color: var(--ef-correct-border) !important;
  color: var(--ef-correct-text) !important;
  font-weight: 600;
}
.ef-comp__option--correct::after { content: ' ✓'; }
.ef-comp__option--wrong {
  background: var(--ef-wrong-bg) !important;
  border-color: var(--ef-wrong-border) !important;
  color: var(--ef-wrong-text) !important;
  text-decoration: line-through;
  opacity: 0.8;
}

/* ----------------------------------------------------------
   7. Fill-blank (word bank) widget
   ---------------------------------------------------------- */
.ef-fb__sentence {
  margin: 0 0 12px;
  line-height: 1.8;
  font-size: 0.95rem;
  color: var(--ef-text);
}
.ef-fb__blank {
  display: inline-block;
  min-width: 90px;
  border-bottom: 2.5px solid var(--ef-primary);
  margin: 0 4px;
  text-align: center;
  font-weight: 600;
  color: var(--ef-primary);
  border-radius: 3px 3px 0 0;
  padding: 1px 6px;
  transition: background 0.12s;
  cursor: default;
  letter-spacing: 0.03em;
}
.ef-fb__blank--filled {
  background: var(--ef-tint);
  cursor: pointer;
}
.ef-fb__blank--filled:hover { background: var(--ef-tint-strong); }
.ef-fb__blank--correct {
  background: var(--ef-correct-bg) !important;
  border-color: var(--ef-correct-border) !important;
  color: var(--ef-correct-text) !important;
  cursor: default !important;
}
.ef-fb__blank--correct::after { content: ' ✓'; }
.ef-fb__blank--wrong {
  background: var(--ef-wrong-bg) !important;
  border-color: var(--ef-wrong-border) !important;
  color: var(--ef-wrong-text) !important;
  text-decoration: line-through;
  cursor: default !important;
}
.ef-fb__bank {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 0;
  padding: 14px;
  background: var(--ef-bg-soft);
  border-radius: 10px;
  border: 1px solid var(--ef-border);
}
.ef-fb__chip {
  padding: 7px 14px;
  background: var(--surface, #fff);
  border: 1.5px solid var(--ef-tint-strong);
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ef-primary);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, opacity 0.12s;
}
.ef-fb__chip:hover:not(:disabled) {
  background: var(--ef-tint);
  border-color: var(--ef-primary);
  color: var(--ef-primary);
}
.ef-fb__chip--used { opacity: 0.3; pointer-events: none; }
.ef-fb__chip:disabled { opacity: 0.4; cursor: default; }

/* ----------------------------------------------------------
   8. True / False widget
   ---------------------------------------------------------- */
.ef-tf__row {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--ef-border-light);
}
.ef-tf__row:last-of-type { margin-bottom: 0; border-bottom: none; padding-bottom: 0; }
.ef-tf__stmt {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ef-text);
  margin: 0 0 10px;
  line-height: 1.5;
}
.ef-tf__btns {
  display: flex;
  gap: 10px;
}
.ef-tf__btn {
  flex: 1;
  padding: 9px 14px;
  border: 1.5px solid var(--ef-border);
  border-radius: 9px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.14s, border-color 0.14s;
  background: var(--ef-bg-soft);
  color: var(--ef-text);
}
.ef-tf__btn:hover:not(:disabled) {
  background: var(--ef-secondary);
  border-color: var(--ef-tint-strong);
  color: var(--ef-primary);
}
.ef-tf__btn--selected {
  background: var(--ef-tint) !important;
  border-color: var(--ef-primary) !important;
  color: var(--ef-primary) !important;
}
.ef-tf__btn--correct {
  background: var(--ef-correct-bg) !important;
  border-color: var(--ef-correct-border) !important;
  color: var(--ef-correct-text) !important;
}
.ef-tf__btn--correct::after { content: ' ✓'; }
.ef-tf__btn--wrong {
  background: var(--ef-wrong-bg) !important;
  border-color: var(--ef-wrong-border) !important;
  color: var(--ef-wrong-text) !important;
  text-decoration: line-through;
  opacity: 0.8;
}

/* ----------------------------------------------------------
   9. Type-it (fill in the blank, typed) widget
   ---------------------------------------------------------- */
.ef-ti__sentence {
  margin: 0 0 14px;
  line-height: 1.9;
  font-size: 0.95rem;
  color: var(--ef-text);
}
.ef-ti__sentence .ef-ti__input {
  /* Scoped with the parent selector (not just `.ef-ti__input`) so this
     always outranks the theme's generic `input[type=text]{width:100%}`
     rule (theme.css) — that rule has the exact same specificity as a bare
     class selector, and theme.css loads *after* this stylesheet, so on a
     tie it was winning and stretching the input to fill its container,
     pushing it onto its own line. `width: auto` hands sizing back to the
     `size` attribute, which JS sets to roughly the answer's length. */
  display: inline-block;
  width: auto;
  vertical-align: baseline;
  border: none;
  border-bottom: 2.5px solid var(--ef-primary);
  background: var(--ef-secondary);
  color: var(--ef-primary);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  padding: 2px 6px;
  border-radius: 3px 3px 0 0;
  outline: none;
  margin: 0 3px;
  transition: border-color 0.14s, background 0.14s;
  min-width: 3ch;
}
.ef-ti__sentence .ef-ti__input:focus {
  border-color: var(--ef-primary-dark);
  background: var(--ef-tint);
}
.ef-ti__input--correct {
  border-color: var(--ef-correct-border) !important;
  background: var(--ef-correct-bg) !important;
  color: var(--ef-correct-text) !important;
}
.ef-ti__input--wrong {
  border-color: var(--ef-wrong-border) !important;
  background: var(--ef-wrong-bg) !important;
  color: var(--ef-wrong-text) !important;
  text-decoration: line-through;
}
.ef-ti__correction {
  display: inline-block;
  margin-left: 6px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ef-correct-text);
  background: var(--ef-correct-bg);
  border-radius: 4px;
  padding: 1px 6px;
}
.ef-ti__correction::before { content: '→ '; }
.ef-ti__hint {
  font-size: 0.8rem;
  color: var(--ef-text-muted);
  font-style: italic;
}

/* ----------------------------------------------------------
   10. Word Reorder widget
   ---------------------------------------------------------- */
.ef-ro__item {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--ef-border-light);
}
.ef-ro__item:last-of-type { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }

.ef-ro__pool {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 38px;
  padding: 8px;
  background: var(--ef-bg-soft);
  border-radius: 8px;
  border: 1px dashed var(--ef-border);
  margin-bottom: 8px;
  align-items: center;
}

.ef-ro__chip {
  padding: 6px 12px;
  background: var(--surface, #fff);
  border: 1.5px solid var(--ef-tint-strong);
  border-radius: 20px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ef-primary);
  cursor: pointer;
  transition: background 0.12s;
}
.ef-ro__chip:hover:not(:disabled) { background: var(--ef-tint); color: var(--ef-primary); }
.ef-ro__chip:disabled { opacity: 0.4; cursor: default; }

.ef-ro__slot {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 42px;
  padding: 8px;
  background: var(--ef-secondary);
  border-radius: 8px;
  border: 2px solid var(--ef-tint-strong);
  align-items: center;
}
.ef-ro__slot:empty::before {
  content: '↑ Clique sur les mots ci-dessus';
  color: var(--ef-text-subtle);
  font-size: 0.8rem;
  font-style: italic;
}

.ef-ro__slot-word {
  padding: 6px 12px;
  background: var(--ef-tint);
  border: 1.5px solid var(--ef-primary);
  border-radius: 20px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ef-primary);
  cursor: pointer;
  transition: background 0.12s;
}
.ef-ro__slot-word:hover:not(:disabled) { background: var(--ef-tint-strong); color: var(--ef-primary); }
.ef-ro__slot-word--correct {
  background: var(--ef-correct-bg) !important; border-color: var(--ef-correct-border) !important; color: var(--ef-correct-text) !important; cursor: default !important;
}
.ef-ro__slot-word--wrong {
  background: var(--ef-wrong-bg) !important; border-color: var(--ef-wrong-border) !important; color: var(--ef-wrong-text) !important; cursor: default !important;
}

/* ----------------------------------------------------------
   11. Matching widget
   ---------------------------------------------------------- */
.ef-match__cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: start;
}
.ef-match__col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ef-match__item {
  display: block;
  width: 100%;
  text-align: center;
  padding: 10px 12px;
  background: var(--ef-bg-soft);
  border: 1.5px solid var(--ef-border);
  border-radius: 9px;
  font-size: 0.88rem;
  color: var(--ef-text);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  line-height: 1.4;
}
.ef-match__item:hover:not(:disabled):not(.ef-match__item--matched) {
  background: var(--ef-secondary); border-color: var(--ef-tint-strong); color: var(--ef-primary);
}
.ef-match__item--selected {
  background: var(--ef-tint) !important; border-color: var(--ef-primary) !important;
  color: var(--ef-primary) !important; font-weight: 600;
}
.ef-match__item--matched {
  background: var(--ef-correct-bg) !important; border-color: var(--ef-correct-border) !important;
  color: var(--ef-correct-text) !important; font-weight: 600; cursor: default;
}
.ef-match__item--matched::after { content: ' ✓'; }
.ef-match__item--wrong {
  background: var(--ef-wrong-bg) !important; border-color: var(--ef-wrong-border) !important; color: var(--ef-wrong-text) !important;
}
.ef-match__results {
  margin-top: 16px; text-align: center; padding-top: 16px;
  border-top: 1px solid var(--ef-border-light); grid-column: 1 / -1;
}
.ef-match__score { font-size: 1.15rem; font-weight: 700; color: var(--ef-correct-text); margin-bottom: 10px; }
.ef-match__retry {
  display: inline-block; padding: 7px 20px; background: var(--ef-border-light);
  border: 1.5px solid var(--ef-border); border-radius: 8px; font-size: 0.87rem;
  cursor: pointer; color: var(--ef-text-subtle); transition: background 0.14s;
}
.ef-match__retry:hover { background: var(--ef-tint-strong); color: var(--ef-text-subtle); }

/* ----------------------------------------------------------
   11b. Expression of the day
   ---------------------------------------------------------- */
.ef-podcast .ef-expression {
  background: var(--ef-secondary);
  border: 1.5px solid var(--ef-tint-strong);
  border-radius: 10px;
  padding: 18px 22px;
}
.ef-podcast .ef-expression__phrase {
  font-size: 1rem;
  color: var(--ef-primary-dark);
  margin: 0 0 8px;
}
.ef-podcast .ef-expression__example {
  font-size: 0.92rem;
  color: var(--ef-text-subtle);
  margin: 0 0 8px;
}
.ef-podcast .ef-expression__gloss {
  font-size: 0.88rem;
  color: var(--ef-text-muted);
  margin: 0;
}

/* ----------------------------------------------------------
   12. Speaking prompt
   ---------------------------------------------------------- */
.ef-podcast .ef-speaking {
  background: var(--note-bg, #fefce8);
  border: 1.5px solid var(--note-bd, #fde68a);
  border-radius: 10px;
  padding: 16px 20px;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--note-ink, #78350f);
}

/* ----------------------------------------------------------
   13. Mobile
   ---------------------------------------------------------- */
@media (max-width: 600px) {
  .ef-comprehension,
  .ef-fillblank,
  .ef-truefalse,
  .ef-typeit,
  .ef-reorder,
  .ef-match { padding: 18px 16px; }
  .ef-podcast .ef-episode-nav,
  .ef-podcast .ef-expression { padding: 14px 16px; }
  .ef-podcast .entry-content h2 { font-size: 0.95rem; }
  .ef-tf__btns { gap: 8px; }
  .ef-match__cols { grid-template-columns: 1fr; }
  .ef-match__item { font-size: 0.82rem; padding: 8px 10px; }
}
