/* Grace Bible Studies website: Now Playing player with Live words.
   Look and colors match the Fire TV app's player (GraceBibleStudiesTV: Styles/GbDesignTokens.xaml, PlayerPage.xaml,
   LiveWordsView.cs). Built by Scripts/gbs-player.js from the markup Components/NowPlayingPlayer.cs writes. */

.gbs-np {
    --np-bg: #0F1A2B;
    --np-bg-deep: #050A12;
    --np-surface: #1A2740;
    --np-text: #F4E7C5;
    --np-muted: #9BB0C9;
    --np-upcoming: rgba(155, 176, 201, .59);
    --np-accent: #C9A227;
    --np-focus: #FFE566;
    --np-parchment: #F4E7C5;
    --np-ink: #1A1208;
    --np-ink-muted: #5C4A32;
    --np-scrub-track: #C9B890;
    --np-serif: Georgia, "Times New Roman", serif;
    --np-viewport-h: 440px;

    position: relative;
    margin: 0 0 8px;
    padding: 24px 28px 20px;
    border-radius: 22px;
    background: linear-gradient(180deg, var(--np-bg) 0%, var(--np-bg-deep) 100%);
    color: var(--np-text);
    box-shadow: var(--shadow-lg, 0 12px 24px -6px rgba(16, 24, 40, .16));
}

/* ---------- Fallback (no script) ---------- */
.gbs-np__fallback-title { margin: 0 0 12px; font-family: var(--np-serif); font-size: 1.4rem; font-weight: 700; }
.gbs-np__fallback audio { width: 100%; max-width: 560px; }
.gbs-np__fallback-links { margin: 10px 0 0; color: var(--np-muted); }
.gbs-np__fallback-links a { margin-right: 14px; color: var(--np-accent); font-weight: 600; }
.gbs-np--ready .gbs-np__fallback { display: none; }
.gbs-np [hidden] { display: none !important; }
.gbs-np__audio { display: none; }

/* ---------- Top bar: label + pills (Live words, Download) ---------- */
.gbs-np__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.gbs-np__label {
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--np-accent);
}
.gbs-np__pills { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

.gbs-np__pill,
.gbs-np__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 6px 18px;
    border: 2px solid var(--np-text);
    border-radius: 999px;
    background: transparent;
    color: var(--np-text);
    font: 600 .95rem/1 var(--font-sans, sans-serif);
    text-decoration: none;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.gbs-np__pill { background: var(--np-surface); border-color: transparent; }
.gbs-np__pill:hover,
.gbs-np__btn:hover { border-color: var(--np-accent); color: var(--np-text); text-decoration: none; }
.gbs-np__pill:focus-visible,
.gbs-np__btn:focus-visible,
.gbs-np__track:focus-visible,
.gbs-np__speed:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--np-focus); }
.gbs-np__pill[aria-pressed="true"] { border-color: var(--np-accent); }
.gbs-np__pill svg,
.gbs-np__btn svg { width: 18px; height: 18px; flex: none; }

.gbs-np__btn--primary {
    min-width: 132px;
    border-color: var(--np-accent);
    background: var(--np-accent);
    color: var(--np-bg);
}
.gbs-np__btn--primary:hover { background: var(--np-focus); border-color: var(--np-focus); color: var(--np-bg); }
.gbs-np__btn[disabled],
.gbs-np__btn[aria-disabled="true"] { opacity: .35; pointer-events: none; }

/* Download menu */
.gbs-np__download { position: relative; margin-left: auto; }
.gbs-np__download > summary { list-style: none; }
.gbs-np__download > summary::-webkit-details-marker { display: none; }
.gbs-np__menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 5;
    min-width: 200px;
    padding: 8px;
    border: 1px solid rgba(201, 162, 39, .45);
    border-radius: 14px;
    background: var(--np-surface);
    box-shadow: 0 12px 24px rgba(0, 0, 0, .35);
}
.gbs-np__menu a {
    display: block;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--np-text);
    font-weight: 600;
    text-decoration: none;
}
.gbs-np__menu a:hover { background: rgba(201, 162, 39, .18); text-decoration: none; }
.gbs-np__menu small { display: block; color: var(--np-muted); font-weight: 400; }

