/**
 * Audio Player Component Styles
 */

.field--audio-player {
  margin: 1rem auto;
  max-width: 700px;
}

 .audio__button-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  /* container-type: inline-size; */
  background-color: #ECECEC;
  padding: 0 10px;
  border-radius: 5px;
}

.audio__button-wrapper--small {
  background-color: #fff;
}

.audio__listen {
  font-weight: bold;
  color: #333;
  font-size: 14px;
}

.audio__button {
  cursor: pointer;
  display: inline-block;
  transition: opacity 0.3s ease;
  border-radius: 50%;
  padding: 1px;
  width: 24px;
  height: 24px;
  margin: 0 10px;
}

.audio__button--play-pause,
.audio__button--play {
  border: 2px solid #cecfd0;
  border-radius: 50%;
  padding: 1px;
  width: 55px;
  height: 55px;
}

/* Small play button modifier for teasers - BEM compliant */
.audio__button--small {
  width: 40px;
  height: 40px;
  padding: 0;
  margin: 0;
}

.audio__button-svg--small {
  width: 36px;
  height: 36px;
}

.audio__button--hidden {
  display: none;
}

.audio__button:hover svg circle,
.audio__button:hover svg path:first-child {
  fill: #8a1e28;
}

/* Hide audio__subscribe-text on mobile */
@media (max-width: 768px) {
  .audio__subscribe-text {
    display: none;
  }
}

.audio__subscribe-item {
  display: flex;
  align-items: center;
}

.audio__duration-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-grow: 1;
}

.audio__duration {
  font-size: 14px;
  color: #8f2934;
  white-space: nowrap;
  font-weight: 700;
  font-variant-numeric: lining-nums;
  font-family: "Source Sans Pro",sans-serif;
}

.audio__progress-container {
  flex-grow: 1;
  height: 6px;
  background-color: #ddd;
  border-radius: 3px;
  cursor: pointer;
  position: relative;
}

.audio__progress-bar {
  height: 100%;
  background-color: #ac2b37;
  border-radius: 3px;
  width: 0%;
  transition: width 0.1s ease;
}

.audio__speed {
  padding: 5px;
  border: 1px solid #ccc;
  border-radius: 3px;
  background-color: #ececec;
  font-size: 12px;
}

.audio__tag-wrapper {
  display: none;
}

.audio__wrapper audio {
  width: 100%;
  height: 40px;
}

/* Hide the default audio controls when using custom player */
.audio__wrapper audio:not([controls]) {
  display: none;
}

/* Container query support for responsive audio player */
@container (max-width: 349px) {
  .audio__progress-container {
    display: none;
  }

  /* Reorder elements: play button, time, speed control */
  .audio__listen {
    order: 1;
  }

  .audio__button--play-pause,
  .audio__button--pause {
    order: 2;
  }

  .audio__duration {
    order: 3;
  }

  .audio__speed {
    order: 4;
  }

  .audio__duration-wrapper {
    order: 3;
  }
}

/* Fallback responsive adjustments for browsers without container query support */
@media (max-width: 768px) {
  .audio__button-wrapper {
    flex-wrap: wrap;
    gap: 5px;
  }

  .audio__duration-wrapper {
    order: 2;
    margin-top: 5px;
  }

  .audio__speed {
    order: 3;
  }
}

.audio__subscribe {
  margin: 14px 65px 0 0;
  align-items: center;
  justify-content: space-between;
  display: flex;
}

@media all and (min-width: 40em) {
  .audio__subscribe {
    margin-right: 14px;
  }
}

@media all and (min-width: 75em) {
  .audio__subscribe {
    margin-right: 65px;
  }
}
