/* 주보 목록 — 소리주보 버튼과 카드 안 플레이어 (templates/msd01/program/jubo/bookList.php, js/jubo-sound.js) */

/* ── 버튼 한 줄: 바로보기 · 다운받기 · 소리주보 ──
   목록에 소리주보가 하나라도 있으면(--sound) 모든 카드를 같은 배치로 바꿔 높이를 맞춘다 */
.msd-jubo__grid--sound .msd-jubo__btns {
    position: relative;   /* 플레이어 기준점 */
    flex-wrap: nowrap;
    gap: 4px;
}
.msd-jubo__grid--sound .msd-jubo__btn {
    flex: 1 1 0;
    min-width: 0;
    justify-content: center;
    gap: 3px;
    padding: 0 2px;
    font-size: clamp(13px, 0.9722vw, 14px);
    white-space: nowrap;
}
.msd-jubo__grid--sound .msd-jubo__btn img,
.msd-jubo__grid--sound .msd-jubo__btn svg { width: 17px; height: 17px; }
button.msd-jubo__listen { font-family: inherit; line-height: normal; cursor: pointer; }
.msd-jubo__grid--sound .msd-jubo__listen[aria-expanded="true"] {
    border-color: var(--color-brand);
    background: var(--color-brand);
    color: #fff;
}

/* 좁은 카드: 아이콘 위 · 글자 아래 */
@container (max-width: 236px) {
    .msd-jubo__grid--sound .msd-jubo__btn {
        flex-direction: column-reverse;
        height: 52px;
        padding: 0;
        border-radius: 12px;
        font-size: 12px;
    }
}
@container (max-width: 150px) {
    .msd-jubo__grid--sound .msd-jubo__btn { font-size: 11px; }
}

/* ── 플레이어: 버튼 줄 바로 위(날짜 자리)에 겹쳐 띄워 카드 높이와 버튼은 그대로 둔다 ── */
.msd-jubo__player {
    box-sizing: border-box;
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(100% - 12px);
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 280px;
    height: 42px;
    margin: 0 auto;
    padding: 0 8px 0 5px;
    border-radius: 999px;
    background: var(--color-brand);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
    color: #fff;
}
.msd-jubo__player[hidden] { display: none; }

.msd-jubo__play,
.msd-jubo__close {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
}
.msd-jubo__play { width: 32px; height: 32px; background: #fff; color: var(--color-brand); }
.msd-jubo__close { width: 24px; height: 24px; background: transparent; color: #fff; }
.msd-jubo__close:hover { background: rgba(255, 255, 255, 0.18); }
.msd-jubo__play .ic-pause,
.msd-jubo__player.is-playing .msd-jubo__play .ic-play { display: none; }
.msd-jubo__player.is-playing .msd-jubo__play .ic-pause { display: block; }

/* 진행바: --pos 까지 흰색으로 채움 */
.msd-jubo__seek {
    -webkit-appearance: none;
    appearance: none;
    flex: 1 1 0;
    min-width: 0;
    height: 18px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}
.msd-jubo__seek::-webkit-slider-runnable-track {
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(to right, #fff var(--pos, 0%), rgba(255, 255, 255, 0.35) var(--pos, 0%));
}
.msd-jubo__seek::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    margin-top: -4px;
    border: 0;
    border-radius: 50%;
    background: #fff;
}
.msd-jubo__seek::-moz-range-track { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.35); }
.msd-jubo__seek::-moz-range-progress { height: 4px; border-radius: 2px; background: #fff; }
.msd-jubo__seek::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: #fff; }

.msd-jubo__listen:focus-visible,
.msd-jubo__player button:focus-visible,
.msd-jubo__seek:focus-visible { outline: 2px solid #ffb300; outline-offset: 2px; }

.msd-jubo__time {
    flex: 0 0 auto;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0;
    white-space: nowrap;
}
.msd-jubo__time b { font-weight: 500; }
.msd-jubo__time i { font-style: normal; opacity: 0.75; }

/* 좁은 카드(모바일 2열): 전체 길이 → 현재 시간 순으로 숨겨 진행바 폭을 확보 */
@container (max-width: 230px) {
    .msd-jubo__time i { display: none; }
    .msd-jubo__player { gap: 5px; padding-right: 5px; }
}
@container (max-width: 165px) {
    .msd-jubo__time { display: none; }
}
