/* Estilo automático para a página: home */

#banner {
    --banner-waves-altura: 120px;
    position: relative;

    @media (max-width: 768px) {
        --banner-waves-altura: 60px;
    }

    .banner-desktop {
        width: 100%;
        height: auto;
        aspect-ratio: var(--banner-proporcao, 1600 / 520); /* definida no page-home.php pela 1ª imagem do ACF */

        /* Mobile: proporção da imagem mobile do banner */
        @media (max-width: 767px) {
            aspect-ratio: var(--banner-proporcao-mobile, var(--banner-proporcao));
        }
        max-height: 760px;
        object-fit: cover;
        object-position: center;

        /* Mobile e tablet: no mínimo 400px de altura (a imagem é recortada pelas laterais, sem distorcer).
           A partir de ~1230px a altura natural do banner já passa de 400px, então o limite fica no breakpoint xl (1280px) */
        @media (max-width: 1279px) {
            min-height: 400px;
        }
    }

    .swiper-pagination {
        bottom: calc(var(--banner-waves-altura) + 8px);
    }

    .swiper-pagination-bullet {
        width: 16px;
        height: 16px;
        margin: 0 5px;
        background: transparent;
        border: 2px solid #fff;
        opacity: 1;
        transition: background-color 0.3s, border-color 0.3s;
    }

    .swiper-pagination-bullet-active {
        background: var(--Primrias-Vermelho);
        border-color: var(--Primrias-Vermelho);
    }

    /* Waves animadas sobre a base da imagem */
    .banner-waves {
        position: absolute;
        left: 0;
        right: 0;
        bottom: -1px; /* evita fresta de 1px entre a wave branca e o conteúdo abaixo */
        z-index: 2;
        height: var(--banner-waves-altura);
        pointer-events: none;

        svg {
            display: block;
            width: 100%;
            height: 100%;
        }

        use {
            animation: banner-waves-mover 25s cubic-bezier(0.55, 0.5, 0.45, 0.5) infinite;
        }

        .banner-waves__primaria {
            fill: var(--Primrias-Azul);
            animation-duration: 13s;
            animation-delay: -2s;
        }

        /* #351C77 a 20% sobre branco, em cor sólida para não deixar a imagem transparecer */
        .banner-waves__clara {
            fill: #D7D2E4;
            animation-duration: 10s;
            animation-delay: -3s;
        }

        .banner-waves__branca {
            fill: #fff;
            animation-duration: 20s;
            animation-delay: -4s;
        }

        @media (prefers-reduced-motion: reduce) {
            use {
                animation: none;
            }
        }
    }
}

/* @keyframes banner-waves-mover fica no assets/css/style.css (global), pois as ondas também são usadas fora da home */


