/* src/main/resources/static/css/board/read.css */

/* --- 기본 (데스크톱) 스타일 --- */
.board-container {
  display: flex;
  gap: 30px;
  width: 1260px;
  margin: 30px auto 120px auto;
  font-family: 'Pretendard', sans-serif;
}

.board-content {
  width: 1010px;
  padding: 0 20px;
  box-sizing: border-box;
  margin: 0 auto;
}

/* 게시글 제목 + 메타 정보 */
.post-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding-bottom: 15px;
  border-bottom: 1px solid #eee;
}

.post-header h2 {
  font-size: 24px;
  margin-bottom: 10px;
  color: #333;
}

.post-meta {
  font-size: 14px;
  color: #777;
  display: flex;
  flex-wrap: wrap; /* 모바일에서 줄바꿈 되도록 */
  gap: 10px;
  margin-top: 10px;
}

.post-actions {
  flex-shrink: 0;
  display: flex;
  gap: 10px;
  align-items: center;
}

.post-actions form {
  margin: 0;
  display: inline;
}

.post-actions button {
  cursor: pointer;
  padding: 6px 14px;
  background-color: #eee;
  border: 1px solid #ccc;
  border-radius: 4px;
  transition: background-color 0.3s ease;
  margin-bottom: 5px;
}

.post-actions button:hover {
  background-color: #ddd;
}

/* 본문 내용 */
.post-body {
  font-size: 16px;
  line-height: 1.6;
  color: #222;
  padding: 20px 0;
  white-space: pre-line;
  word-break: break-word;
}

/* 추천 버튼 */
.recommend-buttons {
  justify-content: center;
  margin-top: 20px;
  display: flex;
  gap: 10px;
}

.recommend-buttons button {
  padding: 8px 14px;
  border: none;
  border-radius: 6px;
  background-color: #ff6f61;
  color: white;
  cursor: pointer;
  transition: 0.2s ease;
}

/* ===== 댓글 리뉴얼 ===== */
.comment-section { margin-top: 40px; }
.comment-title { font-size: 18px; margin-bottom: 16px; color: #222; font-weight: 600; }
.comment-empty { color: #888; background: #fafafa; border: 1px dashed #ddd; padding: 16px; border-radius: 8px; }

.comment-item {
  border: 1px solid #e9e9e9;
  border-radius: 12px;
  background: #fff;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

.c-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.c-author-wrap { display: flex; gap: 12px; align-items: center; }
.c-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: #f1f4ff; color: #335bff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
  border: 1px solid #e2e7ff;
}
.c-name-meta { display: flex; flex-direction: column; gap: 2px; }
.c-author { display: flex; align-items: center; gap: 8px; color: #111; }
.c-badge {
  font-size: 12px; color: #555; background: #f2f2f2;
  border-radius: 999px; padding: 2px 8px; line-height: 1.4;
}
.c-meta { font-size: 12px; color: #777; display: flex; gap: 8px; }

.c-actions { display: inline-flex; }
.c-action-btn {
  border: none; background: transparent; color: #999; cursor: pointer;
  font-size: 16px; padding: 2px 4px; line-height: 1;
  transition: color .15s ease;
}
.c-action-btn:hover { color: #ff4d4f; }

.c-body { margin-top: 6px; }
.c-text { margin: 0; color: #333; font-size: 15px; line-height: 1.6; white-space: pre-wrap; white-space: pre-line; word-break: break-word; }

/* 작성 폼 */
.card-like {
  border: 1px solid #e9e9e9; border-radius: 12px; background: #fff;
  padding: 14px; margin-top: 16px; box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}
.c-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 8px; }
.c-input, .c-textarea {
  width: 100%; border: 1px solid #ddd; border-radius: 8px;
  padding: 10px 12px; font-size: 14px; box-sizing: border-box;
}
.c-input:focus, .c-textarea:focus { outline: none; border-color: #377dff; box-shadow: 0 0 0 3px rgba(55,125,255,.12); }
.c-textarea { resize: none; min-height: 90px; }
.c-form-actions { display: flex; justify-content: flex-end; margin-top: 8px; }
.c-submit {
  padding: 8px 14px; background-color: #377dff; border: none; color: #fff;
  border-radius: 8px; cursor: pointer; transition: background-color .15s ease;
}
.c-submit:hover { background-color: #2f6ee8; }


/* --- ✅ 모바일 화면용 스타일 (768px보다 작을 때) --- */
@media (max-width: 767.98px) {
  /* 게시판 컨테이너: 사이드바와 내용물을 세로로 쌓음 */
  .board-container {
    flex-direction: column;
    width: 100%;
    padding: 0 15px; /* 좌우 여백 */
    margin: 20px auto 60px auto;
    box-sizing: border-box;
  }

  /* 게시글 내용 영역: 너비를 꽉 채움 */
  .board-content {
    width: 100%;
    padding: 0;
  }

  /* 게시글 헤더: 제목과 버튼을 세로로 쌓고, 왼쪽 정렬 */
  .post-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  /* 댓글 폼: 비회원 입력창을 세로로 쌓음 */
  .c-form-row {
    grid-template-columns: 1fr; /* 2열 그리드를 1열로 변경 */
  }
}