/* CSS: styles.css */

/* =====================
   Reset y estilos básicos
===================== */
body {
  margin: 0;
  font-family: Arial, sans-serif;
  background-color: #f4f9f4;
  color: #333;
}



/* =====================
   Header fijo con botones
===================== */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #6bbf59; /* verde kiwi */
  color: white;
  padding: 1rem;
}

header h1 {
  margin: 0;
}

.header-buttons button {
  background-color: white;
  color: #6bbf59;
  border: none;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  margin-left: 0.5rem;
  cursor: pointer;
  transition: background 0.3s;
}

.header-buttons button:hover {
  background-color: #e0f2e0;
}

/* =====================
   Contenedor principal
===================== */
.container {
  display: flex;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: auto;
  padding: 1rem;
}

.content {
  flex: 3;
  min-width: 300px;
  padding: 1rem;
}

.sidebar {
  flex: 1;
  min-width: 200px;
  background-color: #eaf7ea;
  padding: 1rem;
  border-radius: 12px;
  margin-top: 1rem;
  height: fit-content;
}

.sidebar h3 {
  margin-top: 0;
  color: #2e7d32;
  text-align: center;
}

.sidebar ul {
  list-style: none;
  padding-left: 0;
}

.sidebar ul li a {
  display: block;
  padding: 0.3rem 0;
  color: #2e7d32;
  text-decoration: none;
  transition: color 0.3s;
}

.sidebar ul li a:hover {
  color: #6bbf59;
}

/* =====================
   Título del post
===================== */
.post-title {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: #2e7d32;
  text-align: center;
}

/* =====================
   Comentarios
===================== */
.comment {
  background-color: white;
  border: 1px solid #d3e8d3;
  border-radius: 12px;
  margin-bottom: 1rem;
  padding: 1rem;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.comment-header {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: #666;
}

.comment-header img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-right: 0.5rem;
}

.comment-body {
  font-size: 1rem;
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.comment-actions a {
  display: inline-block;
  margin: 0.2rem 0.2rem 0 0;
  padding: 0.4rem 0.8rem;
  background-color: #6bbf59;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.9rem;
  transition: background 0.3s;
}

.comment-actions a:hover {
  background-color: #4a9b3d;
}
.comment-actions {
    text-align: right;
}


/* =====================
   Cuadro de respuesta
===================== */
.reply-box {
  margin-top: 2rem;
  background-color: white;
  border: 1px solid #d3e8d3;
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.reply-box textarea {
  width: 100%;
  min-height: 100px;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 0.5rem;
  font-size: 1rem;
  resize: vertical;
  margin-bottom: 0.5rem;
}

.reply-box button {
  background-color: #6bbf59;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 0.6rem 1.2rem;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s;
}

.reply-box button:hover {
  background-color: #4a9b3d;
}

/* =====================
   Paginación
===================== */
.pagination {
  text-align: center;
  margin-top: 2rem;
}

.pagination a {
  display: inline-block;
  margin: 0 0.3rem;
  padding: 0.5rem 0.8rem;
  background-color: #6bbf59;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.3s;
}

.pagination a:hover {
  background-color: #4a9b3d;
}

/* =====================
   Responsive para móviles
===================== */
@media (max-width: 768px) {
  .container {
    flex-direction: column;
  }

  .sidebar {
    order: -1;
    margin-bottom: 1rem;
  }
}

/* Citas dentro de comentarios */
.quote-box {
    border-left: 3px solid #6bbf59;
    background-color: #f0f9f0;
    padding: 0.5rem 1rem;
    margin: 0.5rem 0;
    border-radius: 6px;
    font-style: italic;
    color: #333;
    white-space: pre-wrap; /* Mantener saltos de línea */
}
/* ===========================
   Fix limpio para scroll lateral en móviles
=========================== */

/* Evitar que medios se salgan */
img, svg, iframe, video {
  max-width: 100%;
  height: auto;
  display: block;
  box-sizing: border-box;
}

/* Contenedores flexibles: permitir que los hijos encogan */
.container, .content, .sidebar, .comment, .reply-box, .pagination {
  min-width: 0;
  box-sizing: border-box;
}

/* Inputs, botones y textareas responsivos */
input, textarea, button, form input[type="text"] {
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/* Palabras, links o etiquetas largas que podrían empujar el layout */
.comment, .comment-header, .post-title, .sidebar ul li a, .post-tag {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Pequeña salvaguarda solo en móviles */
@media (max-width: 768px) {
  html, body { overflow-x: hidden; }
  .content, .sidebar { width: 100%; min-width: 0; }
  header img { max-width: 100%; height: auto; }
}

/* Imagenes posts */
.comment-image img,
.post-image img {
    display: block;
    max-width: 100%;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}