#atalho{
    padding: 40px 0 60px;

    /* Carrossel (mobile/tablet): respiro para a sombra do hover e cards da mesma altura */
    .swiperAtalhos{
        padding: 4px 2px 12px;
    }

    .swiperAtalhos .swiper-slide{
        height: auto;
    }

    /* Barra de progresso do carrossel */
    .scrollbar-atalhos{
        position: relative;
        left: auto;
        bottom: auto;
        width: 100%;
        height: 4px;
        margin-top: 20px;
        border-radius: 4px;
        background: linear-gradient(#E5E5E5, #E5E5E5) center / 100% 1px no-repeat;

        .swiper-scrollbar-drag{
            border-radius: 4px;
            background: var(--Primrias-Azul);
        }
    }

    /* Desktop: carrossel desligado pelo Swiper; os slides viram uma grade de 4 colunas */
    @media (min-width: 1280px){
        .swiperAtalhos .swiper-wrapper{
            display: grid;
            grid-template-columns: repeat(4, minmax(0, 1fr));
            gap: 20px;
            transform: none !important;
        }

        .swiperAtalhos .swiper-slide{
            width: auto !important;
            margin: 0 !important;
        }

        .scrollbar-atalhos{
            display: none;
        }
    }

    /* Card em formato de pílula: roxo por padrão, vermelho no hover (transição suave) */
    .card-atalhos{
        position: relative;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 12px;
        min-height: 120px;
        height: 100%;
        padding: 24px 28px;
        border-radius: 9999px;
        overflow: hidden;
        isolation: isolate;
        background-color: var(--Primrias-Azul);
        transition: background-color 0.4s ease, transform 0.4s ease, box-shadow 0.4s ease;

        /* Brilho claro em curva no lado esquerdo do card */
        &::before{
            content: "";
            position: absolute;
            z-index: -1;
            left: -15%;
            bottom: -95%;
            width: 75%;
            aspect-ratio: 1;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.1);
            pointer-events: none;
        }

        &:hover,
        &:focus-visible{
            background-color: var(--Primrias-Vermelho);
            box-shadow: 0 10px 24px -8px rgba(238, 37, 7, 0.5);
        }

        .icone-card-atalho{
            position: absolute;
            top: 12px;
            right: 26px;
            width: 24px;
            height: 24px;
            color: rgba(255, 255, 255, 0.15);
        }

        .titulo-card-atalho{
            color: var(--color-gray-10, #FFF);
            text-align: center;
            font-family: "Fredoka", sans-serif;
            font-size: 20px;
            font-weight: 600;
            line-height: 1.2;
        }
        .text-card-atalho{
            color: var(--color-gray-10, #FFF);
            text-align: center;
            font-size: 12px;
            font-weight: 400;
            line-height: 1.6;
        }
    }
}

#sobre{
    padding: 60px 0 80px;

    /*
        Mobile: título → vídeo → texto.
        A coluna de texto "se desfaz" (display: contents) para o título e os parágrafos virarem
        itens da linha flex e poderem ser reordenados em volta do vídeo.
    */
    @media (max-width: 767px){
        .sobre-linha{
            row-gap: 0;
        }

        .sobre-texto{
            display: contents;

            > *{
                order: 3;
                width: 100%;
                padding-inline: 16px; /* mesmo respiro do px-4 da coluna */
            }

            > h2{
                order: 1;
            }
        }

        .sobre-midia{
            order: 2;
            margin-bottom: 32px;
        }
    }

    .text-sobre{
        color: var(--Neutros-Cinza);
        font-size: 16px;
        color: var(--Neutros-Cinza, #646464);
        font-family: "Fredoka", sans-serif;
        font-weight: 400;
        line-height: 24px; /* 150% */

        & + .text-sobre{
            margin-top: 24px;
        }
    }

    /* Vídeo: moldura ondulada em azul claro com a capa recortada no mesmo formato */
    .video-sobre{
        position: relative;
        padding: 0 16px;
    }

    .video-sobre__moldura{
        position: relative;
        display: block;
        padding: 14px;
        aspect-ratio: 16 / 9;
        background: rgba(53, 28, 119, 0.1);
        clip-path: url(#sobre-blob);

        &:hover .video-sobre__play,
        &:focus-visible .video-sobre__play{
            background-color: var(--Primrias-Vermelho);
            color: #fff;
        }
    }

    .video-sobre__capa{
        width: 100%;
        height: 122%;
        object-fit: cover;
        clip-path: url(#sobre-blob);
    }

    /* Play: círculo branco com ícone roxo; no hover fundo vermelho e ícone branco */
    .video-sobre__play{
        position: absolute;
        top: 50%;
        left: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 46px;
        height: 46px;
        border-radius: 50%;
        background-color: #fff;
        color: var(--Primrias-Azul);
        transform: translate(-50%, -50%);
        transition: background-color 0.3s ease, color 0.3s ease;

        svg{
            width: 24px;
            height: 24px;
            margin-left: 3px; /* compensação óptica do triângulo */
        }
    }

    .video-sobre__simbolo{
        position: absolute;
        pointer-events: none;
    }

    .video-sobre__simbolo--esquerda{
        top: 50%;
        left: 0;
        width: 49px;
        transform: translate(-30%, -20%);
    }

    .video-sobre__simbolo--direita{
        right: 4px;
        bottom: -14px;
        width: 35px;
    }

    @media (max-width: 768px){
        padding: 40px 0 60px;

        .titulo-sobre{
            font-size: 28px;
        }

        .text-sobre{
            font-size: 15px;
        }

        .video-sobre__simbolo--esquerda{
            width: 36px;
        }

        .video-sobre__simbolo--direita{
            width: 26px;
        }
    }
}

#segmentos{
    padding: 80px 0;

    h3{
        margin-bottom: 12px;
        color: var(--Primrias-Vermelho);
        font-family: "Fredoka", sans-serif;
        font-size: 22px;
        font-weight: 600;
        text-align: center;
    }

    h2{
        margin-bottom: 32px;
        color: var(--Primrias-Azul);
        font-family: "Fredoka", sans-serif;
        font-size: 32px;
        font-weight: 600;
        line-height: 1.15;
        text-align: center;
        text-transform: uppercase;
    }

    /* Respiro para a moldura azul clara que fica atrás de cada card não ser cortada */
    .swiperSegmentos{
        padding: 14px 10px;
    }

    .swiper-slide{
        position: relative;
        height: auto;

        /* Moldura azul clara levemente girada atrás do card */
        &::before{
            content: "";
            position: absolute;
            inset: -8px -6px -6px -10px;
            background: rgba(53, 28, 119, 0.1);
            clip-path: url(#segmento-blob);
            transform: rotate(-2.5deg);
        }
    }

    /* Card: a foto do aluno é o background (definida inline via --card-segmento-bg) */
    .card-segmentos{
        position: relative;
        display: flex;
        align-items: flex-end;
        justify-content: center;
        aspect-ratio: 7 / 8;
        clip-path: url(#segmento-blob);
        isolation: isolate;
        transform: translateZ(0); /* card em camada própria: o clip-path recorta foto + degradê juntos */

        /* Foto em camada própria para poder dar zoom no hover (o clip-path do card corta as bordas) */
        &::before{
            content: "";
            position: absolute;
            inset: 0;
            z-index: -2;
            background: var(--card-segmento-bg) center / cover no-repeat;
            transition: transform 0.6s ease;
            /* Camada fixa: sem ela o Chrome cria/desfaz a camada a cada hover e, no "tira e põe" rápido,
               pinta um quadro sem o clip-path (a foto e o degradê piscam retos, fora do formato do card) */
            will-change: transform;
        }

        /* Degradê escuro por cima da foto, para o texto branco ficar legível */
        &::after{
            content: "";
            position: absolute;
            inset: 0;
            z-index: -1;
            background: linear-gradient(to top, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0) 45%);
        }

        &:hover::before,
        &:focus-visible::before{
            transform: scale(1.08);
        }
    }

    @media (prefers-reduced-motion: reduce){
        .card-segmentos::before{
            transition: none;
        }
    }

    .conteudo-card-segmento{
        padding: 0 16px 28px;
        text-align: center;
    }

    .titulo-card-segmento{
        color: #fff;
        font-family: "Fredoka", sans-serif;
        font-size: 20px;
        font-weight: 600;
        line-height: 1.2;
    }

    /* Texto oculto (abaixo) por padrão; no hover sobe e aparece, empurrando o título junto */
    .texto-card-segmento{
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        max-height: 0;
        overflow: hidden;
        color: #fff;
        font-size: 13px;
        opacity: 0;
        transform: translateY(16px);
        transition: max-height 0.4s ease, margin-top 0.4s ease, opacity 0.4s ease, transform 0.4s ease;

        img{
            width: 15px;
            height: 15px;
        }
    }

    .card-segmentos:hover .texto-card-segmento,
    .card-segmentos:focus-visible .texto-card-segmento{
        max-height: 30px;
        margin-top: 10px;
        opacity: 1;
        transform: translateY(0);
    }

    /* Telas touch não têm hover: o texto fica sempre visível */
    @media (hover: none){
        .texto-card-segmento{
            max-height: 30px;
            margin-top: 10px;
            opacity: 1;
            transform: none;
        }
    }

    /* Barra de rolagem + "Ver todos" */
    .rodape-segmentos{
        display: flex;
        align-items: center;
        gap: 24px;
        margin-top: 36px;
    }

    .scrollbar-segmentos{
        position: relative;
        left: auto;
        bottom: auto;
        flex: 1;
        width: auto;
        height: 4px;
        border-radius: 4px;
        background: linear-gradient(#E5E5E5, #E5E5E5) center / 100% 1px no-repeat;

        .swiper-scrollbar-drag{
            border-radius: 4px;
            background: var(--Primrias-Azul);
        }
    }



    @media (max-width: 768px){
        padding: 60px 0;

        h3{
            font-size: 18px;
        }

        h2{
            font-size: 24px;
        }
    }
}

/* Cabeçalho compartilhado: subtítulo vermelho + título + linha fina + link (sections "blog" e "instagram") */
:is(#blog, #instagram){
    /* Sobrescreve o h3 global (centralizado) — aqui fica alinhado à esquerda */
    h3{
        margin: 0 0 16px;
        text-align: left;
        color: var(--Primrias-Vermelho);
    }

    /* Título + linha fina + link na mesma linha */
    .cabecalho-blog{
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 16px 28px;
        margin-bottom: 40px;

        h2{
            margin: 0;
            color: var(--Primrias-Azul);
            font-family: "Fredoka", sans-serif;
            font-size: 32px;
            font-weight: 600;
            line-height: 1.15;
            text-transform: uppercase;
        }
    }

    .linha-blog{
        flex: 1;
        min-width: 40px;
        height: 1px;
        background: #E5E5E5;
    }

    @media (max-width: 768px){
        h3{
            font-size: 18px;
        }

        .cabecalho-blog h2{
            font-size: 24px;
            width: 100%;
        }
    }
}

/* O card das notícias (.card-blog) fica no assets/css/style.css, pois também é usado na página do Blog */
#blog{
    padding: 80px 0;

    @media (max-width: 768px){
        padding: 60px 0;
    }
}

#instagram {
    padding: 80px 0;

    .link-insta {
        display: block;
    }

    .img-insta {
        width: 100%;
        height: 400px;
        object-fit: cover;
        border-radius: 16px;
    }

    @media (max-width: 768px) {
        padding: 60px 0;
    }
}

