/* Audio Player — Dynamic Island header integration
   Native <audio> elements are hidden, replaced by inline trigger + header player */

/* Hide native audio elements that have been upgraded */
audio.audio-player--upgraded {
  display: none;
}

/* Inline play button that replaces native audio in the content flow */
.audio-inline-trigger {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--hairline);
  background: transparent;
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: border-color var(--duration-fast) var(--ease-default),
              color var(--duration-fast) var(--ease-default);
}

.audio-inline-trigger:hover {
  border-color: var(--heading);
  color: var(--heading);
}

.audio-inline-trigger svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ============================================
   HEADER AUDIO BUTTON — pulse indicator
   ============================================ */

.site-header__audio-btn {
  position: relative;
}

.site-header__audio-btn--playing::after {
  content: '';
  position: absolute;
  top: 6px;
  right: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--heading);
  animation: audio-header-pulse 2s ease-in-out infinite;
}

@keyframes audio-header-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.4); }
}

/* ============================================
   HEADER AUDIO PLAYER — inline controls
   ============================================ */

.audio-header__title {
  flex: 1;
  min-width: 0;
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audio-header__play {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--heading);
  color: var(--bg);
  border: none;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-default);
}

.audio-header__play:hover {
  background: var(--text);
}

.audio-header__play svg {
  width: 16px;
  height: 16px;
}

.audio-header__track {
  flex: 2;
  min-width: 60px;
  height: 4px;
  background: var(--hairline);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
}

.audio-header__track-fill {
  height: 100%;
  background: var(--heading);
  border-radius: 2px;
  width: 0%;
  transition: width 0.15s linear;
  pointer-events: none;
}

.audio-header__time {
  flex-shrink: 0;
  font-size: var(--text-xs);
  color: var(--meta);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.audio-header__skip {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  color: var(--text);
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
  transition: color var(--duration-fast) var(--ease-default);
}

.audio-header__skip:hover {
  color: var(--heading);
}

.audio-header__skip svg {
  width: 16px;
  height: 16px;
}

.audio-header__speed {
  flex-shrink: 0;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  padding: var(--space-1) var(--space-2);
  color: var(--meta);
  border: 1px solid var(--hairline);
  background: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
}

.audio-header__speed:hover {
  border-color: var(--heading);
  color: var(--heading);
}

