/**
 * Library — Albums page styles
 * Covers: /library/albums and /library/albums/:id
 *
 * Most styles are shared with library-artists.css (album-grid, album-card,
 * song-list, etc.) since artist detail also shows albums.
 * This file adds any albums-specific overrides.
 */

.library-page {
    max-width: var(--screen-xl);
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

.library-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.75rem;

    & .page-title {
        margin: 0;
    }
}

.library-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* ── Album grid ──────────────────────────────────────────────────────────── */

.album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}

.album-card {
    display: flex;
    flex-direction: column;
    border-radius: 0.5rem;
    overflow: hidden;
    background: var(--surface-1);
    border: 1px solid var(--border);
    transition: box-shadow 0.2s, transform 0.2s;

    &:hover {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
        transform: translateY(-2px);
    }
}

.album-card-art {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--surface-2);

    & img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }
}

.album-card-art-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-3);
    color: var(--text-muted);

    & .material-icons {
        font-size: 3rem;
    }

    &.large .material-icons {
        font-size: 5rem;
    }
}

.album-card-info {
    padding: 0.6rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.album-card-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.album-card-artist {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.album-card-year {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ── Album detail hero ───────────────────────────────────────────────────── */

.album-detail-hero {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.album-detail-art {
    width: 180px;
    height: 180px;
    flex-shrink: 0;
    border-radius: 0.5rem;
    overflow: hidden;
    background: var(--surface-2);

    & img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }
}

.album-detail-meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;

    & .page-title {
        font-size: 1.75rem;
        margin: 0;
    }
}

.album-detail-artist {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;

    &:hover {
        text-decoration: underline;
    }
}

.album-detail-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* ── Song list ───────────────────────────────────────────────────────────── */

.song-list {
    margin-top: 1.5rem;
}

@media (max-width: 640px) {
    .album-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }

    .album-detail-art {
        width: 120px;
        height: 120px;
    }
}
