/*
 * Wanderland Radio — Widget Stylesheet
 * Version:  1.0.0
 * Author:   Jawad Zafar
 * Prefix:   wn_ran
 */

/* ── Reset (scoped) ───────────────────────────────────────── */
.wn_ran-widget,
.wn_ran-widget * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ── CSS Custom Properties (Neon Noir palette) ────────────── */

@media (min-width: 768px) and (max-width: 1024px) 
{
  /* Your tablet-specific styles go here */
	.wn_ran-widget 
	{
		width:100% !important;
		height:680px;
	}
	.wn_ran-body {
    grid-template-columns: 1fr !important;
	}
}
.wn_ran-widget {
    --wn_ran-bg:          #090909;
    --wn_ran-panel:       #101010;
    --wn_ran-ink:         #f3efe6;
    --wn_ran-muted:       #cfc9bd;
    --wn_ran-dim:         #857f74;
    --wn_ran-faint:       #57534b;
    --wn_ran-line:        rgba(243,239,230,.13);
    --wn_ran-line-strong: rgba(243,239,230,.24);
    /* ── --wn_ran-gold:        #c9a24a;──── */
	--wn_ran-gold:        #d62828;
    --wn_ran-on:          #ff5a3c;
    --wn_ran-sans:        'Oswald';
    --wn_ran-serif:       'Oswald';
    --wn_ran-mono:        'Oswald';

    /* Layout */
    width: min(100%, 680px);
    aspect-ratio: 1 / 1;
    margin: 0 auto;
    padding: clamp(14px, 2.2vw, 20px);
    overflow: hidden;
    display: flex;
    flex-direction: column;

    /* Appearance */
    color:       var(--wn_ran-ink);
    background:  var(--wn_ran-bg);
    /* border:      1px solid var(--wn_ran-line); */
    font-family: var(--wn_ran-sans);
	
	    border-radius: 7px;
    border: none;
}

.wn_ran-widget a {
    color: inherit;
    text-decoration: none;
}

.wn_ran-widget button {
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    font-family: inherit;
}

/* ── Top bar ──────────────────────────────────────────────── */
.wn_ran-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--wn_ran-line);
    margin-bottom: 14px;
}

.wn_ran-brand {
    font-size: clamp(28px, 2.5vw, 28px);
    line-height: 1;
    letter-spacing: -.02em;
    font-weight: 500;
    font-family: var(--wn_ran-sans);
}

/* On Air badge */
.wn_ran-onair {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--wn_ran-muted);
    font: 700 10px/1 var(--wn_ran-mono);
    text-transform: uppercase;
    letter-spacing: .22em;
    white-space: nowrap;
}
.wn_ran-onair::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--wn_ran-on);
    animation: wn_ran-blink 1.35s ease-in-out infinite;
}

@keyframes wn_ran-blink {
    0%, 100% { opacity: 1;   box-shadow: 0 0 0 0   rgba(255,90,60,.5); }
    50%       { opacity: .35; box-shadow: 0 0 0 6px rgba(255,90,60,0); }
}

/* ── Hero ─────────────────────────────────────────────────── */
.wn_ran-hero {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: clamp(12px, 2vw, 18px);
    align-items: center;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--wn_ran-line);
    flex: 0 0 auto;
}

.wn_ran-kicker {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    color: var(--wn_ran-gold);
    font: 700 10px/1 var(--wn_ran-mono);
    letter-spacing: .26em;
    text-transform: uppercase;
}
.wn_ran-kicker::before {
    content: "";
    width: 28px;
    height: 1px;
    background: var(--wn_ran-gold);
}

.wn_ran-title {
    font: 750 clamp(22px, 2.7vw, 30px)/1.05 var(--wn_ran-sans);
    letter-spacing: -.02em !important;
    color: var(--wn_ran-ink) !important;
}

.wn_ran-dek {
    margin-top: 9px;
    max-width: 40ch;
    color: var(--wn_ran-muted);
    font-size: 13px;
    line-height: 1.35;
}

