/* =============================================================================
   Winds & Echoes — Audio Player
   assets/css/audio.css
   ============================================================================= */

/* ── Player container ──────────────────────────────────────────────────────── */

.wae-audio-player {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin: 0 0 2rem;
  max-width: var(--content-width);
  margin-left: auto;
  margin-right: auto;
}

/* Audio-first layout — larger, above the fold */
.gh-article.audio-first .wae-audio-player {
  margin-bottom: 3rem;
  padding: 1.5rem;
  background: var(--forest);
  border-color: var(--forest-dk);
}

.gh-article.audio-first .wae-play-btn      { background: var(--white); color: var(--forest); }
.gh-article.audio-first .wae-progress-fill { background: var(--white); }
.gh-article.audio-first .wae-progress-thumb { background: var(--white); }
.gh-article.audio-first .wae-progress-bar  { background: rgba(255,255,255,.2); }
.gh-article.audio-first .wae-time-current,
.gh-article.audio-first .wae-time-total,
.gh-article.audio-first .wae-track-label   { color: rgba(255,255,255,.8); }
.gh-article.audio-first .wae-speed-btn     { color: rgba(255,255,255,.8); border-color: rgba(255,255,255,.3); }
.gh-article.audio-first .wae-download-btn  { color: rgba(255,255,255,.8); border-color: rgba(255,255,255,.3); }
.gh-article.audio-first .wae-audio-tab     { color: rgba(255,255,255,.6); border-color: rgba(255,255,255,.2); }
.gh-article.audio-first .wae-audio-tab.active { color: var(--white); border-color: var(--white); background: rgba(255,255,255,.15); }

/* ── Tabs (when multiple recordings) ─────────────────────────────────────── */

.wae-audio-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 0.875rem;
  flex-wrap: wrap;
}

.wae-audio-tab {
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-muted);
  background: transparent;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all .15s;
}

.wae-audio-tab.active {
  background: var(--forest);
  color: var(--white);
  border-color: var(--forest);
}

/* ── Controls row ─────────────────────────────────────────────────────────── */

.wae-audio-controls {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

/* Play/pause button */
.wae-play-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--forest);
  color: var(--white);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s, transform .1s;
}

.wae-play-btn:active { transform: scale(.95); }
.wae-play-btn svg    { width: 20px; height: 20px; }

/* Progress bar */
.wae-progress-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  min-width: 0;
}

.wae-progress-bar {
  position: relative;
  height: 4px;
  background: var(--color-border);
  border-radius: 99px;
  cursor: pointer;
}

.wae-progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: var(--forest);
  border-radius: 99px;
  pointer-events: none;
  width: 0%;
  transition: width .1s linear;
}

.wae-progress-thumb {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  background: var(--forest);
  border-radius: 50%;
  left: 0%;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s;
}

.wae-progress-bar:hover .wae-progress-thumb { opacity: 1; }

.wae-time-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.wae-track-label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  max-width: 200px;
  text-align: center;
}

/* Actions */
.wae-audio-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.wae-speed-btn,
.wae-download-btn {
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-muted);
  background: transparent;
  cursor: pointer;
  font-family: var(--font-body);
  text-decoration: none;
  transition: color .15s, border-color .15s;
}

.wae-speed-btn:hover,
.wae-download-btn:hover { color: var(--color-text); border-color: var(--color-text-muted); }

/* ── Audio-first post layout ──────────────────────────────────────────────── */

.gh-article.audio-first .gh-article-header {
  text-align: center;
}

.gh-article.audio-first .gh-article-title {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
}

.gh-article.audio-first .gh-article-image {
  max-height: 400px;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 480px) {
  .wae-audio-actions { display: none; } /* hide speed/download on small screens */
  .wae-track-label   { display: none; }
}
