/* --- VARIABLES Y BASES --- */
:root {
    --azul-oscuro: #002d5a;
    --azul-logo: #1b3651;
    --azul-claro: #a8d1e7;
    --naranja-acento: #ff6b35; /* Basado en tu imagen del carrusel */
    --fondo-gris: #f4f7f9;
}

body { 
    font-family: 'Montserrat', 'Segoe UI', sans-serif; 
    margin: 0; 
    background-color: var(--fondo-gris); 
    color: #333; 
    overflow-x: hidden; /* Evita scroll horizontal por el menú oculto */
}

/* --- HEADER Y NAVEGACIÓN --- */
header {
    background-color: var(--azul-oscuro);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 10px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 15px;
}

.logo-link h1 {
    color: white;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.8rem;
    margin: 0;
}

.main-logo {
    height: 65px;
    width: 65px;
    background-color: white;
    border-radius: 50%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

/* --- BOTÓN HAMBURGUESA (CORREGIDO) --- */
.menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Cambiado para un espaciado más exacto */
    width: 30px;
    height: 20px; /* Reducido ligeramente para que la X sea más compacta */
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 2100;
    padding: 0;
}

.menu-toggle span {
    width: 100%;
    height: 3px;
    background: white;
    border-radius: 10px;
    transition: all 0.3s ease;
}

/* Transformación a X PERFECTA */
.menu-toggle.open span:nth-child(1) { 
    transform: rotate(45deg) translate(6px, 6px); 
}

.menu-toggle.open span:nth-child(2) { 
    opacity: 0; 
    transform: translateX(-10px); 
}

.menu-toggle.open span:nth-child(3) { 
    transform: rotate(-45deg) translate(6px, -6px); 
}
/* Transformación a X */
.menu-toggle.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: rotate(-45deg) translate(6px, -6px); }

/* --- MENÚ LATERAL (DERECHA) --- */
.nav-menu {
    position: fixed;
    top: 0;
    right: -100%; /* Escondido */
    width: 280px;
    height: 100vh;
    background: var(--azul-oscuro);
    padding-top: 80px;
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -5px 0 15px rgba(0,0,0,0.3);
    z-index: 2000;
}

.nav-menu.active {
    right: 0; /* Entra a escena */
}

.nav-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column; /* Lista vertical */
}

.nav-menu a {
    color: white;
    text-decoration: none;
    padding: 20px 30px;
    display: block;
    font-size: 1.1rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: 0.3s;
}

.nav-menu a:hover {
    background: rgba(255,255,255,0.1);
    padding-left: 40px;
    color: var(--azul-claro);
}

/* --- CARRUSEL --- */
.carousel-container {
    position: relative;
    max-width: 600px; 
    margin: 40px auto;
    overflow: hidden; 
    border-radius: 15px;
    border: 4px solid white; 
    box-shadow: 0px 10px 25px rgba(0,0,0,0.15);
}

.slides {
    display: flex; 
    transition: transform 0.5s ease-in-out; 
}

.slides img {
    width: 100%;
    min-width: 100%;
    height: 350px;
    object-fit: contain; 
    background-color: #f4f7f9;
}

.prev, .next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0,0,0,0.5);
    color: white;
    border: none;
    padding: 10px;
    cursor: pointer;
    border-radius: 50%;
    z-index: 10;
    transition: 0.3s;
}

.prev:hover, .next:hover { background-color: var(--azul-logo); }
.prev { left: 15px; }
.next { right: 15px; }

/* --- SECCIÓN DE CARDS --- */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    padding: 40px 20px;
    max-width: 1100px;
    margin: 0 auto;
}

.card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 30px 20px;
    border-radius: 20px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
text-align: center;
}

.card:hover {
    transform: translateY(-12px) scale(1.02);
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 20px 40px rgba(0, 45, 90, 0.15);
}

