/* ============================================================
 * StationHQ Now Playing Widget — v1
 *
 * Default layout: album art on top, title/artist/voting below.
 * Optional ?layout=horizontal restores the side-by-side card.
 * ============================================================ */

:root {
    --shq-bg:           #111418;
    --shq-border:       rgba(255, 255, 255, 0.08);
    --shq-text:         #ffffff;
    --shq-text-soft:    rgba(255, 255, 255, 0.6);
    --shq-accent:       #4f8df9;
    --shq-radius:       12px;
    --shq-pad:          14px;
    --shq-gap:          12px;
    --shq-art:          120px;
    --shq-title-size:   1.05rem;
    --shq-artist-size:  0.85rem;
    --shq-label-size:   0.7rem;
    --shq-font:         system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --shq-width:        100%;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    /* Match the card background on the iframe root so fixed iframe heights
     * never expose the host page as a white strip below the widget. */
    background: var(--shq-bg);
    font-family: var(--shq-font);
    color: var(--shq-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.shq-np {
    box-sizing: border-box;
    padding: var(--shq-pad);
    border-radius: var(--shq-radius);
    border: 1px solid var(--shq-border);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

body.shq-np[data-theme="light"] {
    --shq-bg:        #f6f7f9;
    --shq-border:    rgba(0, 0, 0, 0.08);
    --shq-text:      #111418;
    --shq-text-soft: rgba(0, 0, 0, 0.55);
}

body.shq-np[data-frame="false"],
html:has(body.shq-np[data-frame="false"]) {
    background: transparent;
    border: 0;
    padding: 0;
}

body.shq-np[data-frame="false"] .shq-np-card {
    background: transparent;
    padding: 0;
    border: 0;
}

/* ---------- Card (stacked — default) ---------- */

.shq-np-card {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--shq-gap);
    width: var(--shq-width);
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
    background: transparent;
    border-radius: var(--shq-radius);
    overflow: hidden;
    text-align: center;
}

/* ---------- Album art ---------- */

.shq-np-art {
    position: relative;
    flex: 0 0 auto;
    width:  var(--shq-art);
    height: var(--shq-art);
    border-radius: calc(var(--shq-radius) * 0.6);
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shq-np-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.shq-np-art-fallback {
    font-size: calc(var(--shq-art) * 0.45);
    line-height: 1;
    color: var(--shq-text-soft);
    user-select: none;
}

/* ---------- Meta ---------- */

.shq-np-meta {
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
}

.shq-np-label {
    font-size: var(--shq-label-size);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--shq-accent);
    margin-bottom: 4px;
}

.shq-np-title {
    font-size: var(--shq-title-size);
    font-weight: 600;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shq-np-artist {
    font-size: var(--shq-artist-size);
    color: var(--shq-text-soft);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.shq-np[data-show-artist="false"] .shq-np-artist  { display: none; }
body.shq-np[data-show-label="false"]  .shq-np-label   { display: none; }
body.shq-np[data-show-title="false"]  .shq-np-title   { display: none; }

/* ---------- Rating ---------- */

.shq-np-rating {
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.shq-np-rate {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    font: inherit;
    font-size: 0.8rem;
    color: var(--shq-text);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid transparent;
    border-radius: 999px;
    cursor: pointer;
    transition: background 120ms ease, border-color 120ms ease;
}

.shq-np-rate:hover  { background: rgba(255, 255, 255, 0.14); }
.shq-np-rate:disabled { opacity: 0.5; cursor: default; }

.shq-np-rate.is-active {
    background: var(--shq-accent);
    border-color: var(--shq-accent);
    color: #fff;
}

.shq-np-rate-total {
    font-size: 0.72rem;
    color: var(--shq-text-soft);
}

/* ---------- Horizontal layout (legacy) ---------- */

body.shq-np[data-layout="horizontal"] .shq-np-card {
    flex-direction: row;
    align-items: center;
    text-align: left;
}

body.shq-np[data-layout="horizontal"] .shq-np-meta {
    flex: 1 1 auto;
}

body.shq-np[data-layout="horizontal"] .shq-np-rating {
    justify-content: flex-start;
}
