/****** Lecteur audio ******/

#spk-bar {
  position: fixed;
  left: auto;
  bottom: 15px;
  z-index: 99999;
  transform: translateY(125%);
  transition: all 0.25s ease;
  font-size: 27px;
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.35);
  padding: 20px;
  border-radius: 10px;
  color: var(--gris-attenue);
  background-color: var(--bleu-fonce);
  width: 1250px;
  max-width: 90%;
  transform-origin: bottom right; /* ✅ important */
  border: 1px solid grey !important;
}

#spk-bar.active {
  transform: translateY(0);
}

#spk-bar * {
  box-sizing: border-box;
}

.spk-row {
  display: grid;
  grid-template-columns: calc(50% - 112px) 200px calc(50% - 112px);
  gap: 12px;
  align-items: center;
}

.spk-media {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  max-width: 40vw;
}

.spk-cover {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  flex: 0 0 auto;
}

.spk-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.spk-title {
  text-align: left;
  font: 600 12px/16px "Montserrat", sans-serif;
  color: var(--blanc);
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  max-height: 55px;;
}

.spk-ctrls {
  display: flex;
  justify-content: center;
  gap: 8px;
  width: auto;
  align-items: center;
}

.spk-btn,
.spk-btn-return {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0;
  cursor: pointer;
  transition: filter 0.2s ease;
  flex-shrink: 0;
}

.spk-btn--play {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background-color: transparent;
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    color: var(--bleu-fonce);
    border: none;
    cursor: pointer;
}

.spk-btn--play.play {
  background-image: url("../../icons/play-jaune.svg");
}

.spk-btn--play.pause {
  background-image: url("../../icons/pause-jaune.svg");
}

.spk-btn:hover {
  filter: brightness(0.8);
}

.spk-btn-return {
  width: 52px;
  height: 52px;
  border: none;
  border-radius: 10px;
  font-size: 32px;
  color: var(--gris-attenue);
  background-color: transparent;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 50%;
  transition: all ease 0.3s;
}

.spk-btn--back {
  background-image: url("../../icons/reculer.svg");
}

.spk-btn--back:hover {
  transform: rotate(-30deg);
}

.spk-btn--fwd {
  background-image: url("../../icons/avancer.svg");
}

.spk-btn--fwd:hover {
  transform: rotate(30deg);
}

.spk-btn-return:hover {
  filter: brightness(1.5);
}


.spk-progress-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.spk-progress {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  width: calc(100% - 80px);
}

.spk-time {
  font-size: 15px;
  color: var(--gris-attenue);
}

.spk-range {
  appearance: none;
  height: 6px;
  background: #3a394a;
  border-radius: 999px;
  outline: none;
}

.spk-range::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--jaune-or);
  cursor: pointer;
}

.spk-range::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--jaune-or);
  border: none;
  cursor: pointer;
}

.spk-close {
  width: 27px;
  height: 27px;
  border: none;
  border-radius: 10px;
  font-size: 32px;
  color: var(--gris-attenue);
  background-color: transparent;
  background-repeat: no-repeat;
  background-position: center;
  background-image: url("../../icons/fermer.svg");
  background-size: cover;
  transition: all ease 0.3s;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.spk-close:hover,
.spk-view:hover {
  opacity: 0.8;
}

.spk-view {
  position: relative;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 8px;
  background: var(--bleu-fonce);
  cursor: pointer;
  overflow: hidden;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.spk-view::before,
.spk-view::after{
  content: "";
  position: absolute;
  width: 13px;
  height: 13px;
  background: url("../../icons/angle.svg") center/contain no-repeat;
}

/* Angle haut-gauche */
.spk-view::before {
  top: 8px;
  left: 8px;
  transform: rotate(270deg); /* ⬅️ inversé ici */
  transition: transform 0.3s ease;
}

/* Angle bas-droit */
.spk-view::after {
  bottom: 8px;
  right: 8px;
  transform: rotate(90deg); /* ⬅️ inversé ici aussi */
  transition: transform 0.3s ease;
}

/* État hover : angles qui se referment */
.spk-view::before{
  transform: rotate(90deg);
  top: 5px;
  left: 7px;
}

.spk-view::after{
  transform: rotate(-90deg);
  bottom: 7px;
  right: 5px;
}

.small .spk-view::before {
    transform: rotate(-90deg);
    top: 8px;
    left: 8px;
}

.small .spk-view::after {
    transform: rotate(90deg);
    bottom: 10px;
    right: 9px;
}

.spk-iframe {
  display: none; /* Visible seulement si on charge le widget Spreaker */
}


/* Lecteur réduit */
#spk-bar.small{
  width: 295px;
}

#spk-bar .spk-progress,
#spk-bar .spk-title,
#spk-bar .spk-btn-return{
  transform: opacity ease 1s;
}

