/* Newsroom blog audio player — compact + light/dark */

.newsroom-ap-stack,
.newsroom-ap {
    --newsroom-ap-accent: #6366f1;
    --newsroom-ap-accent-strong: #4f46e5;
    --newsroom-ap-accent-soft: rgba(99, 102, 241, 0.12);
    --newsroom-ap-border: #e2e8f0;
    --newsroom-ap-edge: #c7d2fe;
    --newsroom-ap-text: #0f172a;
    --newsroom-ap-muted: #64748b;
    --newsroom-ap-surface: #ffffff;
    --newsroom-ap-surface-2: #f8fafc;
    --newsroom-ap-track: #e2e8f0;
    --newsroom-ap-buffered: #cbd5e1;
    --newsroom-ap-pill-bg: #f8fafc;
    --newsroom-ap-volume-bg: rgba(255, 255, 255, 0.92);
    --newsroom-ap-shadow: 0 8px 22px rgba(99, 102, 241, 0.1), 0 2px 8px rgba(15, 23, 42, 0.04);
    --newsroom-ap-glow: rgba(99, 102, 241, 0.07);
    --newsroom-ap-caption-border: #dbeafe;
    --newsroom-ap-caption-bg: rgba(255, 255, 255, 0.72);
    --newsroom-ap-radius: 14px;
}

html.dark-mode .newsroom-ap-stack,
html.dark-mode .newsroom-ap,
html[data-theme="dark"] .newsroom-ap-stack,
html[data-theme="dark"] .newsroom-ap,
html[data-ab-theme="dark"] .newsroom-ap-stack,
html[data-ab-theme="dark"] .newsroom-ap,
html[data-bs-theme="dark"] .newsroom-ap-stack,
html[data-bs-theme="dark"] .newsroom-ap {
    --newsroom-ap-accent: #818cf8;
    --newsroom-ap-accent-strong: #a5b4fc;
    --newsroom-ap-accent-soft: rgba(129, 140, 248, 0.18);
    --newsroom-ap-border: #334155;
    --newsroom-ap-edge: #4338ca;
    --newsroom-ap-text: #f1f5f9;
    --newsroom-ap-muted: #94a3b8;
    --newsroom-ap-surface: #0f172a;
    --newsroom-ap-surface-2: #1e293b;
    --newsroom-ap-track: #334155;
    --newsroom-ap-buffered: #475569;
    --newsroom-ap-pill-bg: #1e293b;
    --newsroom-ap-volume-bg: rgba(30, 41, 59, 0.95);
    --newsroom-ap-shadow: 0 10px 28px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(129, 140, 248, 0.08);
    --newsroom-ap-glow: rgba(129, 140, 248, 0.12);
    --newsroom-ap-caption-border: #334155;
    --newsroom-ap-caption-bg: rgba(15, 23, 42, 0.85);
}

.newsroom-ap-stack {
    position: relative;
    margin-bottom: 1.25rem;
    border: 1px solid var(--newsroom-ap-edge);
    border-radius: var(--newsroom-ap-radius);
    overflow: hidden;
    background:
        radial-gradient(circle at 100% 0%, var(--newsroom-ap-glow), transparent 46%),
        linear-gradient(145deg, var(--newsroom-ap-surface) 0%, var(--newsroom-ap-surface-2) 100%);
    box-shadow: var(--newsroom-ap-shadow);
}

.newsroom-ap-stack::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #a5b4fc, var(--newsroom-ap-accent), var(--newsroom-ap-accent-strong));
    z-index: 1;
}

.np-single-post-wrap .newsroom-ap-stack {
    margin-top: 0.25rem;
}

.newsroom-ap-stack > .newsroom-ap,
.newsroom-ap-stack > .newsroom-ap-embed {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    margin-bottom: 0;
}

.newsroom-ap {
    margin-bottom: 0;
    border: 0;
    background: transparent;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    position: relative;
    z-index: 2;
}

.newsroom-ap__audio {
    display: none;
}

