/* --- CORREÇÃO DE LAYOUT: Sobrescreve o grid principal --- */
main.container {
    display: block !important; /* Força largura total, removendo a sidebar invisível */
    padding-bottom: 60px;
}

.books-main {
    width: 100%;
}

/* --- Estilos da Página de Livros --- */

.section-header {
    margin-bottom: 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
}

.books-intro {
    font-family: var(--font-tech);
    color: var(--text-muted);
    margin-top: 10px;
}

/* Filtros */
.books-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 40px;
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--text-muted);
    color: var(--text-muted);
    font-family: var(--font-tech);
    padding: 8px 16px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
    font-weight: 700;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--accent-cream);
    color: var(--bg-blueprint);
    border-color: var(--accent-cream);
    box-shadow: 0 0 10px rgba(242, 227, 213, 0.2);
}

/* Grid de Livros */
.books-grid {
    display: grid;
    /* Cria colunas automaticamente */
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

/* Card */
.book-card {
    background-color: var(--bg-surface);
    border: 1px solid rgba(242, 227, 213, 0.1);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
    overflow: hidden;
    position: relative;
    height: 100%; 
}

.book-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-cream);
    box-shadow: 0 10px 20px rgba(0,0,0,0.4);
}

/* Capa */
.book-cover {
    height: 240px;
    background-color: #0d131c;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px;
}

.book-cover-img {
    height: 100%;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    transition: transform 0.3s;
}

.book-card:hover .book-cover-img {
    transform: scale(1.05);
}

/* Informações */
.book-info {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.book-meta {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.meta-tag {
    font-family: var(--font-tech);
    font-size: 0.75rem;
    background: rgba(242, 227, 213, 0.1);
    color: var(--accent-cream);
    padding: 2px 6px;
    border-radius: 2px;
    border: 1px solid rgba(242, 227, 213, 0.2);
}

.book-info h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--text-main);
    margin-bottom: 8px;
    line-height: 1.3;
}

.book-author {
    font-family: var(--font-tech);
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.book-description {
    font-size: 0.9rem;
    color: #b0c4de;
    margin-bottom: 20px;
    line-height: 1.5;
    flex-grow: 1;
}

/* Botão */
.book-link {
    display: block;
    text-align: center;
    background: transparent;
    border: 1px solid var(--accent-cream);
    color: var(--accent-cream);
    padding: 10px;
    font-family: var(--font-tech);
    font-size: 0.8rem;
    font-weight: 700;
    margin-top: auto;
    transition: all 0.2s;
}

.book-link:hover {
    background: var(--accent-cream);
    color: var(--bg-blueprint);
    text-decoration: none;
}

.book-card.hidden {
    display: none;
}

/* Responsivo */
@media (max-width: 600px) {
    .books-filter {
        justify-content: center;
    }
    .filter-btn {
        flex: 1 1 auto;
        text-align: center;
    }
}