:root {
    --gold: #b45309;
    --gold-light: #fef3c7;
    --dark: #1e293b;
    --primary-color: #3B82F6; /* Azul moderno */
    --secondary-color: #FBBF24; /* Amarelo/Ouro para destaque */
    --text-color-light: #F9FAFB; /* Branco leve para contraste */
    --background-dark: #1F2937; /* Fundo do rodapé */
}
*{
    padding: 0; margin: 0; box-sizing: border-box;
}
body { font-family: 'Inter', sans-serif; background: #fdfdfd; }

/* Header de Boas-vindas */
.boas-vindas-livros {
    height: 40vh;
    background: url('../../IMG/biblioteca/livraria.jpg') center/cover no-repeat;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
}

.overlay-welcome {
    background: rgba(0, 0, 0, 0.6);
    width: 100%; height: 100%;
    display: flex; flex-direction: column; 
    justify-content: center; align-items: center;
    padding: 20px;
}
.logo-top {
    width: 80px; margin-bottom: 15px;
}

.divider-ouro {
    width: 60px; height: 4px;
    background: var(--gold);
    margin-top: 15px;
}

/* Layout Principal */
.layout-principal {
    display: grid;
    grid-template-columns: 1fr 300px;
    max-width: 1200px;
    margin: -50px auto 50px;
    gap: 30px;
    padding: 0 20px;
}

/* Grid de Livros */
.grid-livros {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
}

.card-livro {
    background: white;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    text-align: center;
    transition: transform 0.3s;
}

.card-livro:hover { transform: translateY(-10px); }

.capa-container {
    perspective: 1000px;
    margin-bottom: 15px;
}

.capa-3d {
    width: 150px;
    height: 220px;
    border-radius: 4px 12px 12px 4px;
    box-shadow: 5px 5px 15px rgba(0,0,0,0.3);
    transition: transform 0.5s;
    object-fit: cover;
}

.card-livro:hover .capa-3d {
    transform: rotateY(-20deg);
}

.btn-detalhes {
    background: var(--dark);
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
}

.btn-detalhes:hover { background: var(--gold); }

/* Sidebar */
.sidebar-links { display: flex; flex-direction: column; gap: 20px; }

.card-sugestao-mini {
    padding: 20px; border-radius: 15px; color: white;
}
.artigos { background: #1e40af; }
.reflexoes { background: #6366f1; }

.card-sugestao-mini a { color: white; text-decoration: none; font-weight: bold; font-size: 0.9rem; }

/* Modal */
.close-modal {
    position: absolute; top: 15px; right: 50px;
    font-size: 1.5rem; color: #555; cursor: pointer;
}
.modal-container {
    display: none; position: fixed; z-index: 1000;
    left: 0; top: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8); backdrop-filter: blur(5px);
}

.modal-content {
    background: white; margin: 10% auto; padding: 30px;
    width: 90%; max-width: 700px; border-radius: 20px;
    position: relative; animation: slideDown 0.4s ease;
}

/* Estilo do Botão Voltar */
.btn-voltar-home {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    transition: all 0.3s ease;
}

.btn-voltar-home i {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.btn-voltar-home:hover {
    background: var(--gold); /* Usa a cor ouro que você já definiu */
    border-color: var(--gold);
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(180, 83, 9, 0.3);
}

.btn-voltar-home:hover i {
    transform: translateX(-3px); /* A seta faz um movimento para trás ao hover */
}

/* Responsividade: No mobile ele fica um pouco menor */
@media (max-width: 600px) {
    .btn-voltar-home span {
        display: none; /* Esconde o texto, deixa só o ícone em telas muito pequenas */
    }
    .btn-voltar-home {
        padding: 10px;
        border-radius: 50%;
    }
}

@keyframes slideDown {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-flex { display: flex; gap: 30px; align-items: center; }

/* 1. Definição das Animações */

/* Animação para o Header (surge de cima) */
@keyframes slideFromTop {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Animação para os Cards (surge de baixo com fade) */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Animação para a Sidebar (surge da direita) */
@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

/* 2. Aplicação nos Elementos */

.overlay-welcome {
    animation: slideFromTop 0.8s ease-out forwards;
}

.card-livro {
    opacity: 0; /* Começa invisível para o JS mostrar */
    animation: fadeInUp 0.8s ease-out forwards;
}

.sidebar-links {
    animation: fadeInRight 1s ease-out forwards;
}

/* 3. Efeito de Escalonamento (Staggered Delay) */
/* Isso faz com que cada livro apareça um pouquinho depois do outro */

.card-livro:nth-child(1) { animation-delay: 0.2s; }
.card-livro:nth-child(2) { animation-delay: 0.4s; }
.card-livro:nth-child(3) { animation-delay: 0.6s; }
.card-livro:nth-child(4) { animation-delay: 0.8s; }
/* Adicione mais se tiver mais livros iniciais */

@media (max-width: 900px) {
    .layout-principal { grid-template-columns: 1fr; margin-top: 20px; }
    .modal-flex { flex-direction: column; text-align: center; }
}

/* --- Rodapé (Footer) --- */
.footer {
    background-color: var(--background-dark);
    color: var(--text-color-light);
    padding: 40px 0 20px;
    font-size: 0.9rem;
    text-align: center;
}

/* --- Ajustes no Rodapé --- */

.container-footer {
    max-width: 1200px; /* Mesma largura do seu layout principal */
    margin: 0 auto;    /* Centraliza o bloco na tela */
    padding: 0 20px;   /* Evita que o texto encoste nas bordas em telas menores */
}

.footer-grid {
    display: grid;
    /* Ajustado para centralizar o próprio grid se houver poucos itens */
    justify-content: center; 
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 30px;
}

.footer-block {
    /* Garante que o conteúdo interno do bloco não flutue estranhamente */
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Alinha o texto à esquerda dentro do bloco */
}

/* Centralização para Mobile */
@media (max-width: 768px) {
    .footer-block {
        align-items: center; /* Centraliza o conteúdo dos blocos no mobile */
        text-align: center;
    }
    
    .footer-block p {
        justify-content: center; /* Centraliza ícones e textos juntos */
    }
}
.footer-block h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--secondary-color);
}

.footer-block p {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.footer-block i {
    margin-right: 10px;
    color: var(--primary-color);
}

.footer-block ul {
    list-style: none;
}

.footer-block ul a {
    color: var(--text-color-light);
    text-decoration: none;
    display: block;
    margin-bottom: 5px;
    transition: color 0.3s ease;
}

.footer-block ul a:hover {
    color: var(--secondary-color);
}

.social-block {
    text-align: center;
}

.social-icons {
    margin-top: 15px;
}

.social-icons a {
    color: var(--text-color-light);
    font-size: 1.5rem;
    margin: 0 10px;
    transition: color 0.3s ease;
}

.social-icons a:hover {
    color: var(--primary-color);
}

.mini-logo {
    font-size: 1rem;
    font-weight: 700;
    margin-top: 20px;
}

.footer-bottom {
    border-top: 1px solid #374151;
    padding-top: 20px;
}

.footer-bottom p:first-child {
    font-weight: 600;
    margin-bottom: 5px;
}



@media (max-width: 768px) {

    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-block {
        padding-bottom: 20px;
    }

    .footer-block p, .footer-block ul {
        text-align: center;
        padding-left: 0;
    }
}