/* ========================= */
/* Estilos Generales y Layout */
/* ========================= */
.container {
    /* Centra el contenido en el medio de la pantalla */
    max-width: 1200px;
    margin: 40px auto; 
    padding: 0 20px;
}

h2 {
    text-align: center;
    color: #333;
    font-size: 2.5em;
    margin-bottom: 10px;
}

.intro-text {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 1.1em;
}

.contenedor-galeria {
    /* Crea un layout de rejilla responsivo */
    /* Permite 1 columna en móvil y expande a más si hay espacio */
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px; /* Espacio entre tarjetas */
}

/* ------------------------------------- */
/* Estilos de Botones de Filtro */
/* ------------------------------------- */
.filtros-deportivos {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
    flex-wrap: wrap; /* Permite que los botones salten de línea en móvil */
    gap: 10px;
}

.filtro-btn {
    background-color: #eee;
    color: #333;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    font-size: 1em;
    flex-grow: 0; /* Evita que los botones se estiren demasiado por defecto */
}

.filtro-btn.activo {
    background-color: #007bff; /* Azul vibrante */
    color: white;
    box-shadow: 0 4px 6px rgba(0, 123, 255, 0.3);
}

.filtro-btn:hover {
    background-color: #ddd;
}


/* ------------------------------------- */
/* Estilos de la Tarjeta de Noticia */
/* ------------------------------------- */
.tarjeta-noticia {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: block; 
}

/* CLASE CRÍTICA: Solución estable para el filtrado con JS */
.tarjeta-noticia.oculto {
    display: none !important; 
}

.tarjeta-noticia:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.tarjeta-noticia img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-bottom: 1px solid #eee;
}

.tarjeta-noticia .info {
    padding: 20px;
}

.tarjeta-noticia .tag {
    display: inline-block;
    background-color: #ffc107; /* Amarillo */
    color: #333;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8em;
    font-weight: bold;
    margin-bottom: 10px;
}

.tarjeta-noticia h3 {
    font-size: 1.4em;
    color: #333;
    margin-top: 0;
    margin-bottom: 10px;
    /* Evita saltos de línea extraños en títulos largos en móvil */
    word-wrap: break-word; 
}

.tarjeta-noticia p {
    color: #666;
    font-size: 0.95em;
    line-height: 1.4;
    margin-bottom: 15px;
}

.tarjeta-noticia small {
    display: block;
    color: #999;
    font-size: 0.8em;
    margin-bottom: 15px;
}

.btn-leer-mas {
    display: inline-block;
    text-decoration: none;
    background-color: #28a745; /* Verde */
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.btn-leer-mas:hover {
    background-color: #1e7e34;
}


/* ========================= */
/* ADAPTACIÓN MÓVIL (MAX-WIDTH: 600px) */
/* ========================= */
@media (max-width: 600px) {
    
    .container {
        margin: 20px auto;
        padding: 0 10px; /* Más estrecho en móvil */
    }

    h2 {
        font-size: 1.8em; /* Título más pequeño */
    }

    .intro-text {
        font-size: 1em;
        margin-bottom: 20px;
    }

    /* Optimización de Filtros */
    .filtros-deportivos {
        justify-content: space-around; /* Distribuye el espacio entre botones */
        gap: 8px;
        margin-bottom: 25px;
    }
    
    .filtro-btn {
        /* Permite que los botones tomen más ancho si es necesario */
        width: 45%; 
        padding: 8px 15px;
        font-size: 0.9em;
    }

    /* Optimización de Tarjetas */
    .contenedor-galeria {
        /* Se asegura que en el móvil, la rejilla solo tenga una columna, aunque grid-template-columns ya lo maneja bien */
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .tarjeta-noticia img {
        height: 200px; /* Imagen un poco más baja */
    }

    .tarjeta-noticia .info {
        padding: 15px;
    }
    
    .tarjeta-noticia h3 {
        font-size: 1.2em; /* Títulos más concisos */
    }
}