/*! Lecteur chapitré — v3.0.0 */

.lc-lecteur {
  --lc-accent: #2b59c3;
  --lc-on-accent: #fff;
  --lc-bg: #fff;
  --lc-surface: #f3f4f7;
  --lc-hover: #f0f2f5;
  --lc-border: rgba(17, 24, 39, .09);
  --lc-text: #141a26;
  --lc-muted: #6a7386;
  --lc-track: #e3e6ec;
  --lc-tip-bg: #141a26;
  --lc-tip-text: #fff;
  --lc-error: #c2410c;
  --lc-radius: 18px;
  --lc-shadow: 0 1px 2px rgba(17, 24, 39, .05), 0 12px 32px -16px rgba(17, 24, 39, .25);
  --lc-font: inherit;
  --lc-accent-soft: color-mix(in srgb, var(--lc-accent) 10%, transparent);
  --lc-accent-line: color-mix(in srgb, var(--lc-accent) 30%, transparent);

  display: block;
  max-width: 680px;
  margin: 1.6em 0;
  color: var(--lc-text);
  font-family: var(--lc-font);
  font-size: 15px;
  line-height: 1.4;
  text-align: left;
  -webkit-font-smoothing: antialiased;
}

.lc-lecteur[data-theme="sombre"] {
  --lc-accent: #7b9cff;
  --lc-on-accent: #0f1420;
  --lc-bg: #171b24;
  --lc-surface: #232834;
  --lc-hover: #212633;
  --lc-border: rgba(255, 255, 255, .08);
  --lc-text: #eef1f6;
  --lc-muted: #97a0b3;
  --lc-track: #2f3644;
  --lc-tip-bg: #eef1f6;
  --lc-tip-text: #141a26;
  --lc-error: #fb923c;
  --lc-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 14px 34px -16px rgba(0, 0, 0, .65);
  --lc-accent-soft: color-mix(in srgb, var(--lc-accent) 16%, transparent);
}

@media (prefers-color-scheme: dark) {
  .lc-lecteur[data-theme="auto"] {
    --lc-accent: #7b9cff;
    --lc-on-accent: #0f1420;
    --lc-bg: #171b24;
    --lc-surface: #232834;
    --lc-hover: #212633;
    --lc-border: rgba(255, 255, 255, .08);
    --lc-text: #eef1f6;
    --lc-muted: #97a0b3;
    --lc-track: #2f3644;
    --lc-tip-bg: #eef1f6;
    --lc-tip-text: #141a26;
    --lc-error: #fb923c;
    --lc-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 14px 34px -16px rgba(0, 0, 0, .65);
    --lc-accent-soft: color-mix(in srgb, var(--lc-accent) 16%, transparent);
  }
}

.lc-lecteur *,
.lc-lecteur *::before,
.lc-lecteur *::after { box-sizing: border-box; }
.lc-lecteur [hidden] { display: none !important; }
.lc-lecteur audio { display: none !important; }

/* Boutons : on neutralise les styles du thème WordPress */
.lc-lecteur .lc-btn {
  all: unset;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font: inherit;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .15s, color .15s, border-color .15s, transform .15s, box-shadow .15s, opacity .15s;
}
.lc-lecteur .lc-btn svg { width: 20px; height: 20px; fill: currentColor; flex: none; }
.lc-lecteur .lc-btn:focus-visible,
.lc-lecteur .lc-track:focus-visible { outline: 2px solid var(--lc-accent); outline-offset: 3px; }

/* Carte */
.lc-lecteur .lc-card {
  background: var(--lc-bg);
  border: 1px solid var(--lc-border);
  border-radius: var(--lc-radius);
  box-shadow: var(--lc-shadow);
  padding: 20px 22px 14px;
}

/* En-tête */
.lc-lecteur .lc-head { display: flex; align-items: center; gap: 16px; }

