/* ==================================================================
   Comments page
   ================================================================== */

.comments-main {
  padding-top: 30px;
  padding-bottom: 80px;
  max-width: 740px;
  margin: 0 auto;
}

/* --- Toolbar / filters ----------------------------------------- */
.comments-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--rule-fine);
  flex-wrap: wrap;
}
.toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.toolbar-label {
  font-family: var(--font-ui);
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}
.toolbar-select, .toolbar-input {
  font-family: var(--font-body);
  font-size: 14px;
  padding: 6px 10px;
  border: 1px solid var(--rule-fine);
  background: transparent;
  color: var(--ink);
  min-width: 140px;
}
.toolbar-select:focus, .toolbar-input:focus {
  outline: 0;
  border-color: var(--gold);
}
.toolbar-search { min-width: 200px; }

/* --- Post box -------------------------------------------------- */
.post-box {
  border: 1px solid var(--rule-fine);
  margin-bottom: 28px;
  background: rgba(255, 252, 240, 0.5);
}
.post-box-locked {
  padding: 20px;
  text-align: center;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--muted);
  font-style: italic;
}
.post-box-form {
  padding: 16px;
}
.post-keyword-select {
  font-family: var(--font-body);
  font-size: 14px;
  padding: 6px 10px;
  border: 1px solid var(--rule-fine);
  background: transparent;
  color: var(--ink);
  margin-bottom: 10px;
  width: 100%;
  max-width: 240px;
}
.post-textarea {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  padding: 10px;
  border: 1px solid var(--rule-fine);
  background: transparent;
  color: var(--ink);
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
  min-height: 70px;
  max-height: 140px;
}
.post-textarea:focus { outline: 0; border-color: var(--gold); }
.post-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}
.char-count {
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  color: var(--muted);
}
.post-submit {
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 8px 20px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  transition: all 0.15s;
}
.post-submit:hover { background: var(--gold); border-color: var(--gold); }

/* --- Comment feed ---------------------------------------------- */
.comment-feed { margin-bottom: 24px; }
.comments-loading { padding: 30px 0; color: var(--muted); font-style: italic; }

.comment-card {
  border-bottom: 1px solid var(--rule-fine);
  padding: 16px 0;
}
.comment-card:first-child { padding-top: 0; }

.comment-meta {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.comment-user {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.comment-keyword {
  font-family: var(--font-ui);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  padding: 2px 8px;
  border: 1px solid var(--gold);
}
.comment-date {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  color: var(--muted);
  margin-left: auto;
}

.comment-body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  margin: 0 0 8px;
  max-width: 60ch;
}

.comment-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}
.comment-action {
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}
.comment-action:hover { color: var(--gold); }
.comment-action svg { width: 12px; height: 12px; }

.comment-flagged {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--muted);
  font-style: italic;
  padding: 16px 0;
  border-bottom: 1px solid var(--rule-fine);
}

/* Replies — indented */
.comment-replies {
  margin-left: 32px;
  border-left: 2px solid var(--rule-fine);
  padding-left: 16px;
}
.comment-replies .comment-card { padding: 12px 0; }
.comment-replies .comment-body { font-size: 15px; }

/* --- Pager ----------------------------------------------------- */
.comments-pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  gap: 20px;
}

/* --- Sign On Modal --------------------------------------------- */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-box {
  background: var(--paper, #f5eedc);
  padding: 36px 32px;
  max-width: 380px;
  width: 90%;
  position: relative;
}
.modal-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
  margin: 0 0 20px;
  color: var(--ink);
}
.modal-close {
  position: absolute;
  top: 12px; right: 16px;
  font-size: 24px;
  background: none; border: none;
  color: var(--muted); cursor: pointer;
}
.modal-close:hover { color: var(--ink); }
.auth-error {
  color: #8a2f1b;
  font-size: 13px;
  margin-bottom: 12px;
}
#authTabs {
  display: flex; gap: 0; margin-bottom: 16px;
  border-bottom: 1px solid var(--rule-fine);
}
.auth-tab {
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: none; border: none;
  padding: 8px 16px;
  color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent;
}
.auth-tab.is-on { color: var(--ink); border-bottom-color: var(--gold); }
.modal-box form { display: flex; flex-direction: column; gap: 10px; }
.modal-box input {
  font-family: var(--font-body);
  font-size: 15px;
  padding: 10px 12px;
  border: 1px solid var(--rule-fine);
  background: transparent;
  color: var(--ink);
}
.modal-box input:focus { outline: 0; border-color: var(--gold); }

/* --- Profile page ---------------------------------------------- */
.profile-section { margin-bottom: 40px; }
.profile-heading {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 400;
  margin: 0 0 12px;
  color: var(--ink);
}
.profile-note {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 16px;
  font-style: italic;
}
.profile-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 360px;
}
.profile-label {
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: -6px;
}
.profile-check {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink-soft);
  display: flex; align-items: center; gap: 8px;
}
.profile-check input { accent-color: var(--gold); }

/* Favorites on profile */
.fav-count {
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.1em;
  margin: 0 0 10px;
}
.no-favorites { color: var(--muted); font-style: italic; font-size: 14px; }
.fav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--rule-fine);
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
}
.fav-remove {
  background: none; border: none;
  color: var(--muted); font-size: 18px;
  cursor: pointer; padding: 0 4px;
}
.fav-remove:hover { color: #8a2f1b; }
.flag-badge {
  font-family: var(--font-ui);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8a2f1b;
  border: 1px solid #8a2f1b;
  padding: 1px 6px;
}
.comment-x {
  font-size: 11px;
  color: var(--muted);
  text-decoration: none;
}
.comment-x:hover { color: var(--gold); }

.reply-form { margin-top: 10px; }
.reply-textarea { min-height: 50px; max-height: 80px; }
.reply-submit { margin-top: 6px; }

/* --- Mobile ---------------------------------------------------- */
@media (max-width: 640px) {
  .comments-toolbar { flex-direction: column; align-items: stretch; }
  .toolbar-left { flex-direction: column; align-items: stretch; }
  .toolbar-search { min-width: 0; width: 100%; }
  .comment-replies { margin-left: 16px; padding-left: 12px; }
}