.newsroom-ap__inner {
    display: flex;
    gap: 0.85rem;
    padding: 0.75rem 0.9rem 0.7rem;
    align-items: center;
}

.newsroom-ap__art-wrap {
    position: relative;
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.18);
    border: 1px solid color-mix(in srgb, var(--newsroom-ap-accent) 25%, transparent);
}

.newsroom-ap__art {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.newsroom-ap__visualizer {
    position: absolute;
    inset: auto 0 0 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 2px;
    height: 18px;
    padding: 0 6px 5px;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.55), transparent);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.newsroom-ap.is-playing .newsroom-ap__visualizer {
    opacity: 1;
}

.newsroom-ap__bar {
    display: block;
    width: 2px;
    height: 6px;
    border-radius: 999px;
    background: #fff;
    transform-origin: bottom;
    animation: newsroomApBar 0.9s ease-in-out infinite;
}

.newsroom-ap__bar:nth-child(2) { animation-delay: 0.15s; }
.newsroom-ap__bar:nth-child(3) { animation-delay: 0.3s; }
.newsroom-ap__bar:nth-child(4) { animation-delay: 0.45s; }
.newsroom-ap__bar:nth-child(5) { animation-delay: 0.6s; }

.newsroom-ap:not(.is-playing) .newsroom-ap__bar {
    animation: none;
    height: 4px;
}

@keyframes newsroomApBar {
    0%, 100% { transform: scaleY(0.45); }
    50% { transform: scaleY(1.4); }
}

.newsroom-ap__body {
    flex: 1;
    min-width: 0;
}

.newsroom-ap__meta {
    margin-bottom: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.newsroom-ap__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    flex-shrink: 0;
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--newsroom-ap-accent);
    background: var(--newsroom-ap-accent-soft);
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    margin-bottom: 0;
}

.newsroom-ap__title {
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--newsroom-ap-text);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.newsroom-ap__artist {
    margin: 0;
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--newsroom-ap-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.newsroom-ap__artist--muted {
    font-weight: 400;
}

.newsroom-ap__progress-wrap {
    position: relative;
    height: 14px;
    display: flex;
    align-items: center;
    cursor: pointer;
    touch-action: none;
    margin-bottom: 0.1rem;
}

.newsroom-ap__progress-wrap:focus-visible {
    outline: 2px solid var(--newsroom-ap-accent);
    outline-offset: 2px;
    border-radius: 4px;
}

.newsroom-ap__progress-track {
    position: relative;
    width: 100%;
    height: 4px;
    background: var(--newsroom-ap-track);
    border-radius: 999px;
    overflow: visible;
    transition: height 0.15s ease;
}

.newsroom-ap__progress-wrap:hover .newsroom-ap__progress-track,
.newsroom-ap__progress-wrap.is-dragging .newsroom-ap__progress-track {
    height: 6px;
}

.newsroom-ap__progress-buffered,
.newsroom-ap__progress-played {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    border-radius: 999px;
    pointer-events: none;
}

.newsroom-ap__progress-buffered {
    background: var(--newsroom-ap-buffered);
    width: 0%;
}

.newsroom-ap__progress-played {
    background: linear-gradient(90deg, #818cf8, var(--newsroom-ap-accent));
    width: 0%;
}

.newsroom-ap__progress-thumb {
    position: absolute;
    top: 50%;
    left: 0%;
    width: 11px;
    height: 11px;
    margin-top: -5.5px;
    margin-left: -5.5px;
    border-radius: 50%;
    background: var(--newsroom-ap-surface);
    border: 2px solid var(--newsroom-ap-accent);
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.2);
    opacity: 0;
    transition: opacity 0.15s ease;
    pointer-events: none;
}

.newsroom-ap__progress-wrap:hover .newsroom-ap__progress-thumb,
.newsroom-ap__progress-wrap.is-dragging .newsroom-ap__progress-thumb {
    opacity: 1;
}

.newsroom-ap__time-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.62rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--newsroom-ap-muted);
    margin-bottom: 0.35rem;
}

