/* Base */
body {
  margin: 0;
  font-family: "Libre Baskerville", Georgia, serif;
  background: linear-gradient(135deg, rgb(255, 248, 240), rgb(243, 230, 216));
  color: rgb(74, 52, 40);
  min-height: 100vh;
}

.forum-shell {
  max-width: 1150px;
  margin: 40px auto;
  background: rgb(255, 250, 244);
  border-radius: 16px;
  overflow: visible;
}

.forum-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid rgb(230, 214, 197);
  gap: 20px;
  font-family: "Inter", "Segoe UI", sans-serif;
}

/* Header left side */
.header-left {
  display: flex;
  align-items: center;
  gap: 40px;
}

.logo {
  font-size: 1.1em;
  font-weight: bold;
  letter-spacing: 0.8px;
}

.auth-links {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: "Inter", "Segoe UI", sans-serif;
}

.auth-links a,
.auth-links button {
  margin: 0;
  background: none;
  border: none;
  color: rgb(122, 90, 68);
  cursor: pointer;
  font-size: 1em;
  text-decoration: underline;
}

/* Header right side (Register, Login, Category, Search) */
.main-nav {
  display: flex;
  gap: 22px;
}

.nav-link {
  font-size: 1em;
  color: rgb(122, 90, 68);
  text-decoration: none;
  position: relative;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 1px;
  background: rgb(168, 122, 79);
  transition: width 0.25s ease;
}

.nav-link:hover::after {
  width: 100%;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}

.header-search {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-search select {
  width: 115px;
  padding: 6px 12px;
  font-size: 0.85em;
  border-radius: 20px;
  border: 1px solid rgb(215, 195, 175);
  background: rgb(255, 250, 244);
  color: rgb(74, 52, 40);
  font-family: "Inter", "Segoe UI", sans-serif;
  outline: none;
  cursor: pointer;
  box-sizing: border-box;
}

.header-search select:focus {
  border-color: rgb(168, 122, 79);
  box-shadow: 0 0 0 2px rgba(168, 122, 79, 0.3);
}

.header-search button {
  padding: 6px 14px;
  font-size: 0.8em;
  border-radius: 20px;
  border: 1px solid rgb(215, 195, 175);
  background: linear-gradient(180deg, rgb(198, 156, 109), rgb(168, 122, 79));
  color: rgb(255, 255, 255);
  cursor: pointer;
  font-family: "Inter", "Segoe UI", sans-serif;
}

.header-search button:hover {
  box-shadow: 0 4px 10px rgba(168, 122, 79, 0.35);
}

.header-search input {
  width: 115px;
  width: 100px;
  padding: 6px 10px;
  font-size: 0.85em;
  border-radius: 20px;
  border: 1px solid rgb(215, 195, 175);
  outline: none;
}

.header-search input:focus {
  border-color: rgb(168, 122, 79);
  box-shadow: 0 0 0 2px rgba(168, 122, 79, 0.3);
}

.nav-dropdown {
  position: relative;
}

.dropdown-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  outline: none;
  font-size: 1em;
  font-family: "Inter", "Segoe UI", sans-serif;
}

.dropdown-menu {
  position: absolute;
  top: 140%;
  left: 0;
  min-width: 220px;
  background: rgb(255, 250, 244);
  border: 1px solid rgb(230, 214, 197);
  border-radius: 12px;
  padding: 10px 0;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.08);
  font-family: "Inter", "Segoe UI", sans-serif;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: all 0.2s ease;
  z-index: 20;
}

.dropdown-menu a {
  display: block;
  padding: 10px 18px;
  font-size: 0.85em;
  color: rgb(74, 52, 40);
  text-decoration: none;
}

.dropdown-menu a:hover {
  background: rgba(198, 156, 109, 0.15);
}

