/* =========================================================
   LECTEUR AUDIO
========================================================= */

#audio-player {
    width: 100%;
}

.audio-container {
    width: 100%;
}

.custom-audio-player {
    width: 100%;
    box-sizing: border-box;

    padding: 1rem;

    border: 1px solid var(--color-stage-line);
    border-radius: 8px;

    background: var(--color-stage);
    box-shadow: var(--shadow-soft);
}


/* =========================================================
   CONTRÔLES
========================================================= */

.audio-controls {
    display: grid;

    grid-template-columns:
        auto
        auto
        minmax(0, 1fr)
        auto;

    align-items: center;

    gap: 0.9rem;

    width: 100%;
}


.audio-play-button {
    width: 46px;
    height: 46px;

    border: 0;
    border-radius: 50%;

    background: var(--color-white);
    color: var(--color-ink);

    cursor: pointer;

    font-size: 1.1rem;
    box-shadow: 0 0.45rem 0.9rem rgba(0, 0, 0, 0.18);
    transition: transform 160ms ease, background-color 160ms ease;
}

.audio-play-button:hover {
    background: var(--color-blue-100);
    transform: translateY(-1px);
}


/* =========================================================
   TIMELINE
========================================================= */

.audio-timeline {
    position: relative;

    width: 100%;
    height: 52px;

    box-sizing: border-box;
}


/*
 * Barre grise de fond
 */
.audio-timeline::before {
    content: "";

    position: absolute;

    left: 0;
    right: 0;

    top: 38px;

    height: 5px;

    border-radius: 999px;

    background: rgba(232, 238, 244, 0.32);
}


/*
 * Progression verte
 */
.audio-progress {
    position: absolute;

    left: 0;
    top: 38px;

    width: 0;
    height: 5px;

    border-radius: 999px;

    background: var(--color-music-accent);

    pointer-events: none;

    z-index: 2;
}


/* =========================================================
   RANGE INVISIBLE
========================================================= */

#audio-range {
    position: absolute;

    left: 0;
    right: 0;

    top: 28px;
    bottom: 0;

    width: 100%;
    height: 24px;

    margin: 0;

    opacity: 0;

    cursor: pointer;

    z-index: 10;
}


/* =========================================================
   SECTIONS AU-DESSUS DE LA TIMELINE
========================================================= */

.audio-markers {
    position: absolute;

    left: 0;
    right: 0;
    top: 0;

    height: 38px;

    pointer-events: none;

    z-index: 5;
}


/*
 * Chaque .audio-marker représente maintenant
 * toute la durée d'une section.
 *
 * left et width sont définis en JS.
 */
.audio-marker {
    position: absolute;

    top: 0;

    height: 34px;

    box-sizing: border-box;

    padding: 0 7px;

    border: 0;
    border-left:
        1px solid
        rgba(232, 238, 244, 0.36);

    background: transparent;

    color:
        rgba(232, 238, 244, 0.78);

    cursor: pointer;

    pointer-events: auto;

    overflow: visible;

    text-align: left;

    transition:
        background 0.15s ease,
        color 0.15s ease;
}


/*
 * Petite barre verticale indiquant
 * précisément le début de la section.
 */
.audio-marker::after {
    content: "";

    position: absolute;

    left: 0;
    top: 27px;

    width: 2px;
    height: 16px;

    border-radius: 2px;

    background:
        rgba(232, 238, 244, 0.86);
}


/* =========================================================
   NOM DE LA SECTION
========================================================= */

.audio-marker-label {
    position: static;

    display: flex;

    align-items: baseline;

    gap: 5px;

    width: 100%;

    padding: 0;

    background: transparent;

    color: inherit;

    transform: none;

    opacity: 1;

    pointer-events: none;

    overflow: hidden;

    white-space: nowrap;

    text-overflow: ellipsis;

    font-size: 0.75rem;
    font-weight: 700;
}


.audio-marker-time {
    flex: 0 0 auto;

    opacity: 0.55;

    font-size: 0.65rem;
    font-weight: 400;
}


/* =========================================================
   SURVOL
========================================================= */

.audio-marker:hover {
    color: var(--color-white);

    background:
        rgba(255, 255, 255, 0.08);
}


/* =========================================================
   SECTION EN COURS
========================================================= */

.audio-marker.is-active {
    color: var(--color-music-accent);

    background:
        rgba(184, 211, 232, 0.12);
}


.audio-marker.is-active::after {
    background: var(--color-music-accent);
}


/* =========================================================
   ANCIENS BOUTONS SOUS LE LECTEUR
   Plus utilisés.
========================================================= */

.audio-sections {
    display: none;
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 650px) {

    .audio-controls {
        grid-template-columns:
            auto
            minmax(0, 1fr)
            auto;
    }

    #audio-current-time {
        display: none;
    }

    .audio-marker-label {
        font-size: 0.65rem;
    }

    .audio-marker-time {
        display: none;
    }
}
