/* ==============================================
   1. CONFIGURACIÓN GENERAL Y VARIABLES
   ============================================== */
:root {
    --primario: #b43ca6;
    --secundario: #bd54ab;
    --morado-oscuro: #7b0c6e;
    --morado-logo: #5a2050;
    --rosa-principal: #e58dd8;
    --rosa-claro: #fbeffd;
    --fondo: #f9f6f9;
    --blanco: #ffffff;
    --gris: #666;
    --texto-oscuro: #2d2d2d;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box; 
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--fondo);
    color: var(--texto-oscuro);
    line-height: 1.6;
}

p {
    letter-spacing: normal;
    word-spacing: normal;
    text-align: justify;
    text-justify: inter-word;
    hyphens: auto;
}

/* ==============================================
   2. HEADER, NAVBAR Y NAVEGACIÓN (COMPACTADO)
   ============================================== */
header.recursos-header {
    background-color: var(--rosa-principal);
    color: var(--blanco);
    text-align: center;
    padding: 1rem 1rem 2.5rem; /* Reducido drásticamente para evitar la altura excesiva */
    position: relative;
    z-index: 1000;
}

.navbar {
    max-width: 1300px;
    margin: 0 auto 1.5rem; /* Margen inferior reducido */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 2rem;
}

.logo { 
    font-weight: 600; 
    font-size: 1.5rem; 
    color: var(--morado-logo); 
}

.menu { 
    display: flex; 
    list-style: none; 
    gap: 2rem; 
    align-items: center;
}

.nav-link { 
    text-decoration: none; 
    color: #3a2a34; 
    font-weight: 600; 
    position: relative;
    padding-bottom: 5px;
    transition: 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0; 
    height: 2px;
    background: var(--morado-oscuro);
    bottom: 0; 
    left: 0;
    transition: 0.3s ease;
}

.nav-link:hover::after { 
    width: 100%; 
}

/* Menú Desplegable (Dropdown) */
.dropdown { 
    position: relative; 
}

.dropdown-content {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    background: var(--blanco);
    min-width: 220px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    margin-top: 10px;
    padding: 10px 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 1001;
    border: 1px solid rgba(123, 12, 110, 0.1);
}

.dropdown::after {
    content: "";
    position: absolute;
    width: 100%;
    height: 15px;
    bottom: -15px;
    left: 0;
}

.dropdown:hover .dropdown-content {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

.dropdown-content li {
    list-style: none;
}

.dropdown-content li a {
    display: block;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: left;
    transition: 0.2s ease;
}

.dropdown-content li a:hover {
    background: var(--rosa-claro);
    color: var(--morado-oscuro);
    padding-left: 25px;
}

.menu-toggle { 
    display: none; 
    background: none;
    border: none;
    font-size: 2rem; 
    color: var(--morado-logo);
    cursor: pointer; 
}

/* ==============================================
   3. SECCIÓN DE BÚSQUEDA Y TÍTULO HERO (ESTILIZADO)
   ============================================== */
.recursos-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.3rem; /* Reducido de 3rem para mejor balance visual */
    margin-bottom: 0.5rem;
    color: var(--blanco);
    font-style: italic;
}

.search-container {
    margin-top: 1.2rem; /* Separación compacta */
}

#searchInput {
    width: 100%;
    max-width: 520px; /* Ancho máximo refinado */
    padding: 0.75rem 1.5rem; /* Padding más estilizado y menos tosco */
    border-radius: 50px;
    border: none;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(90, 32, 80, 0.15);
    outline: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#searchInput:focus {
    transform: scale(1.01);
    box-shadow: 0 6px 18px rgba(90, 32, 80, 0.25);
}

/* ==============================================
   4. GRID DE RECURSOS Y TARJETAS (CARDS)
   ============================================== */
.recursos-grid {
    max-width: 1200px;
    margin: 2.5rem auto 4rem; /* Eliminado el margen negativo molesto */
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2.5rem;
    padding: 0 2rem;
    position: relative;
    z-index: 10;
}

