/* =============================================
   community.css — 커뮤니티 페이지 스타일
   ============================================= */

/* ===== Community Hero ===== */
.community-hero {
  position: relative;
  width: 100%;
  height: 280px;
  margin: -24px 0 28px;
  overflow: hidden;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.community-hero-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: high-quality;
}
.community-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15,10,30,0.3) 0%, rgba(15,10,30,0.1) 40%, rgba(250,245,255,0.8) 85%, rgba(250,245,255,1) 100%);
}
.community-hero-content {
  position: absolute;
  bottom: 32px;
  left: 0;
  right: 0;
  text-align: center;
}
.community-hero-title {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.community-hero-desc {
  font-size: 14px;
  color: var(--text-secondary);
}
@media (max-width: 520px) {
  .community-hero {
    height: 200px;
    margin: -16px 0 20px;
  }
  .community-hero-title { font-size: 24px; }
  .community-hero-content { bottom: 20px; }
}

/* 이벤트 배너 */
.community-event-banner {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 24px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  border: 1px solid rgba(245, 158, 11, 0.3);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(249, 115, 22, 0.06));
}
.event-badge {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  margin-top: 2px;
}
.event-content {
  flex: 1;
}
.event-title {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.event-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 2px;
}
.event-desc strong {
  color: #f59e0b;
  font-weight: 700;
}
.event-progress-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}
.event-progress-bar {
  flex: 1;
  height: 8px;
  background: rgba(245, 158, 11, 0.12);
  border-radius: 4px;
  overflow: hidden;
}
.event-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #f97316);
  border-radius: 4px;
  transition: width 0.6s ease-out;
}
.event-progress-text {
  font-size: 13px;
  font-weight: 700;
  color: #f59e0b;
  white-space: nowrap;
}
.event-completed {
  border-color: rgba(167, 139, 250, 0.3);
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.08), rgba(124, 58, 237, 0.06));
}
.event-completed .event-badge {
  background: linear-gradient(135deg, #7c3aed, #a78bfa);
}
.event-completed .event-progress-fill {
  background: linear-gradient(90deg, #7c3aed, #a78bfa);
}
.event-completed .event-progress-text {
  color: var(--text-accent);
}

/* 게시글 목록 */
.community-feed {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 게시글 카드 */
.community-post {
  padding: 20px;
  border-radius: var(--radius-md);
  transition: border-color 0.3s;
}
.community-post:hover {
  border-color: rgba(167, 139, 250, 0.3);
}
.community-post-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.community-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(167, 139, 250, 0.2);
  flex-shrink: 0;
}
.community-author {
  font-size: 14px;
  font-weight: 500;
}
.community-date {
  font-size: 12px;
  color: var(--text-secondary);
  margin-left: auto;
}
.community-post-body {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 12px;
}

/* 게시글 액션 (좋아요, 댓글) */
.community-actions {
  display: flex;
  gap: 16px;
}
.community-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: none;
  border-radius: var(--radius-full);
  background: rgba(245, 235, 250, 0.4);
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.3s, color 0.3s;
}
.community-action-btn:hover {
  background: rgba(167, 139, 250, 0.15);
  color: var(--text-accent);
}

/* 글쓰기 입력 */
.community-compose {
  padding: 20px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}
.community-compose-input {
  width: 100%;
  min-height: 80px;
  padding: 12px;
  border: 1px solid rgba(167, 139, 250, 0.2);
  border-radius: var(--radius-sm);
  background: rgba(245, 235, 250, 0.6);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
}
.community-compose-input:focus {
  outline: none;
  border-color: var(--violet-500);
}

/* 글쓰기 영역 */
.compose-top {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.compose-avatar {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}
.compose-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.compose-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.compose-tag {
  padding: 5px 12px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(167, 139, 250, 0.2);
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s;
  font-family: var(--font-sans);
}
.compose-tag.active {
  background: rgba(167, 139, 250, 0.2);
  border-color: rgba(167, 139, 250, 0.5);
  color: var(--text-accent);
}
.compose-submit {
  padding: 10px 24px;
  font-size: 14px;
  flex-shrink: 0;
}
.compose-login-msg {
  display: none;
  margin-top: 10px;
  font-size: 12px;
  color: var(--amber-500);
  text-align: center;
}
.compose-login-msg.show {
  display: block;
}

/* 카테고리 필터 */
.community-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin-bottom: 20px;
  padding-bottom: 4px;
}
.community-filters::-webkit-scrollbar {
  display: none;
}
.community-filter-tag {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(167, 139, 250, 0.2);
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s;
  white-space: nowrap;
  flex-shrink: 0;
  font-family: var(--font-sans);
}
.community-filter-tag.active,
.community-filter-tag:hover {
  background: rgba(167, 139, 250, 0.15);
  border-color: rgba(167, 139, 250, 0.4);
  color: var(--text-accent);
}

/* 카테고리 배지 */
.community-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  background: rgba(167, 139, 250, 0.15);
  color: var(--text-accent);
  margin-left: 8px;
}

/* 좋아요 활성 */
.community-action-btn.liked {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

/* 게시글 애니메이션 */
.community-post {
  animation: fadeInUp 0.4s ease-out both;
}
.community-post:nth-child(2) { animation-delay: 0.05s; }
.community-post:nth-child(3) { animation-delay: 0.1s; }
.community-post:nth-child(4) { animation-delay: 0.15s; }
.community-post:nth-child(5) { animation-delay: 0.2s; }

/* 게시글 숨기기 */
.community-post.hidden {
  display: none;
}

/* 아바타 이미지 */
.community-avatar img,
img.community-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.avatar-initial {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-accent);
}

/* 댓글 영역 */
.community-comments {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(167, 139, 250, 0.1);
}
.comment-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 0;
  font-size: 13px;
  line-height: 1.5;
}
.comment-author {
  font-weight: 600;
  color: var(--text-primary);
  flex-shrink: 0;
}
.comment-text {
  color: var(--text-secondary);
  word-break: break-word;
}
.comment-date {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-left: auto;
}
.comment-input-wrap {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.comment-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid rgba(167, 139, 250, 0.2);
  border-radius: var(--radius-sm);
  background: rgba(245, 235, 250, 0.4);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
}
.comment-input:focus {
  outline: none;
  border-color: var(--violet-500);
}
.comment-submit-btn {
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius-sm);
  background: rgba(167, 139, 250, 0.2);
  color: var(--text-accent);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s;
  font-family: var(--font-sans);
}
.comment-submit-btn:hover {
  background: rgba(167, 139, 250, 0.35);
}
.comments-loading {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  padding: 8px 0;
}

/* 빈 상태 */
.community-empty {
  text-align: center;
  padding: 60px 20px;
}
.community-empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
}
.community-empty-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.community-empty-sub {
  font-size: 14px;
  color: var(--text-muted);
}