/* Retro radio art — CSS illustration (no image) */
.wn_ran-art {
    aspect-ratio: 1 / 1;
    border: 1px solid var(--wn_ran-line);
    background:
        radial-gradient(circle at 52% 48%, rgba(243,239,230,.22) 0 7%, transparent 8%),
        radial-gradient(circle at 52% 48%, transparent 0 16%, rgba(243,239,230,.35) 17% 18%, transparent 19%),
        linear-gradient(90deg, rgba(243,239,230,.05), rgba(243,239,230,.18) 45%, rgba(243,239,230,.04)),
        #111;
    position: relative;
    overflow: hidden;
    filter: grayscale(1) contrast(1.1);
}
.wn_ran-art::before {
    content: "";
    position: absolute;
    left: 16%; right: 16%;
    top: 38%;
    height: 35%;
    border: 2px solid rgba(243,239,230,.38);
    border-radius: 999px;
    box-shadow: inset 0 0 18px rgba(243,239,230,.12), 0 18px 24px rgba(0,0,0,.55);
}
.wn_ran-art::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(0,0,0,.4), transparent 45%, rgba(255,255,255,.08) 52%, rgba(0,0,0,.35)),
        repeating-linear-gradient(0deg, rgba(255,255,255,.035) 0 1px, transparent 1px 4px);
    mix-blend-mode: screen;
}
/* Photo cover: override CSS illustration */
.wn_ran-art--photo {
    background-size: cover;
    background-position: center;
    filter: none;
}
.wn_ran-art--photo::before,
.wn_ran-art--photo::after { display: none; }

/* ── Body grid ────────────────────────────────────────────── */
.wn_ran-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0,1fr) minmax(250px,.82fr);
    gap: clamp(12px, 2vw, 18px);
    padding-top: 14px;
}

/* ── Track list ───────────────────────────────────────────── */
.wn_ran-list-panel {
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.wn_ran-list-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--wn_ran-line);
    color: var(--wn_ran-muted);
    font: 700 11px/1 var(--wn_ran-mono);
    letter-spacing: .24em;
    text-transform: uppercase;
}
.wn_ran-list-head span {
    color: var(--wn_ran-dim);
    font-size: 10px;
}

.wn_ran-list-wrap {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    border-bottom: 1px solid var(--wn_ran-line);
    scrollbar-width: thin;
    scrollbar-color: var(--wn_ran-gold) transparent;
}

.wn_ran-tracks {
    list-style: none;
}

/* Each track row */
.wn_ran-track {
    display: grid;
    grid-template-columns: 34px minmax(0,1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 8px 2px;
    border-bottom: 1px solid var(--wn_ran-line);
    cursor: pointer;
    transition: background .1s;
}
.wn_ran-track:hover {
    background: rgba(243,239,230,.04);
}
.wn_ran-track:last-child {
    border-bottom: none;
}

.wn_ran-track__num {
    color: var(--wn_ran-dim) !important;
    font: 600 11px/1 var(--wn_ran-mono);
    font-variant-numeric: tabular-nums;
    text-align: center;
}

.wn_ran-track--active .wn_ran-track__num {
    color: var(--wn_ran-on);
}

.wn_ran-track__main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.wn_ran-track__title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--wn_ran-ink);
    font: 400 16px/1.22 var(--wn_ran-serif);
    letter-spacing: -.005em;
    transition: color .12s;
}
.wn_ran-track--active .wn_ran-track__title {
    color: #fff;
}

.wn_ran-track__artist {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--wn_ran-gold);
    font-size: 12px;
    line-height: 1.4;
}

.wn_ran-track__desc {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--wn_ran-dim);
    font-size: 10px;
    line-height: 1.2;
    font-style: italic;
}

/* Actions column: play button + optional Spotify link */
.wn_ran-track__actions {
    display: flex;
    align-items: center;
    gap: 0px;
    flex-shrink: 0;
}

/* Per-track play button */
.wn_ran-track__btn {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: 1px solid var(--wn_ran-line);
    color: var(--wn_ran-muted);
    transition: border-color .12s, color .12s;
    flex-shrink: 0;
}
.wn_ran-track__btn:hover {
    border-color: var(--wn_ran-gold);
    color: var(--wn_ran-gold) !important;
	    background-color: #101010 !important;

}
.wn_ran-track__btn:disabled {
    opacity: .3;
    cursor: not-allowed;
}
.wn_ran-track__btn svg {
    width: 11px;
    height: 11px;
}