.recurso-card {
    background: var(--blanco);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%; 
}

.recurso-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(123, 12, 110, 0.08);
}

.recurso-tag {
    background: #f0e6ef;
    color: var(--primario);
    font-size: 0.75rem;
    font-weight: bold;
    padding: 5px 14px;
    border-radius: 50px;
    width: fit-content;
    margin-bottom: 1.2rem;
    text-transform: uppercase;
}

.recurso-card h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--morado-oscuro);
    margin-bottom: 1rem;
    line-height: 1.4;
    text-align: left;
}

.capa-recurso {
    width: 100%;            
    height: 190px;           
    object-fit: cover;     
    border-radius: 12px;   
    margin-bottom: 1.2rem; 
    display: block;
    transition: opacity 0.3s ease;
}

.recurso-card:hover .capa-recurso {
    opacity: 0.95;
}

.autora {
    font-weight: 600;
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
}

.descripcion {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--gris);
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.btn-leer {
    text-align: center;
    background: var(--secundario);
    color: var(--blanco);
    text-decoration: none;
    padding: 12px;
    border-radius: 10px;
    font-weight: 600;
    transition: background 0.3s ease;
    display: block;
    width: 100%;
}

.btn-leer:hover { 
    background: var(--morado-oscuro);
}

/* ==============================================
   5. FOOTER Y REDES SOCIALES
   ============================================== */
.menu-footer {
    color: #520257;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding-bottom: 40px;
    padding-left: 30px;
    padding-right: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.logo_footer img {
    width: 180px;
    height: 180px;
    object-fit: contain;
}

.menu-footer-list {
    border-right: 2px solid #520257;
    display: flex;
    flex-direction: column;
    margin-left: 40px;
    padding-right: 40px;
}

.menu-footer-list h2 {
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.menu-footer ul {
    list-style: none;
}

.menu-footer ul li {
    margin-bottom: 10px;
}

.menu-footer ul li a {
    text-decoration: none;
    color: #520257;
    font-weight: 600;
    transition: color 0.2s ease;
}

.menu-footer ul li a:hover {
    color: var(--morado-oscuro);
}

.social-media {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-left: 40px;
}

.media-ico wa-icon {
    font-size: 32px; 
    color: #520257;
    transition: transform 0.2s ease;
}

.media-ico wa-icon:hover {
    transform: scale(1.15);
}

.copyright {
    background: #520257;
    color: var(--blanco);
    text-align: center !important;
    padding: 1.2rem;
}

.copyright p {
    text-align: center !important;
    font-size: 0.9rem;
}

/* ==============================================
   6. RESPONSIVE DESIGN (MEDIA QUERIES)
   ============================================== */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    
    .navbar {
        padding: 1rem 1.5rem;
        flex-wrap: wrap;
    }
    
    .menu {
        display: none;
        flex-direction: column;
        width: 100%;
        gap: 0;
        background: var(--rosa-principal);
        padding: 1rem 0;
    }

    .menu.active {
        display: flex;
    }

    .menu li {
        width: 100%;
        text-align: center;
        padding: 0.8rem 0;
        border-bottom: 1px solid rgba(255,255,255,0.2);
    }

    .dropdown-content {
        position: static;
        opacity: 1;
        visibility: visible;
        display: none;
        transform: none;
        box-shadow: none;
        background: rgba(255, 255, 255, 0.1);
        width: 100%;
    }

    .dropdown:hover .dropdown-content {
        display: block;
    }

    .dropdown-content li a {
        text-align: center;
        color: var(--blanco);
    }

    .recursos-grid {
        margin-top: 2rem;
        padding: 0 1.5rem;
        gap: 1.5rem;
    }

    .menu-footer {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 35px;
    }

    .logo_footer img {
        width: 140px;
        height: 140px;
    }

    .menu-footer-list {
        border-right: none;
        padding-right: 0;
        margin-left: 0;
    }

    .social-media {
        justify-content: center;
        margin-left: 0;
    }

    .media-ico wa-icon {
        font-size: 38px;
    }
}