/* ---------- Now playing card (parchment, like the Fire TV card without Live words) ---------- */
.gbs-np__card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px 28px;
    align-items: start;
    padding: 28px 32px 24px;
    border-radius: 20px;
    background: var(--np-parchment);
    color: var(--np-ink);
}
.gbs-np__art {
    display: grid;
    place-items: center;
    width: 140px;
    height: 140px;
    border: 3px solid var(--np-accent);
    border-radius: 50%;
    background: var(--np-bg);
    overflow: hidden;
}
.gbs-np__art img { width: 78%; height: 78%; object-fit: contain; }
.gbs-np__art { grid-row: 1 / span 3; }
.gbs-np__info,
.gbs-np__progress,
.gbs-np__error { grid-column: 2; min-width: 0; }
.gbs-np__title {
    margin: 4px 0 6px;
    font-family: var(--np-serif);
    font-size: 2.1rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--np-ink);
    overflow-wrap: anywhere;
}
.gbs-np__meta { margin: 0; font-size: 1.15rem; color: var(--np-ink-muted); }

.gbs-np__progress {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: center;
    margin-top: 8px;
    font-variant-numeric: tabular-nums;
    font-size: 1rem;
    color: var(--np-ink-muted);
}
.gbs-np__track {
    position: relative;
    height: 28px;
    cursor: pointer;
    touch-action: none;
    border-radius: 999px;
}
.gbs-np__rail,
.gbs-np__fill {
    position: absolute;
    left: 0;
    top: 50%;
    height: 12px;
    margin-top: -6px;
    border-radius: 6px;
}
.gbs-np__rail { right: 0; background: var(--np-scrub-track); }
.gbs-np__fill { width: 0; background: var(--np-accent); }
.gbs-np__thumb {
    position: absolute;
    top: 50%;
    left: 0;
    width: 22px;
    height: 22px;
    margin: -11px 0 0 -11px;
    border-radius: 50%;
    background: var(--np-accent);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
}
.gbs-np__error { margin: 0; color: #8A5A00; font-weight: 600; }


/* ---------- Live words layout: compact strip + synced text (replaces the parchment card) ---------- */
.gbs-np--live .gbs-np__card {
    grid-template-columns: auto minmax(0, 1fr) minmax(0, 2fr);
    gap: 16px;
    align-items: center;
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: var(--np-text);
}
.gbs-np--live .gbs-np__art { grid-row: auto; width: 56px; height: 56px; border-width: 2px; }
.gbs-np--live .gbs-np__info { grid-column: 2; }
.gbs-np--live .gbs-np__progress { grid-column: 3; grid-row: 1; }
.gbs-np--live .gbs-np__title {
    margin: 0;
    font-size: 1.3rem;
    color: var(--np-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    overflow-wrap: normal;
}
.gbs-np--live .gbs-np__meta {
    font-size: .95rem;
    color: var(--np-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gbs-np--live .gbs-np__progress { margin-top: 0; color: var(--np-muted); font-size: .95rem; }
.gbs-np--live .gbs-np__rail,
.gbs-np--live .gbs-np__fill { height: 8px; margin-top: -4px; border-radius: 4px; }
.gbs-np--live .gbs-np__rail { background: var(--np-surface); }
.gbs-np--live .gbs-np__thumb { width: 16px; height: 16px; margin: -8px 0 0 -8px; }
.gbs-np--live .gbs-np__error { grid-column: 1 / -1; margin: 0; color: var(--np-accent); }

.gbs-np__live { display: none; margin-top: 14px; }
.gbs-np--live .gbs-np__live { display: block; }

.gbs-np__strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 32px;
    margin-bottom: 10px;
}
.gbs-np__strip-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.gbs-np__badge {
    flex: none;
    font-size: .85rem;
    font-weight: 600;
    letter-spacing: .08em;
    color: var(--np-accent);
}
.gbs-np__chapter {
    min-width: 0;
    font-family: var(--np-serif);
    font-size: 1.05rem;
    color: var(--np-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gbs-np__chip {
    flex: none;
    padding: 3px 14px 4px;
    border: 1.5px solid var(--np-accent);
    border-radius: 14px;
    background: rgba(201, 162, 39, .16);
    color: var(--np-accent);
    font-size: .95rem;
    font-weight: 600;
}


.gbs-np__viewport {
    position: relative;
    height: var(--np-viewport-h);
    overflow: hidden;
    border: 1px solid rgba(201, 162, 39, .27);
    border-radius: 18px;
    background: linear-gradient(180deg, var(--np-surface) 0%, var(--np-bg) 100%);
}
.gbs-np__content {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    padding: 22px 34px 60vh;
    will-change: transform;
}
.gbs-np__fade-top,
.gbs-np__fade-bottom {
    position: absolute;
    left: 0;
    right: 0;
    pointer-events: none;
}
.gbs-np__fade-top { top: 0; height: 54px; background: linear-gradient(180deg, var(--np-surface) 0%, rgba(26, 39, 64, 0) 100%); }
.gbs-np__fade-bottom { bottom: 0; height: 96px; background: linear-gradient(180deg, rgba(15, 26, 43, 0) 0%, var(--np-bg) 100%); }

.gbs-np__heading {
    margin: 4px 0 10px;
    font-family: var(--np-serif);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--np-accent);
}
.gbs-np__para {
    margin: 0 0 26px;
    font-size: 1.6rem;
    line-height: 2.5rem;
    color: var(--np-upcoming);
}
.gbs-np__stamp {
    display: inline-block;
    min-width: 3.4em;
    margin-right: 10px;
    font-size: 1rem;
    font-variant-numeric: tabular-nums;
    color: var(--np-muted);
    vertical-align: 1px;
}
.gbs-np__para span[data-w] { cursor: pointer; transition: color .12s linear; }
@media (hover: hover) {
    .gbs-np__para span[data-w]:hover { text-decoration: underline; text-decoration-color: rgba(201, 162, 39, .5); }
}
.gbs-np__para .is-past { color: var(--np-text); }
.gbs-np__para .is-now { color: var(--np-accent); font-weight: 600; }

.gbs-np__status {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    margin: 0;
    padding: 24px;
    font-size: 1.2rem;
    text-align: center;
    color: var(--np-muted);
}


/* ---------- Transport: Previous | -30 | Play/Pause | +30 | Next | speed ---------- */
.gbs-np__transport {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 18px;
}
.gbs-np__btn--round { min-width: 64px; }
.gbs-np .gbs-np__speed {
    width: auto;
    flex: none;
    margin: 0;
    min-height: 40px;
    padding: 6px 14px;
    border: 2px solid var(--np-text);
    border-radius: 999px;
    background: var(--np-bg);
    color: var(--np-text);
    font: 600 .95rem/1 var(--font-sans, sans-serif);
    cursor: pointer;
}
.gbs-np__keys { margin: 12px 0 0; text-align: center; font-size: .8rem; color: var(--np-muted); }

/* ---------- Tablet ---------- */
@media (max-width: 900px) {
    .gbs-np { --np-viewport-h: 400px; }
    .gbs-np--live .gbs-np__card { grid-template-columns: auto minmax(0, 1fr); }
    .gbs-np--live .gbs-np__progress { grid-column: 1 / -1; grid-row: auto; }
    .gbs-np__para { font-size: 1.4rem; line-height: 2.2rem; }
}

/* ---------- Phone ---------- */
@media (max-width: 620px) {
    .gbs-np { --np-viewport-h: 44vh; padding: 16px 14px 14px; border-radius: 18px; }
    .gbs-np__bar { margin-bottom: 12px; }
    .gbs-np__label { display: none; }
    .gbs-np__pills { width: 100%; justify-content: space-between; }
    .gbs-np__pills { gap: 6px; flex-wrap: nowrap; }
    .gbs-np__pill { min-height: 36px; padding: 6px 12px; font-size: .86rem; gap: 6px; }
    .gbs-np__download > summary { padding: 6px 10px; }
    .gbs-np__download > summary span { display: none; }
    .gbs-np__card { grid-template-columns: 1fr; justify-items: center; gap: 14px; padding: 20px 18px; text-align: center; }
    .gbs-np__art { width: 104px; height: 104px; }
    .gbs-np__title { font-size: 1.5rem; }
    .gbs-np__meta { font-size: 1rem; }
    .gbs-np__art { grid-row: auto; }
    .gbs-np__info,
    .gbs-np__progress,
    .gbs-np__error { grid-column: 1; width: 100%; }
    .gbs-np__progress { margin-top: 0; }
    .gbs-np__error { margin: 0; }
    .gbs-np--live .gbs-np__card { grid-template-columns: auto minmax(0, 1fr); justify-items: stretch; gap: 12px; text-align: left; }
    .gbs-np--live .gbs-np__art { width: 44px; height: 44px; }
    .gbs-np--live .gbs-np__title { font-size: 1.05rem; }
    .gbs-np--live .gbs-np__meta { font-size: .85rem; }
    .gbs-np__strip { flex-wrap: wrap; }
    .gbs-np__content { padding: 16px 16px 60vh; }
    .gbs-np__para { font-size: 1.2rem; line-height: 1.95rem; margin-bottom: 20px; }
    .gbs-np__heading { font-size: 1.15rem; }
    .gbs-np__stamp { display: block; margin: 0 0 2px; font-size: .85rem; }
    .gbs-np__transport { gap: 8px; margin-top: 14px; }
    .gbs-np__btn { min-height: 44px; padding: 6px 12px; }
    .gbs-np__btn--primary { min-width: 0; flex: 1 1 100%; order: -1; }
    .gbs-np__btn--nav .gbs-np__btn-text { display: none; }
    .gbs-np__keys { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .gbs-np__para span[data-w] { transition: none; }
}