/* ─────────────────────────────────────────────────────────────────────────
   jingle-player.css  —  Arab Sheet Metal radio jingle player
   Designed to match site.css variables and typography exactly.
   Decorative animations stop via html.acc-pause-motion (accessibility widget).
   ───────────────────────────────────────────────────────────────────────── */

/* ── Section wrapper ─────────────────────────────────────────────────────── */
.jingle-section {
    background: var(--bg-alt, #f4f7fc);
    border-top: 1px solid var(--line, #dde4ed);
}

/* ── Entrance animation ──────────────────────────────────────────────────── */
@keyframes jingleFadeUp {
    from { opacity: 0; transform: translateY(22px); }
    to   { opacity: 1; transform: translateY(0); }
}
.jingle-wrap {
    max-width: 600px;
    margin: 0 auto;
    animation: jingleFadeUp .55s ease both;
}
html.acc-pause-motion .jingle-wrap { animation: none; }

/* ── Header ──────────────────────────────────────────────────────────────── */
.jingle-header { text-align: center; margin-bottom: 2rem; }

.jingle-badge {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--red, #CC1111);
    background: rgba(204,17,17,.08);
    border: 1px solid rgba(204,17,17,.2);
    border-radius: 20px;
    padding: .22rem .72rem;
    margin-bottom: .85rem;
}

.jingle-heading {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -.02em;
    color: var(--navy, #0f2d5e);
    margin: 0 0 .5rem;
    line-height: 1.2;
}

.jingle-sub {
    font-size: 1.05rem;
    color: var(--muted, #5c6f84);
    margin: 0;
    line-height: 1.55;
}

/* ── Player card — no padding; sections handle their own spacing ─────────── */
.jingle-player {
    background: var(--bg, #fff);
    border: 1px solid var(--line, #dde4ed);
    border-radius: var(--radius, 12px);
    box-shadow: var(--shadow-md, 0 6px 28px rgba(15,45,94,.13));
    overflow: hidden;
}

/* ── Equalizer strip  -  full-width header band inside the card ──────────── */
.jingle-wave {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 4px;
    height: 52px;
    padding: 8px 1.5rem 0;
    background: linear-gradient(135deg, var(--navy, #0f2d5e) 0%, #1a4a8c 100%);
}

.jingle-wave span {
    display: block;
    width: 5px;
    border-radius: 3px 3px 0 0;
    background: rgba(255,255,255,.45);
    transform-origin: bottom center;
    transition: background .25s;
}

/* Bar heights (varied for organic look) */
.jingle-wave span:nth-child(1)  { height: 14px; }
.jingle-wave span:nth-child(2)  { height: 28px; }
.jingle-wave span:nth-child(3)  { height: 38px; }
.jingle-wave span:nth-child(4)  { height: 20px; }
.jingle-wave span:nth-child(5)  { height: 34px; }
.jingle-wave span:nth-child(6)  { height: 44px; }
.jingle-wave span:nth-child(7)  { height: 30px; }
.jingle-wave span:nth-child(8)  { height: 40px; }
.jingle-wave span:nth-child(9)  { height: 24px; }
.jingle-wave span:nth-child(10) { height: 12px; }

/* Bars brighten when audio is playing */
.jp-playing .jingle-wave span { background: rgba(255,255,255,.9); }

/* Bar animations — keyframes */
@keyframes jingleBar1  { 0%,100%{transform:scaleY(1)}   50%{transform:scaleY(.25)} }
@keyframes jingleBar2  { 0%,100%{transform:scaleY(.35)} 50%{transform:scaleY(1)}   }
@keyframes jingleBar3  { 0%,100%{transform:scaleY(.8)}  40%{transform:scaleY(.15)} }
@keyframes jingleBar4  { 0%,100%{transform:scaleY(.45)} 60%{transform:scaleY(1)}   }
@keyframes jingleBar5  { 0%,100%{transform:scaleY(1)}   30%{transform:scaleY(.25)} }
@keyframes jingleBar6  { 0%,100%{transform:scaleY(.25)} 55%{transform:scaleY(1)}   }
@keyframes jingleBar7  { 0%,100%{transform:scaleY(.6)}  45%{transform:scaleY(.1)}  }
@keyframes jingleBar8  { 0%,100%{transform:scaleY(1)}   35%{transform:scaleY(.35)} }
@keyframes jingleBar9  { 0%,100%{transform:scaleY(.4)}  65%{transform:scaleY(1)}   }
@keyframes jingleBar10 { 0%,100%{transform:scaleY(.9)}  50%{transform:scaleY(.2)}  }

/* Animations — only while jp-playing class is on #jingleWrap */
.jp-playing .jingle-wave span:nth-child(1)  { animation: jingleBar1  1.1s  ease-in-out infinite; }
.jp-playing .jingle-wave span:nth-child(2)  { animation: jingleBar2  1.3s  ease-in-out infinite; }
.jp-playing .jingle-wave span:nth-child(3)  { animation: jingleBar3   .9s  ease-in-out infinite; }
.jp-playing .jingle-wave span:nth-child(4)  { animation: jingleBar4  1.4s  ease-in-out infinite; }
.jp-playing .jingle-wave span:nth-child(5)  { animation: jingleBar5  1.0s  ease-in-out infinite; }
.jp-playing .jingle-wave span:nth-child(6)  { animation: jingleBar6  1.2s  ease-in-out infinite; }
.jp-playing .jingle-wave span:nth-child(7)  { animation: jingleBar7   .8s  ease-in-out infinite; }
.jp-playing .jingle-wave span:nth-child(8)  { animation: jingleBar8  1.5s  ease-in-out infinite; }
.jp-playing .jingle-wave span:nth-child(9)  { animation: jingleBar9  1.1s  ease-in-out infinite; }
.jp-playing .jingle-wave span:nth-child(10) { animation: jingleBar10  .95s ease-in-out infinite; }

/* Stop decorative animations via accessibility widget — audio controls unaffected */
html.acc-pause-motion .jingle-wave span,
html.acc-pause-motion .jp-playing .jingle-wave span { animation: none !important; }
html.acc-pause-motion .jp-playing .jp-play-btn      { animation: none !important; }
html.acc-pause-motion .jingle-wrap                  { animation: none !important; }

/* ── State notices (loading / error) ─────────────────────────────────────── */
.jingle-state {
    min-height: 0;
    font-size: .88rem;
    color: var(--muted, #5c6f84);
    text-align: center;
    padding: 0 1.5rem;
    margin-top: .6rem;
    transition: opacity .2s;
}
.jingle-state:empty { display: none; }
.jingle-state.jp-error {
    color: var(--red, #CC1111);
    font-weight: 600;
}

/* ── Top row: play button + timeline ─────────────────────────────────────── */
.jp-top-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.4rem 1.5rem .85rem;
}

/* Play / Pause button */
.jp-play-btn {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: var(--red, #CC1111);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .18s, transform .12s, box-shadow .18s;
    box-shadow: 0 3px 16px rgba(204,17,17,.38);
    position: relative;
}
.jp-play-btn:hover {
    background: #aa0e0e;
    transform: scale(1.07);
    box-shadow: 0 4px 22px rgba(204,17,17,.52);
}
.jp-play-btn:active { transform: scale(.94); }
.jp-play-btn:focus-visible {
    outline: 3px solid var(--blue, #0055cc);
    outline-offset: 3px;
}

/* Pulse ring while playing */
@keyframes jpPulse {
    0%   { box-shadow: 0 3px 16px rgba(204,17,17,.38), 0 0 0 0   rgba(204,17,17,.4); }
    70%  { box-shadow: 0 3px 16px rgba(204,17,17,.38), 0 0 0 14px rgba(204,17,17,0); }
    100% { box-shadow: 0 3px 16px rgba(204,17,17,.38), 0 0 0 0   rgba(204,17,17,0); }
}
.jp-playing .jp-play-btn { animation: jpPulse 1.8s ease-out infinite; }

/* Play/pause SVG icons */
.jp-play-btn .jp-icon { width: 22px; height: 22px; fill: #fff; pointer-events: none; }
.jp-play-btn .jp-icon-pause { display: none; }
.jp-playing .jp-play-btn .jp-icon-play  { display: none; }
.jp-playing .jp-play-btn .jp-icon-pause { display: block; }

/* ── Timeline (seek bar + times) ─────────────────────────────────────────── */
.jp-timeline {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: .38rem;
}
.jp-times {
    display: flex;
    justify-content: space-between;
    font-size: .78rem;
    color: var(--muted, #5c6f84);
    font-variant-numeric: tabular-nums;
    letter-spacing: .01em;
}

/* Custom seek bar */
.jp-seekwrap {
    position: relative;
    height: 20px;
    display: flex;
    align-items: center;
}
.jp-seekwrap input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--line, #dde4ed);
    outline: none;
    cursor: pointer;
    position: relative;
    z-index: 2;
    margin: 0;
}
.jp-seekwrap input[type="range"]:focus-visible {
    outline: 2px solid var(--blue, #0055cc);
    outline-offset: 2px;
}
.jp-seekwrap input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: var(--red, #CC1111);
    border: 2px solid #fff;
    box-shadow: 0 1px 5px rgba(0,0,0,.25);
    cursor: pointer;
    transition: transform .12s;
}
.jp-seekwrap input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.25); }
.jp-seekwrap input[type="range"]::-moz-range-thumb {
    width: 16px; height: 16px;
    border-radius: 50%;
    background: var(--red, #CC1111);
    border: 2px solid #fff;
    box-shadow: 0 1px 5px rgba(0,0,0,.25);
    cursor: pointer;
}

/* Fill track overlay */
.jp-seekfill {
    position: absolute;
    left: 0; top: 50%; transform: translateY(-50%);
    height: 6px;
    border-radius: 3px;
    background: var(--red, #CC1111);
    pointer-events: none;
    z-index: 1;
    transition: width .1s linear;
    width: 0%;
    max-width: calc(100% - 8px);
}

/* ── Bottom row: mute, volume, replay ────────────────────────────────────── */
.jp-bottom-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 0 1.5rem 1.5rem;
    flex-wrap: wrap;
}

.jp-icon-btn {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--line, #dde4ed);
    background: transparent;
    color: var(--navy, #0f2d5e);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color .15s, background .15s, color .15s;
}
.jp-icon-btn:hover {
    border-color: var(--red, #CC1111);
    color: var(--red, #CC1111);
    background: rgba(204,17,17,.06);
}
.jp-icon-btn:focus-visible {
    outline: 2px solid var(--blue, #0055cc);
    outline-offset: 2px;
}
.jp-icon-btn svg { width: 16px; height: 16px; fill: currentColor; pointer-events: none; }

/* Mute state */
.jp-vol-icon-off { display: none; }
.jp-muted .jp-vol-icon-on  { display: none; }
.jp-muted .jp-vol-icon-off { display: block; }

/* Volume slider */
.jp-vol-slider {
    flex: 1;
    min-width: 60px;
    max-width: 140px;
}
.jp-vol-slider input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 5px;
    border-radius: 3px;
    background: var(--line, #dde4ed);
    outline: none;
    cursor: pointer;
    margin: 0;
}
.jp-vol-slider input[type="range"]:focus-visible {
    outline: 2px solid var(--blue, #0055cc);
    outline-offset: 2px;
}
.jp-vol-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: var(--navy, #0f2d5e);
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.2);
    cursor: pointer;
}
.jp-vol-slider input[type="range"]::-moz-range-thumb {
    width: 14px; height: 14px;
    border-radius: 50%;
    background: var(--navy, #0f2d5e);
    border: 2px solid #fff;
    cursor: pointer;
}

.jp-vol-label {
    font-size: .75rem;
    color: var(--muted, #5c6f84);
    white-space: nowrap;
}

/* ── Download link ───────────────────────────────────────────────────────── */
.jingle-download {
    text-align: center;
    padding: 0 1.5rem 1.25rem;
    border-top: 1px solid var(--line, #dde4ed);
    padding-top: 1rem;
    margin-top: .25rem;
}

/* ── No-JS fallback ──────────────────────────────────────────────────────── */
.jingle-noscript {
    text-align: center;
    padding: 1rem;
    font-size: .9rem;
    color: var(--muted, #5c6f84);
}
.jingle-noscript a { color: var(--red, #CC1111); }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 520px) {
    .jp-top-row  { padding: 1.1rem 1rem .75rem; gap: .75rem; }
    .jp-bottom-row { padding: 0 1rem 1.2rem; gap: .5rem; }
    .jingle-state  { padding: 0 1rem; }
    .jingle-download { padding: .9rem 1rem 1rem; }
    .jp-play-btn { width: 50px; height: 50px; }
    .jp-play-btn .jp-icon { width: 20px; height: 20px; }
    .jingle-heading { font-size: 1.55rem; }
    .jp-vol-label { display: none; }
    .jp-vol-slider { max-width: none; flex: 1; }
}
