/* Album grid, album pages, song rows and the playlist. */

.album-grid__list {
    display: grid;
    align-items: stretch;
    /* Wide columns, so titles wrap less; phones keep two. */
    grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
    gap: 1.25rem 1rem;
    margin: 0;
    padding: 0.5rem;
    list-style: none;
}

/* Cards in a row share its height; the tab takes the extra space, so covers align
   even when titles wrap to a different number of lines. */
.album-grid__list > li {
    display: grid;
}

.album-card {
    display: grid;
    grid-template-rows: 1fr auto;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    color: var(--kp-orange);
    font-family: var(--kp-font-display);
    text-align: left;
    background: none;
    box-shadow: 0 0 5px 5px rgb(255 255 255 / 0.25);
    transition: box-shadow 250ms ease-out;

    & img {
        width: 100%;
        height: auto;
        aspect-ratio: 1;
        object-fit: cover;
        filter: sepia(70%);
        transition: filter 250ms ease-out;
    }

    &:hover,
    &:focus-visible {
        box-shadow: 0 0 8px 8px rgb(255 255 255 / 0.55);

        & img {
            filter: none;
        }

        & .album-card__title {
            color: #6dbdff;
        }
    }
}

/* Title as a tab on top of the cover, sharing the card's glow. */
.album-card__title {
    display: grid;
    place-items: center;
    padding: 0.35rem 0.6rem;
    font-size: 0.8em;
    text-align: center;
    border: 1px solid rgb(255 255 255 / 0.18);
    border-bottom: 0;
    background: #121412;
    font-style: normal;
    font-weight: 700;
    line-height: 1.25;
    transition: color 250ms ease-out;
}

@media (max-width: 30rem) {
    .album-grid__list {
        grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
    }
}

.album-detail {
    padding: 0.5rem;

    &:focus-visible {
        outline-offset: -3px;
    }
}

.album-detail__head {
    display: grid;
    grid-template-columns: 1fr minmax(6rem, 30%);
    gap: var(--kp-gap);
    align-items: start;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgb(222 184 135 / 0.35);
}

.album-detail__cover {
    padding: 0;
    border: 2px ridge #000;
    background: none;

    & img {
        width: 100%;
        height: auto;
    }
}

.song-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.song-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.25rem 0.75rem;
    padding: 0.35rem 0.25rem 0.35rem 0.75rem;
    border-bottom: 1px solid rgb(222 184 135 / 0.35);

    &.is-current {
        background: rgb(255 165 0 / 0.25);
    }

    &.is-drop-target {
        box-shadow: inset 0 3px 0 0 var(--kp-orange);
    }

    &[draggable="true"] .song-row__title {
        cursor: grab;
    }
}

.song-row__title {
    flex: 1 1 12rem;
    color: var(--kp-burlywood);
    font-weight: 700;
}

.song-row__number {
    color: var(--kp-text-muted);
}

.song-row__length {
    font-weight: 400;
    color: var(--kp-text-muted);
}

.song-row__actions {
    display: flex;
    gap: 0.25rem;
}
