/* =========================
   ESTILOS BÁSICOS
========================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Fredoka', sans-serif;
    color: #334155;
}

h1, h2, h3, h4, .navbar-brand {
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
    color: var(--verde-institucional);
}

/* =========================
   CONTENEDOR GENERAL
========================= */
.contenedor {
    max-width: 1100px;
    margin: 0 auto 40px auto;
    padding: 0 20px;
    text-align: center;
}

/* =========================
    CARRUSEL 
========================= */
#carouselAnnieSoper {
    position: relative;
    z-index: 2;
    cursor: grab;
    overflow: hidden;
    user-select: none;
    margin-top: 0;
}

#carouselAnnieSoper:active { 
    cursor: grabbing; 
}

/* IMAGENES */
#carouselAnnieSoper .carousel-item img {
    width: 100%;
    height: 450px;
    object-fit: cover;
    object-position: center;
    user-select: none;
    -webkit-user-drag: none;
}

/* OVERLAY EN VEZ DE FILTER */
#carouselAnnieSoper .carousel-item {
    position: relative;
}

#carouselAnnieSoper .carousel-item.con-capa::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.4); /* Solo aparece si tiene la clase */
    z-index: 1;
}

#carouselAnnieSoper .carousel-item::before {
    content: none; 
}

/* TEXTO ENCIMA */
.carousel-caption {
    z-index: 2;
}

@media (min-width: 992px) {
    #carouselAnnieSoper .carousel-item img { 
        height: 600px;
    }
}

/* =========================
   TEXTOS DEL CARRUSEL
========================= */
.carousel-caption {
    bottom: 15%;
    left: 5%; 
    right: 5%;
    text-align: left;
}

.carousel-caption h2 { 
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 10px;
}

@media (min-width: 768px) {
    .carousel-caption { 
        bottom: 20%; 
        left: 10%; 
    }
    .carousel-caption h2 { 
        font-size: 3.5rem; 
    }
}

/* =========================
   ANIMACIONES
========================= */
.carousel-item { 
    transition: transform 0.8s ease;
}
    
.titulo-animado, 
.texto-animado, 
.boton-animado { 
    opacity: 0; 
}

.carousel-item.active .titulo-animado { 
    animation: bounceInDown 0.8s ease 0.2s forwards; 
}

.carousel-item.active .texto-animado { 
    animation: bounceInDown 0.8s ease 0.4s forwards; 
}

.carousel-item.active .boton-animado { 
    animation: bounceInDown 0.8s ease 0.6s forwards; 
}

@keyframes bounceInDown {
    0% { 
        opacity: 0; 
        transform: translate3d(0, -50px, 0); 
    }
    100% { 
        opacity: 1; 
        transform: translate3d(0, 0, 0); 
    }
}

/* =========================================
   TARJETAS INTERACTIVAS Y BIENVENIDA
========================================= */

