:root {
    --primaria: #288ab8;
    --fundo-base: #0d1226;
    --fundo-solido: #141b35;
    --texto: #ffffff;
    --cinza: #b0bec5;
    --laranja: #d67b3d;
}

body.historia-view {
    background-color: var(--fundo-base);
    color: var(--texto);
    margin: 0;
    overflow-x: hidden;
    overflow-y: auto;
}

/* --- BANNER INTERNO --- */
.hero-interna {
    margin-top: 100px;
    height: 35vh;
    min-height: 250px;
    background: linear-gradient(rgba(13, 18, 38, 0.8), rgba(13, 18, 38, 0.95)), url('../assets/fundo.jpg');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.hero-interna-content h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    color: var(--texto);
    margin-bottom: 10px;
}

.hero-interna-content p {
    color: var(--cinza);
    max-width: 800px;
    margin: 0 auto;
    padding: 0 15px;
}

/* --- CONTEÚDO COM MARGENS LATERAIS --- */
.historia-conteudo .container {
    max-width: 1200px;
    margin-top: 15px;
    padding: 0 40px;
}

.historia-section {
    padding: 60px 0;
    margin-top: 15px;
}

/* --- GRID DE TEXTO/IMAGEM (Proporção Ajustada 60/40) --- */
.historia-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 20px;
    align-items: stretch;
    margin-top: 15px;

}

.historia-section.reverse .historia-grid {
    direction: rtl;
}

.historia-section.reverse .historia-texto,
.historia-section.reverse .historia-imagem {
    direction: ltr;
}

/* --- TEXTOS --- */
.ano-tag {
    color: var(--laranja);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    margin-bottom: 10px;
    display: block;
}

.historia-texto h2 {
    font-size: 2.2rem;
    line-height: 1.2;
    margin-bottom: 30px;
    color: var(--texto);
}

.historia-texto p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--cinza);
    margin-bottom: 30px;
    text-align: justify;
}

/* --- IMAGEM LATERAL (Com Limite de Altura) --- */
.historia-imagem {
    position: sticky;
    top: 120px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
    max-height: 480px;
    display: flex;
    flex-direction: column;
    margin: 15px;

}

.historia-imagem img {
    width: 100%;
    height: 100%;
    max-height: 480px;
    display: block;
    object-fit: cover;
    transition: 0.5s ease;
}

.historia-imagem img:hover {
    transform: scale(1.03);
}

/* Para a seção que tem 2 fotos lado a lado */
.historia-imagens-duplas {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    height: 100%;
    max-height: 480px;
}

.legenda {
    display: block;
    text-align: center;
    font-size: 0.8rem;
    color: var(--cinza);
    margin-top: 12px;
    font-style: italic;
    padding-bottom: 10px;
}

/* --- BOX TESTEMUNHO --- */
.box-testemunho {
    background: var(--fundo-solido);
    padding: 50px;
    border-radius: 20px;
    text-align: center;
    border: 1px solid var(--primaria);
    margin: 40px 0;
}

.box-testemunho i {
    font-size: 2.5rem;
    color: var(--laranja);
    margin-bottom: 20px;
}

.valor-milagre {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primaria);
    margin-top: 20px;
}

.citacao {
    border-left: 4px solid var(--laranja);
    padding-left: 20px;
    margin: 30px 0;
    font-style: italic;
}

.citacao span {
    display: block;
    font-size: 0.85rem;
    color: var(--laranja);
    font-weight: 700;
    margin-top: 10px;
    font-style: normal;
}


/* ========================================================= */
/* --- GALERIA HORIZONTAL HISTÓRICA E MODAL --- */
/* ========================================================= */
.galeria-historica {
    margin-top: 40px;
    margin-bottom: 20px;
    padding: 20px 0;
}

.titulo-galeria {
    color: var(--laranja);
    font-size: 1.2rem;
    text-align: center;
    margin-bottom: 25px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.track-fotos {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding: 10px 5px 25px 5px;
    scrollbar-width: thin;
    scrollbar-color: var(--primaria) var(--fundo-solido);
}

.track-fotos::-webkit-scrollbar {
    height: 8px;
}

.track-fotos::-webkit-scrollbar-track {
    background: var(--fundo-solido);
    border-radius: 4px;
}

.track-fotos::-webkit-scrollbar-thumb {
    background-color: var(--primaria);
    border-radius: 4px;
}

.foto-card {
    flex: 0 0 220px;
    height: 160px;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.foto-card:hover {
    transform: translateY(-5px);
    border-color: var(--primaria);
}

.foto-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.3s;
}

/* MODAL FOTO */
#modal-foto-antiga {
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#modal-foto-antiga.mostrar {
    opacity: 1;
    pointer-events: auto;
}

.modal-conteudo {
    max-width: 90%;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

#modal-foto-antiga.mostrar .modal-conteudo {
    transform: scale(1);
}

.fechar-modal {
    position: absolute;
    top: 20px;
    right: 40px;
    color: #fff;
    font-size: 45px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.fechar-modal:hover {
    color: var(--laranja);
}


/* --- CONTAINER DO BOTÃO FINAL (ANIMAÇÃO) --- */
.container-botao-final {
    display: flex;
    justify-content: center;
    padding: 40px 0;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
    pointer-events: none;
}

.container-botao-final.revelar {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.btn-saiba-mais {
    display: inline-block;
    background-color: var(--laranja);
    color: var(--texto);
    padding: 18px 45px;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
    font-size: 0.9rem;
}

.btn-saiba-mais:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(214, 123, 61, 0.4);
}

/* --- RESPONSIVIDADE (A MÁGICA DA ORDEM ESTÁ AQUI) --- */
@media (max-width: 900px) {
    .historia-grid {
        display: flex;
        flex-direction: column;
        gap: 30px;
    }

    .historia-section.reverse .historia-grid {
        direction: ltr;
    }

    .historia-texto {
        order: 1;
    }

    .historia-imagem {
        order: 2;
        position: static;
        max-height: 350px;
        width: 100%;
        margin: 0;
    }

    .historia-conteudo .container {
        padding: 0 20px;
    }

    .historia-texto h2 {
        font-size: 1.8rem;
    }

    .historia-texto p {
        text-align: left;
    }

    .historia-imagem img,
    .historia-imagens-duplas {
        max-height: 350px;
    }
}
