/* ================================
   미니 피드 스타일 (인스타그램 스타일)
================================ */

.feed-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 16px;
}

#feed-main-view.hidden {
  display: none;
}

.feed-card-author-clickable {
  cursor: pointer;
}

.feed-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.feed-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

#feed-write-btn {
  font-size: 13px;
  padding: 6px 10px;
  width: auto;
  min-width: auto;
}

.feed-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* 게시물 카드 */
.feed-card {
  background: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  border: var(--card-border);
  box-shadow: var(--card-shadow);
}

.feed-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  gap: 12px;
}

.feed-card-author {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.feed-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--card-bg-solid);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.feed-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.feed-avatar .avatar-fallback {
  font-size: 20px;
}

.feed-card-author-info {
  min-width: 0;
}

.feed-card-author-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
}

.feed-card-time {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: 6px;
}

.feed-card-menu {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.feed-card-image-wrap {
  width: 100%;
  aspect-ratio: 1;
  background: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feed-card-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.feed-card-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 16px;
}

.feed-card-action-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 24px;
  cursor: pointer;
  padding: 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.feed-card-action-btn.liked {
  color: #ed4956;
}

.feed-card-action-btn span {
  font-size: 14px;
  font-weight: 500;
}

.feed-card-caption {
  padding: 0 16px 12px;
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.5;
}

.feed-card-caption .author-name {
  font-weight: 600;
  margin-right: 6px;
}

.feed-card-caption .more-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 0;
}

.feed-loading {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
}

.feed-loading.hidden {
  display: none;
}

.feed-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 14px;
}

/* 피드 프로필 뷰 (사용자 게시물만 그리드) */
.feed-profile-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 16px;
}

.feed-profile-container.hidden {
  display: none;
}

.feed-profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--card-border, #333);
}

.feed-profile-back {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
  flex-shrink: 0;
}

.feed-profile-info {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
}

.feed-profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--card-bg-solid);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.feed-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.feed-profile-avatar .avatar-fallback {
  font-size: 36px;
}

.feed-profile-meta {
  min-width: 0;
}

.feed-profile-nickname {
  margin: 0 0 4px 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}

.feed-profile-stats {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
}

.feed-profile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.feed-profile-grid-item {
  aspect-ratio: 1;
  background: #1a1a1a;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feed-profile-grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 글쓰기 모달 */
.feed-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.feed-modal.hidden {
  display: none;
}

.feed-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 0;
}

.feed-modal-content {
  position: relative;
  z-index: 1;
  background: var(--card-bg);
  border-radius: 16px;
  padding: 24px;
  max-width: 480px;
  width: 100%;
  border: var(--card-border);
  max-height: 90vh;
  overflow-y: auto;
}

.feed-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.feed-modal-header h2 {
  margin: 0;
  font-size: 18px;
  color: var(--text-primary);
}

.feed-modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}

.feed-write-form textarea {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: var(--card-border);
  background: var(--card-bg-solid);
  color: var(--text-primary);
  font-size: 14px;
  resize: vertical;
  margin-bottom: 12px;
  box-sizing: border-box;
}

.feed-write-preview {
  margin-bottom: 16px;
  min-height: 120px;
}

.feed-write-preview img {
  max-width: 100%;
  max-height: 280px;
  border-radius: 8px;
  display: block;
  margin-bottom: 8px;
}

.feed-write-preview img.hidden {
  display: none;
}

.feed-write-image-label {
  display: inline-block;
  padding: 10px 16px;
  background: var(--gold-primary);
  color: #000;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}

.feed-write-image-label input {
  display: none;
}

/* 댓글 상세 모달 (좌측 이미지 + 우측 댓글) */
.feed-comment-panel {
  position: relative;
  z-index: 1;
  display: flex;
  max-width: 900px;
  width: 100%;
  max-height: 85vh;
  background: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  border: var(--card-border);
}

.feed-comment-left {
  flex: 0 0 50%;
  max-width: 450px;
  background: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feed-comment-left img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.feed-comment-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-height: 85vh;
}

.feed-comment-header {
  padding: 12px 16px;
  border-bottom: var(--card-border);
  display: flex;
  justify-content: flex-end;
}

.feed-comment-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

.feed-comment-post-info {
  padding: 16px;
  border-bottom: var(--card-border);
}

.feed-comment-author {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.feed-comment-author .feed-avatar {
  width: 36px;
  height: 36px;
}

.feed-comment-author-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
}

.feed-comment-time {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: 8px;
}

.feed-comment-caption {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.5;
  margin: 0;
  white-space: pre-wrap;
}

.feed-comment-actions {
  padding: 8px 16px;
  border-bottom: var(--card-border);
}

.feed-action-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 0;
}

.feed-action-btn.liked {
  color: #ed4956;
}

.feed-comment-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
}

.feed-comment-item {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.feed-comment-item .feed-avatar {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.feed-comment-item-body {
  flex: 1;
  min-width: 0;
}

.feed-comment-item-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.feed-comment-item-author {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
}

.feed-comment-item-time {
  font-size: 12px;
  color: var(--text-muted);
}

.feed-comment-item-content {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.4;
}

.feed-comment-item-delete {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  padding: 0 4px;
}

/* 답글(대댓글) 들여쓰기 */
.feed-comment-item-reply {
  margin-left: 24px;
}

.feed-comment-item-actions {
  margin-top: 4px;
}

.feed-comment-reply-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
}

.feed-comment-replies {
  margin-top: 8px;
}

.feed-comment-replies-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  margin-bottom: 4px;
}

.feed-comment-replies-list {
  margin-top: 4px;
}

.feed-comment-replies-list.hidden {
  display: none;
}

.feed-comment-footer {
  padding: 12px 16px;
  border-top: var(--card-border);
  background: var(--card-bg-solid);
}

.feed-comment-summary {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.feed-comment-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.feed-comment-input-row input {
  flex: 1;
  padding: 10px 12px;
  border: var(--card-border);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text-primary);
  font-size: 14px;
}

.feed-comment-input-row input::placeholder {
  color: var(--text-muted);
}

.feed-comment-submit {
  background: none;
  border: none;
  color: #0095f6;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  padding: 8px;
}

.feed-comment-submit:disabled {
  color: var(--text-muted);
  cursor: not-allowed;
}

/* 모바일: 댓글 패널 세로 스택 */
@media (max-width: 768px) {
  .feed-comment-panel {
    flex-direction: column;
    max-height: 90vh;
  }

  .feed-comment-left {
    max-width: none;
    flex: 0 0 300px;
    min-height: 300px;
  }

  .feed-comment-right {
    max-height: none;
    flex: 1;
    overflow-y: auto;
  }
}
