/* ============================================
   Inline audio player
   Native <audio> under a custom Apple-styled UI, so the podcast
   plays on the page instead of throwing the visitor to Libsyn.
   Loads after style.css and depends on its tokens.
   ============================================ */

.audio-player {
    display: grid;
    grid-template-columns: 168px 1fr;
    gap: 2rem;
    align-items: center;
    background: var(--gray-900);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 18px;
    padding: 1.75rem 2rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.audio-player:hover {
    border-color: rgba(255,255,255,0.16);
    box-shadow: 0 18px 50px -16px rgba(0,0,0,0.7);
}

/* Cover art */
.audio-art {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2c 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1rem;
}
.audio-art::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
      radial-gradient(circle at 30% 20%, rgba(255,59,48,0.28), transparent 55%),
      radial-gradient(circle at 80% 80%, rgba(41,151,255,0.14), transparent 55%);
}
.audio-art .art-inner { position: relative; z-index: 1; }
.audio-art .art-eyebrow {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.2em;
    color: var(--gray-300);
    margin-bottom: 0.6rem;
    font-weight: 500;
}
.audio-art .art-title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1;
    color: var(--white);
}

/* Body */
.audio-body { min-width: 0; }
.audio-body .source {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--gray-500);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 0.6rem;
    font-weight: 500;
}
.audio-body h4 {
    font-family: var(--font-display);
    font-size: clamp(1.1rem, 1.6vw, 1.4rem);
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.025em;
    color: var(--white);
    margin-bottom: 1.25rem;
}

/* Transport */
.audio-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.audio-play {
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 0;
    cursor: pointer;
    background: var(--white);
    color: var(--gray-900);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, background 0.2s ease;
}
.audio-play:hover { background: var(--accent); color: var(--white); transform: scale(1.06); }
.audio-play:active { transform: scale(0.97); }
.audio-play svg { width: 20px; height: 20px; fill: currentColor; }
.audio-play .icon-pause { display: none; }
.audio-play .icon-play { margin-left: 3px; }   /* optically centre the triangle */
.audio-player.playing .audio-play .icon-play { display: none; }
.audio-player.playing .audio-play .icon-pause { display: block; margin-left: 0; }

.audio-track { flex: 1 1 auto; min-width: 0; }

/* Scrubber. Range input, restyled — keeps keyboard + a11y for free. */
.audio-seek {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 999px;
    background: rgba(255,255,255,0.16);
    cursor: pointer;
    outline: none;
    /* --pct is written by media.js so the played portion fills red */
    background-image: linear-gradient(var(--accent), var(--accent));
    background-repeat: no-repeat;
    background-size: var(--pct, 0%) 100%;
    transition: height 0.15s ease;
}
.audio-seek:hover { height: 6px; }
.audio-seek::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 13px; height: 13px;
    border-radius: 50%;
    background: var(--white);
    box-shadow: 0 1px 6px rgba(0,0,0,0.6);
    cursor: pointer;
}
.audio-seek::-moz-range-thumb {
    width: 13px; height: 13px;
    border: 0;
    border-radius: 50%;
    background: var(--white);
    box-shadow: 0 1px 6px rgba(0,0,0,0.6);
    cursor: pointer;
}
.audio-seek:focus-visible { box-shadow: 0 0 0 3px rgba(41,151,255,0.5); }

.audio-time {
    display: flex;
    justify-content: space-between;
    margin-top: 0.6rem;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    color: var(--gray-500);
}
.audio-player.loading .audio-time .t-now::after {
    content: " loading…";
    color: var(--gray-700);
}

.audio-links {
    margin-top: 1.1rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.audio-links a { color: var(--gray-500); }
.audio-links a:hover { color: var(--white); }

@media (max-width: 640px) {
    .audio-player {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1.5rem;
    }
    .audio-art { max-width: 140px; }
    .audio-play { width: 46px; height: 46px; }
}
