/* =====================================================================
   Article audio: headphone buttons and the floating player
   ===================================================================== */

/* ---------- Headphone button on article cards ---------- */

.blog-card-actions-right {
    display: inline-flex;
    align-items: center;
    gap: 14px;
}

.hba-listen-card {
    min-width: 24px;
    min-height: 24px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    color: inherit;
}

.hba-listen-card i {
    font-size: 1.15rem;
}

.hba-listen.is-active i,
.hba-listen.is-playing i {
    color: #d89b00;
}

.hba-listen:focus-visible {
    outline: 2px solid #d89b00;
    outline-offset: 3px;
    border-radius: 4px;
}

/* ---------- "Listen to this article" bar on the article page ---------- */

.hba-listen-bar {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 22px;
    padding: 10px 18px 10px 12px;
    border: 1px solid #e7dfc9;
    border-radius: 999px;
    background: #fbf7ec;
    color: #412e03;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.hba-listen-bar:hover {
    background: #f6eed6;
    box-shadow: 0 4px 14px rgba(65, 46, 3, 0.1);
}

.hba-listen-bar > i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #412e03;
    color: #ffffff;
    font-size: 1rem;
}

.hba-listen-bar.is-active > i {
    background: #d89b00;
    color: #2c1f02;
}

.hba-listen-bar .hba-bar-text strong {
    display: block;
    font-size: 0.95rem;
    line-height: 1.2;
}

.hba-listen-bar .hba-bar-text small {
    display: block;
    margin-top: 2px;
    font-size: 0.78rem;
    color: #7a6a45;
}

/* ---------- The floating player ---------- */

.hba-player {
    position: fixed;
    left: 50%;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    z-index: 2147483000;

    width: min(560px, calc(100vw - 24px));

    color: #ffffff;
    font-family: inherit;

    background: rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(14px) saturate(1.2);
    backdrop-filter: blur(14px) saturate(1.2);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 18px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);

    opacity: 0;
    transform: translate(-50%, 18px) scale(0.96);
    transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.hba-player[hidden] {
    display: none;
}

.hba-player.is-open {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
}

.hba-player-full {
    padding: 14px 16px 14px;
}

.hba-player-top {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hba-player-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #d89b00;
    color: #2c1f02;
    font-size: 1.05rem;
}

.hba-player-info {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.hba-player-label {
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
}

.hba-player-title {
    font-size: 0.95rem;
    line-height: 1.25;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hba-player-source {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.72);
}

.hba-player-window {
    flex: 0 0 auto;
    display: flex;
    gap: 4px;
}

.hba-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #ffffff;
    font: inherit;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.15s ease;
}

.hba-btn:hover,
.hba-btn:focus-visible {
    background: rgba(255, 255, 255, 0.16);
    outline: none;
}

.hba-progress {
    margin-top: 12px;
    height: 5px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.22);
    overflow: hidden;
}

.hba-progress-bar {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 99px;
    background: #d89b00;
    transition: width 0.3s ease;
}

.hba-times {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.78);
    font-variant-numeric: tabular-nums;
}

.hba-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 4px;
}

.hba-controls .hba-speed {
    min-width: 48px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    font-size: 0.82rem;
    font-weight: 700;
}

.hba-controls .hba-main {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #ffffff;
    color: #2c1f02;
    font-size: 1.1rem;
}

.hba-controls .hba-main:hover {
    background: #f1e6c5;
}

.hba-note {
    margin: 8px 0 0;
    text-align: center;
    font-size: 0.8rem;
    color: #ffd98a;
}

/* ---------- Minimised: a small pill ---------- */

.hba-player-mini {
    display: none;
    align-items: center;
    gap: 4px;
    padding: 6px 8px 6px 14px;
}

.hba-player.is-minimized {
    width: min(360px, calc(100vw - 24px));
    border-radius: 999px;
}

.hba-player.is-minimized .hba-player-full {
    display: none;
}

.hba-player.is-minimized .hba-player-mini {
    display: flex;
}

.hba-mini-open {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    border: 0;
    background: transparent;
    color: #ffffff;
    font: inherit;
    font-size: 0.85rem;
    text-align: left;
    cursor: pointer;
}

.hba-mini-open i {
    color: #d89b00;
}

.hba-mini-title {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* ---------- Phones ---------- */

@media (max-width: 480px) {
    .hba-player {
        bottom: calc(10px + env(safe-area-inset-bottom, 0px));
        border-radius: 16px;
    }

    .hba-player-full {
        padding: 12px 12px 12px;
    }

    .hba-player-icon {
        width: 36px;
        height: 36px;
    }

    .hba-listen-bar {
        width: 100%;
        border-radius: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hba-player {
        transition: opacity 0.01s;
    }
}

html.hba-no-audio .hba-listen {
    display: none !important;
}

/* ---------- Phone article lists: pictures without rounded corners ---------- */

@media (max-width: 768px) {
    .blog-card .blog-image,
    .blog-card .blog-image img,
    .home-blogs .blog-card .blog-image,
    .home-blogs .blog-card .blog-image img,
    .blog-page .blog-card .blog-image,
    .blog-page .blog-card .blog-image img {
        border-radius: 0 !important;
    }
}
