/* ========================================
   BEATZA — SHARED COMPONENTS

   The pieces more than one page uses: album cards,
   artist cards, genre chips, the show-all button and
   the follow button. Loaded by genre.html, album.html,
   artist.html and search.html, after style.css.
======================================== */


/* ========================================
   FOLLOW BUTTON
======================================== */

.follow-button {
    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 48px;

    padding: 13px 24px;

    color: var(--milk);
    background: transparent;

    border: 1px solid rgba(170, 210, 255, 0.45);
    border-radius: 26px;

    font-size: 0.94rem;
    font-weight: 600;

    transition: 0.25s ease;
}

.follow-button:hover {
    color: var(--cyan);

    border-color: var(--cyan);
}

.follow-button.following {
    color: #04121f;
    background: var(--green);

    border-color: var(--green);
}


/* ========================================
   THE QUEUE PANEL

   Sits above the player bar, because that is the thing it
   belongs to. On a phone it takes the width of the screen.
======================================== */

.queue-panel {
    position: fixed;
    right: 18px;
    bottom: calc(var(--player-height) + 22px);
    z-index: 90;

    display: flex;
    flex-direction: column;

    width: 330px;
    max-height: min(58vh, 460px);

    overflow: hidden;

    background: rgba(6, 18, 34, 0.97);

    border: 1px solid var(--line-bright);
    border-radius: var(--radius-medium);

    box-shadow: 0 26px 60px rgba(0, 0, 0, 0.66);

    backdrop-filter: blur(18px);
}

.queue-panel[hidden] {
    display: none;
}

.queue-panel header {
    display: flex;
    align-items: center;
    gap: 10px;

    padding: 14px 16px;

    border-bottom: 1px solid var(--line);
}

.queue-panel header strong {
    font-size: 0.86rem;
}

.queue-count {
    color: var(--muted);

    font-size: 0.72rem;
}

.queue-close {
    margin-left: auto;

    width: 26px;
    height: 26px;

    color: var(--muted);
    background: transparent;

    border: 0;
    border-radius: 50%;

    cursor: pointer;
}

.queue-close:hover {
    color: var(--white);
    background: rgba(87, 223, 255, 0.14);
}

.queue-list {
    overflow-y: auto;

    padding: 8px;
}

.queue-row {
    display: grid;
    align-items: center;
    gap: 11px;

    grid-template-columns: 24px minmax(0, 1fr) auto;

    width: 100%;

    padding: 9px 10px;

    color: var(--white);
    background: transparent;

    border: 0;
    border-radius: 10px;

    text-align: left;

    cursor: pointer;
    transition: 0.18s ease;
}

.queue-row:hover {
    background: rgba(87, 223, 255, 0.1);
}

.queue-row.is-now {
    background: rgba(87, 223, 255, 0.14);
}

.queue-row.is-now strong {
    color: var(--cyan);
}

.queue-mark {
    color: var(--muted-dark);

    text-align: center;

    font-size: 0.7rem;
    font-variant-numeric: tabular-nums;
}

.queue-row.is-now .queue-mark {
    color: var(--cyan);
}

.queue-text {
    min-width: 0;
}

.queue-text strong,
.queue-text small {
    display: block;

    overflow: hidden;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.queue-text strong {
    font-size: 0.82rem;
}

.queue-text small {
    margin-top: 1px;

    color: var(--muted);

    font-size: 0.72rem;
}

.queue-time {
    color: var(--muted-dark);

    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
}

.queue-empty {
    padding: 22px 14px;

    color: var(--muted);

    text-align: center;

    font-size: 0.8rem;
    line-height: 1.6;
}

/* on a phone the song title is the way into the queue */
.now-information.opens-queue {
    cursor: pointer;
}

.now-information.opens-queue strong::after {
    margin-left: 6px;

    color: var(--muted);

    font-size: 0.7em;

    content: "▤";
}

/* the two player buttons that can be switched on */
#queueToggle.on,
#muteToggle.on {
    color: var(--cyan);
}


/* ========================================
   THE TOP BAR PANELS — what is new, and
   your own music
======================================== */

.top-panel {
    position: fixed;
    z-index: 95;

    width: 290px;
    max-width: calc(100vw - 20px);

    overflow: hidden;

    background: rgba(6, 18, 34, 0.97);

    border: 1px solid var(--line-bright);
    border-radius: var(--radius-medium);

    box-shadow: 0 26px 60px rgba(0, 0, 0, 0.66);

    backdrop-filter: blur(18px);
}

.top-panel[hidden] {
    display: none;
}

.top-panel header {
    padding: 13px 16px;

    border-bottom: 1px solid var(--line);
}

.top-panel header strong {
    font-size: 0.84rem;
}

.panel-list {
    max-height: 320px;

    overflow-y: auto;

    padding: 7px;
}

.panel-row {
    display: flex;
    align-items: center;
    gap: 11px;

    padding: 8px 9px;

    color: var(--white);

    border-radius: 10px;

    text-decoration: none;

    transition: 0.18s ease;
}

.panel-row:hover {
    background: rgba(87, 223, 255, 0.1);
}

