#historias {
    position: relative;
    width: 100%;
    padding: 5vw 3vw;
    box-sizing: border-box;
    text-align: center;
    transition: background-color 0.9s ease, color 0.9s ease;

    /* cor vinda do estilo.js — sempre igual à do #sparks, adaptando por tema */
    background-color: rgb(var(--cor-secao-neutra, 24, 24, 26));
}

.historias-titulo {
    margin: 0 0 1.6vw;
    font-size: 2.6vw;
    font-weight: bold;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: white;
    mix-blend-mode: difference;
}
body.tema-branco .historias-titulo { color: rgb(30, 30, 30); mix-blend-mode: normal; }

.historias-texto {
    max-width: 55vw;
    margin: 0 auto 2.6vw;
    font-size: 1.15vw;
    line-height: 1.6;
    color: white;
    mix-blend-mode: difference;
}
body.tema-branco .historias-texto { color: rgb(30, 30, 30); mix-blend-mode: normal; }

.capas-livros {
    display: flex;
    gap: 3vw;
    justify-content: center;
    margin: 0 0 2.6vw;
    flex-wrap: wrap;
}

.capa-livro {
    width: 150px;
    height: 212px;
    background: rgb(252, 252, 250);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 14px;
    box-sizing: border-box;

    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.capa-titulo {
    color: rgb(30, 30, 30);
    font-weight: bold;
    font-size: 0.95rem;
    line-height: 1.3;
}

.capa-livro:hover {
    transform: translateY(-10px) rotate(-1.5deg);
    box-shadow: 0 20px 34px rgba(0, 0, 0, 0.5);
}

.capa-livro.abrindo {
    animation: livro-abrir 0.5s ease forwards;
}

@keyframes livro-abrir {
    0%   { transform: scale(1) rotate(0deg); }
    50%  { transform: scale(1.06) rotate(-2deg); }
    100% { transform: scale(0.94) rotate(-4deg); opacity: 0.5; }
}

@media (max-width: 900px) {
    .historias-titulo { font-size: 5.5vw; }
    .historias-texto { max-width: 90vw; font-size: 3.6vw; }
    .capa-livro { width: 120px; height: 170px; }
}