.lc-lecteur .lc-play {
  position: relative;
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--lc-accent);
  color: var(--lc-on-accent);
  box-shadow: 0 8px 18px -8px var(--lc-accent);
}
.lc-lecteur .lc-play:hover { transform: scale(1.05); }
.lc-lecteur .lc-play:active { transform: scale(.96); }
.lc-lecteur .lc-play svg { width: 24px; height: 24px; }
.lc-lecteur .lc-play .lc-i-play { margin-left: 2px; }
.lc-lecteur .lc-i-pause,
.lc-lecteur.is-playing .lc-i-play { display: none; }
.lc-lecteur.is-playing .lc-i-pause { display: block; }
.lc-lecteur .lc-play::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--lc-accent);
  opacity: 0;
  transition: opacity .2s;
}
.lc-lecteur.is-loading .lc-play::after { opacity: 1; animation: lc-spin .8s linear infinite; }
.lc-lecteur.no-src .lc-play,
.lc-lecteur.is-error .lc-play { opacity: .35; pointer-events: none; box-shadow: none; }

.lc-lecteur .lc-meta { flex: 1; min-width: 0; }
.lc-lecteur .lc-over {
  margin-bottom: 3px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--lc-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lc-lecteur .lc-title {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -.01em;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lc-lecteur .lc-sub {
  margin-top: 2px;
  font-size: 13px;
  color: var(--lc-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lc-lecteur .lc-sub.is-msg { color: var(--lc-muted); }
.lc-lecteur.is-error .lc-sub.is-msg { color: var(--lc-error); }

/* Barre de progression chapitrée */
.lc-lecteur .lc-scrub { margin-top: 18px; }
.lc-lecteur .lc-track {
  position: relative;
  height: 22px;
  cursor: pointer;
  touch-action: none;
  border-radius: 6px;
  outline: none;
}
.lc-lecteur .lc-rail {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 6px;
  transform: translateY(-50%);
  border-radius: 6px;
  overflow: hidden;
  background: var(--lc-track);
  transition: height .15s;
}
.lc-lecteur .lc-track:hover .lc-rail,
.lc-lecteur.is-dragging .lc-rail { height: 9px; }
.lc-lecteur .lc-fill {
  position: absolute;
  inset: 0;
  background: var(--lc-accent);
  transform-origin: left center;
  transform: scaleX(0);
}
.lc-lecteur .lc-zone { position: absolute; top: 0; bottom: 0; display: none; }
.lc-lecteur .lc-zone-hover { background: color-mix(in srgb, var(--lc-text) 12%, transparent); }
.lc-lecteur .lc-zone-loop { background: color-mix(in srgb, var(--lc-accent) 35%, transparent); }
.lc-lecteur .lc-marks { position: absolute; inset: 0; pointer-events: none; }
.lc-lecteur .lc-mark {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  margin-left: -1px;
  background: var(--lc-bg);
}
.lc-lecteur .lc-thumb {
  position: absolute;
  left: 0;
  top: 50%;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: var(--lc-accent);
  box-shadow: 0 0 0 3px var(--lc-bg), 0 1px 5px rgba(0, 0, 0, .28);
  pointer-events: none;
  transition: width .15s, height .15s, margin .15s;
}
.lc-lecteur .lc-track:hover .lc-thumb,
.lc-lecteur.is-dragging .lc-thumb { width: 16px; height: 16px; margin: -8px 0 0 -8px; }
.lc-lecteur.no-src .lc-thumb { display: none; }

.lc-lecteur .lc-tip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  z-index: 2;
  display: flex;
  gap: 7px;
  max-width: 280px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--lc-tip-bg);
  color: var(--lc-tip-text);
  font-size: 12.5px;
  line-height: 1.3;
  white-space: nowrap;
  transform: translateX(-50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity .12s;
}
.lc-lecteur .lc-tip-label { overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.lc-lecteur .lc-tip-time { opacity: .65; font-variant-numeric: tabular-nums; }
.lc-lecteur .lc-tip.is-time-only .lc-tip-label { display: none; }
.lc-lecteur .lc-tip.is-time-only .lc-tip-time { opacity: 1; }
.lc-lecteur .lc-track:hover .lc-tip,
.lc-lecteur.is-dragging .lc-tip { opacity: 1; }
.lc-lecteur.no-src .lc-tip { display: none; }
@media (hover: none) {
  .lc-lecteur .lc-track:hover .lc-tip { opacity: 0; }
  .lc-lecteur.is-dragging .lc-tip { opacity: 1; }
}

.lc-lecteur .lc-times {
  display: flex;
  justify-content: space-between;
  margin-top: 3px;
  font-size: 12px;
  color: var(--lc-muted);
  font-variant-numeric: tabular-nums;
}

/* Commandes */
.lc-lecteur .lc-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}
.lc-lecteur .lc-nav { display: flex; gap: 2px; margin-left: -8px; }
.lc-lecteur .lc-opts { display: flex; gap: 8px; }
.lc-lecteur:not(.is-playlist) .lc-nav { visibility: hidden; }

.lc-lecteur .lc-icon { width: 38px; height: 38px; border-radius: 50%; color: var(--lc-text); }
.lc-lecteur .lc-icon:hover { background: var(--lc-hover); }
.lc-lecteur .lc-icon:disabled { opacity: .3; cursor: default; background: none; }

.lc-lecteur .lc-chip {
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--lc-border);
  border-radius: 999px;
  color: var(--lc-muted);
  font-size: 13px;
  font-weight: 550;
}
.lc-lecteur .lc-chip svg { width: 15px; height: 15px; }
.lc-lecteur .lc-chip:hover { color: var(--lc-text); background: var(--lc-hover); }
.lc-lecteur .lc-chip[aria-pressed="true"],
.lc-lecteur .lc-chip.is-mod {
  color: var(--lc-accent);
  background: var(--lc-accent-soft);
  border-color: var(--lc-accent-line);
}
.lc-lecteur .lc-speed { min-width: 54px; font-variant-numeric: tabular-nums; }

/* Liste des pistes */
.lc-lecteur .lc-browse {
  margin: 12px -10px 0;
  padding-top: 10px;
  border-top: 1px solid var(--lc-border);
}
.lc-lecteur:not(.is-playlist) .lc-browse,
.lc-lecteur.no-list .lc-browse { display: none; }

.lc-lecteur .lc-list {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0 0 2px;
}
.lc-lecteur.is-long .lc-list {
  max-height: 420px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--lc-track) transparent;
}
.lc-lecteur .lc-list li { margin: 0; padding: 0; list-style: none; }
.lc-lecteur .lc-list li::before,
.lc-lecteur .lc-list li::marker { content: none; }
.lc-lecteur .lc-list li[hidden] { display: none; }

/* Recherche */
.lc-lecteur .lc-search {
  position: relative;
  margin: 0 10px 8px;
}
.lc-lecteur .lc-search svg {
  position: absolute;
  left: 11px;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  color: var(--lc-muted);
  pointer-events: none;
}
.lc-lecteur .lc-search input {
  box-sizing: border-box;
  width: 100%;
  height: 36px;
  margin: 0;
  padding: 0 12px 0 34px;
  border: 1px solid var(--lc-border);
  border-radius: 10px;
  background: var(--lc-surface);
  color: var(--lc-text);
  font: inherit;
  font-size: 14px;
  outline: none;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .15s, background-color .15s;
}
.lc-lecteur .lc-search input::placeholder { color: var(--lc-muted); opacity: 1; }
.lc-lecteur .lc-search input:focus { border-color: var(--lc-accent-line); background: var(--lc-bg); }
.lc-lecteur .lc-empty { padding: 14px 12px 6px; color: var(--lc-muted); font-size: 14px; text-align: center; }

/* Sous-listes (accordéon) */
.lc-lecteur .lc-group + .lc-group { border-top: 1px solid var(--lc-border); }
.lc-lecteur .lc-group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  text-align: left;
}
.lc-lecteur .lc-group-head:hover { background: var(--lc-hover); }
.lc-lecteur .lc-chev {
  flex: none;
  width: 16px !important;
  height: 16px !important;
  fill: none !important;
  color: var(--lc-muted);
  transition: transform .2s ease;
}
.lc-lecteur .lc-group.is-open .lc-chev,
.lc-lecteur.is-searching .lc-chev { transform: rotate(90deg); }
.lc-lecteur .lc-group-title {
  flex: 1;
  min-width: 0;
  font-size: 14.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lc-lecteur .lc-group-meta {
  flex: none;
  font-size: 12.5px;
  color: var(--lc-muted);
  font-variant-numeric: tabular-nums;
}
.lc-lecteur .lc-group.is-current .lc-group-title { color: var(--lc-accent); }
.lc-lecteur .lc-group-now { display: none; align-items: flex-end; gap: 2px; height: 10px; color: var(--lc-accent); flex: none; }
.lc-lecteur .lc-group-now i {
  display: block;
  width: 2.5px;
  height: 100%;
  border-radius: 1px;
  background: currentColor;
  transform-origin: bottom;
  animation: lc-eq 1s ease-in-out infinite;
}
.lc-lecteur .lc-group-now i:nth-child(2) { animation-delay: -.45s; }
.lc-lecteur .lc-group-now i:nth-child(3) { animation-delay: -.75s; }
.lc-lecteur.is-playing .lc-group.is-current:not(.is-open) .lc-group-now { display: flex; }

.lc-lecteur .lc-sub-wrap {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .25s ease;
}
.lc-lecteur .lc-group.is-open .lc-sub-wrap,
.lc-lecteur.is-searching .lc-sub-wrap { grid-template-rows: 1fr; }
.lc-lecteur .lc-sublist {
  min-height: 0;
  overflow: hidden;
  list-style: none;
  margin: 0;
  padding: 0 0 0 14px;
}
.lc-lecteur .lc-group.is-open .lc-sublist,
.lc-lecteur.is-searching .lc-sublist { padding-bottom: 8px; }

.lc-lecteur .lc-item {
  position: relative;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 12px;
  border-radius: 12px;
  text-align: left;
}
.lc-lecteur .lc-item:hover { background: var(--lc-hover); }
.lc-lecteur .lc-idx {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--lc-surface);
  color: var(--lc-muted);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: background-color .15s, color .15s;
}
.lc-lecteur .lc-label {
  font-size: 14.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lc-lecteur .lc-time { font-size: 13px; color: var(--lc-muted); font-variant-numeric: tabular-nums; }

.lc-lecteur .lc-item.is-active { background: var(--lc-accent-soft); }
.lc-lecteur .lc-item.is-active .lc-idx { background: var(--lc-accent); color: var(--lc-on-accent); }
.lc-lecteur .lc-item.is-active .lc-label { font-weight: 600; color: var(--lc-text); }
.lc-lecteur .lc-item.is-active .lc-time { color: var(--lc-accent); }

/* Petit égaliseur animé sur la partie en cours */
.lc-lecteur .lc-eq { display: none; align-items: flex-end; gap: 2px; height: 11px; }
.lc-lecteur .lc-eq i {
  display: block;
  width: 2.5px;
  height: 100%;
  border-radius: 1px;
  background: currentColor;
  transform-origin: bottom;
  animation: lc-eq 1s ease-in-out infinite;
}
.lc-lecteur .lc-eq i:nth-child(2) { animation-delay: -.45s; }
.lc-lecteur .lc-eq i:nth-child(3) { animation-delay: -.75s; }
.lc-lecteur.is-playing .lc-item.is-active .lc-num { display: none; }
.lc-lecteur.is-playing .lc-item.is-active .lc-eq { display: flex; }

@keyframes lc-eq { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }
@keyframes lc-spin { to { transform: rotate(360deg); } }

/* Mobile */
@media (max-width: 520px) {
  .lc-lecteur .lc-card { padding: 16px 16px 10px; border-radius: 16px; }
  .lc-lecteur .lc-head { gap: 13px; }
  .lc-lecteur .lc-play { width: 50px; height: 50px; }
  .lc-lecteur .lc-title { font-size: 16px; }
  .lc-lecteur .lc-loop { padding: 0 10px; }
  .lc-lecteur .lc-loop .lc-chip-text { display: none; }
  .lc-lecteur .lc-browse { margin-left: -8px; margin-right: -8px; }
  .lc-lecteur .lc-group-meta { font-size: 12px; }
  .lc-lecteur .lc-sublist { padding-left: 6px; }
  .lc-lecteur .lc-item { padding: 9px 8px; gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .lc-lecteur .lc-eq i { animation: none; transform: scaleY(.7); }
  .lc-lecteur *, .lc-lecteur .lc-btn { transition: none !important; }
}
