/* --- RESET Y ESTILOS GENERALES --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    overflow-x: hidden; /* Evita desbordamientos horizontales no deseados */
}

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.7;
    color: #2d3748;
    background-color: #f7fafc;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.contenedor {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* --- CABECERA ESTILO INSTITUCIONAL --- */
.site-header {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 1rem 0;
    width: 100%;
}

.header-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    width: 100%;
}

.logo-container {
    text-align: center;
}

.logo-container h1 {
    font-size: 1.2rem;
    font-weight: 800;
    color: #1a202c;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.logo-container span {
    display: block;
    font-size: 0.75rem;
    color: #718096;
    letter-spacing: 1px;
}

.navegacion-principal {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

/* --- ESTILOS MEJORADOS PARA LOS BOTONES DE NAVEGACIÓN --- */
.navegacion-principal a {
    color: #4a5568;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 8px 16px;
    border-radius: 6px;
    background-color: #edf2f7; /* Fondo sutil para que parezcan botones */
    border: 1px solid #e2e8f0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.navegacion-principal a:hover {
    color: #ffffff;
    background-color: #2b6cb0; /* Azul moderno al pasar el cursor */
    border-color: #2b6cb0;
    transform: translateY(-2px); /* Efecto de elevación */
    box-shadow: 0 4px 10px rgba(43, 108, 176, 0.25); /* Sombra elegante */
}

/* --- BOTÓN DE ADMINISTRADOR DESTACADO --- */
.btn-admin {
    background-color: #1a202c !important; /* Fondo oscuro institucional */
    color: white !important;
    border-color: #1a202c !important;
}

.btn-admin:hover {
    background-color: #2d3748 !important;
    border-color: #2d3748 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(26, 32, 44, 0.3) !important;
}

/* --- HERO BANNER CON SLIDER DINÁMICO & RESPONSIVE --- */
.hero-banner {
    position: relative;
    color: white;
    padding: 4rem 16px 5rem 16px;
    text-align: center;
    overflow: hidden;
    background-color: #1a202c;
    width: 100%;
}

/* Contenedor de las diapositivas de fondo */
.hero-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.hero-slide.active {
    opacity: 1;
}

/* Capa oscura semitransparente para garantizar la lectura del texto */
.hero-banner::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(15, 23, 42, 0.65), rgba(15, 23, 42, 0.75));
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.hero-content h2 {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #cbd5e0;
    margin-bottom: 8px;
}

.hero-content h3 {
    font-size: 1.35rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    letter-spacing: -0.5px;
    line-height: 1.3;
}

/* Barra de búsqueda adaptable a móviles por defecto */
.search-box {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    padding: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.search-box input {
    border: none;
    padding: 12px 16px;
    font-size: 0.95rem;
    outline: none;
    border-radius: 15px;
    width: 100%;
}

.search-box button {
    background-color: #d97706;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    width: 100%;
    margin-top: 4px;
}

.search-box button:hover {
    background-color: #b45309;
}

/* --- TARJETAS DE ACCESO RÁPIDO FLOTANTES --- */
.quick-access-container {
    max-width: 1000px;
    margin: -2.5rem auto 2rem auto;
    padding: 0 20px;
    position: relative;
    z-index: 10;
    width: 100%;
}

.quick-access-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.qa-card {
    background: white;
    padding: 18px;
    border-radius: 10px;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
    text-decoration: none;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid #e2e8f0;
    transition: transform 0.2s, box-shadow 0.2s;
}

.qa-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 20px -3px rgba(0,0,0,0.12);
}

.qa-card h4 {
    font-size: 0.95rem;
    color: #1a202c;
    margin-bottom: 2px;
}

.qa-card p {
    font-size: 0.78rem;
    color: #718096;
}

/* --- CONTENIDO Y ARTÍCULOS --- */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 20px 3rem 20px;
    width: 100%;
}

.seccion-titulo {
    font-size: 1.25rem;
    color: #1a202c;
    margin-bottom: 1.2rem;
    text-align: center;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.grid-articulos {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.card-articulo {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s;
}

.card-articulo:hover {
    transform: translateY(-3px);
}

.card-articulo h4 {
    font-size: 1.15rem;
    color: #1a202c;
    margin-bottom: 8px;
}

.card-articulo .fecha {
    font-size: 0.75rem;
    color: #718096;
    margin-bottom: 10px;
    display: inline-block;
    background: #edf2f7;
    padding: 2px 8px;
    border-radius: 4px;
}

.card-articulo p {
    color: #4a5568;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.btn-leer {
    color: #2b6cb0;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
}

.btn-leer:hover {
    text-decoration: underline;
}

/* --- PIE DE PÁGINA --- */
.site-footer {
    background-color: #f8fafc;
    color: #64748b;
    text-align: center;
    padding: 2rem 20px;
    font-size: 0.85rem;
    margin-top: auto;
    border-top: 1px solid #e2e8f0;
    width: 100%;
}

/* --- MEDIA QUERIES PARA TABLETS Y COMPUTADORAS (min-width: 768px) --- */
@media (min-width: 768px) {
    .contenedor {
        padding: 0 24px;
    }

    .header-inner {
        flex-direction: row;
        justify-content: space-between;
    }

    .logo-container {
        text-align: left;
    }

    .logo-container h1 {
        font-size: 1.3rem;
    }

    .navegacion-principal a {
        font-size: 0.9rem;
        padding: 8px 16px;
    }

    .hero-banner {
        padding: 6rem 24px 8rem 24px;
    }

    .hero-content h3 {
        font-size: 2rem;
    }

    /* La barra de búsqueda pasa a ser horizontal en pantallas medianas en adelante */
    .search-box {
        flex-direction: row;
        border-radius: 50px;
        padding: 5px;
        max-width: 600px;
    }

    .search-box input {
        border-radius: 50px 0 0 50px;
        padding: 12px 20px;
    }

    .search-box button {
        width: auto;
        border-radius: 50px;
        margin-top: 0;
        padding: 10px 24px;
    }

    .quick-access-container {
        margin: -3.5rem auto 3rem auto;
        padding: 0 24px;
    }

    .quick-access-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }

    .qa-card h4 {
        font-size: 1rem;
    }

    .qa-card p {
        font-size: 0.8rem;
    }

    .main-content {
        padding: 2rem 24px 4rem 24px;
    }

    .seccion-titulo {
        font-size: 1.4rem;
        margin-bottom: 1.5rem;
    }

    .grid-articulos {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }

    .card-articulo {
        padding: 25px;
    }
}

/* --- COMPUTADORAS GRANDES (min-width: 1024px) --- */
@media (min-width: 1024px) {
    .grid-articulos {
        grid-template-columns: repeat(3, 1fr);
    }
}