.wn_ran-track--playing .wn_ran-track__btn {
    border-color: var(--wn_ran-on);
    color: var(--wn_ran-on);
}

/* Spotify ↗ link per track */
.wn_ran-track__go {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: 1px solid var(--wn_ran-line);
    color: var(--wn_ran-muted);
    font: 700 13px/1 var(--wn_ran-mono);
    transition: border-color .12s, color .12s;
    flex-shrink: 0;
    text-decoration: none;
}
.wn_ran-track__go:hover {
    border-color: #1DB954;
    color: #1DB954;
}

.wn_ran-empty {
    padding: 1.5rem 0;
    color: var(--wn_ran-dim);
    font: italic 13px/1.4 var(--wn_ran-serif);
}

/* ── Sidebar ──────────────────────────────────────────────── */
.wn_ran-side {
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ── Player card ──────────────────────────────────────────── */
.wn_ran-player {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--wn_ran-line);
    background: var(--wn_ran-panel);
    min-height: 130px;
}

.wn_ran-player-top {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
}

.wn_ran-player-info { flex: 1; min-width: 0; }

.wn_ran-player-title {
    font: 400 16px/1.15 Oswald;
    color: var(--wn_ran-ink);
    /*overflow: hidden;
    text-overflow: ellipsis;*/
    white-space: nowrap;    
	margin-block-end: 0px !important;
}