.nav-dropdown:focus-within .dropdown-menu {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.nav-link,
.auth-links a,
.auth-links button, .header-left {
  white-space: nowrap;
}

/* Center */
.center-panel {
  padding: 40px 28px 60px;
}

/* Everything related to post show*/
.primary-btn {
  font-family: "Libre Baskerville", Georgia, serif;
  display: block;
  width: fit-content;
  margin: 0 auto 26px;
  padding: 16px 28px;
  border-radius: 50px;
  background: linear-gradient(180deg, rgb(198, 156, 109), rgb(168, 122, 79));
  color: rgb(255, 255, 255);
  text-decoration: none;
  text-align: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.primary-btn:hover,
.create-post-form button.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(168, 122, 79, 0.4);
}

.post-card {
  background: rgb(255, 255, 255);
  border: 1px solid rgb(230, 214, 197);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 20px;
}

.post-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.post-header a {
  color: rgb(74, 52, 40);
  text-decoration: none;
}

.post-date {
  font-size: 0.75em;
  color: rgb(138, 106, 84);
}

.post-meta {
  font-size: 0.85em;
  color: rgb(122, 90, 68);
  margin: 6px 0 10px;
}

.post-preview {
  font-size: 0.95em;
  line-height: 1.4;
}

.post-footer {
  margin-top: 14px;
}
.comment .like-btn {
  margin-top: 16px;
}

.like-btn {
  background: none;
  border: 1px solid rgb(215, 195, 175);
  border-radius: 30px;
  padding: 6px 14px;
  cursor: pointer;
}

.feed .post-image {
  display: flex;
  justify-content: center;
  margin: 12px 0;
}

.feed .post-image img {
  width: 90%;
  max-width: 700px;
  height: 240px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}

/* Everything related to post creation */

.create-post-form .form-group {
  width: 100%;
  max-width: 900px;
  margin: 0 auto 20px auto;
  display: grid;
  grid-template-columns: 180px 1fr;
  column-gap: 24px;
  align-items: start;
}

.create-post-form-container h1 {
  text-align: center;
  margin-top: 20px;
  margin-bottom: 30px;
  padding: 18px 24px;
  font-size: 2em;
  gap: 20px;
}

.create-post-form label {
  text-align: right;
  padding-top: 10px;
  font-size: 0.9em;
  color: rgb(74, 52, 40);
}

.create-post-form input[type="text"],
.create-post-form select,
.create-post-form textarea,
.create-post-form input[type="file"] {
  padding: 10px 14px;
  border: 1px solid rgb(215, 195, 175);
  border-radius: 8px;
  font-size: 0.95em;
  font-family: "Libre Baskerville", Georgia, serif;
  outline: none;
  width: 100%;
  max-width: 500px;
  margin: 0;
  box-sizing: border-box;
}
.create-post-form textarea {
  min-height: 120px;
  resize: vertical;
}

.create-post-form button.primary-btn {
  border: none;
  border-radius: 50px;
  width: 100%;
  max-width: 200px;
  background: linear-gradient(180deg, rgb(198, 156, 109), rgb(168, 122, 79));
  color: rgb(255, 255, 255);
  font-size: 1em;
  text-align: center;
  cursor: pointer;
  margin-top: 12px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.create-post-form input:focus,
.create-post-form select:focus,
.create-post-form textarea:focus {
  border-color: rgb(168, 122, 79);
  box-shadow: 0 0 0 2px rgba(168, 122, 79, 0.2);
}

.create-post-form select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: rgb(255, 255, 255);
  border-color: rgb(230, 214, 197);
  padding: 10px 42px 10px 14px;
  cursor: pointer;
}

.create-post-form select option {
  background: rgb(255, 250, 244);
  color: rgb(74, 52, 40);
  font-family: "Libre Baskerville", Georgia, serif;
}

/* Related book actions */

.related-book-actions {
  width: 100%;
  max-width: 500px;
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  grid-column: 2;
  margin-top: 6px;
}

.secondary-btn, .create-post-form input[type="file"]::file-selector-button {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid rgb(215, 195, 175);
  background: rgb(255, 250, 244);
  color: rgb(122, 90, 68);
  font-size: 0.85em;
  font-family: "Libre Baskerville", Georgia, serif;
  text-decoration: none;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.secondary-btn:hover, .create-post-form input[type="file"]::file-selector-button:hover {
  background: rgb(243, 230, 216);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.related-book-actions .hint {
  font-size: 0.75em;
  color: rgb(139, 106, 74);
  line-height: 1.4;
  padding-left: 4px;
}

/* FILE UPLOAD */
.file-upload-group {
  width: 100%;
  align-items: center;
  grid-column: 2;
}

.file-name {
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: 0.85em;
  color: rgb(122, 90, 68);
  padding-left: 6px;
}

/* Everything related to post edit */
.back-link {
  display: block;
  text-align: center;
  margin-top: 20px;
  font-size: 0.9em;
  color: rgb(139, 106, 74);
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
}

/* Everything related to post view */

.full-post {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 30px;
}

.full-post .post-header h1 {
  margin: 0 0 10px;
  font-size: 2em;
  line-height: 1.3;
}

.full-post .meta {
  font-size: 0.85em;
  color: rgb(122, 90, 68);
  margin-bottom: 18px;
}

.post-content {
  font-size: 1.05em;
  line-height: 1.6;
  margin-bottom: 24px;
  white-space: pre-wrap;
}

.full-post span {
  margin-left: 8px;
  font-size: 0.9em;
  color: rgb(122, 90, 68);
}

.full-post + div {
  text-align: center;
}

.confirm-delete {
  margin-left: 8px;
  font-size: 0.75em;
  color: rgb(139, 106, 74);
  font-family: "Libre Baskerville", Georgia, serif;
}

.confirm-delete input {
  margin-right: 4px;
}

.secondary-btn.danger {
  border-color: rgb(214, 163, 163);
  color: rgb(139, 58, 58);
  background: rgb(255, 245, 245);
}

.secondary-btn.danger:hover {
  background: rgb(246, 221, 221);
  box-shadow: 0 2px 6px rgba(139, 58, 58, 0.25);
}

.full-post .post-image {
  margin: 20px 0;
}

.full-post .post-image img {
  width: 100%;
  height: auto;
  max-height: 520px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.full-post .post-header h1 {
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: 1.7em;
  font-weight: 700;
}

.comments-area {
  max-width: 760px;
  margin: 0 auto 40px;
  padding: 22px 24px;
  background: rgb(255, 250, 244);
  border: 1px solid rgb(255, 250, 244);
  border-radius: 14px;
}

.comments-area h3 {
  margin-bottom: 18px;
  font-size: 1.3em;
}

.comment {
  background: rgb(255, 255, 255);
  border: 1px solid rgb(215, 195, 175);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 24px;
  margin-top: 30px;
}

.comment-input {
  max-width: 620px;
  margin: 0 auto;
}

.comment-input textarea {
  width: 100%;
  min-height: 120px;
  padding: 14px 16px;
  border: 1px solid rgb(215, 195, 175);
  border-radius: 12px;
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: 0.95em;
  resize: vertical;
  box-sizing: border-box;
}

.comment-author {
  font-size: 1em;
  color: rgb(122, 90, 68);
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.comment-time {
  margin-left: 8px;
  font-size: 0.85em;
  color: rgb(138, 106, 84);
}

.comment > div:last-child {
  margin-top: 30px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.like-btn {
  background: none;
  border: 1px solid rgb(215, 195, 175);
  border-radius: 30px;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 0.9em;
}

.like-btn:hover {
  background: rgba(198, 156, 109, 0.15);
}

.add-comment-section {
  max-width: 760px;
  margin: 40px auto 0;
  padding: 0;
  background: none;
  border: none;
}

.add-comment-section h3 {
  margin-bottom: 14px;
}

.add-comment-section textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border: 1px solid rgb(215, 195, 175);
  border-radius: 10px;
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: 0.95em;
  resize: vertical;
  outline: none;
}

.add-comment-section textarea:focus {
  border-color: rgb(168, 122, 79);
  box-shadow: 0 0 0 2px rgba(168, 122, 79, 0.2);
}

.add-comment-section button {
  margin-top: 24px;
  background: linear-gradient(180deg, rgb(198, 156, 109), rgb(168, 122, 79));
  border: none;
  border-radius: 30px;
  padding: 10px 22px;
  color: rgb(255, 255, 255);
  cursor: pointer;
  font-size: 0.9em;
}

.add-comment-section button:hover {
  box-shadow: 0 6px 14px rgba(168, 122, 79, 0.4);
}

.comments-area a {
  color: rgb(140, 94, 60);
  text-decoration: underline;
}

.full-post + div button:not(.secondary-btn),
.comment-author button:not(.secondary-btn) {
  background: linear-gradient(180deg, rgb(198, 156, 109), rgb(168, 122, 79));
  border: none;
  color: rgb(255, 255, 255);
}

.full-post + div button:not(.secondary-btn):hover,
.comment-author button:not(.secondary-btn):hover {
  background: linear-gradient(180deg, rgb(211, 173, 125), rgb(184, 138, 92));
  box-shadow: 0 6px 14px rgba(168, 122, 79, 0.35);
}

#likes-list {
  display: flex;
  flex-direction: column;
}

.clean-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    display: block;
}

.clean-link:visited {
    color: inherit;
}

.clean-link:hover {
    text-decoration: none;
    color: inherit;
}


.comment-content, .post-preview, .txt-content {
  margin-top: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;

  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.post-content {
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.comment-form {
  margin-top: 1.6rem;
  padding: 1.2rem 1.4rem;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(74, 52, 40, 0.12);
  border-radius: 14px;
}

.comment-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgb(106, 74, 54);
  letter-spacing: 0.3px;
}

.comment-textarea {
  width: 96%;
  min-height: 110px;
   max-height: 240px;
  resize: vertical;

  padding: 0.75rem 0.9rem;

  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.5;
  color: rgb(74, 52, 40);

  background: rgb(255, 255, 255);
  border: 1px solid rgba(74, 52, 40, 0.18);
  border-radius: 10px;

  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.comment-textarea:focus {
  outline: none;
  border-color: rgb(181, 139, 99);
  box-shadow: 0 0 0 3px rgba(181, 139, 99, 0.18);
}
.comment-textarea:hover {
  border-color: rgba(74, 52, 40, 0.28);
}


.comment-textarea::placeholder {
  color: rgb(160, 137, 119);
  font-style: italic;
}

.comment-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.8rem;
}

.reply-form .comment-textarea {
  min-height: 80px;
  font-size: 0.9rem;
}



/* Mobile */
@media (max-width: 900px) {
}
