body {
  margin: 0;
  padding: 0;
  background-color: #e8f5e98d;
}

/* Logo + header */
a.logo {
    display: inline-flex;
    align-items: center;
    gap: 1px;
    margin-left: 1rem;
    text-decoration: none;
    cursor: pointer;
    z-index: 1;
}

.logo img {
    width: 75px;
    height: 75px;
}

.logo h1 {
    font-size: 1.8rem;
    color: #2e7d32;
    margin-left: -0.5rem;
}

/* Menú */
.encabezado {
  background-image: url('../img/1.1.png');
  background-size: cover;     /* o 'cover' */
  background-repeat: no-repeat;
  background-position: center;
  height: 90px;
  width: 245px; /* ajusta según la imagen */
  margin-left: -15px;
  margin-top: -15px;
  padding-bottom: 15px;
  pointer-events: none; /* esto hace que no bloquee clics */
}

.navbar {
  display: flex;
  justify-content: space-between; /* en lugar de flex-start */
  gap: 2rem; /* separación*/
  align-items: center;
  background-color: #e8f5e98d;
  padding: 0 1rem;
  flex-wrap: wrap; /* asegúrate que se comporte bien en responsive */

}

nav {
  flex-grow: 1;
}


nav ul.menu {
  list-style: none;
  display: flex;
 justify-content: space-around;
  align-items: center;
  gap: 1rem;
  flex-wrap: nowrap;
  padding: 1rem 0;
  margin: 0;
  width: 100%;
}

nav ul.menu li a {
    text-decoration: none;
    color: #2e8132;
    font-weight: 500;
    font-size: 1.2rem;
    padding: 0.9rem 1rem;
    border-radius: 6px;
    transition: background 0.3s ease;
    font-weight: bold;
    
}

nav ul.menu li a:hover {
    color: #1a491c;
    background-color: #7dda0476;
}

/* Ícono de hamburguesa */
.hamburger {
  display: none;
  font-size: 2rem;
  background: none;
  border: none;
  cursor: pointer;
  margin-left: 1rem;
  padding-bottom: 1rem;
  color: #2e8132;
  z-index: 1;
}

.bienvenida h2 {
  font-size: 2.5rem; 
  color: #000000;    
  font-weight: bold;
  margin-bottom: 1rem;
}

/* Botón principal */
.btn {
    display: inline-block;
    background-color: #2e7d32;
    color: white;
    border-radius: 8px;
    text-decoration: none;
    margin-top: 1rem;
    font-weight: bold;
    transition: background 0.3s ease;
    font-size: 1.3rem;
    padding: 1.1rem 1.7rem;
}

.btn:hover {
    background-color: #27642b;
}

/* Sección buscador */
.buscador {
  padding: 1rem 1rem;
 /* background: linear-gradient(to right, #dcedc8, #a5d6a7);*/
  text-align: center;
  margin-bottom: 2rem;
}

.titulo-busqueda {
  font-size: 2.5rem;
  /*color: #2e7d32;*/
  color: #27642b;
  margin-bottom: 1rem;
}

