/* ESTILOS PERSONALIZADOS RED PULSO - NUEVA VERSIÓN */

body {
    font-family: 'Inter', sans-serif;
    background-color: #f4f4f4;
}

/* Fuentes Serif elegantes para títulos */
h1, h2, h3, .serif-font {
    font-family: 'Playfair Display', serif;
}

/* El Rojo Marca */
.brand-red {
    color: #D31212;
}
.bg-brand-red {
    background-color: #D31212;
}

/* Animación de la línea roja debajo de los links */
.nav-item {
    position: relative;
    transition: color 0.3s ease;
}

.nav-item::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: #D31212; /* Rojo al pasar el mouse */
    transition: width 0.3s ease;
}

.nav-item:hover::after {
    width: 100%;
}

/* Suavidad del menú lateral */
#side-menu {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}




/* =======================================================
   VERSION MÓVIL (PANTALLAS PEQUEÑAS)
   ======================================================= */
@media only screen and (max-width: 768px) {

    /* --- 1. ARREGLO DE NOTICIAS (Verticalización) --- */
    
    /* Convierte grillas a 1 sola columna */
    .grid, [class*="grid-cols-"] {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
        display: grid !important;
    }

    /* Pone fotos arriba y texto abajo */
    article.flex, 
    section .flex:not(header .flex):not(#grupo-anonimo):not(#grupo-usuario):not(.huincha-container):not(#side-menu *) {
        flex-direction: column !important;
    }

    /* Imágenes seguras */
    img {
        max-width: 100% !important;
        height: auto !important;
        object-fit: cover;
    }

    /* Márgenes laterales para que no se pegue al borde del celular */
    main, section, article {
        padding-left: 0px !important; 
        padding-right: 0px !important;
        width: 100% !important;
        box-sizing: border-box;
    }

    /* Títulos legibles en celular */
    h1, h2, .text-3xl, .text-4xl, .text-5xl {
        font-size: 1.75rem !important;
        line-height: 1.2 !important;
        word-wrap: break-word;
    }
    
    /* Aire entre bloques */
    section, article, .mb-4, .mb-8 {
        margin-bottom: 2rem !important;
    }


    /* --- 2. BARRA DE NAVEGACIÓN DESLIZABLE (SCROLL HORIZONTAL) --- */
    
    /* Esto permite que la barra negra del menú se deslice con el dedo */
    nav.overflow-x-auto, nav ul {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        width: 100vw !important;
        margin-left: -15px !important; 
        margin-right: -15px !important;
        padding-left: 15px !important; 
        padding-right: 15px !important;
        -webkit-overflow-scrolling: touch !important; 
        scrollbar-width: none; 
    }
    
    /* Ocultar la barra gris fea del scroll */
    nav.overflow-x-auto::-webkit-scrollbar, nav ul::-webkit-scrollbar {
        display: none;
    }

    nav.sticky ul li,
    nav.sticky a,
    nav.sticky .nav-item {
        flex: 0 0 auto !important;      /* Prohibido encogerse */
        width: auto !important;
        display: block !important;      
        white-space: nowrap !important; /* Texto en una línea */
        margin-right: 15px !important;  /* Separación */
    }

    /* --- 3. ESTILOS INTERNOS DEL MENÚ LATERAL (EXPLORAR) --- */
    /* Nota: El z-index y la posición ya están arreglados en el HTML */

    #side-menu {
        width: 85% !important; 
        overflow-x: hidden !important; /* PROHIBIDO deslizar al lado */
    }

    /* === CORRECCIÓN CLAVE: ANULAMOS EL EFECTO "FILA" DE LA BARRA DE ARRIBA === */
    /* Aquí le decimos: "Dentro del menú lateral, compórtate verticalmente" */
    
    #side-menu nav, 
    #side-menu ul {
        display: block !important;       /* No usar Flexbox aquí */
        flex-wrap: wrap !important;      /* Permitir bajar de línea */
        overflow-x: hidden !important;   /* Sin scroll horizontal */
        overflow-y: auto !important;     /* Scroll vertical permitido */
        white-space: normal !important;  /* Texto puede tener varias líneas */
        margin: 0 !important;            /* Quitar márgenes negativos */
        width: 100% !important;
    }

    #side-menu li, 
    #side-menu a {
        display: block !important;       /* Ocupar todo el ancho */
        width: 100% !important;
        margin-right: 0 !important;      /* Quitar separación lateral */
        padding: 15px 0 !important;      /* Dar aire vertical */
        border-bottom: 1px solid #f0f0f0 !important;
    }

    /* Asegura que la cabecera negra del menú se quede quieta */
    #side-menu .p-6 {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
}



/* === ESTILOS UNIFICADOS PARA TARJETAS DE NOTICIAS === */

        /* 1. La Rejilla (Grid) */
        .news-grid {
            display: grid;
            grid-template-columns: 1fr;
            gap: 1.5rem; /* Espacio entre tarjetas */
            margin-bottom: 3rem;
        }
        /* En PC, 3 columnas */
        @media (min-width: 768px) {
            .news-grid { grid-template-columns: repeat(3, 1fr); }
        }

        /* 2. La Tarjeta (El Marco) */
        .news-card {
            display: flex;
            flex-direction: column;
            height: 100%; /* Esto obliga a que todas midan lo mismo */
            background-color: white;
            border: 1px solid #e5e7eb; /* Borde gris suave */
            transition: box-shadow 0.3s ease;
        }
        .news-card:hover {
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); /* Sombra al pasar el mouse */
        }

        /* 3. La Imagen (Contenedor y Zoom) */
        .news-img-wrapper {
            height: 12rem; /* Altura fija para la foto */
            overflow: hidden;
            display: block;
        }
        .news-img-wrapper img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: transform 0.7s ease;
        }
        .news-card:hover .news-img-wrapper img {
            transform: scale(1.05); /* Efecto zoom suave */
        }

        /* 4. El Cuerpo de texto (Padding y Espaciado) */
        .news-body {
            padding: 1.5rem;
            display: flex;
            flex-direction: column;
            flex-grow: 1; /* Esto empuja el botón hacia abajo */
        }

        /* 5. La Etiqueta Negra */
        .news-tag {
            background-color: #000000;
            color: #ffffff;
            font-size: 10px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.2em;
            padding: 4px 8px;
            display: inline-block;
            margin-bottom: 1rem;
            align-self: flex-start; /* Evita que la etiqueta se estire */
        }

        /* 6. El Título */
        .news-title {
            font-family: 'Playfair Display', serif;
            font-size: 1.25rem; /* 20px */
            font-weight: 700;
            line-height: 1.2;
            margin-bottom: 0.75rem;
            color: #1a1a1a;
            text-decoration: none;
            transition: color 0.2s;
        }
        .news-title:hover { color: #D31212; }

        /* 7. El botón "Leer más" al fondo */
        .news-footer {
            margin-top: auto; /* Magia: Empuja esto al fondo siempre */
            padding-top: 1rem;
            border-top: 1px solid #f3f4f6;
            font-size: 10px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.15em;
        }
        .news-footer a { color: black; transition: color 0.2s; }
        .news-footer a:hover { color: #D31212; }