/* AICRA Community — main.css 디자인 토큰 활용 */

.community-page {
  max-width: var(--content-width, 760px);
  margin: 0 auto;
}

.community-auth-bar {
  margin-top: var(--space-4, 16px);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: var(--space-4, 16px);
  flex-wrap: wrap;
}

.community-auth-bar strong {
  color: var(--text);
}

.community-auth-bar .btn-text {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.community-intro {
  margin-bottom: var(--space-8, 32px);
  color: var(--text-muted);
  line-height: var(--leading, 1.8);
}

.community-panel {
  margin-bottom: var(--space-12, 48px);
}

.community-panel.hidden,
.community-tab.hidden,
.community-compose.hidden,
.community-detail.hidden,
.community-form.hidden {
  display: none !important;
}

.community-segment {
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: var(--space-6, 24px);
}

.community-segment-btn {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  padding: 0.45rem 1rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.community-segment-btn:hover {
  color: var(--text);
}

.community-segment-btn.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.community-app-tabs {
  display: flex;
  flex-wrap: wrap;
}

.community-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4, 16px);
  max-width: 480px;
}

.community-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2, 8px);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.community-field span {
  font-weight: 500;
}

.community-input,
.community-textarea,
.community-select,
.community-file {
  font-family: var(--font-sans);
  font-size: var(--text-base, 17px);
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  width: 100%;
  box-sizing: border-box;
}

.community-textarea {
  resize: vertical;
  min-height: 120px;
  line-height: var(--leading, 1.8);
}

.community-input:focus,
.community-textarea:focus,
.community-select:focus {
  outline: 2px solid var(--accent-secondary);
  outline-offset: 1px;
}

.community-error {
  color: var(--danger);
  font-size: 0.9rem;
  margin-top: var(--space-2, 8px);
}

.community-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4, 16px);
  margin-bottom: var(--space-6, 24px);
}

.community-toolbar h2,
.community-tab .section-header h2 {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  margin: 0;
}

.community-toolbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3, 12px);
}

.community-select {
  width: auto;
  min-width: 120px;
}

.community-compose {
  padding: var(--space-6, 24px);
  margin-bottom: var(--space-6, 24px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: var(--space-3, 12px);
}

.community-posts-grid,
.community-files-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-4, 16px);
}

.community-posts-grid .post-card {
  cursor: pointer;
}

.community-card-thumb {
  min-height: 80px;
  display: flex;
  align-items: flex-end;
  padding: var(--space-3, 12px);
  background: var(--surface-alt);
}

.community-card-thumb .post-card-category {
  position: static;
}

.community-detail {
  margin-top: var(--space-4, 16px);
}

.community-article {
  margin: var(--space-6, 24px) 0;
  line-height: var(--leading, 1.8);
}

.community-article h2 {
  font-family: var(--font-serif);
  margin: var(--space-4, 16px) 0;
}

.community-article .post-body {
  white-space: pre-wrap;
  font-family: var(--font-sans);
}

.community-comments {
  margin: var(--space-8, 32px) 0;
  padding-top: var(--space-6, 24px);
  border-top: 1px solid var(--divider);
}

.community-comment {
  padding: var(--space-4, 16px) 0;
  border-bottom: 1px solid var(--divider);
}

.community-comment:last-child {
  border-bottom: none;
}

.community-comment-author {
  font-weight: 600;
  font-family: var(--font-sans);
  margin-right: var(--space-2, 8px);
}

.community-comment time {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.community-comment p {
  margin: var(--space-2, 8px) 0 0;
  line-height: var(--leading, 1.8);
}

.community-comment-form {
  margin-top: var(--space-6, 24px);
  max-width: 100%;
}

.community-upload {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-3, 12px);
  margin-bottom: var(--space-6, 24px);
  padding: var(--space-4, 16px);
  background: var(--surface-alt);
  border-radius: 8px;
}

.community-upload .community-input {
  flex: 1;
  min-width: 160px;
}

.community-file-card {
  padding: var(--space-4, 16px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: box-shadow 0.15s;
}

.community-file-card:hover {
  box-shadow: var(--shadow-md);
}

.community-file-card h3 {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  margin: 0 0 var(--space-2, 8px);
}

.community-file-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: var(--space-3, 12px);
}

.community-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3, 12px);
}

.community-chat-messages {
  min-height: 300px;
  max-height: 440px;
  overflow-y: auto;
  padding: var(--space-4, 16px);
  margin-bottom: var(--space-4, 16px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.community-chat-msg {
  margin-bottom: var(--space-4, 16px);
  padding-bottom: var(--space-3, 12px);
  border-bottom: 1px solid var(--divider);
}

.community-chat-msg:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.community-chat-msg .author {
  font-weight: 600;
  font-family: var(--font-sans);
  color: var(--accent-secondary);
}

.community-chat-msg time {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: var(--space-2, 8px);
}

.community-chat-msg .text {
  margin-top: var(--space-2, 8px);
  line-height: 1.6;
}

.community-chat-form {
  display: flex;
  gap: var(--space-3, 12px);
}

.community-chat-form .community-input {
  flex: 1;
}

.community-guidelines {
  margin-top: var(--space-16, 64px);
  padding-top: var(--space-8, 32px);
  border-top: 1px solid var(--divider);
}

.community-guidelines h2 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  margin-bottom: var(--space-4, 16px);
}

.community-guidelines ul {
  padding-left: 1.25rem;
  color: var(--text-muted);
  line-height: var(--leading, 1.8);
}

.community-guidelines li {
  margin-bottom: var(--space-2, 8px);
}

[data-theme="dark"] .community-segment {
  background: var(--surface-alt);
}

[data-theme="dark"] .community-chat-messages,
[data-theme="dark"] .community-compose,
[data-theme="dark"] .community-file-card {
  background: var(--surface);
}