.newsroom-ap__controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.newsroom-ap__controls-primary {
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.newsroom-ap__controls-secondary {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.newsroom-ap__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    border: 0;
    background: transparent;
    color: var(--newsroom-ap-muted);
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease, transform 0.12s ease;
    padding: 0;
    line-height: 1;
}

.newsroom-ap__btn:hover {
    color: var(--newsroom-ap-accent);
}

.newsroom-ap__btn:active {
    transform: scale(0.96);
}

.newsroom-ap__btn--ghost {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    font-size: 0.9rem;
}

.newsroom-ap__btn--ghost:hover {
    background: var(--newsroom-ap-accent-soft);
}

.newsroom-ap__btn-label {
    font-size: 0.58rem;
    font-weight: 700;
}

.newsroom-ap__btn--play {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--newsroom-ap-accent);
    color: #fff;
    font-size: 1.05rem;
    box-shadow: 0 3px 10px color-mix(in srgb, var(--newsroom-ap-accent) 40%, transparent);
}

.newsroom-ap__btn--play:hover {
    background: var(--newsroom-ap-accent-strong);
    color: #fff;
}

.newsroom-ap__btn--pill {
    height: 26px;
    padding: 0 0.5rem;
    border-radius: 999px;
    border: 1px solid var(--newsroom-ap-border);
    background: var(--newsroom-ap-pill-bg);
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--newsroom-ap-text);
}

.newsroom-ap__btn--pill:hover {
    background: var(--newsroom-ap-accent-soft);
    border-color: color-mix(in srgb, var(--newsroom-ap-accent) 40%, var(--newsroom-ap-border));
    color: var(--newsroom-ap-accent);
}

.newsroom-ap__speed-wrap {
    position: relative;
}

.newsroom-ap__speed-menu {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 0;
    min-width: 88px;
    padding: 0.3rem;
    background: var(--newsroom-ap-surface);
    border: 1px solid var(--newsroom-ap-border);
    border-radius: 10px;
    box-shadow: var(--newsroom-ap-shadow);
    z-index: 20;
}

.newsroom-ap__speed-menu[hidden] {
    display: none;
}

.newsroom-ap__speed-option {
    display: block;
    width: 100%;
    padding: 0.3rem 0.45rem;
    border: 0;
    border-radius: 6px;
    background: transparent;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--newsroom-ap-text);
    cursor: pointer;
}

.newsroom-ap__speed-option:hover,
.newsroom-ap__speed-option.is-active {
    background: var(--newsroom-ap-accent-soft);
    color: var(--newsroom-ap-accent);
}

.newsroom-ap__volume {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.35rem 0.2rem 0.5rem;
    border-radius: 999px;
    border: 1px solid var(--newsroom-ap-border);
    background: var(--newsroom-ap-volume-bg);
    min-width: 128px;
}

.newsroom-ap.is-muted .newsroom-ap__volume {
    border-color: #fca5a5;
    background: color-mix(in srgb, #fecaca 35%, var(--newsroom-ap-surface));
}

.newsroom-ap__volume-wrap {
    position: relative;
    width: 72px;
    height: 18px;
    display: flex;
    align-items: center;
    cursor: pointer;
    touch-action: none;
    flex-shrink: 0;
}

.newsroom-ap__volume-wrap:focus-visible {
    outline: 2px solid var(--newsroom-ap-accent);
    outline-offset: 2px;
    border-radius: 6px;
}

.newsroom-ap__volume-track {
    position: relative;
    width: 100%;
    height: 4px;
    background: var(--newsroom-ap-track);
    border-radius: 999px;
    overflow: visible;
    transition: height 0.15s ease;
}

.newsroom-ap__volume-wrap:hover .newsroom-ap__volume-track,
.newsroom-ap__volume-wrap.is-dragging .newsroom-ap__volume-track {
    height: 6px;
}

.newsroom-ap__volume-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #818cf8, var(--newsroom-ap-accent));
    pointer-events: none;
}

