/* Sistema visual único da INJ --------------------------------------------------
   Carrega por último em todas as páginas. Sai do logotipo: o azul do globo, o dourado
   das páginas do livro aberto e a Montserrat maiúscula do anel. Mudou aqui, mudou no site. */

:root {
    --navy-950: #071433;
    --navy-900: #0c2151;
    --navy-700: #1c3f7c;
    --navy-500: #2f63b6;
    --navy-300: #5a86d6;
    --accent-gold: #f5b041;
    --gold-claro: #ffd27a;
    --neutral-900: #1f2333;
    --neutral-700: #3c435c;
    --neutral-200: #e5e8f2;
    --neutral-100: #f5f7fc;

    --noite: radial-gradient(90% 90% at 78% 12%, rgba(47, 99, 182, 0.42), transparent 68%), var(--navy-900);
    --linha-noite: rgba(255, 255, 255, 0.14);
    --texto-noite: rgba(255, 255, 255, 0.84);

    --titulo-1: clamp(1.85rem, 1rem + 4.4vw, 4.4rem);
    --titulo-2: clamp(1.8rem, 3.3vw, 2.75rem);
    --titulo-3: 1.2rem;

    --raio: 20px;
    --raio-menor: 12px;
    --sombra: 0 18px 44px rgba(12, 33, 81, 0.13);
    --sombra-alta: 0 28px 64px rgba(12, 33, 81, 0.22);
    --margem: clamp(20px, 5vw, 72px);
    --largura: 1240px;
    --ease-chegada: cubic-bezier(0.16, 1, 0.3, 1);

    /* As páginas do livro do logotipo, em linha */
    --livro: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 14' fill='none' stroke='%23f5b041' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M2 3C22 1 46 3 60 12 74 3 98 1 118 3'/%3E%3Cpath d='M14 8C28 6.5 48 8 60 12 72 8 92 6.500 106 8' opacity='.55'/%3E%3C/svg%3E");
}


/* 1. Superfícies do navegador ---------------------------------------------------- */
html {
    scrollbar-color: var(--navy-700) var(--neutral-100);
}

body {
    font-family: 'Montserrat', Arial, sans-serif;
    color: var(--neutral-900);
    background: var(--neutral-100);
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: var(--accent-gold);
    color: var(--navy-950);
}

:focus-visible {
    outline: 2px solid var(--accent-gold);
    outline-offset: 3px;
    border-radius: 4px;
}

.stat-value {
    font-variant-numeric: tabular-nums;
}


/* 2. Títulos: o mesmo em todas as páginas -----------------------------------------
   :not(#_) vence o CSS de cada página sem precisar de !important. */
