/* --- VARIABLES --- */
:root {
    --primary: #2e59e1;
    --accent: #e91e63;
    --dark: #0f172a;
    --light: #f8fafc;
    --yellow: #f4d03f;
    --shadow: 0 10px 30px -10px rgba(0,0,0,0.15);
    --radius: 12px;
}

/* --- RESET & BASE --- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Poppins', sans-serif;
    color: #334155;
    background-color: var(--light);
    line-height: 1.6;
    overflow-x: hidden;
}

/* --- TIPOGRAFÍA --- */
h1, h2, h3 { font-family: 'Oswald', sans-serif; font-weight: 700; text-transform: uppercase; }
a { text-decoration: none; color: inherit; transition: 0.3s; }
.text-accent { color: var(--accent); }
.text-white { color: white; }
.text-center { text-align: center; }

/* --- BOTONES --- */
.btn { display: inline-block; padding: 12px 30px; border-radius: 50px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; transition: all 0.3s ease; cursor: pointer; border: none; }
.btn-primary { background: var(--accent); color: white; box-shadow: 0 4px 15px rgba(233, 30, 99, 0.4); }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 8px 25px rgba(233, 30, 99, 0.6); }

/* --- LAYOUT & SECCIONES --- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.section { padding: 80px 0; }
.section-header { margin-bottom: 50px; }
.section-title { font-size: 2.5rem; color: var(--dark); margin-bottom: 15px; }
.separator { height: 4px; width: 60px; background: var(--accent); margin: 15px auto; border-radius: 2px; }
.overline { display: block; font-size: 0.9rem; font-weight: 600; color: var(--accent); letter-spacing: 2px; text-transform: uppercase; margin-bottom: 5px; }

/* --- NAVBAR --- */
.navbar { position: fixed; top: 0; width: 100%; z-index: 1000; padding: 20px 0; transition: 0.4s; background: transparent; }
.navbar.scrolled { background: rgba(15, 23, 42, 0.95); padding: 10px 0; backdrop-filter: blur(10px); box-shadow: 0 5px 20px rgba(0,0,0,0.1); }
.nav-container { display: flex; justify-content: space-between; align-items: center; }
.nav-logo { height: 50px; }
.nav-links { display: flex; list-style: none; gap: 30px; }
.nav-links a { color: white; font-weight: 500; font-size: 0.95rem; text-shadow: 0 2px 4px rgba(0,0,0,0.3); }
.nav-links a:hover { color: var(--yellow); }
.menu-toggle { display: none; color: white; font-size: 1.5rem; cursor: pointer; }

/* --- HERO --- */
.hero { height: 100vh; position: relative; display: flex; align-items: center; justify-content: center; text-align: center; background: url('Comunidadpng.png') no-repeat center center/cover; }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(15,23,42,0.6), rgba(15,23,42,0.9)); }
.hero-content { position: relative; z-index: 2; color: white; padding: 0 20px; }
.hero-logo { width: 250px; margin-bottom: 30px; filter: drop-shadow(0 0 20px rgba(255,255,255,0.2)); }
.hero-title { font-size: 4rem; line-height: 1.1; margin-bottom: 20px; text-shadow: 0 4px 10px rgba(0,0,0,0.5); }

/* --- NUEVAS TARJETAS (Noticias y Entrenamientos) --- */
/* Grid responsive: se adapta al ancho sin necesidad de muchas media queries */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    padding-top: 20px;
}

