/* ── Avatar com fundo dinâmico — define --avatar-bg via style= no JS ── */
.author-card .author-avatar,
.publisher-logo,
.publisher-row-logo { background: var(--avatar-bg, var(--color-bg-elevated)); }

/* Iniciais do avatar de gênero */
.genre-avatar-initials {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--color-on-accent, #fff);
}

/* ─────────────────────────────────────────────────────────────────── */
.page-wrapper {
    max-width: 1100px;
}

.livros-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.livro-card {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    text-decoration: none;
    color: inherit;
    border-radius: var(--r-lg);
    transition: transform .2s ease, background .2s ease, border-color .2s ease;
}

.livro-card:hover { transform: translateY(-2px); }

.livro-cover {
    width: 100%;
    aspect-ratio: 2 / 3;
    border-radius: var(--r-md);
    overflow: hidden;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.livro-cover-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    gap: 0.4rem;
    padding: 1rem;
    text-align: center;
}

.livro-cover-placeholder i { font-size: 2rem; color: var(--color-on-accent); opacity: .5; }

.livro-cover-placeholder span {
    font-size: .65rem;
    color: rgba(255,255,255,.45);
    line-height: 1.3;
    word-break: break-word;
}

.livro-info { padding: 0 2px; }

.livro-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: .85rem;
    line-height: 1.3;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.livro-author {
    font-size: .75rem;
    color: var(--text-secondary);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.livro-meta {
    font-size: .72rem;
    color: var(--text-secondary);
    margin-top: 3px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.livros-list { display: flex; flex-direction: column; gap: 0; margin-bottom: 2rem; }

.livro-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 4px;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
    transition: background .1s;
    border-radius: var(--r);
}

.livro-row:hover { background: rgba(255,255,255,.04); }

.livro-row-cover {
    width: 40px;
    aspect-ratio: 2 / 3;
    border-radius: var(--r-sm);
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
}

.livro-row-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.livro-row-cover i { font-size: .9rem; color: rgba(255,255,255,.4); }
.livro-row-info { flex: 1; min-width: 0; }
.livro-row-name { font-family: var(--font-body); font-weight: var(--font-weight-semibold); font-size: var(--font-size-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.livro-row-count { font-size: .72rem; color: var(--text-secondary); margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.livro-row-rank { font-family: var(--font-mono); font-size: .68rem; color: var(--text-muted, var(--text-secondary)); margin-left: auto; flex-shrink: 0; }

@media (max-width: 480px) {
    .livros-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 0.9rem; }
}

#featuredCover.discover-featured-avatar {
    width: 90px;
    height: 135px;
    border-radius: var(--r-lg);
    flex-shrink: 0;
}

#featuredCover.discover-featured-avatar img {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: var(--r-lg);
}

.discover-featured-avatar--contain img { object-fit: contain; }
