/* ==========================================================================
   Estilos ÚNICOS para comunidad.html - comunidad.css
   ========================================================================== */

/* -------------------------------------------------------------------------- */
/*                                  VARIABLES CSS                           */
/* -------------------------------------------------------------------------- */
/* Heredamos variables generales para consistencia, pero las definimos aquí
   para que el archivo sea autosuficiente. */
:root {
    /* Colores principales */
    --primary-color: #006400; /* Verde oscuro principal */
    --secondary-color: #088f18; /* Verde secundario */
    --accent-color: #43b17e; /* Verde acento */

    /* Colores de apoyo */
    --primary-color-alt: #226d3f; /* Verde oscuro alternativo */
    --light-green: #e8f5e9; /* Verde muy claro */

    /* Colores de texto y fondo */
    --text-color: #333; /* Texto principal oscuro */
    --light-text: #fff; /* Texto claro */
    --light-text-secondary: #666; /* Texto claro secundario */
    --light-bg: #f5f5f5; /* Fondo claro general */
    --dark-bg: #121212; /* Fondo oscuro para footer */
    --white: #fff; /* Blanco absoluto */
    --border-color: #e0e0e0; /* Color de borde sutil */

    /* Sombras */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 5px 20px rgba(0, 0, 0, 0.15); /* Sombra para tarjetas */

    /* Espaciado y bordes */
    --spacing-unit: 8px;
    --border-radius: 4px;
    --border-radius-lg: 8px;
    --border-radius-pill: 30px;

    /* Transiciones */
    --transition: all 0.3s ease;
}

/* -------------------------------------------------------------------------- */
/*                                  RESET Y GLOBALES                        */
/* -------------------------------------------------------------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--white);
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--primary-color-alt);
}

h1 { font-size: 3rem; }
h2 { font-size: 2.5rem; margin-bottom: 20px; text-align: center; }
h3 { font-size: 1.8rem; }
h4 { font-size: 1.4rem; }
h5 { font-size: 1.1rem; }

p {
    margin-bottom: 1rem;
    color: var(--text-color);
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: var(--transition);
}

a:hover {
    color: var(--secondary-color);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* -------------------------------------------------------------------------- */
/*                                NAVEGACIÓN PRINCIPAL (NAVBAR)               */
/* -------------------------------------------------------------------------- */
/* Copiamos los estilos de navbar de estilosgenerales.css para consistencia */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow);
    z-index: 1000;
    padding: 10px 0;
    transition: var(--transition);
}

.navbar.scrolled {
    padding: 8px 0;
    background-color: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.12);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--primary-color);
}

.logo img {
    height: 45px;
    margin-right: 12px;
}

.logo span {
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--primary-color-alt);
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu li {
    margin-left: 25px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    padding: 8px 0;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background-color: var(--primary-color);
    transition: var(--transition);
}

.nav-link:hover::after, .nav-link.active::after {
    width: 100%;
}

/* Botón para menú móvil */
.menu-toggle {
    display: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--primary-color-alt);
    background: none;
    border: none;
    padding: 5px;
}

/* Responsivo para el menú */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        background-color: var(--white);
        flex-direction: column;
        text-align: center;
        transition: 0.3s ease-in-out;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 20px 0;
        z-index: 100;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu li {
        margin: 15px 0;
        width: 100%;
    }

    .nav-link {
        display: block;
        padding: 15px;
        border-bottom: 1px solid var(--border-color);
    }
    
    .nav-link:hover, .nav-link.active {
        background-color: var(--light-bg);
        color: var(--primary-color);
    }

    .nav-menu li:not(:last-child) {
        margin-left: 0;
    }
}

/* -------------------------------------------------------------------------- */
/*                                 SECCIONES GENERALES                        */
/* -------------------------------------------------------------------------- */
.section {
    padding: 80px 0;
}

.section.bg-light {
    background-color: var(--light-bg);
}

.section-description {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 40px;
    font-size: 1.1rem;
    color: var(--text-color);
}

/* -------------------------------------------------------------------------- */
/*                                  PAGE HEADER (PARA COMUNIDAD)              */
/* -------------------------------------------------------------------------- */
/* Estilos específicos para el header de la página de comunidad */
.page-header {
    background-color: var(--primary-color); /* Usa el verde oscuro principal */
    color: var(--white);
    padding: 60px 0;
    text-align: center;
    margin-bottom: 40px;
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: var(--white);
}

