.talk-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  font-family: 'Pretendard', sans-serif;
}

h2, h3 {
  font-weight: 700;
  margin-bottom: 15px;
}

/* 🔥 인기 학교 */
.popular-schools {
  padding: 10px 0;
  margin-bottom: 24px;
  border-bottom: 1px solid #eee;
}

.popular-schools h3 {
  font-size: 16px;
  font-weight: 600;
  color: #222;
  margin-bottom: 10px;
}

.popular-schools ol {
  list-style: none;
  padding: 0;
  margin: 0;
}

.popular-schools li {
  font-size: 14px;
  color: #444;
  padding: 4px 0;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #f0f0f0;
}

.popular-schools li:last-child {
  border-bottom: none;
}

.popular-schools li span:first-child {
  width: 24px;
  font-weight: 600;
  color: #555;
}


/* 🎓 학교 필터 */
.search-form {
  margin: 30px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.search-form select,
.search-form input[type="text"] {
  height: 36px;
  padding: 6px 10px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
}
.search-btn {
  background-color: #008ddc;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 20px;
  font-size: 14px;
  cursor: pointer;
}

/* ✍️ 글쓰기 폼 */
#postForm {
  margin-bottom: 30px;
}
#postForm .form-group {
  margin-bottom: 10px;
}
#postForm input,
#postForm textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
}
#postForm button {
  padding: 8px 16px;
  background-color: #008ddc;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: bold;
}
.image-upload-label {
  font-size: 18px;
  cursor: pointer;
  margin-left: 10px;
}

/* 🧾 게시글 카드 */
.post-card {
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 15px;
  background: #fff;
  margin-bottom: 20px;
  text-align: left;
  position: relative;
  max-width: 760px;
  margin: 0 auto 20px auto; /* ⬅ 가운데 정렬 */
}
.card-title {
  font-size: 18px;
  font-weight: bold;
}
.card-subtitle {
  font-size: 13px;
  color: #777;
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
}

/* ⏳ 작성 시간 */
.card-time {
  font-size: 12px;
  color: #aaa;
  margin-top: 5px;
}

/* 📄 게시글 본문 */
.card-text {
  margin-top: 8px;
  line-height: 1.5;
  word-break: break-word;  /* ✅ 추가 */
}

/* 더보기 버튼 */
.btn-link {
  font-size: 13px;
  color: #007bff;
  cursor: pointer;
}

/* 💬 댓글 */
.comments {
  margin-top: 20px;
}
.comment {
  background-color: #f9f9f9;
  padding: 10px 15px;
  margin-bottom: 10px;
  border-radius: 8px;
  border: 1px solid #eee;
  text-align: left;
  position: relative;
}
.comment .author {
  font-weight: bold;
  color: #333;
}
.comment .content {
  margin: 6px 0;
  font-size: 14px;
  white-space: pre-line;
}
.comment small {
  color: #999;
}

/* ❤️ 좋아요, 삭제, 신고 버튼 */
.like-button {
  background: none;
  border: none;
  color: #888;
  font-size: 13px;
  margin-right: 8px;
  cursor: pointer;
}
.like-button:hover {
  color: #ff3d3d;
}
.btn-delete {
  background-color: #dc3545;
  color: white;
  border: none;
  padding: 4px 8px;
  border-radius: 5px;
  font-size: 12px;
  cursor: pointer;
  margin-left: 5px;
}
.comment .btn-delete:hover {
  background-color: #c82333;
}

/* ✍️ 댓글 폼 */
.comment-form,
.reply-form {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
}
.comment-form input,
.reply-form input {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
}
.comment-form button,
.reply-form button {
  padding: 6px 12px;
  background: #28a745;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
}
.uploaded-image-preview {
  max-height: 100px;
  margin-top: 8px;
  display: block;
  border-radius: 6px;
  max-width: 100%;  /* ✅ 추가 */
}

/* ⛔ 신고/블라인드 토글 메뉴 */
.action-menu {
  position: relative;
}

.action-button {
  background: none;
  border: none;
  font-size: 18px;
  color: #888;
  cursor: pointer;
  padding: 0;
}

.action-dropdown {
  display: none;
  position: absolute;
  right: 0;
  background: white;
  border: 1px solid #ccc;
  z-index: 100;
  padding: 5px;
  border-radius: 6px;
}

.action-dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  border: none;
  background: none;
  font-size: 14px;
  color: #333;
}
.action-dropdown button:hover {
  background-color: #f1f1f1;
}

/* 전체 정렬 개선 */
.post-card, .comment, .form-group, .comment-form, .reply-form {
  text-align: left;
}

.action-button {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
}

.action-dropdown button {
  display: block;
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 4px 10px;
  font-size: 0.9em;
  cursor: pointer;
}

.action-dropdown button:hover {
  background-color: #f0f0f0;
}

/* ✅ talk-container 내부 요소들의 너비 제한 및 줄바꿈 보장 */
.talk-container * {
  max-width: 100%;
  box-sizing: border-box;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* ✅ 이미지가 talk-container를 넘지 않도록 처리 */
.post-card img,
.comment img,
.reply img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ✅ 코드 블록이나 긴 문자열 대응 */
pre, code {
  white-space: pre-wrap;
  word-break: break-word;
}

/* ✅ 광고 배너 */
.ad-banner img {
  max-width: 100%;
  height: auto;
  border: 1px solid #ddd;
  transition: transform 0.3s ease;
}

.ad-banner img:hover {
  transform: scale(1.02);
}

@media (max-width: 768px) {
  .talk-container {
    padding: 16px;
  }

  .popular-schools h3 {
    font-size: 15px;
  }

  .popular-schools li {
    font-size: 13px;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .search-form {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .search-form select,
  .search-form input[type="text"],
  .search-btn {
    width: 100%;
  }

  #postForm input,
  #postForm textarea {
    font-size: 14px;
  }

  .post-card {
    padding: 12px;
  }

  .card-title {
    font-size: 16px;
  }

  .card-subtitle {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    font-size: 12px;
  }

  .comment-form,
  .reply-form {
    flex-direction: column;
    align-items: stretch;
  }

  .comment-form input,
  .reply-form input {
    width: 100%;
  }

  .comment-form button,
  .reply-form button {
    width: 100%;
    font-size: 13px;
  }

  .btn-delete,
  .like-button {
    font-size: 12px;
  }

  .image-upload-label {
    font-size: 16px;
  }

  .ad-banner img {
    margin-top: 10px;
  }
}

@media (max-width: 480px) {
  .card-title {
    font-size: 15px;
  }

  .comment .content {
    font-size: 13px;
  }

  .card-time {
    font-size: 11px;
  }

  .search-btn {
    padding: 8px 14px;
    font-size: 13px;
  }

  .action-button {
    font-size: 16px;
  }

  .action-dropdown button {
    font-size: 13px;
    padding: 6px 10px;
  }

  .btn-link {
    font-size: 12px;
  }

  .talk-container {
    padding: 12px;
  }
}
