/* CBA Episodes Styling */
.cba-episodes {
  margin-top: 60px;
}

.cba-episodes h1 {
  color: var(--wp--preset--color--pearl);
  margin-bottom: 2rem;
  font-family: 'QuicksandBold', sans-serif;
}

#cba-episodes-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.episode-audio {
  background-color: var(--wp--preset--color--darkmode);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.episode-info {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
  gap: 1.5rem;
}

.episode-title {
  color: var(--wp--preset--color--pearl);
  font-family: 'GlacialIndifference', sans-serif;
  font-size: 1rem;
  font-weight: normal;
  margin: 0;
  flex: 1;
  line-height: 1.4;
}

.episode-date {
  color: var(--wp--preset--color--pearl);
  font-family: 'GlacialIndifference', sans-serif;
  font-size: 0.9rem;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  background-color: rgba(255, 255, 255, 0.1);
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.episode-date-icon {
  width: 14px;
  height: 14px;
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

/* Hide native controls; custom UI is rendered separately */
.episode-audio audio {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
  display: none;
}

.episode-player {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
}

.player-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.player-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.32);
}

.cba-episodes .icon {
  width: 18px;
  height: 18px;
  fill: #f5f5f5;
}

.icon-pause,
.icon-volume-off {
  display: none;
}

.play-toggle.is-playing .icon-play {
  display: none;
}

.play-toggle.is-playing .icon-pause {
  display: block;
}

.volume-toggle.is-muted .icon-volume-on {
  display: none;
}

.volume-toggle.is-muted .icon-volume-off {
  display: block;
}

.time-display {
  color: rgba(255, 255, 255, 0.88);
  font-family: 'GlacialIndifference', sans-serif;
  font-size: 0.9rem;
  min-width: 110px;
}

.progress-wrapper {
  position: relative;
  flex: 1;
  height: 14px;
  display: flex;
  align-items: center;
}

.progress-bar {
  position: relative;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 3px;
  overflow: hidden;
}

.progress-buffer {
  position: absolute;
  inset: 0;
  width: 0;
  background: rgba(255, 255, 255, 0.42);
}

.progress-fill {
  position: absolute;
  inset: 0;
  width: 0;
  background: #f6f6f6;
}

.progress-thumb {
  position: absolute;
  top: 50%;
  left: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.3);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.progress-seek {
  position: absolute;
  inset: -6px 0;
  width: 100%;
  height: 20px;
  opacity: 0;
  cursor: pointer;
}

.icon-button {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--wp--preset--color--pearl);
  opacity: 0.9;
  transition: opacity 0.2s ease;
}

.icon-button:hover {
  opacity: 1;
}

.more-wrapper {
  position: relative;
  z-index: 5;
}

.more-menu {
  position: absolute;
  right: 0;
  top: 120%;
  min-width: 140px;
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 0.35rem 0;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
  display: none;
  z-index: 10;
}

.more-menu.is-open {
  display: block;
}

.more-menu .menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.45rem 0.9rem;
  background: transparent;
  border: none;
  color: var(--wp--preset--color--pearl);
  font-family: 'GlacialIndifference', sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
}

 .more-menu.menu-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 768px) {
  .episode-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .episode-title {
    font-size: 0.95rem;
  }
  
  .episode-audio {
    padding: 1rem 1.25rem;
  }

  .episode-player {
    display: grid;
    grid-template-columns: auto auto 1fr auto auto;
    grid-template-rows: auto auto;
    column-gap: 0.6rem;
    row-gap: 0.6rem;
    align-items: center;
  }

  .progress-wrapper {
    grid-column: 1 / -1;
    grid-row: 1;
    width: 100%;
    margin-top: 0.1rem;
  }

  .player-btn,
  .icon-button {
    width: 38px;
    height: 38px;
  }

  .player-btn { grid-column: 1; grid-row: 2; }
  .time-display { grid-column: 2; grid-row: 2; min-width: auto; font-size: 0.9rem; }
  .volume-toggle { grid-column: 4; grid-row: 2; }
  .more-wrapper { grid-column: 5; grid-row: 2; }

  .more-menu {
    top: 110%;
  }
}