main h1:not(.visually-hidden):not(#_),
main h2:not(.visually-hidden):not(#_) {
    font-family: inherit;
    font-weight: 800;
    font-style: normal;
    text-transform: uppercase;
    letter-spacing: 0.01em;
    line-height: 1.12;
    text-wrap: balance;
    overflow-wrap: break-word;
    background: none;
    -webkit-text-fill-color: currentColor;
    text-shadow: none;
}

/* Títulos em duas partes (O que / Fazemos): agora uma voz só */
main h2:not(.visually-hidden):not(#_) > span,
main h2:not(.visually-hidden):not(#_) > em {
    display: inline;
    font: inherit;
    color: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    opacity: 1;
}

/* A primeira parte desses títulos vive fora do h2: leva a mesma letra */
.script-title.script-title,
.perguntas__script.perguntas__script {
    display: block;
    margin: 0;
    font-family: inherit;
    font-size: var(--titulo-2);
    font-weight: 800;
    letter-spacing: 0.01em;
    line-height: 1.12;
    text-transform: uppercase;
}

.palavra__cabecalho .script-title {
    color: var(--navy-900);
}

.what-we-do .script-title,
.jornada__cabecalho .script-title,
.perguntas__script.perguntas__script {
    color: #fff;
}

.what-we-do h2:not(#_),
.palavra__cabecalho h2:not(#_),
.jornada__cabecalho h2:not(#_),
.perguntas__cabecalho h2:not(#_) {
    margin-top: 0;
}

main h1:not(.visually-hidden):not(#_) {
    font-size: var(--titulo-1);
    margin: 0;
}

main h2:not(.visually-hidden):not(#_) {
    font-size: var(--titulo-2);
}

main .card h2.title:not(#_) {
    font-size: 1.2rem;
    letter-spacing: 0;
}

main h3:not(#_) {
    font-family: inherit;
    font-weight: 700;
    letter-spacing: 0;
}

/* Sob cada título, as páginas do livro se abrem ao entrar na tela */
main h2.titulo-livro::after {
    content: '';
    display: block;
    width: 84px;
    height: 10px;
    margin: 0.55em 0 0;
    background: var(--livro) left center / 100% 100% no-repeat;
    clip-path: inset(0 50% 0 50%);
    transition: clip-path 0.9s var(--ease-chegada) 0.1s;
}

main h2.titulo-livro--centro::after {
    margin-inline: auto;
}

main h2.titulo-livro.aberto::after {
    clip-path: inset(0 0 0 0);
}

html:not(.sistema-js) main h2.titulo-livro::after {
    clip-path: none;
}


/* 3. Botão: um só, em todo o site ------------------------------------------------- */
.botao,
.btn-join,
.artigo-btn,
.hero-cta-button,
.voce-sabia__botao,
.jornada__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 12px 26px;
    border: 0;
    border-radius: 999px;
    background: var(--accent-gold);
    color: var(--navy-950);
    font: 700 0.95rem/1.2 'Montserrat', Arial, sans-serif;
    letter-spacing: 0;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(12, 33, 81, 0.2);
    transition: transform 0.2s var(--ease-chegada), box-shadow 0.2s, background-color 0.2s;
}

.botao:hover,
.btn-join:hover,
.artigo-btn:hover,
.hero-cta-button:hover,
.voce-sabia__botao:hover,
.jornada__link:hover {
    background: var(--gold-claro);
    color: var(--navy-950);
    transform: translateY(-2px);
    box-shadow: 0 16px 30px rgba(12, 33, 81, 0.26);
}

.botao--contorno {
    background: transparent;
    color: #fff;
    box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.5);
}

.botao--contorno:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    box-shadow: inset 0 0 0 1.5px #fff;
}


/* 4. Portada: a abertura de cada página interna ----------------------------------- */
.portada {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    align-items: center;
    min-height: clamp(340px, 52vh, 520px);
    padding: clamp(56px, 8vw, 104px) var(--margem) clamp(96px, 11vw, 140px);
    background: var(--noite);
    color: #fff;
}

.portada__conteudo {
    position: relative;
    z-index: 1;
    width: min(100%, var(--largura));
    margin-inline: auto;
}

.portada__texto {
    max-width: 44rem;
}

.portada__texto h1 {
    color: #fff;
}

.portada__texto p {
    margin: 1.2em 0 0;
    max-width: 38rem;
    color: var(--texto-noite);
    font-size: clamp(1rem, 1.4vw, 1.15rem);
    line-height: 1.7;
}

/* O globo do logotipo, em meridianos, girando devagar */
.globo {
    position: absolute;
    z-index: 0;
    top: 50%;
    right: clamp(-200px, -6vw, -40px);
    width: clamp(320px, 42vw, 620px);
    aspect-ratio: 1;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.26);
    pointer-events: none;
}

.globo svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.globo circle,
.globo ellipse,
.globo path {
    fill: none;
    stroke: currentColor;
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
}

.globo__contorno {
    color: rgba(255, 255, 255, 0.4);
}

.globo__meridiano {
    transform-box: fill-box;
    transform-origin: center;
    animation: globo-gira 28s linear infinite;
    animation-delay: calc(var(--i) * -3.5s);
}

@keyframes globo-gira {
    0% { transform: scaleX(0); opacity: 0.15; }
    25% { transform: scaleX(0.7071); opacity: 1; }
    50% { transform: scaleX(1); opacity: 0.55; }
    75% { transform: scaleX(0.7071); opacity: 1; }
    100% { transform: scaleX(0); opacity: 0.15; }
}

/* As páginas do livro fecham a portada de ponta a ponta e se desenham ao abrir */
.livro-aberto {
    position: absolute;
    z-index: 1;
    left: 0;
    right: 0;
    bottom: -2px;
    width: 100%;
    height: clamp(56px, 8vw, 110px);
    pointer-events: none;
}

.livro-aberto path {
    fill: none;
    stroke: var(--accent-gold);
    stroke-width: 1.6;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: livro-desenha 1.8s var(--ease-chegada) 0.15s forwards;
}

.livro-aberto path:nth-child(2) { opacity: 0.6; animation-delay: 0.3s; }
.livro-aberto path:nth-child(3) { opacity: 0.32; animation-delay: 0.45s; }

.livro-aberto .livro-aberto__fundo {
    fill: var(--neutral-100);
    stroke: none;
    stroke-dasharray: none;
    stroke-dashoffset: 0;
    animation: none;
}

@keyframes livro-desenha {
    to { stroke-dashoffset: 0; }
}


/* 5. Início ------------------------------------------------------------------------ */
.mission-vision-section,
#missao {
    background: var(--neutral-100);
}


/* 6. Quem somos: as páginas herdadas ---------------------------------------------- */

/* Em que acreditamos */
.seccion-azul {
    display: none;
}

.contenedor-foto {
    position: relative;
    max-width: none;
    z-index: 2;
    width: min(calc(100% - 2 * var(--margem)), var(--largura));
    margin: clamp(-96px, -7vw, -48px) auto 0;
    padding: 0;
    border-radius: var(--raio);
    overflow: hidden;
    background: var(--navy-900);
    box-shadow: var(--sombra-alta);
}

