/* ============================================
   AUDIO PLAYER — مقالات التفريغ الصوتي (ta_audio)
   ============================================ */

.article-audio-player {
    direction: rtl;
    text-align: right;
    max-width: 42rem;
    margin: 0 auto 1.35rem;
    padding: 0 1rem;
}

.article-audio-player__inner {
    display: flex;
    align-items: stretch;
    gap: 1rem;
    padding: 0.9rem 1rem 0.95rem;
    border-radius: 1.1rem;
    border: 1px solid rgba(147, 51, 234, 0.38);
    background: linear-gradient(145deg, rgba(76, 29, 149, 0.42) 0%, rgba(30, 27, 75, 0.55) 55%, rgba(15, 23, 42, 0.65) 100%);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.article-audio-player__cover {
    flex-shrink: 0;
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 0.65rem;
    overflow: hidden;
    position: relative;
    background: linear-gradient(135deg, #6d28d9 0%, #4338ca 100%);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
}

.article-audio-player__cover-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-audio-player__cover-img--hidden {
    display: none;
}

.article-audio-player__cover-img--visible {
    display: block;
}

.article-audio-player__cover-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ede9fe;
    font-size: 1.45rem;
}

.article-audio-player__cover-fallback--hidden {
    display: none;
}

.article-audio-player__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.55rem;
}

.article-audio-player__meta {
    min-width: 0;
}

.article-audio-player__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.35;
    color: var(--text-main, #f9fafb);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.article-audio-player__artist {
    margin: 0.15rem 0 0;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.3;
    color: rgba(221, 214, 254, 0.88);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.article-audio-player__transport {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.article-audio-player__play {
    flex-shrink: 0;
    width: 2.55rem;
    height: 2.55rem;
    border: none;
    border-radius: 9999px;
    background: linear-gradient(135deg, #a78bfa 0%, #7c3aed 100%);
    color: #1e1b4b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.45);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.article-audio-player__play:hover:not(:disabled) {
    transform: scale(1.04);
    box-shadow: 0 6px 16px rgba(124, 58, 237, 0.55);
}

.article-audio-player__play:focus-visible {
    outline: 2px solid #c4b5fd;
    outline-offset: 2px;
}

.article-audio-player__play--disabled,
.article-audio-player__play:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    box-shadow: none;
    background: rgba(139, 92, 246, 0.35);
    color: #ede9fe;
}

.article-audio-player__play i {
    font-size: 0.9rem;
}

.article-audio-player__play [data-audio-icon-play] {
    margin-inline-start: 2px;
}

.article-audio-player__icon-pause {
    font-size: 0.85rem;
}

.article-audio-player__timeline {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.article-audio-player__seek {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 0.35rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.18);
    cursor: pointer;
    margin: 0;
}

.article-audio-player__seek::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 50%;
    background: #ede9fe;
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.5);
}

.article-audio-player__seek::-moz-range-thumb {
    width: 0.85rem;
    height: 0.85rem;
    border: none;
    border-radius: 50%;
    background: #ede9fe;
}

.article-audio-player__seek::-moz-range-track {
    height: 0.35rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.18);
}

.article-audio-player__times {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    font-variant-numeric: tabular-nums;
    color: rgba(237, 233, 254, 0.75);
    line-height: 1;
}

.article-audio-player__element {
    display: none;
}

.article-audio-player__soon {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.article-audio-player__soon-text {
    font-size: 0.875rem;
    font-weight: 700;
    color: rgba(237, 233, 254, 0.9);
}

.article-audio-player--soon .article-audio-player__artist {
    color: rgba(196, 181, 253, 0.75);
}

/* Academic theme */
[data-theme="academic"] .article-audio-player__inner {
    background: linear-gradient(145deg, rgba(124, 58, 237, 0.09) 0%, rgba(99, 102, 241, 0.07) 100%);
    border-color: rgba(124, 58, 237, 0.28);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.07);
}

[data-theme="academic"] .article-audio-player__title {
    color: var(--text-main);
}

[data-theme="academic"] .article-audio-player__artist {
    color: var(--text-secondary, #6b7280);
}

[data-theme="academic"] .article-audio-player__seek {
    background: rgba(124, 58, 237, 0.2);
}

[data-theme="academic"] .article-audio-player__times {
    color: var(--text-secondary, #6b7280);
}

[data-theme="academic"] .article-audio-player__soon-text {
    color: var(--text-secondary, #4b5563);
}

@media (max-width: 640px) {
    .article-audio-player {
        padding: 0 0.75rem;
        margin-bottom: 1rem;
    }

    .article-audio-player__inner {
        gap: 0.75rem;
        padding: 0.8rem 0.85rem;
    }

    .article-audio-player__cover {
        width: 3.75rem;
        height: 3.75rem;
    }

    .article-audio-player__title {
        font-size: 0.92rem;
    }

    .article-audio-player__play {
        width: 2.35rem;
        height: 2.35rem;
    }
}