.contenedor-busqueda {
  max-width: 800px;
  margin: 0 auto;
  background: #84be8286;
  padding: 2rem;
  border-radius: 15px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.descripcion-busqueda {
  font-size: 1.2rem;
  color: #4b4b4b;
  margin-bottom: 1.5rem;
}

.form-busqueda {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.form-busqueda input[type="text"] {
  padding: 0.8rem 1rem;
  font-size: 1rem;
  width: 60%;
  max-width: 400px;
  border: 1px solid #a5d6a7;
  border-radius: 8px;
  outline: none;
}

.form-busqueda button {
  padding: 0.8rem 1.5rem;
  font-size: 1rem;
  background-color: #388e3c;
  color: rgb(255, 255, 255);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.form-busqueda button:hover {
  background-color: #2e7d32;
}

.bienvenida {
  background-size: contain;
  background-position: right center;
  background-repeat: no-repeat;
  height: auto; /* Pantalla completa */
  display: flex;
  align-items: center;
  justify-content: flex-start; /* Texto a la izquierda */
  padding-left: 1.5%;
  padding-right: 1.5%;
  background-color: #e8f5e98d; /* Color de fondo para el lado izquierdo*/
}

/* Contenedor del contenido de bienvenida */
.bienvenida-content {
  max-width: 38%;
  color: #000;
}

.bienvenida-imagen img {
  max-width: 100%;
  height: 50%;
  margin-left: 0.4rem;

  /*border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);*/
}

.bienvenida-content h2 {
  font-size: 5rem;
  font-weight: bold;
  margin-bottom: 2rem;
  margin-left: 0rem;
  margin-top: -5rem;
  text-align: center;
}

.verde {
  color: #2e7d32;
  margin-left: 0rem;
  text-align: center;
}

.bienvenida-content p {
  font-size: 1.5rem;
  margin-bottom: 0rem;
  margin-top: 0rem;
  margin-right: 3rem;
  margin-left: 3rem;
  text-align: justify;
}

.bienvenida-content .btn {
  margin-top: 2rem;
  margin-left: 6rem;
}

.registro-link {
  margin-top: 1rem;
  font-size: 1.3rem;
  text-align: center;
  color: #333;
  margin-left: 1rem;
}

.registro-link a {
  color: #2e7d32;
  font-weight: bold;
  text-decoration: none;
}

.registro-link a:hover {
  text-decoration: underline;
  color: #27642b;
}

/* Footer */
.footer {
  background-color: #2e7d32;
  color: white;
  text-align: center;
  padding: 1rem;
  font-size: 0.95rem;
  margin-top: 0rem;
  position: relative;
  bottom: 0;
  width: auto;
}

.footer p {
  margin: 0;
}

section.descubre,
section.proposito,
section.impacto {
  text-align: center;
  margin-left: 6%;
}

section.descubre::after,
section.proposito::after {
  content: "";
  display: block;
  height: 3px;
  width: 60%;
  margin: 2rem auto 0 auto;
  background: linear-gradient(to right, #2e7d32, #a5d6a7);
  border-radius: 2px;
  opacity: 0.8;
}

div.huella {
  background-image: url('../img/huella.jpg');
  margin: 1rem 0;
  padding: 0.5rem 0rem;
  background-size: contain;
  background-position:left;
  padding-bottom: 2rem;
}

section h2 {
  font-size: 2.2rem;
  /*color: #2e7d32;*/
  color: #000;
  margin-top: 1.3rem;
  margin-bottom: 1rem;
  align-items: center;
}

section p {
  font-size: 1.3rem;
  max-width: 700px;
  margin: 0 auto;
  color: #333;
   text-align: justify;
}

section.impacto ul {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2rem;
}

section.impacto li {
  background: #ffffff89;
  border: 1px solid #cce8cc;
  border-radius: 10px;
  padding: 1.5rem;
  font-size: 1.2rem;
  width: 250px;
  color: #2e7d32;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

/*------------------------------------------------------------------------------------------------------------------------------------*/
/* Estilos responsive para index.php */
@media (max-width: 768px) {
    .form-busqueda {
    flex-direction: column;
  }

  .form-busqueda input[type="text"] {
    width: 100%;
  }

  .form-busqueda button {
    width: 100%;
  }

    section.impacto ul {
    flex-direction: column;
    align-items: center;
  }

  section.impacto li {
    width: 80%;
  }

    .footer {
    font-size: 0.85rem;
    padding: 1rem 0.5rem;
  }

  .hamburger {
    display: block;
    z-index: 1;
    padding-left: 1rem;
  }
  
  .hamburger.open {
    display: flex;
  }

   .navbar {
    position: relative; /* para que el menú absoluto se ubique con base en este */
    z-index: 1;
  }

  nav ul.menu {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    padding-left: 1rem;
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    z-index: 1;
    background-color: #e8f5e9;
    margin: 0;
    padding: 1rem;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  }

  nav ul.menu.open {
    display: flex;
  }

   nav ul.menu li {
    width: 100%;
    margin: 0.5rem 0;
  }

  nav ul.menu li a {
    width: 100%;
    text-align: center;
    padding: 1rem;
  }

   .encabezado {
    width: 100%;
    margin-left: 0;
    margin-top: 0;
    background-position: center;
    height: 60px;
    margin-left: -2rem;
    margin-right: -4rem;
  }

  .logo h1 {
    font-size: 1.7rem;
    white-space: nowrap; /* Evita salto de línea */
}

.logo img {
    width: 65px;
    height: 65px;
}
  /* Sección de bienvenida */
 .bienvenida {
  height: auto; 
  background-size: cover; /* mejor para que se adapte a todo */
  background-position: center;
  flex-direction: column;
  justify-content: center;
}

.bienvenida-imagen img {
  width: 104%;
  height: auto;
  margin-top: 1rem;
  margin-left: -0.5rem;
}

.bienvenida-content .btn {
  width: 50%;
  display: block;
  margin: 2rem auto 1rem auto; /* top right bottom left */
  justify-content: center; /* esto no afecta botones individuales */
}


  /* Botón iniciar sesión */
  .btn {
    display: block;
    margin: 1rem auto;
    padding: 1rem;
    font-size: 1.2rem;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-radius: 8px;
    background-color: #2e8132;
    color: white;
    border: none;
  }

 .registro-link {
    display: none;
  }

  .bienvenida-content h2 {
  font-size: 3.6rem;
  margin-left: 0;
  margin-top: 10rem;
  text-align: center;
  min-width: 240px;
}

.verde {
  margin-left: 0;
  text-align: center;
}

.bienvenida-content {
  width: 100%;
  max-width: 100%;
  padding: 1rem;
  box-sizing: border-box;
}

.bienvenida-content p {
  max-width: none; /* Quita el límite */
  width: 80%;
  padding: 0 1rem;
  font-size: 1.3rem;
  margin-top: -1rem;
}

}

/* --- NUEVO HEADER MODERNO --- */
.main-header {
    background-color: #ffffff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0 1rem;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Logo */
.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #2e7d32;
    font-weight: bold;
    font-size: 1.4rem;
}

.header-logo img {
    height: 40px;
}

/* Navegación */
.header-nav {
    display: flex;
    gap: 20px;
}

.header-nav a {
    text-decoration: none;
    color: #666;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.header-nav a:hover,
.header-nav a.active {
    background-color: #e8f5e9; /* Verde muy suave */
    color: #2e7d32;
}

/* Área de Usuario */
.header-auth {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f1f3f4;
    padding: 5px 15px 5px 5px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
    color: #333;
}

.user-chip .avatar {
    background: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.btn-login {
    background: #2e7d32;
    color: white;
    padding: 0.5rem 1.2rem;
    border-radius: 20px;
    text-decoration: none;
    font-weight: bold;
}

.btn-logout {
    color: #d32f2f;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
}

/* --- ESTILOS COMUNIDAD (TIPO FACEBOOK) --- */
.feed-container {
    max-width: 700px;
    margin: 2rem auto;
}

.create-post-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.create-post-form textarea {
    width: 100%;
    border: none;
    background: #f0f2f5;
    padding: 1rem;
    border-radius: 12px;
    resize: none;
    font-family: inherit;
    margin-bottom: 1rem;
    outline: none;
    transition: background 0.2s;
}

.create-post-form textarea:focus {
    background: #e4e6eb;
}

.post-actions {
    display: flex;
    justify-content: flex-end;
}

.btn-post {
    background: #2e7d32;
    color: white;
    border: none;
    padding: 0.6rem 2rem;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
}

.btn-post:hover { background: #1b5e20; }

/* Tarjetas de Publicaciones */
.post-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.post-header {
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.post-avatar {
    width: 40px;
    height: 40px;
    background: #e8f5e9;
    color: #2e7d32;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.post-info h4 { margin: 0; font-size: 1rem; color: #050505; }
.post-info span { font-size: 0.8rem; color: #65676b; }

.post-content {
    padding: 0 1rem 1rem 1rem;
    font-size: 1.1rem;
    color: #050505;
    line-height: 1.5;
}

.post-footer {
    border-top: 1px solid #f0f2f5;
    padding: 0.5rem;
    display: flex;
    justify-content: space-around;
}

.action-btn {
    background: none;
    border: none;
    color: #65676b;
    font-weight: 600;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 5px;
    width: 100%;
}

.action-btn:hover { background: #f0f2f5; }

/* Responsive Header */
@media (max-width: 768px) {
    .header-nav { display: none; } /* En móvil se oculta el menú central (puedes reactivar tu hamburguesa después) */
}

/* --- ESTILOS DE COMENTARIOS Y LIKES MEJORADOS --- */

/* Contenedor de la sección de comentarios */
.comments-section {
    background-color: #f7f8fa; /* Fondo muy suave */
    padding: 15px 20px;
    border-top: 1px solid #eef0f2;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

/* Lista de comentarios */
.comment-bubble {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    align-items: flex-start;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    background-color: #e0e0e0;
    color: #555;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    flex-shrink: 0;
}

.comment-content {
    background-color: #ffffff;
    padding: 8px 12px;
    border-radius: 12px;
    border-top-left-radius: 2px; /* Efecto burbuja de chat */
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    font-size: 0.95rem;
    color: #333;
    line-height: 1.4;
    max-width: 90%;
}

.comment-author {
    font-weight: 600;
    color: #2e7d32; /* Verde marca */
    margin-right: 5px;
    font-size: 0.9rem;
    text-decoration: none;
}

.comment-text {
    color: #444;
}

.comment-date {
    display: block;
    font-size: 0.75rem;
    color: #999;
    margin-top: 4px;
    margin-left: 45px; /* Alineado con el texto */
    margin-bottom: 8px;
}

/* Formulario de nuevo comentario */
.comment-form {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    background: white;
    padding: 5px;
    border-radius: 25px;
    border: 1px solid #ddd;
    transition: border-color 0.3s;
}

.comment-form:focus-within {
    border-color: #2e7d32;
    box-shadow: 0 0 0 2px rgba(46, 125, 50, 0.1);
}

.comment-form input {
    flex: 1;
    border: none;
    padding: 8px 15px;
    outline: none;
    font-size: 0.95rem;
    background: transparent;
}

.comment-form button {
    background: none;
    border: none;
    color: #2e7d32; /* Verde activo */
    cursor: pointer;
    padding: 8px 15px;
    border-radius: 50%;
    transition: background 0.2s;
    font-size: 1.1rem;
}

.comment-form button:hover {
    background-color: #e8f5e9;
}

/* Ajustes de botones de acción (Like/Comentar) */
.post-footer {
    display: flex;
    justify-content: space-around; /* Distribución uniforme */
    padding: 10px 0;
    border-top: 1px solid #f0f2f5;
    margin-top: 5px;
}

.action-btn {
    flex: 1;
    background: none;
    border: none;
    color: #65676b;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.action-btn:hover {
    background-color: #f2f2f2;
}

/* Estado activo del Like */
.action-btn.liked {
    color: #2e7d32;
}

.action-btn.liked i {
    animation: pop 0.3s ease; /* Pequeña animación */
}

@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* --- NUEVOS ESTILOS COMUNIDAD v3 --- */

.post-image {
    width: 100%;
    max-height: 500px; /* Limita la altura máxima */
    overflow: hidden; /* Corta lo que sobre */
    background-color: #f0f0f0; /* Fondo gris mientras carga */
    border-radius: 8px; /* Bordes redondeados opcionales */
    margin-top: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.post-image img {
    width: 100%;
    height: 100%;
    max-height: 500px; /* Asegura que la imagen no crezca más */
    object-fit: contain; /* 'cover' recorta para llenar, 'contain' muestra toda la foto */
    display: block;
}

/* public/css/community_styles.css */

.comment-avatar-small {
    width: 35px;       /* Ancho fijo */
    height: 35px;      /* Alto fijo igual al ancho para que sea un círculo */
    flex-shrink: 0;    /* Evita que se aplaste si hay poco espacio */
    border-radius: 50%; /* Lo hace perfectamente circular */
    overflow: hidden;  /* Recorta cualquier parte de la imagen que se salga */
    
    /* Estilos para cuando se muestra la inicial (sin foto) */
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #e8f5e9; /* Color de fondo para la inicial */
    color: #2e7d32;            /* Color de letra para la inicial */
    font-weight: bold;
    font-size: 0.9rem;
    margin-right: 10px;        /* Separación con el texto del comentario */
}

/* Aseguramos que la imagen dentro se adapte al contenedor */
.comment-avatar-small img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Recorta la imagen para llenar el círculo sin deformarse */
}

/* --- ESTILOS RESPONSIVE PARA EL HEADER --- */

/* 1. Estilos base para el botón hamburguesa (oculto en PC) */
.menu-toggle {
    display: none; /* Oculto por defecto */
    font-size: 1.8rem;
    background: none;
    border: none;
    color: var(--primary, #2e7d32);
    cursor: pointer;
    padding: 0 10px;
}

/* 2. Clases auxiliares para imágenes de perfil (para limpiar el HTML) */
.user-avatar-img {
    width: 35px; height: 35px; border-radius: 50%; object-fit: cover; border: 2px solid white;
}
.user-avatar-placeholder {
    width: 35px; height: 35px; display: flex; align-items: center; justify-content: center; 
    background: #e8f5e9; color: #2e7d32; border-radius: 50%; font-weight: bold;
}
.btn-logout {
    margin-left: 10px; color: red; text-decoration: none; font-size: 0.9rem;
}

/* --- MEDIA QUERY (MÁGIA RESPONSIVE) --- */
/* Esto se activa cuando la pantalla mide menos de 768px (Tablets y Celulares) */
@media (max-width: 900px) {

    .header-container {
        /* Permitir que los elementos se envuelvan si es necesario */
        flex-wrap: wrap; 
        position: relative; /* Para posicionar el menú absoluto respecto a esto */
    }

    /* Mostrar el botón hamburguesa */
    .menu-toggle {
        display: block;
        order: 1; /* Ponerlo después del logo */
        margin-left: auto; /* Empujarlo a la derecha si es necesario */
        margin-right: 15px;
    }

    /* Ajustar la sección de usuario para que no estorbe */
    .header-auth {
        order: 2; /* Al final de la fila superior */
    }
    
    .username {
        display: none; /* Ocultar el nombre largo en móvil para ahorrar espacio */
    }

    /* El menú de navegación (links) */
    .header-nav {
        display: none; /* Oculto inicialmente */
        width: 100%;
        order: 3; /* Que baje a la siguiente línea */
        flex-direction: column; /* Lista vertical */
        background-color: white;
        padding: 10px 0;
        border-top: 1px solid #eee;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        
        /* Animación opcional */
        position: absolute;
        top: 60px; /* Altura del header aprox */
        left: 0;
        z-index: 1000;
    }

    /* Clase que agrega Javascript cuando haces click */
    .header-nav.active {
        display: flex;
    }

    .header-nav a {
        padding: 15px;
        border-bottom: 1px solid #f0f0f0;
        text-align: center; /* Centrar texto */
        width: 100%;
    }
    
    .header-nav a:hover {
        background-color: #f9f9f9;
    }
}