.page-header p {
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto;
    color: var(--white);
}

/* -------------------------------------------------------------------------- */
/*                                  ESTRUCTURA DE COMUNIDAD                   */
/* -------------------------------------------------------------------------- */
.community-section {
    padding: 40px 0 80px;
}

.community-layout {
    display: flex;
    gap: 30px;
    position: relative;
}

/* Índice lateral */
.community-index {
    width: 300px;
    flex-shrink: 0;
    background-color: var(--light-bg);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.index-header {
    padding: 15px 20px;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.index-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--white);
}

.toggle-btn {
    background: none;
    border: none;
    color: var(--white);
    cursor: pointer;
    font-size: 1rem;
    padding: 5px;
}

.index-list {
    list-style: none;
    padding: 0;
    margin: 0;
    transition: max-height 0.3s ease;
}

.index-list.collapsed {
    max-height: 0;
    overflow: hidden;
}

.index-list li {
    border-bottom: 1px solid var(--border-color);
}

.index-list li:last-child {
    border-bottom: none;
}

.index-list a {
    display: block;
    padding: 15px 20px;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.2s ease;
}

.index-list a:hover {
    background-color: var(--light-green);
    color: var(--primary-color);
}

.index-list a.active {
    background-color: var(--light-green);
    color: var(--primary-color);
    font-weight: 600;
    border-left: 4px solid var(--primary-color);
}

/* Contenido principal de las actividades */
.community-content {
    flex: 1;
}

.activity-container {
    display: none;
    background-color: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 30px;
}

.activity-container.active {
    display: flex;
    flex-direction: column;
}

/* Estilos para el área de noticias */
.activity-news {
    padding: 30px;
}

.activity-news h2 {
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.8rem;
    text-align: left;
}

.activity-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    color: var(--light-text-secondary);
    font-size: 0.9rem;
}

.activity-meta i {
    margin-right: 5px;
    color: var(--primary-color);
}

.activity-text blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 20px;
    margin: 20px 0;
    font-style: italic;
    color: #555;
}

.activity-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.activity-tags span {
    background-color: var(--light-green);
    color: var(--primary-color);
    padding: 5px 12px;
    border-radius: var(--border-radius-pill);
    font-size: 0.85rem;
}

/* Estilos para la galería dentro de las actividades */
.activity-gallery {
    padding: 0 30px 30px;
}

.activity-gallery h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.4rem;
}

/* -------------------------------------------------------------------------- */
/*                                   RESPONSIVE GENERAL                       */
/* -------------------------------------------------------------------------- */
@media (max-width: 992px) {
    /* Ajustes para pantallas medianas */
    .section { padding: 60px 0; }
    
    .page-header {
        padding: 40px 0;
    }
    .page-header h1 { font-size: 2rem; }
    .page-header p { font-size: 1.1rem; }

    h2 { font-size: 2rem; }

    /* Layout de comunidad */
    .community-layout {
        flex-direction: column;
    }
    
    .community-index {
        width: 100%;
        position: relative;
        top: 0;
        max-height: none;
        margin-bottom: 30px;
    }
}

@media (max-width: 768px) {
    /* Ajustes para pantallas pequeñas */
    .hero h1 { font-size: 2.8rem; }
    .hero p { font-size: 1.1rem; }

    .card, .info-card, .platform-card { padding: 20px; }

    .cta-buttons { flex-direction: column; gap: 10px; }
    .cta-buttons a { width: 100%; }

    .footer-content { grid-template-columns: 1fr; text-align: center; }
    .footer-logo { align-items: center; }
    .footer-links h4::after, .footer-social h4::after { left: 50%; transform: translateX(-50%); }
    .social-icons { justify-content: center; }

    /* Ajustes específicos de comunidad en pantallas pequeñas */
    .activity-news, .activity-gallery { padding: 20px; }
    .gallery-item { height: 200px; }
}

@media (max-width: 576px) {
    /* Ajustes para pantallas extra pequeñas */
    .hero h1 { font-size: 2rem; }
    .hero p { font-size: 1rem; }
    
    h2 { font-size: 2rem; }

    .navbar { padding: 8px 0; }
    .logo img { height: 35px; margin-right: 8px; }
    .logo span { font-size: 1.3rem; }
    .menu-toggle { font-size: 1.5rem; }
    .nav-menu { top: 60px; }
}