/* Esto asegura que el link dentro de la card no cambie de color */
.card-link-wrapper, 
.card a {
    text-decoration: none; /* Quita el subrayado */
    color: inherit;       /* Hereda el color del texto del padre (negro o azul oscuro) */
}

/* El truco mágico: Forzar el color incluso si ya se visitó */
.card-link-wrapper:visited,
.card a:visited {
    color: inherit !important; 
}

/* Opcional: Si quieres que el título de la card sea siempre azul oscuro */
.card h2, .card h3 {
    color: var(--azul-oscuro);
}

/* --- ELIMINAR COLOR GUINDA (VISITED) --- */
/* Esto obliga a los enlaces de las cards a ignorar el historial del navegador */
.card, .card:visited {
    text-decoration: none;
    color: inherit !important;
}

/* --- CASCADA PARA INDEX (.cards-grid) Y BLOG (.blog-grid) --- */
/* Agrupamos ambos para que no tengas que repetir código */
.cards-grid .card:nth-child(1), .blog-grid .card:nth-child(1) { animation-delay: 0.1s; }
.cards-grid .card:nth-child(2), .blog-grid .card:nth-child(2) { animation-delay: 0.3s; }
.cards-grid .card:nth-child(3), .blog-grid .card:nth-child(3) { animation-delay: 0.5s; }
.cards-grid .card:nth-child(4), .blog-grid .card:nth-child(4) { animation-delay: 0.7s; }
/* ... puedes seguir hasta el 10 si quieres */
/* --- TÍTULOS Y ANIMACIONES --- */
h2 {
    text-align: center;
    font-family: 'Fredoka', sans-serif;
    color: var(--azul-oscuro);
    font-size: 2rem;
    margin: 40px 0 10px;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.animated-title {
    animation: fadeInUp 1s ease-out both;
    animation-delay: 0.3s;
}

.search-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
}

#blogSearch {
    width: 100%;
    padding: 12px 20px;
    font-size: 16px;
    font-family: 'Montserrat', sans-serif;
    border: 2px solid #ddd;
    border-radius: 25px; /* Bordes redondeados modernos */
    outline: none;
    transition: border-color 0.3s;
}

#blogSearch:focus {
    border-color: #002d5a; /* Cambia al azul oscuro al hacer clic */
}

.resumen-header {
    background-color: #f9f9f9; /* Color gris muy claro para que el título azul resalte */
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    border: 1px solid #eee; /* Un borde fino para dar definición */
}

.resumen-header h2 {
    font-family: 'Fredoka', sans-serif;
    color: #002d5a; /* Tu azul institucional ahora será legible */
    margin: 0;
    font-size: 1.8rem;
}

p {
    text-align: justify;
}

ul, ol {
    margin-left: 40px !important; /* Fuerza el espacio desde el borde izquierdo */
    padding-left: 0 !important;
    text-align: justify;
}

li {
    text-align: justify;
    list-style-position: outside; /* Mantiene la viñeta en su propia columna */
    padding-left: 5px; /* Pequeño espacio entre la viñeta y el texto */
    margin-bottom: 10px;
}

/* Animación en cascada automática para hasta 10 tarjetas */
.blog-grid .card:nth-child(1) { animation-delay: 0.1s; }
.blog-grid .card:nth-child(2) { animation-delay: 0.2s; }
.blog-grid .card:nth-child(3) { animation-delay: 0.4s; }
.blog-grid .card:nth-child(4) { animation-delay: 0.6s; }
.blog-grid .card:nth-child(5) { animation-delay: 0.8; }
.blog-grid .card:nth-child(6) { animation-delay: 1.0s; }
.blog-grid .card:nth-child(7) { animation-delay: 1.2s; }
.blog-grid .card:nth-child(8) { animation-delay: 1.4s; }
.blog-grid .card:nth-child(9) { animation-delay: 1.6s; }
.blog-grid .card:nth-child(10) { animation-delay: 1.8s; }