/* The window over the playlist row (playlist-peek.js). It lives on <body>,
   outside the bio column, whose own scrolling would clip it. The outer box
   moves and casts the shadow, drawn around whatever the card's clip leaves
   while it opens out of the tile. */
.playlist-peek {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9998;
    width: 248px; /* WIDTH in playlist-peek.js */
    pointer-events: none;
    filter: drop-shadow(0 22px 28px rgb(0 0 0 / 0.5)) drop-shadow(0 4px 8px rgb(0 0 0 / 0.35));
    will-change: transform, opacity;
}

/* Opened by a tap, the card is the link through to the playlist; under a
   mouse it stays out of the pointer's way, and the tile is the link. */
.playlist-peek.is-tappable {
    pointer-events: auto;
}

/* playlist-peek.js tweens the four --clip-* lengths rather than clip-path
   itself: the browser shortens an inset() whose sides match, and a tween
   between two differently shaped strings pairs up the wrong numbers. */
.playlist-peek__card {
    --clip-top: 0px;
    --clip-side: 0px;
    --clip-bottom: 0px;
    --clip-radius: var(--radius-lg);
    display: block;
    padding: 8px 8px 12px;
    border-radius: var(--radius-lg);
    background: var(--raised);
    clip-path: inset(var(--clip-top) var(--clip-side) var(--clip-bottom) round var(--clip-radius));
}

.playlist-peek__body {
    padding: 0 6px;
}

/* Holds the two .preview-shot layers that wipe between covers. */
.playlist-peek__cover {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    /* Concentric with the card: its radius less the 8px inset. */
    border-radius: calc(var(--radius-lg) - 8px);
    background: var(--raised-hover);
}

/* Cropped like the tile's own cover (centred), not like a project screenshot
   (top), so a non-square cover lands in its tile without a jump. */
.playlist-peek__cover .preview-shot {
    object-position: center;
}

.playlist-peek__name {
    margin-top: 12px;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.25;
    text-wrap: balance;
}

.playlist-peek__desc {
    display: -webkit-box;
    margin-top: 4px;
    overflow: hidden;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
    text-wrap: pretty;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    line-clamp: 4;
}

.playlist-peek__desc:empty {
    display: none;
}

.playlist-peek__meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 8px;
    color: var(--spotify);
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* Said only where the card is the way through. */
.playlist-peek:not(.is-tappable) .playlist-peek__open {
    display: none;
}

/* With the window open, the row steps back so the hovered tile leads; the
   tile no longer tips, since the card growing out of it is the response. */
.playlists.has-peek .playlist {
    display: block;
    border-radius: var(--radius-sm);
    transition: background-color 200ms var(--ease-smooth-out);
}

.playlists.has-peek .playlist img {
    transition: opacity 200ms var(--ease-smooth-out);
}

/* While the window is open, not while the row is hovered: a tap leaves its
   hover behind on a touch screen. */
.playlists.is-peeking .playlist img {
    opacity: 0.5;
}

.playlists.has-peek .playlist:hover img,
.playlists.has-peek .playlist:focus-visible img {
    opacity: 1;
    transform: none;
}

/* Its cover is out in the card: the tile is left as an empty socket. Moving
   along the row the covers cross-fade back and out; opening and folding swap
   at once (.is-snapping), since the card itself covers the tile then. */
.playlists.has-peek .playlist.is-lifted {
    background: var(--raised);
}

.playlists.has-peek .playlist.is-lifted img {
    opacity: 0;
}

.playlists.is-snapping .playlist,
.playlists.is-snapping .playlist img {
    transition: none;
}