.contenedor-foto img {
    display: block;
    width: 100%;
    border-radius: 0;
}

.texto-superior {
    margin: 0;
    padding: 16px 24px;
    color: #fff;
    font-weight: 600;
    text-align: center;
}

.contenido {
    max-width: var(--largura);
    margin-inline: auto;
    padding-inline: var(--margem);
}

/* Diretoria */
.section-title {
    background: none;
    box-shadow: none;
}

/* O script antigo pinta uma foto atrás destes títulos: aqui o título é igual aos outros */
.section-title.missionaries-title,
.directoria-title,
.board-title {
    min-height: 0 !important;
    padding: 0 !important;
    background: none !important;
    box-shadow: none !important;
}

.section-title .title-overlay {
    display: none;
}

.missionaries-title .title-overlay {
    display: none;
}

.missionaries-title h2 {
    color: var(--navy-900);
}

.missionary-card,
.carousel-card-inner,
.card,
.artigo-box {
    border-radius: var(--raio);
    box-shadow: var(--sombra);
}

/* O título da Diretoria agora mora dentro da seção azul */
.missionaries-section:not(#_) {
    padding-bottom: clamp(48px, 7vw, 88px);
}

.directoria-section:not(#_) {
    padding-top: clamp(48px, 7vw, 88px);
}

main h2.directoria-titulo:not(#_) {
    margin: 0 0 clamp(28px, 4vw, 48px);
    color: #fff;
    text-align: center;
}

/* Departamentos */
.dark-section {
    background: var(--noite);
}

/* Discipulado: dois cartões iguais aos dos outros departamentos */
.discipulado-container:not(#_) {
    padding: 0;
    background: none;
    border-radius: 0;
    box-shadow: none;
}

.discipulado-item:not(#_) {
    padding: clamp(22px, 3vw, 40px);
    border-radius: var(--raio);
    background: #fff;
    box-shadow: var(--sombra);
}

main .discipulado-item h3:not(#_) {
    margin: 0;
    color: var(--navy-900);
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1.3;
    text-transform: uppercase;
}

.discipulado-item p {
    margin: 0;
    line-height: 1.75;
}

@media (max-width: 620px) {
    .discipulado-container:not(#_) {
        grid-template-columns: minmax(0, 1fr);
        gap: 20px;
    }
}

/* História */
.celebration-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: clamp(340px, 52vh, 520px);
    background: var(--noite);
    color: #fff;
}

.celebration-hero::before {
    display: none;
}

.celebration-hero-content {
    position: relative;
    z-index: 1;
    width: min(100%, var(--largura));
    margin-inline: auto;
    padding: clamp(56px, 8vw, 104px) var(--margem) clamp(96px, 11vw, 140px);
    text-align: left;
    background: none;
    box-shadow: none;
    backdrop-filter: none;
}

.celebration-hero-content h1 {
    color: #fff;
    max-width: 44rem;
}

.celebration-subtitle {
    margin: 1.2em 0 0;
    text-align: left;
    max-width: 38rem;
    color: var(--texto-noite);
    font-size: clamp(1rem, 1.4vw, 1.15rem);
    line-height: 1.7;
}

.celebration-hero .selo-da-portada {
    position: absolute;
    z-index: 1;
    top: 50%;
    right: clamp(20px, 9vw, 150px);
    width: clamp(170px, 24vw, 340px);
    transform: translateY(-58%);
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.45));
}


/* Carrosséis: as tarjetas se movem sem que a página role para o lado */
.carousel-wrapper {
    overflow: clip;
    overflow-clip-margin: 24px;
    user-select: none;
    -webkit-user-select: none;
    cursor: grab;
}

.carousel-wrapper:active {
    cursor: grabbing;
}

.carousel-card img {
    -webkit-user-drag: none;
}

.carousel-card:not(.center) {
    cursor: pointer;
}

.hero-carousel-track {
    transition: translate 0.25s var(--ease-chegada);
}


/* 7. Movimento e telas pequenas --------------------------------------------------- */
@media (max-width: 760px) {
    .globo {
        right: -36%;
        width: 92vw;
        color: rgba(255, 255, 255, 0.16);
    }

    .celebration-hero .selo-da-portada {
        position: static;
        display: block;
        width: 150px;
        margin: 0 var(--margem) 90px;
        transform: none;
    }

    .celebration-hero-content {
        padding-bottom: 28px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .globo__meridiano {
        animation: none;
        transform: scaleX(calc(var(--i) * 0.14));
        opacity: 0.8;
    }

    .livro-aberto path {
        animation: none;
        stroke-dashoffset: 0;
    }

    main h2.titulo-livro::after {
        clip-path: none;
        transition: none;
    }
}