.panel-art {
    flex: 0 0 auto;

    width: 38px;
    height: 38px;

    border-radius: 7px;

    background:
        radial-gradient(
            circle at 70% 20%,
            rgba(255, 255, 255, 0.35),
            transparent 38%
        ),
        linear-gradient(
            150deg,
            var(--cover-one, #1d5c9e),
            var(--cover-two, #061628)
        );
}

.panel-text {
    min-width: 0;
}

.panel-text strong,
.panel-text small {
    display: block;

    overflow: hidden;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.panel-text strong {
    font-size: 0.82rem;
}

.panel-text small {
    margin-top: 1px;

    color: var(--muted);

    font-size: 0.71rem;
}

.panel-link {
    display: block;

    padding: 10px 11px;

    color: var(--milk);

    border-radius: 9px;

    font-size: 0.84rem;
    font-weight: 600;

    text-decoration: none;

    transition: 0.18s ease;
}

.panel-link:hover {
    color: var(--cyan);
    background: rgba(87, 223, 255, 0.1);
}

.panel-note,
.panel-empty {
    padding: 12px 16px 15px;

    color: var(--muted-dark);

    font-size: 0.73rem;
    line-height: 1.6;
}

.panel-empty {
    text-align: center;
}

/* the bell's dot, when there is something unseen */
.notification-button.has-new span {
    background: var(--cyan);
}


/* ========================================
   NARROW SCREENS
======================================== */

@media (max-width: 650px) {
    .queue-panel {
        right: 10px;
        left: 10px;

        width: auto;
        max-height: 52vh;

        bottom: calc(70px + 92px + env(safe-area-inset-bottom));
    }

    .top-panel {
        right: 10px !important;
        left: 10px;

        width: auto;
    }
}

/* ========================================
   COVER PHOTOS

   Every piece of artwork on the site is a gradient with an
   optional photo on top. The photo is only in the markup when
   a file is named, and it removes itself if the file is missing,
   so the gradient is both the placeholder and the fallback.
======================================== */

.album-art,
.artist-face,
.cover,
.now-cover,
.album-sleeve,
.artist-portrait,
.hero-cover,
.top-art,
.top-face {
    position: relative;
    overflow: hidden;
}

.cover-photo {
    position: absolute;
    inset: 0;
    z-index: 1;

    width: 100%;
    height: 100%;

    object-fit: cover;
}

/* once a photo is in place the drawn lettering gets out of the way */
.has-photo > b,
.has-photo > span,
.has-photo::before,
.has-photo::after {
    display: none;
}

/* …but the play badge on a card stays on top of it */
.album-art .album-play {
    z-index: 2;
}

/* ========================================
   TINTED ROW COVER

   The home page uses .cover.c0-.c4 from style.css.
   Pages that build rows from the catalogue set the two
   colours themselves, so one rule serves all of them.
======================================== */

.cover.tinted {
    background:
        radial-gradient(
            circle at 70% 20%,
            rgba(255, 255, 255, 0.35),
            transparent 38%
        ),
        linear-gradient(
            150deg,
            var(--cover-one, #1d5c9e),
            var(--cover-two, #061628)
        );
}


/* ========================================
   ALBUMS
======================================== */

.album-grid {
    display: grid;

    grid-template-columns: repeat(
        auto-fill,
        minmax(180px, 1fr)
    );

    gap: 16px;
}

.album-card {
    display: block;

    min-width: 0;

    padding: 0;

    color: var(--white);
    background: transparent;

    border: 0;

    text-align: left;
    text-decoration: none;

    transition: 0.25s ease;
}

.album-art {
    position: relative;

    display: grid;
    place-items: center;

    aspect-ratio: 1;

    margin-bottom: 11px;

    overflow: hidden;

    background:
        radial-gradient(
            circle at 74% 16%,
            rgba(255, 255, 255, 0.4),
            transparent 36%
        ),
        linear-gradient(
            150deg,
            var(--cover-one, #1d5c9e),
            var(--cover-two, #061628)
        );

    border-radius: 12px;

    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.5);

    transition: 0.25s ease;
}

.album-art b {
    padding: 0 14px;

    color: #eaf3ff;

    text-align: center;

    font-size: 0.62rem;
    font-weight: 800;
    line-height: 1.6;
    letter-spacing: 0.18em;

    /* labels in catalogue.js use \n to break onto a second line */
    white-space: pre-line;

    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.75);
}

.album-play {
    position: absolute;
    right: 12px;
    bottom: 12px;

    display: grid;
    place-items: center;

    width: 42px;
    height: 42px;

    color: #04121f;

    background: var(--cyan);

    border-radius: 50%;

    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.45);

    opacity: 0;

    transform: translateY(8px);

    transition: 0.25s ease;
}

.album-play svg {
    width: 17px;
    height: 17px;

    fill: currentColor;
}

.album-card:hover {
    transform: translateY(-4px);
}

.album-card:hover .album-art {
    box-shadow: 0 20px 38px rgba(0, 88, 190, 0.45);
}

.album-card:hover .album-play {
    opacity: 1;

    transform: translateY(0);
}

.album-card strong,
.album-card small {
    display: block;

    overflow: hidden;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.album-card strong {
    font-size: 0.88rem;
}

.album-card small {
    margin-top: 3px;

    color: var(--muted);

    font-size: 0.74rem;
}


/* ========================================
   ARTISTS
======================================== */

.artist-row {
    display: grid;

    grid-template-columns: repeat(
        auto-fill,
        minmax(140px, 1fr)
    );

    gap: 16px;
}

.artist-card {
    display: block;

    text-decoration: none;

    padding: 16px 12px;

    color: var(--white);
    background: rgba(10, 26, 48, 0.6);

    border: 1px solid var(--line);
    border-radius: var(--radius-medium);

    text-align: center;

    transition: 0.25s ease;
}

.artist-face {
    display: grid;
    place-items: center;

    width: 84px;
    height: 84px;

    margin: 0 auto 12px;

    color: #04121f;

    background: linear-gradient(
        150deg,
        var(--cover-one, #1d5c9e),
        var(--cover-two, #061628)
    );

    border-radius: 50%;

    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.5);

    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 0.06em;
}

.artist-card strong {
    display: block;

    font-size: 0.86rem;
}

.artist-card small {
    display: block;

    margin-top: 3px;

    color: var(--muted);

    font-size: 0.72rem;
}

.artist-card:hover {
    background: rgba(20, 54, 96, 0.8);

    border-color: var(--line-bright);

    transform: translateY(-4px);
}


/* ========================================
   RELATED SOUNDS
======================================== */

.related-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.related-chip {
    display: flex;
    align-items: center;
    gap: 9px;

    padding: 9px 16px 9px 10px;

    color: var(--milk);
    background: rgba(10, 26, 48, 0.7);

    border: 1px solid var(--line);
    border-radius: 22px;

    text-decoration: none;

    font-size: 0.82rem;
    font-weight: 600;

    transition: 0.25s ease;
}

.related-chip span {
    width: 24px;
    height: 24px;

    background: linear-gradient(
        150deg,
        var(--cover-one, #1d5c9e),
        var(--cover-two, #061628)
    );

    border-radius: 7px;
}

.related-chip:hover {
    color: var(--cyan);
    background: rgba(20, 54, 96, 0.9);

    border-color: var(--line-bright);

    transform: translateY(-2px);
}


/* ========================================
   SHOW ALL
======================================== */

.show-all {
    display: block;

    width: 100%;

    margin-top: 14px;
    padding: 13px;

    color: var(--milk);
    background: rgba(87, 223, 255, 0.05);

    border: 1px solid var(--line);
    border-radius: 22px;

    font-size: 0.86rem;
    font-weight: 600;

    transition: 0.25s ease;
}

.show-all[hidden] {
    display: none;
}


.show-all:hover {
    color: #04121f;
    background: var(--cyan);

    border-color: var(--cyan);
}


/* ========================================
   MOBILE
======================================== */

@media (max-width: 650px) {
    .follow-button {
        min-height: 44px;

        padding: 11px 20px;

        font-size: 0.86rem;
    }

    .album-grid {
        display: flex;

        margin-right: -14px;
        padding-bottom: 10px;

        overflow-x: auto;

        scroll-snap-type: x mandatory;
    }

    .album-card {
        flex: 0 0 46%;

        scroll-snap-align: start;
    }

    .artist-row {
        grid-template-columns: repeat(
            2,
            minmax(0, 1fr)
        );
    }
}


/* ============================================================
   the hidden YouTube player

   A song imported from YouTube plays through a real YouTube
   player — it just isn't one you look at. It cannot be
   display:none or visibility:hidden: browsers stop playback in
   a hidden frame. So it is a 1px square, parked out of the way
   and untouchable.
   ============================================================ */

.tube-host {
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: -1;

    width: 1px;
    height: 1px;

    overflow: hidden;

    opacity: 0.01;

    pointer-events: none;
}


/* ============================================================
   a line that survived a redirect

   "Signed out.", "Name changed." — it says its piece at the top
   of the next page and is gone the one after that.
   ============================================================ */

.flash-strip {
    position: fixed;
    top: 14px;
    left: 50%;
    z-index: 90;

    width: max-content;
    max-width: min(420px, calc(100vw - 28px));

    transform: translateX(-50%);
}

.flash-strip p {
    margin: 0 0 8px;
    padding: 11px 18px;

    color: var(--white);
    background: rgba(8, 26, 46, 0.96);

    border: 1px solid var(--line-bright);
    border-radius: 25px;

    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);

    font-size: 0.86rem;
    text-align: center;
}

/* ============================================================
   long titles

   A title with no spaces in it — which an import can produce —
   used to run off the side of the hero rather than wrapping.
   Breaking mid-word is ugly; a title pushing the page sideways
   is worse.
   ============================================================ */

.featured-title,
.album-hero h1,
.artist-hero h1,
.album-card strong,
.genre-card strong,
.now-information strong,
.now-information small {
    overflow-wrap: anywhere;
}