/* 1. Contenedor Base de Bienvenida */
.bento-card-welcome {
    position: relative;
    overflow: visible !important; /* Para que Jesús y la Paloma sobresalgan */
    padding: 60px 50px; 
    background-color: #ffffff;
    background-image: linear-gradient(#f1f5f9 1.5px, transparent 1.5px), 
                      linear-gradient(90deg, #f1f5f9 1.5px, transparent 1.5px);
    background-size: 30px 30px;
    background-position: center;
    border-radius: 24px;
    border: 3px solid #004341; /* Borde institucional siempre visible */
    z-index: 1;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* 2. Texto de la Descripción */
.bento-card-welcome p {
    color: #475569;
    font-size: 1.15rem;
    line-height: 1.8;
    max-width: 850px;
    margin: 0 auto;
    text-align: justify;
    text-justify: inter-word;
    hyphens: auto;
}

/* 3. EFECTO HOVER */
.bento-card-welcome:hover {
    transform: translateY(-12px) !important;
    border: 3px solid #004341 !important; 
    box-shadow: 
        0 20px 40px rgba(0, 67, 65, 0.25), 
        0 0 30px rgba(0, 168, 150, 0.6),    /* Glow verde esmeralda fuerte */
        0 0 15px rgba(176, 141, 87, 0.4) !important;   /* Glow dorado sutil */
}

/* =========================================
   IMPLEMENTACIÓN DE IMÁGENES (JESÚS Y PALOMA)
========================================= */

.img-spiritual {
    position: absolute;
    pointer-events: none;
    z-index: 10;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.1));
}

.img-paloma {
    top: -60px;
    left: -30px;
    height: 180px;
    width: auto;
}

.img-jesus {
    top: -90px;
    right: -20px;
    height: 180px;
    width: auto;
}

/* Movimiento de imágenes al hacer hover en la tarjeta */
.bento-card-welcome:hover .img-paloma {
    transform: translate(-5px, -10px) rotate(-10deg) scale(1.05);
}

.bento-card-welcome:hover .img-jesus {
    transform: translate(5px, -5px) rotate(5deg) scale(1.03);
}

/* =========================
   SECCIÓN IDENTIDAD (GLAZE & 4 COLORS)
========================= */
.identidad-moderna {
    background-color: #ffffff;
    padding: 60px 0;
}

.cards-identidad-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: center;
}

.bento-card {
    flex: 1 1 calc(50% - 30px);
    min-width: 300px;
    max-width: 535px;
    background: #ffffff;
    border-radius: 24px;
    padding: 35px;
    border: 1.5px solid #f1f5f9; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.bento-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.bento-header h4 {
    margin: 0;
    font-weight: 700;
    color: #1e293b;
}

.card-icon {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    transition: all 0.4s ease;
}

.card-icon i {
    font-size: 1.1rem !important;
    color: white !important;
}

