/* --- Blogcast Player --- */

.blogcast-player {
    width: 100%;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    padding: 1.2em 1.2em;
    margin-bottom: 2em;
    box-sizing: border-box;
}

.blogcast-player h2 {
    font-size: 1.2em;
    margin: 0 0 0.8em;
    text-align: center;
}

/* Controls row */
.blogcast-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6em;
}

/* Play button */
.blogcast-play {
    width: 2.6em;
    height: 2.6em;
    border-radius: 50%;
    border: 2px solid currentColor;
    background: none;
    font-size: 1em;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}

.blogcast-play:hover {
    background: currentColor;
    color: #fff;
}

.blogcast-play:hover {
    /* Invert icon color on hover */
    filter: invert(1);
}

/* Progress slider */
.blogcast-progress {
    flex: 1 1 120px;
    min-width: 80px;
    height: 6px;
    cursor: pointer;
    accent-color: currentColor;
}

/* Time display */
.blogcast-time {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85em;
    opacity: 0.7;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Speed button group */
.blogcast-speed {
    display: flex;
    gap: 0;
    flex-shrink: 0;
}

.blogcast-speed-btn {
    background: none;
    border: 1px solid #ccc;
    padding: 0.2em 0.45em;
    font-size: 0.78em;
    cursor: pointer;
    line-height: 1.3;
    transition: background 0.15s, font-weight 0.15s;
}

.blogcast-speed-btn:first-child {
    border-radius: 4px 0 0 4px;
}

.blogcast-speed-btn:last-child {
    border-radius: 0 4px 4px 0;
}

.blogcast-speed-btn+.blogcast-speed-btn {
    border-left: 0;
}

.blogcast-speed-active {
    font-weight: 700;
    background: rgba(0, 0, 0, 0.08);
}

/* Row 2: time + volume */
.blogcast-row-time-vol {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6em;
    margin-top: 0.45em;
}

/* Row 3: speed */
.blogcast-row-speed {
    display: flex;
    align-items: center;
    gap: 0.55em;
    margin-top: 0.55em;
}

.blogcast-speed-label {
    font-size: 0.82em;
    opacity: 0.7;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Volume control */
.blogcast-volume-wrap {
    display: flex;
    align-items: center;
    gap: 0.35em;
    flex-shrink: 0;
}

.blogcast-vol-icon {
    font-size: 1em;
    line-height: 1;
    flex-shrink: 0;
}

.blogcast-volume {
    width: 9em;
    height: 6px;
    cursor: pointer;
    accent-color: currentColor;
}

/* Highlight row (label + toggle) */
.blogcast-hl-row {
    display: flex;
    align-items: center;
    gap: 0.45em;
    margin-top: 0.55em;
}

.blogcast-hl-label {
    font-size: 0.82em;
    opacity: 0.7;
    white-space: nowrap;
}

/* Highlight toggle (segmented buttons) */
.blogcast-highlight-toggle {
    display: flex;
    gap: 0;
    flex-shrink: 0;
}

.blogcast-hl-btn {
    background: none;
    border: 1px solid #ccc;
    padding: 0.2em 0.55em;
    font-size: 0.78em;
    cursor: pointer;
    line-height: 1.3;
    transition: background 0.15s, font-weight 0.15s;
}

.blogcast-hl-btn:first-child {
    border-radius: 4px 0 0 4px;
}

.blogcast-hl-btn:last-child {
    border-radius: 0 4px 4px 0;
}

.blogcast-hl-btn+.blogcast-hl-btn {
    border-left: 0;
}

.blogcast-hl-active {
    font-weight: 700;
    background: rgba(0, 0, 0, 0.08);
}

/* No-audio fallback */
.blogcast-no-audio h2 {
    text-align: center;
}

.blogcast-no-audio p {
    font-style: italic;
    opacity: 0.6;
    margin: 0;
    text-align: center;
}

/* Active text highlight */
.blogcast-highlight-active {
    background: rgba(255, 220, 80, 0.35);
    border-radius: 2px;
    transition: background 0.15s;
}

/* Paragraph timestamp gutter (first sentence timestamp per paragraph) */
.blogcast-paragraph-with-ts {
    position: relative;
}

.blogcast-paragraph-ts {
    position: absolute;
    left: -6rem;
    top: 0;
    width: 5rem;
    text-align: right;
    border: 0;
    background: transparent;
    color: var(--wp--preset--color--contrast-2, #666);
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.78rem;
    line-height: 1.35;
    cursor: pointer;
    opacity: 0.85;
    padding: 0;
}

.blogcast-paragraph-ts:hover,
.blogcast-paragraph-ts:focus-visible {
    color: var(--wp--preset--color--contrast, #111);
    opacity: 1;
    text-decoration: underline;
    outline: none;
}

@media (max-width: 1000px) {
    .blogcast-paragraph-with-ts {
        position: static;
    }

    .blogcast-paragraph-ts {
        position: static;
        display: block;
        width: auto;
        margin-right: 0;
        margin-bottom: 0.28rem;
        text-align: left;
        line-height: 1.15;
        opacity: 0.72;
        font-size: 0.72rem;
        letter-spacing: 0.01em;
    }

    .blogcast-paragraph-ts:hover,
    .blogcast-paragraph-ts:focus-visible {
        opacity: 1;
        text-decoration: none;
    }
}

/* Highlighting UI/logic disabled for go-live (advisor task 2026-05-14) */
.blogcast-hl-row,
.blogcast-highlight-toggle,
.blogcast-hl-btn,
.blogcast-hl-label,
.blogcast-highlight-active {
    display: none !important;
}

/* --- Sticky mini-player --- */
.blogcast-player-dock {
    min-height: 4.25rem;
    margin: 1.25rem 0 1.5rem;
}

#blogcast-mini {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    padding: 0.55em 1.1em;
    background: var(--wp--preset--color--base, #fff);
    color: var(--wp--preset--color--contrast, #111);
    border-top: 1px solid var(--wp--preset--color--contrast-3, #d0d0d0);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.12);
    transform: translateY(100%);
    transition: transform 0.22s ease;
    box-sizing: border-box;
}

#blogcast-mini.blogcast-mini-visible {
    transform: translateY(0);
}

#blogcast-mini.blogcast-mini-docked {
    position: static;
    left: auto;
    right: auto;
    bottom: auto;
    z-index: auto;
    transform: none;
    box-shadow: none;
    border: 1px solid var(--wp--preset--color--contrast-3, #d0d0d0);
    border-radius: 10px;
    padding: 0.5em 0.9em;
}

.blogcast-mini-inner {
    display: flex;
    align-items: center;
    gap: 0.75em;
    max-width: var(--wp--style--global--content-size, 660px);
    margin: 0 auto;
    width: 100%;
}

#blogcast-mini-play {
    width: 2.2em;
    height: 2.2em;
    border-radius: 50%;
    border: 2px solid currentColor;
    background: none;
    color: inherit;
    font-size: 0.9em;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s;
}

#blogcast-mini-play:hover {
    background: currentColor;
    filter: invert(1);
}

#blogcast-mini-time {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85em;
    opacity: 0.75;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Spacer pushes controls to the right */
.blogcast-mini-sep {
    flex: 1;
}

/* Compact control buttons (vol / speed / hl) */
.blogcast-mini-ctrl {
    background: none;
    border: 1px solid currentColor;
    border-radius: 4px;
    color: inherit;
    cursor: pointer;
    font-size: 0.78em;
    line-height: 1;
    opacity: 0.7;
    padding: 0.25em 0.5em;
    white-space: nowrap;
    flex-shrink: 0;
    transition: opacity 0.15s, background 0.15s;
}

.blogcast-mini-ctrl:hover {
    opacity: 1;
}

.blogcast-mini-ctrl-active {
    background: rgba(0, 0, 0, 0.1);
    opacity: 1;
    font-weight: 700;
}

html.dark-mode .blogcast-mini-ctrl-active {
    background: rgba(255, 255, 255, 0.15);
}

/* Responsive: controls wrap naturally via flexbox — no breakpoints needed.
   Ensure progress bar takes full row on very small screens. */
@media (max-width: 480px) {
    .blogcast-player-dock {
        min-height: 4.75rem;
        margin: 1rem 0 1.25rem;
    }

    .blogcast-progress {
        flex: 1 1 100%;
        order: 10;
    }
}