.newsroom-ap.is-muted .newsroom-ap__volume-fill {
    background: linear-gradient(90deg, #fca5a5, #f87171);
    opacity: 0.55;
}

.newsroom-ap__volume-thumb {
    position: absolute;
    top: 50%;
    left: 100%;
    width: 11px;
    height: 11px;
    margin-top: -5.5px;
    margin-left: -5.5px;
    border-radius: 50%;
    background: var(--newsroom-ap-surface);
    border: 2px solid var(--newsroom-ap-accent);
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.18);
    pointer-events: none;
    transition: opacity 0.15s ease;
    opacity: 0;
}

.newsroom-ap__volume-wrap:hover .newsroom-ap__volume-thumb,
.newsroom-ap__volume-wrap.is-dragging .newsroom-ap__volume-thumb,
.newsroom-ap__volume-wrap:focus-visible .newsroom-ap__volume-thumb {
    opacity: 1;
}

.newsroom-ap.is-muted .newsroom-ap__volume-thumb {
    border-color: #f87171;
}

.newsroom-ap__btn--mute {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 8px;
}

.newsroom-ap.is-muted .newsroom-ap__btn--mute {
    color: #dc2626;
    background: rgba(254, 226, 226, 0.65);
}

html.dark-mode .newsroom-ap.is-muted .newsroom-ap__btn--mute,
html[data-theme="dark"] .newsroom-ap.is-muted .newsroom-ap__btn--mute,
html[data-ab-theme="dark"] .newsroom-ap.is-muted .newsroom-ap__btn--mute,
html[data-bs-theme="dark"] .newsroom-ap.is-muted .newsroom-ap__btn--mute {
    color: #fca5a5;
    background: rgba(127, 29, 29, 0.35);
}

.newsroom-ap__volume-label {
    min-width: 30px;
    font-size: 0.6rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--newsroom-ap-muted);
    text-align: right;
}

.newsroom-ap-embed {
    border: 1px solid var(--newsroom-ap-border);
    border-radius: var(--newsroom-ap-radius);
    overflow: hidden;
    background: var(--newsroom-ap-surface-2);
    padding: 0.75rem;
    margin-bottom: 0;
    min-height: 96px;
}

.newsroom-ap-embed iframe,
.newsroom-ap-embed audio {
    width: 100%;
    max-width: 100%;
}

.np-media-caption--below-audio {
    margin-top: 0;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    border-top: 1px solid var(--newsroom-ap-caption-border);
    background: var(--newsroom-ap-caption-bg);
    color: var(--newsroom-ap-muted);
    position: relative;
    z-index: 2;
}

.newsroom-ap-stack .np-media-caption--below-audio:only-child,
.newsroom-ap-stack > .np-media-caption:only-child {
    border-top: 0;
}

.newsroom-ap + .np-media-caption--below-audio,
.newsroom-ap-embed + .np-media-caption--below-audio {
    margin-top: 0;
}

@media (max-width: 575.98px) {
    .newsroom-ap__inner {
        flex-direction: row;
        align-items: flex-start;
        padding: 0.7rem;
        gap: 0.7rem;
    }

    .newsroom-ap__art-wrap {
        width: 48px;
        height: 48px;
    }

    .newsroom-ap__meta {
        flex-wrap: wrap;
        gap: 0.3rem 0.45rem;
    }

    .newsroom-ap__title {
        flex: 1 1 100%;
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    .newsroom-ap__controls {
        flex-direction: column;
        align-items: stretch;
        gap: 0.45rem;
    }

    .newsroom-ap__controls-primary {
        justify-content: center;
    }

    .newsroom-ap__controls-secondary {
        justify-content: space-between;
        width: 100%;
    }

    .newsroom-ap__volume {
        flex: 1;
        justify-content: flex-end;
        min-width: 0;
    }

    .newsroom-ap__volume-wrap {
        width: 56px;
    }
}