/* --- COLORES DINÁMICOS (CICLO DE 4 COLORES) --- */
.bento-card:nth-child(4n+1) .card-icon { background-color: #004341 !important; } /* Verde */
.bento-card:nth-child(4n+2) .card-icon { background-color: #B08D57 !important; } /* Dorado */
.bento-card:nth-child(4n+3) .card-icon { background-color: #003366 !important; } /* Azul Naval */
.bento-card:nth-child(4n+4) .card-icon { background-color: #8B4513 !important; } /* Terracota */

/* --- MICRO INTERACCIONES (HOVER PERSONALIZADO) --- */
.bento-card:hover {
    transform: translateY(-8px);
}

/* Hover específico por color para efecto Glaseado y Borde */
.bento-card:nth-child(4n+1):hover { 
    background-color: rgba(0, 67, 65, 0.05); 
    border-color: #004341; 
    box-shadow: 0 15px 40px rgba(0, 67, 65, 0.12);
}
.bento-card:nth-child(4n+2):hover { 
    background-color: rgba(176, 141, 87, 0.05); 
    border-color: #B08D57; 
    box-shadow: 0 15px 40px rgba(176, 141, 87, 0.12);
}
.bento-card:nth-child(4n+3):hover { 
    background-color: rgba(0, 51, 102, 0.05); 
    border-color: #003366; 
    box-shadow: 0 15px 40px rgba(0, 51, 102, 0.12);
}
.bento-card:nth-child(4n+4):hover { 
    background-color: rgba(139, 69, 19, 0.05); 
    border-color: #8B4513; 
    box-shadow: 0 15px 40px rgba(139, 69, 19, 0.12);
}

.bento-card:hover .card-icon {
    transform: scale(1.15) rotate(-5deg);
}

/* --- VIDEO DEBAJO --- */
.video-identidad-wrapper {
    max-width: 1100px; 
    margin: 50px auto 0 auto;
    width: 100%;
    position: relative;
    z-index: 10;
}

.video-container {
    position: relative;
    padding-top: 56.25%; /* Relación 16:9 */
    border-radius: 30px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    border: 1.5px solid rgba(0, 67, 65, 0.12);
    transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.video-container iframe, 
.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* --- MICRO INTERACCIÓN (HOVER VIDEO) --- */
.video-identidad-wrapper:hover .video-container {
    transform: translateY(-15px);
    box-shadow: 0 25px 50px rgba(0, 67, 65, 0.15);
    border-color: rgba(0, 67, 65, 0.45);
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .bento-card {
        flex: 1 1 100%;
        max-width: none;
    }
}

/* ========================
   SECCIÓN VALORES
=========================== */
.valores-seccion {
    padding: 4rem 0;
    background-color: #ffffff;
}

.grid-valores {
    display: flex;         
    flex-wrap: wrap;       
    gap: 30px;
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
}

.valor-card {
    flex: 1 1 320px;       /* Crece, se encoge y tiene base de 320px */
    max-width: 380px;      /* Para que no se estiren demasiado en pantallas raras */
    background: #f8fafc;
    padding: 45px 30px;
    border-radius: 35px;
    border: 1px solid #e2e8f0;
    transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    overflow: hidden;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1;
}

.valor-icon {
    width: 75px;
    height: 75px;
    background: #ffffff; /* Icono sobre fondo blanco resalta sobre el card gris */
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px;
    font-size: 2rem;
    color: #004341;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: all 0.6s ease;
}

.valor-card h3 {
    color: #1e293b;
    font-weight: 700;
    margin-bottom: 15px;
}

.valor-card p {
    color: #64748b;
    line-height: 1.6;
}

.valor-footer {
    margin-top: auto; /* Empuja la cita siempre al final */
    padding-top: 20px;
    font-size: 0.9rem;
    font-weight: 700;
    color: #B08D57;
    font-style: italic;
}

/* --- MICRO INTERACCIÓN (HOVER VERDE) --- */
.valor-card:hover {
    transform: translateY(-15px);
    background-color: #004341 !important;
    box-shadow: 0 30px 60px rgba(0, 67, 65, 0.35);
    border-color: #004341;
}

.valor-card:hover h3, 
.valor-card:hover p,
.valor-card:hover .valor-footer {
    color: #ffffff !important;
    animation: efectoNeon 0.4s ease-in-out forwards; 
}

.valor-card:hover .valor-icon {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff !important;
    transform: rotateY(360deg);
}

/* Animación de "destello o neón" */
@keyframes efectoNeon {
    0% {
        text-shadow: 2px 0 0 #ff00ea, -2px 0 0 #00ffff;
        transform: translateX(2px);
    }
    25% {
        text-shadow: -2px 0 0 #ff00ea, 2px 0 0 #00ffff;
        transform: translateX(-2px);
    }
    50% {
        text-shadow: 2px 0 0 #ff00ea, -2px 0 0 #00ffff;
    }
    100% {
        text-shadow: 0 0 10px rgba(255,255,255,0.5);
        transform: translateX(0);
    }
}

/* --- RESPONSIVE TABLET / MÓVIL --- */
@media (max-width: 1024px) {
    .grid-valores {
        padding: 0 20px;
        gap: 20px;
    }

    .valor-card {
        /* En tablets, forzamos un ancho que permita 2 por fila si es necesario, 
           pero el "flex-grow: 1" las centrará si queda una sola */
        flex: 1 1 calc(45% - 20px); 
        min-width: 300px;
    }
}

@media (max-width: 768px) {
    .grid-valores {
        gap: 15px;
    }

    .valor-card {
        flex: 1 1 100%;
        max-width: none;
        padding: 30px 20px;
    }

    .valor-icon {
        width: 60px;
        height: 60px;
        font-size: 1.6rem;
    }
}

/* =========================================
   TARJETAS DE NIVELES (PRIMARIA, SECUNDARIA, ETC)
========================================= */
.niveles {
    display: flex;
    gap: 20px;
    margin-top: 50px;
}

.tarjeta-interactiva {
    background-color: white;
    padding: 0px;
    flex: 1;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.contenido-tarjeta {
    padding: 20px;
}

.imagen-tarjeta {
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.imagen-tarjeta img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tarjeta-interactiva {
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: 1px solid transparent !important;
}

.tarjeta-interactiva:hover {
    transform: translateY(-10px); 
    box-shadow: 0 20px 40px rgba(0, 67, 65, 0.12) !important; 
    border: 1px solid rgba(0, 67, 65, 0.2) !important;
}

.tarjeta-interactiva:hover .img-fluida-nivel {
    transform: scale(1.1);
    filter: brightness(1.05);
}

/* BOTÓN VER MÁS */
.btn-ver-mas {
    display: inline-flex;
    align-items: center;
    padding: 10px 25px;
    background-color: #f1f5f9;
    color: #475569;
    text-decoration: none;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.tarjeta-interactiva:hover .btn-ver-mas {
    background-color: #004341;
    color: white;
    box-shadow: 0 5px 15px rgba(0, 67, 65, 0.3);
    transform: translateY(-2px);
}

/* Responsivo */
@media (max-width: 768px) {
    .img-spiritual { height: 120px; }
    .img-jesus { top: -60px; right: 0; }
    .img-paloma { top: -40px; left: 0; }
}

/* =========================================
   ESTILOS DE SECCIÓN (FONDOS Y ESPACIADO)
========================================= */

/* SECCIONES PARES (Identidad y Niveles) - Verde Tenue */
.identidad-moderna,
.seccion-niveles {
    background-color: #F0F4F2 !important;
    padding: 120px 0 100px 0; /* Más espacio arriba para que el título suba */
    border-top: 1px solid rgba(0, 67, 65, 0.05);
    border-bottom: 1px solid rgba(0, 67, 65, 0.05);
}

/* SECCIONES IMPARES (Bienvenida y Valores) - Crema Cálido */
.bienvenida-seccion,
.valores-seccion {
    background-color: #FFFDF9 !important;
    padding: 120px 0 100px 0;
    position: relative;
}

/* Ajuste específico para Bienvenida (para que no quede tan lejos del carrusel) */
.bienvenida-seccion {
    padding-top: 80px; 
}

/* LA LÍNEA DORADA ENTRE SECCIONES */
.bienvenida-seccion::after,
.valores-seccion::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px; 
    height: 4px;
    background: #B08D57;
    border-radius: 10px;
    opacity: 0.6;
}

/* =========================================
   TÍTULOS Y SEPARACIÓN DE CARDS
========================================= */

/* Mandamos los títulos más arriba y los separamos de las cards */
.identidad-moderna h2,
.seccion-niveles h2,
.valores-seccion h2 {
    margin-top: 0;
    margin-bottom: 4.5rem !important; /* Espacio generoso hacia las cards */
    font-weight: 700;
}

/* Estilo de las cards de Valores en fondo blanco */
.valor-card {
    background: #ffffff !important;
    border: 1px solid #efeae2 !important;
    box-shadow: 0 15px 35px rgba(0,0,0,0.03) !important;
}

/* =========================================
   ADAPTACIÓN PARA MÓVILES (RESPONSIVE)
========================================= */

@media (max-width: 768px) {
    /* Reducimos los paddings para que no haya que hacer scroll infinito */
    .identidad-moderna,
    .seccion-niveles,
    .valores-seccion,
    .bienvenida-seccion {
        padding-top: 70px !important;
        padding-bottom: 70px !important;
    }

    /* Reducimos el margen entre título y cards en móvil */
    .identidad-moderna h2,
    .seccion-niveles h2,
    .valores-seccion h2 {
        margin-bottom: 2.5rem !important;
        font-size: 2rem; /* Títulos un poco más pequeños para que no rompan */
    }

    /* Ajustamos la línea dorada para que no sea muy gruesa en pantallas chicas */
    .bienvenida-seccion::after,
    .valores-seccion::after {
        width: 60px;
        height: 3px;
    }
}