/* =========================
   COMUNIDAD PAGE STYLES
========================= */
/* CREATE POST */
.cm-create-post {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 40px;
}

.cm-create-post h3 {
  margin-bottom: 16px;
}

.cm-post-form {
  display: flex;
  gap: 12px;
}

.cm-post-input {
  flex: 1;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  transition: var(--transition);
}

.cm-post-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.cm-post-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  font-family: inherit;
}

.cm-post-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

/* CATEGORIES */
.cm-categories {
  display: flex;
  gap: 12px;
  margin-bottom: 40px;
  overflow-x: auto;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.cm-categories::-webkit-scrollbar {
  display: none;
}

.cm-cat-btn {
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
  font-size: 0.9rem;
  transition: var(--transition);
  font-family: inherit;
}

.cm-cat-btn.active {
  background: var(--primary);
  color: white;
  border: none;
}

.cm-cat-btn:not(.active) {
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--border);
}

.cm-cat-btn:not(.active):hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* FEED */
.cm-feed {
  display: grid;
  gap: 24px;
  margin-bottom: 48px;
}

/* POST CARD */
.cm-post {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: var(--transition);
}

.cm-post:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(34, 197, 94, 0.3);
}

.cm-post-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  gap: 12px;
}

.cm-post-author h3 {
  font-weight: 600;
  margin-bottom: 4px;
}

.cm-post-meta {
  font-size: 0.85rem;
  color: var(--muted);
}

.cm-post-badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.cm-post-badge.expert {
  background: var(--primary);
  color: white;
  text-transform: uppercase;
}

.cm-post-badge.trending {
  background: #f59e0b;
  color: white;
}

.cm-post-title {
  font-weight: 500;
  margin-bottom: 12px;
}

.cm-post-body {
  margin-bottom: 12px;
  line-height: 1.6;
}

.cm-post-body.muted {
  color: var(--muted);
}

.cm-post-gallery {
  background: var(--surface-2);
  height: 250px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.cm-post-actions {
  display: flex;
  gap: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}

.cm-action-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.9rem;
  padding: 4px 0;
  transition: var(--transition);
  font-family: inherit;
}

.cm-action-btn:hover {
  color: var(--primary);
}

/* RULES CTA */
.cm-rules {
  background: linear-gradient(135deg, #f7f8fa 0%, #f1f5f9 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 40px;
  text-align: center;
  margin-bottom: 60px;
}

.cm-rules h2 {
  margin-bottom: 16px;
}

.cm-rules-intro {
  color: var(--muted);
  max-width: 600px;
  margin: 0 auto 24px;
  line-height: 1.6;
}

.cm-rules-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  text-align: left;
  max-width: 600px;
  margin: 0 auto;
}

.cm-rule h4 {
  margin-bottom: 8px;
  color: var(--primary);
}

.cm-rule p {
  font-size: 0.85rem;
  color: var(--muted);
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 768px) {
  .cm-hero {
    padding: 32px 0 24px;
  }

  .cm-post-form {
    flex-direction: column;
  }

  .cm-post-btn {
    width: 100%;
  }

  .cm-rules {
    padding: 28px 20px;
  }

  .cm-rules-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .cm-post-actions {
    gap: 10px;
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .cm-post {
    padding: 16px;
  }

  .cm-post-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .cm-rules-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