/* Tarjeta Noticia */
.news-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
    border-top: 5px solid var(--primary);
    display: flex;
    flex-direction: column;
    height: 100%;
}
.news-card:hover { transform: translateY(-5px); }
.news-body { padding: 25px; flex-grow: 1; display: flex; flex-direction: column; }
.news-title { font-size: 1.3rem; color: var(--dark); margin-bottom: 10px; line-height: 1.3; }
.news-meta { font-size: 0.8rem; color: #64748b; margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; }
.news-excerpt { font-size: 0.9rem; color: #475569; margin-bottom: 20px; line-height: 1.6; }
.read-more-btn { margin-top: auto; color: var(--primary); font-weight: 600; font-size: 0.9rem; }

/* Tarjeta Entrenamiento */
.training-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border-left: 5px solid var(--accent);
    padding: 25px;
    transition: all 0.3s ease;
    height: 100%;
}
.training-card:hover { transform: translateX(5px); box-shadow: var(--shadow); }
.training-header { display: flex; justify-content: space-between; align-items: start; margin-bottom: 15px; }
.training-title { font-size: 1.4rem; color: var(--dark); margin: 0; line-height: 1.2; }
.training-icon { font-size: 1.5rem; color: var(--accent); opacity: 0.2; }
.training-details { background: #f8fafc; padding: 12px; border-radius: 8px; margin-bottom: 15px; font-size: 0.9rem; }
.training-row { display: flex; align-items: center; margin-bottom: 8px; color: #334155; }
.training-row i { width: 25px; color: var(--primary); text-align: center; margin-right: 5px; }
.training-body { font-size: 0.9rem; color: #475569; line-height: 1.6; border-top: 1px dashed #cbd5e1; padding-top: 15px; }

/* --- NOCTURNA & DARK MODE --- */
.dark-mode { background-color: var(--dark); color: white; }
.row { display: flex; flex-wrap: wrap; gap: 40px; align-items: center; }
.col-text, .col-img { flex: 1; min-width: 300px; } /* Responsive Flex */
.nocturna-info-box { background: rgba(255,255,255,0.1); padding: 20px; border-radius: 10px; border-left: 4px solid var(--yellow); margin-top: 20px; }

/* --- GALERÍA --- */
.gallery-wrapper { padding: 20px 0; }
.album-group { margin-bottom: 40px; }
.album-header h3 { font-size: 1.2rem; color: var(--primary); margin-bottom: 15px; border-bottom: 1px solid #ddd; padding-bottom: 10px; }
.album-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 15px; }
.album-grid img { width: 100%; height: 200px; object-fit: cover; border-radius: 8px; transition: transform 0.3s; cursor: pointer; }
.album-grid img:hover { transform: scale(1.03); }

/* --- FOOTER --- */
.main-footer { background: var(--dark); color: white; padding: 50px 0 20px; text-align: center; border-top: 5px solid var(--primary); }
.stats-badge { background: rgba(255,255,255,0.1); display: inline-block; padding: 5px 15px; border-radius: 20px; font-size: 0.9rem; margin: 20px 0; }
.copyright { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 20px; color: #64748b; font-size: 0.85rem; }

/* --- RESPONSIVE AVANZADO (MOBILE) --- */
@media (max-width: 768px) {
    .section { padding: 50px 0; }
    .hero-title { font-size: 2.5rem; }
    .section-title { font-size: 2rem; }
    
    /* Navbar Mobile */
    .menu-toggle { display: block; z-index: 1001; }
    .nav-links {
        position: fixed; top: 0; right: -100%; height: 100vh; width: 80%;
        background: rgba(15,23,42,0.98); flex-direction: column;
        justify-content: center; align-items: center; transition: 0.4s ease;
        z-index: 999;
    }
    .nav-links.active { right: 0; }
    .nav-links li { margin: 15px 0; }
    .nav-links a { font-size: 1.2rem; }

    /* Ajustes Cards en móvil */
    .cards-grid { grid-template-columns: 1fr; gap: 20px; } /* Una columna en móvil */
    .col-text, .col-img { min-width: 100%; }
    
    /* Galería en móvil: scroll horizontal */
    .album-grid { display: flex; overflow-x: auto; padding-bottom: 10px; scroll-snap-type: x mandatory; }
    .album-grid img { width: 80vw; height: 250px; flex-shrink: 0; scroll-snap-align: center; }
}
/* --- SECCIÓN PRIMICIA / CARRERA DESTACADA --- */
.primicia-section {
    background: #fff;
    border-bottom: 1px solid #eee;
    padding: 60px 0;
}
.primicia-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 40px;
    background: linear-gradient(to right, #f8fafc 0%, #fff 100%);
    border: 2px solid var(--accent); /* Borde color llamativo */
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: 0 15px 30px rgba(233, 30, 99, 0.15);
    position: relative;
    overflow: hidden;
}
/* Etiqueta de "Destacado" */
.primicia-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--accent);
    color: white;
    padding: 5px 20px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    border-bottom-left-radius: 10px;
}
.primicia-img {
    flex: 1;
    min-width: 300px;
    max-width: 450px;
}
.primicia-img img {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    transition: transform 0.3s;
}
.primicia-img img:hover { transform: scale(1.02); }
.primicia-content {
    flex: 2;
    min-width: 300px;
}
.primicia-title {
    font-size: 2.2rem;
    color: var(--dark);
    margin-bottom: 15px;
    line-height: 1.2;
}
.primicia-body {
    font-size: 1.05rem;
    color: #475569;
    margin-bottom: 25px;
    white-space: pre-line; /* Respeta los saltos de línea */
}

/* En móvil, la imagen arriba */
@media (max-width: 768px) {
    .primicia-box { flex-direction: column-reverse; }
    .primicia-img { width: 100%; max-width: 100%; }
}
/* --- ESTILOS NOTICIAS (Responsive Avanzado: Igual que Entrenamientos) --- */
.news-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border-top: 4px solid var(--primary); /* Mantenemos el color azul de noticias */
    overflow: hidden;
    display: flex;
    flex-direction: column; /* Móvil: Vertical */
    transition: transform 0.3s ease;
    height: 100%;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

/* Contenedor de la imagen */
.news-img-box {
    width: 100%;
    height: 250px; /* Altura en móvil */
    background-color: #f1f5f9;
    position: relative;
    overflow: hidden;
}

.news-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* En noticias usamos 'cover' para que se vea bonita la foto sin bordes */
    transition: transform 0.5s ease;
}

.news-card:hover .news-img-box img {
    transform: scale(1.05);
}

/* Cuerpo del texto */
.news-body {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* --- VISTA DE ORDENADOR (Pantallas grandes) --- */
@media (min-width: 992px) {
    .news-card {
        flex-direction: row; /* Horizontal: Foto Izq | Texto Der */
        min-height: 280px;
    }

    .news-img-box {
        width: 40%; /* La foto ocupa el 40% del ancho */
        height: auto; 
        min-height: 100%;
        border-bottom: none; /* Quitamos bordes internos si los hubiera */
    }
    
    .news-body {
        width: 60%; /* El texto ocupa el 60% */
    }
}
/* --- ESTILOS TARJETA ENTRENAMIENTO (Responsive Avanzado) --- */
.training-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column; /* Por defecto (móvil): columna */
    transition: transform 0.3s ease;
    border: 1px solid #e2e8f0;
    height: 100%;
}

.training-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

/* Contenedor de la imagen */
.training-img-box {
    width: 100%;
    height: 300px; /* Altura en móvil */
    background-color: #0f172a; /* Fondo oscuro para resaltar el flyer */
    position: relative;
    overflow: hidden;
}

.training-img-box img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Muestra el flyer ENTERO sin cortar nada */
    backdrop-filter: blur(5px);
}

/* Contenedor del texto */
.training-info-box {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* --- VISTA DE ORDENADOR (Pantallas mayores a 992px) --- */
@media (min-width: 992px) {
    .training-card {
        flex-direction: row; /* Cambia a horizontal: Imagen Izq | Texto Der */
        min-height: 350px; /* Altura mínima para que el flyer se vea grande */
    }

    .training-img-box {
        width: 45%; /* La imagen ocupa el 45% del ancho */
        height: auto; /* La altura se ajusta automática al contenedor */
        min-height: 100%;
        border-right: 4px solid var(--accent); /* Borde decorativo vertical */
    }
    
    .training-info-box {
        width: 55%; /* El texto ocupa el resto */
    }
}