.wn_ran-player-artist {
    color: var(--wn_ran-gold);
    font-size: 11px;
    letter-spacing: .08em;
    margin-top: 2px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wn_ran-player-sub {
    margin-top: 4px;
    color: var(--wn_ran-dim);
    font: 700 10px/1 var(--wn_ran-mono);
    letter-spacing: .18em;
    text-transform: uppercase;
}

/* Big play/pause button */
.wn_ran-play-mark {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border: 1px solid var(--wn_ran-line-strong);
    color: var(--wn_ran-on);
    transition: border-color .12s, color .12s;
}
.wn_ran-play-mark:hover {
    border-color: var(--wn_ran-on);    background-color: #101010 !important;
}
.wn_ran-play-mark:focus,.wn_ran-widget button:focus {
    background-color: #101010 !important;
}
.wn_ran-play-mark svg {
    width: 14px;
    height: 14px;
}

/* Description in player */
.wn_ran-player-desc {
    color: var(--wn_ran-dim);
    font: italic 11px/1.4 var(--wn_ran-serif);
    min-height: 16px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ── Animated waveform bars (v1.1 — 9 bars, glow, colour gradient) ── */
.wn_ran-bars {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 32px;
    padding: 2px 0;
}

.wn_ran-bars span {
    display: block;
    flex: 1;
    min-width: 3px;
    border-radius: 2px 2px 1px 1px;
    background: var(--wn_ran-line-strong);
    transform-origin: bottom center;
    transition: background .3s ease;
    /* Idle resting heights — different per bar for a natural staggered look */
}

/* Idle bar heights (no animation, just static shape) */
.wn_ran-bars span:nth-child(1) { height: 35%; }
.wn_ran-bars span:nth-child(2) { height: 55%; }
.wn_ran-bars span:nth-child(3) { height: 75%; }
.wn_ran-bars span:nth-child(4) { height: 48%; }
.wn_ran-bars span:nth-child(5) { height: 90%; }
.wn_ran-bars span:nth-child(6) { height: 60%; }
.wn_ran-bars span:nth-child(7) { height: 78%; }
.wn_ran-bars span:nth-child(8) { height: 42%; }
.wn_ran-bars span:nth-child(9) { height: 65%; }

/* ── Playing state: colours + animation ── */
/* Colour zones: left=orange, centre=gold/red, right fade to muted */
.wn_ran-widget--playing .wn_ran-bars span:nth-child(1) { background: var(--wn_ran-on);   }
.wn_ran-widget--playing .wn_ran-bars span:nth-child(2) { background: #e8472a;             }
.wn_ran-widget--playing .wn_ran-bars span:nth-child(3) { background: var(--wn_ran-gold);  }
.wn_ran-widget--playing .wn_ran-bars span:nth-child(4) { background: #c04040;             }
.wn_ran-widget--playing .wn_ran-bars span:nth-child(5) { background: var(--wn_ran-on);   }
.wn_ran-widget--playing .wn_ran-bars span:nth-child(6) { background: var(--wn_ran-gold);  }
.wn_ran-widget--playing .wn_ran-bars span:nth-child(7) { background: #e8472a;             }
.wn_ran-widget--playing .wn_ran-bars span:nth-child(8) { background: #c04040;             }
.wn_ran-widget--playing .wn_ran-bars span:nth-child(9) { background: var(--wn_ran-on);   }

/* Glow effect on active bars */
.wn_ran-widget--playing .wn_ran-bars span:nth-child(odd) {
    box-shadow: 0 0 6px 1px rgba(255, 90, 60, .45);
}
.wn_ran-widget--playing .wn_ran-bars span:nth-child(even) {
    box-shadow: 0 0 5px 1px rgba(214, 40, 40, .38);
}

/* Each bar gets its own speed + delay for an organic, non-mechanical feel */
.wn_ran-widget--playing .wn_ran-bars span:nth-child(1) {
    animation: wn_ran-bar 0.95s  ease-in-out infinite;
    animation-delay: 0s;
}
.wn_ran-widget--playing .wn_ran-bars span:nth-child(2) {
    animation: wn_ran-bar 1.15s  ease-in-out infinite;
    animation-delay: .11s;
}
.wn_ran-widget--playing .wn_ran-bars span:nth-child(3) {
    animation: wn_ran-bar 0.80s  ease-in-out infinite;
    animation-delay: .27s;
}
.wn_ran-widget--playing .wn_ran-bars span:nth-child(4) {
    animation: wn_ran-bar 1.35s  ease-in-out infinite;
    animation-delay: .05s;
}
.wn_ran-widget--playing .wn_ran-bars span:nth-child(5) {
    animation: wn_ran-bar 0.70s  ease-in-out infinite;
    animation-delay: .19s;
}
.wn_ran-widget--playing .wn_ran-bars span:nth-child(6) {
    animation: wn_ran-bar 1.05s  ease-in-out infinite;
    animation-delay: .33s;
}
.wn_ran-widget--playing .wn_ran-bars span:nth-child(7) {
    animation: wn_ran-bar 0.88s  ease-in-out infinite;
    animation-delay: .07s;
}
.wn_ran-widget--playing .wn_ran-bars span:nth-child(8) {
    animation: wn_ran-bar 1.20s  ease-in-out infinite;
    animation-delay: .22s;
}
.wn_ran-widget--playing .wn_ran-bars span:nth-child(9) {
    animation: wn_ran-bar 0.78s  ease-in-out infinite;
    animation-delay: .14s;
}

/* The animation itself: scale from ~20% to 100% height, with a subtle mid-bounce */
@keyframes wn_ran-bar {
    0%   { transform: scaleY(.20); }
    30%  { transform: scaleY(1.00); }
    55%  { transform: scaleY(.55); }
    75%  { transform: scaleY(.85); }
    100% { transform: scaleY(.20); }
}

/* Progress bar */
.wn_ran-progress-wrap { display: flex; flex-direction: column; gap: 4px; }

.wn_ran-progress {
    height: 1px;
    background: var(--wn_ran-line);
    position: relative;
    cursor: pointer;
}
.wn_ran-progress-fill {
    position: absolute;
    left: 0; top: 0;
    height: 100%;
    width: 0%;
    background: var(--wn_ran-on);
    transition: width .25s linear;
}

.wn_ran-time-row {
    display: flex;
    justify-content: space-between;
    font: 10px/1 var(--wn_ran-mono);
    color: var(--wn_ran-dim);
    letter-spacing: .06em;
}

/* Prev / Next controls */
.wn_ran-controls {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}
.wn_ran-ctrl {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border: 1px solid var(--wn_ran-line);
    color: var(--wn_ran-dim);
    transition: border-color .12s, color .12s;
}
.wn_ran-ctrl:hover {
    border-color: var(--wn_ran-gold);
    color: var(--wn_ran-gold);
}
.wn_ran-ctrl svg {
    width: 14px;
    height: 14px;
}

/* ── Footer ───────────────────────────────────────────────── */
.wn_ran-foot {
    flex: 0 0 auto;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-top: 12px;
    margin-top: 14px;
    border-top: 1px solid var(--wn_ran-line);
    color:#fff;
    font: 500 11px/1 var(--wn_ran-mono);
    letter-spacing: .22em;
    text-transform: uppercase;
}
.wn_ran-foot em {
    color: var(--wn_ran-muted);
    font: italic 14px/1 var(--wn_ran-serif);
    text-transform: none;
    letter-spacing: 0;
}

/* ── Responsive ───────────────────────────────────────────── */

/* Tablet: 560px–720px — tighten hero art, shrink sidebar */
@media (max-width: 720px) {
    .wn_ran-widget {
        aspect-ratio: auto;
        min-height: auto;
        padding: clamp(12px, 3vw, 16px);
    }

    .wn_ran-hero {
        grid-template-columns: minmax(0,1fr) 100px;
        gap: 12px;
    }

    .wn_ran-body {
        grid-template-columns: minmax(0,1fr) minmax(180px,.7fr);
        gap: 12px;
    }

    .wn_ran-brand {
        font-size: clamp(17px, 4vw, 22px);
    }

    .wn_ran-title {
        font-size: clamp(18px, 4.5vw, 24px);
    }

    .wn_ran-player {
        min-height: auto;
        padding: 10px;
    }

    .wn_ran-player-title {
        font-size: 14px;
    }
}

/* Mobile: single-column stack below 560px */
@media (max-width: 560px) {
    .wn_ran-widget {
        aspect-ratio: auto;
        min-height: auto;
        width: 100%;
        padding: 14px;
        border-left: none;
        border-right: none;
        border-radius: 0;
    }

    /* Top bar */
    .wn_ran-top {
        margin-bottom: 12px;
        padding-bottom: 10px;
    }
    .wn_ran-brand {
        font-size: 20px;
    }

    /* Hero: title full width, hide art illustration */
    .wn_ran-hero {
        grid-template-columns: 1fr;
        gap: 0;
        padding-bottom: 12px;
    }
    .wn_ran-art {
        display: none;
    }
    .wn_ran-title {
        font-size: clamp(20px, 6vw, 26px);
    }
    .wn_ran-dek {
        max-width: 100%;
        font-size: 12px;
    }

    /* Body: stack list above player */
    .wn_ran-body {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        gap: 14px;
        padding-top: 12px;
        overflow: visible;  /* allow full height on mobile */
    }

    /* Track list: fixed scroll window */
    .wn_ran-list-wrap {
        max-height: 260px;
    }

    /* Track row: smaller number col, hide Spotify ↗ on very small screens */
    .wn_ran-track {
        grid-template-columns: 26px minmax(0,1fr) auto;
        gap: 8px;
        padding: 9px 2px;
    }
    .wn_ran-track__num {
        font-size: 10px;
    }
    .wn_ran-track__title {
        font-size: 16px;
    }
    .wn_ran-track__artist {
        font-size: 13px;
    }
    .wn_ran-track__go {
        display: none; /* reclaimed space on very narrow screens */
    }
    .wn_ran-track__btn {
        width: 28px;
        height: 28px;
    }

    /* Player card: full width, compact */
    .wn_ran-side {
        order: -1;          /* player card appears ABOVE tracklist on mobile */
    }
    .wn_ran-player {
        min-height: auto;
        padding: 12px;
        gap: 8px;
    }
    .wn_ran-player-title {
        font-size: 15px;
    }
    .wn_ran-player-desc {
        -webkit-line-clamp: 1;
    }
    .wn_ran-bars {
        height: 26px;
        gap: 2px;
    }
    .wn_ran-controls {
        justify-content: flex-start;
    }

    /* Footer */
    .wn_ran-foot {
        flex-direction: column;
        gap: 6px;
        align-items: flex-start;
        font-size: 9px;
        letter-spacing: .16em;
        padding-top: 10px;
        margin-top: 10px;
    }
}

/* Very small phones: 360px and below */
@media (max-width: 360px) {
    .wn_ran-widget {
        padding: 12px;
    }
    .wn_ran-brand {
        font-size: 17px;
    }
    .wn_ran-onair {
        font-size: 9px;
        letter-spacing: .14em;
    }
    .wn_ran-track {
        grid-template-columns: 22px minmax(0,1fr) auto;
        gap: 6px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .wn_ran-onair::before,
    .wn_ran-bars span { animation: none !important; }
}