#spk-bar.small .spk-progress,
#spk-bar.small .spk-title,
#spk-bar.small .spk-btn-return{
  display: none!important;
  opacity: 0;
}

#spk-bar.small .spk-row{
  grid-template-columns: calc(50% - 65px) 85px calc(50% - 45px);
}

#spk-bar.small .spk-ctrls {
  gap: 0px;
}

#spk-bar.small .spk-nav-unique {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.spk-nav {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-direction: column;
}

.spk-btn-lang {
  background: #ffffff;
}

.spk-btn-lang svg g path{
  fill: #002349;
}

.spk-btn-lang.active svg g path{
  fill: #ffffff;
}

.spk-btn-lang:hover {
  background: #fff;
  color: #002349;
}

.spk-btn-lang.active {
  background: #ffbf00;
  border-color: #ffbf00;
}

.spk-btn-lang.active .lang-text{
  color: #ffffff;
}

.spk-btn-lang.active .icone-svg-play,
.icone-svg-pause{
  display: none!important;
}

.spk-btn-lang.active .icone-svg-pause{
  display: flex!important;
}

@media (min-width: 1400px) {
  #spk-bar {
    right: calc((100vw - 1260px) / 2);
  }
}
@media (max-width: 1399px) {

  #spk-bar.active {
    /*left: 50%;
    transform: translate(-50%,0);*/
    left:inherit;
    right: 0;
    transform: translate(-30px, 0);
    max-width: calc(100% - 60px);
  }
}

@media (max-width: 1024px) {

  /* Lecteur audio */

  .spk-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px; /* espacement horizontal et vertical moderne */
    flex-direction: row-reverse;
  }

  /* Les deux blocs principaux restent sur la même ligne */
  .spk-media {
    flex: 1 1 auto;
    min-width: calc(100% - 100px);
    flex-direction: row-reverse;
  }

  .spk-media.with-btn-lang {min-width: calc(100% - 180px);}

  .spk-ctrls {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .spk-btn-return{
    display:none!important;
  }

  .spk-title{
    max-height: inherit;
  }

  /* La barre de progression passe dessous */
  .spk-progress-container {
    flex: 0 0 100%;
    order: 3;          /* forcer en dessous */
    margin-top: 10px;
  }

  .spk-title {
    max-width: unset;
  }
}

@media (max-width: 767px) {

  /* Lecteur audio */

  .spk-progress {
    max-width: 100vw;
  }
}

@media (max-width: 500px) {

  .spk-row .bouton-audio:hover {
    width: 100px;
  }

  .spk-row .bouton-audio:hover .line::after {
    opacity: 0;
  }

  .spk-cover {
    width: 100%;
    height: 100%;
    display: none;
  }

  #spk-bar.small {
    width: 190px;
  }

  #spk-bar.small .spk-media{
    display: none!important;
  }

  #spk-bar.small .spk-ctrls{
    width: 100%;
    gap: 0;
  }
}

/* Mini-bouton (optionnel) */

.spk-mini {
  display: flex;
  justify-content: center;
  align-items: center;
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 10000;
  width: 52px;
  height: 52px;
  border: none;
  border-radius: 50%;
  background: var(--bleu-fonce);
  color: var(--blanc);
  font-weight: 900;
  font-size: 1rem;
  cursor: pointer;
  display: none;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease;
}

.spk-mini--pulse {
  animation: spkPulse 1.2s infinite;
}

.spk-mini img {
  width: 35px;
  height: 35px;
}

@keyframes spkPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
}