/* Neighborly Frontend UI
   v3.0.0 polish pass
   Admin palettes control colors via inline CSS variables on .neighborly.
*/

.neighborly {
  --n-accent: #2563eb;
  --n-success: #16a34a;
  --n-warning: #d97706;
  --n-danger: #dc2626;

  --n-bg: #ffffff;
  --n-card: #ffffff;
  --n-text: #111827;
  --n-muted: #6b7280;
  --n-border: #e5e7eb;

  --n-radius: 14px;
  --n-radius-sm: 10px;

  --n-surface: var(--n-bg);
  --n-surface-2: color-mix(in srgb, var(--n-bg) 92%, var(--n-text));
  --n-chip: color-mix(in srgb, var(--n-text) 7%, transparent);
  --n-focus: color-mix(in srgb, var(--n-accent) 35%, transparent);

  color: var(--n-text);
  font-size: 16px;
  line-height: 1.55;
  text-transform: none;
}

.neighborly *,
.neighborly *::before,
.neighborly *::after { box-sizing: border-box; }

.neighborly .neighborly-container {
  max-width: 980px;
  margin: 0 auto;
  padding: 18px 14px;
}

/* Support BOTH naming conventions:
   - older: .neighborly-thread
   - current template: .neighborly-thread-view
*/
.neighborly.neighborly-forum,
.neighborly.neighborly-thread,
.neighborly.neighborly-thread-view,
.neighborly.neighborly-profile,
.neighborly.neighborly-latest-threads,
.neighborly.neighborly-thread-list-wrapper,
.neighborly.neighborly-user-threads,
.neighborly.neighborly-new-thread {
  max-width: 980px;
  margin: 18px auto;
  padding: 18px 14px;
}

.neighborly a { color: var(--n-accent); text-decoration: none; text-underline-offset: 2px; }
.neighborly a:hover { text-decoration: underline; }

.neighborly .neighborly-card {
  background: var(--n-card);
  border: 1px solid var(--n-border);
  border-radius: var(--n-radius);
  padding: 14px;
}

.neighborly h1, .neighborly h2, .neighborly h3 {
  color: var(--n-text);
  letter-spacing: -0.01em;
}

/* Buttons */
.neighborly-button,
.neighborly button.neighborly-button,
.neighborly input[type="submit"].neighborly-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  border: 1px solid var(--n-border);
  background: var(--n-surface-2);
  color: var(--n-text);

  padding: 10px 14px;
  border-radius: var(--n-radius-sm);
  cursor: pointer;

  font-weight: 800;
  font-size: 14px;
  line-height: 1;

  transition: transform .06s ease, filter .12s ease, border-color .12s ease;
}

.neighborly-button:hover { text-decoration: none; filter: brightness(0.985); }
.neighborly-button:active { transform: translateY(1px); }

.neighborly-button.primary {
  background: var(--n-accent);
  border-color: transparent;
  color: #fff;
}
.neighborly-button.primary:hover { filter: brightness(0.95); }

.neighborly-button:focus,
.neighborly button:focus,
.neighborly input:focus,
.neighborly select:focus,
.neighborly textarea:focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--n-focus);
}

/* Notices */
.neighborly-notice {
  border-radius: 12px;
  border: 1px solid var(--n-border);
  background: var(--n-surface-2);
  padding: 10px 12px;
  margin-bottom: 12px;
  color: var(--n-text);
}

.neighborly-notice-success {
  border-color: color-mix(in srgb, var(--n-success) 45%, var(--n-border));
  background: color-mix(in srgb, var(--n-success) 10%, var(--n-card));
}
.neighborly-notice-error {
  border-color: color-mix(in srgb, var(--n-danger) 45%, var(--n-border));
  background: color-mix(in srgb, var(--n-danger) 10%, var(--n-card));
}
.neighborly-notice-warning {
  border-color: color-mix(in srgb, var(--n-warning) 50%, var(--n-border));
  background: color-mix(in srgb, var(--n-warning) 10%, var(--n-card));
}

/* Badges */
.neighborly-badge,
.neighborly-thread-badge,
.neighborly-reply-solution-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  background: var(--n-chip);
  border: 1px solid transparent;
  color: var(--n-text);
}

.neighborly-badge-solved,
.neighborly-thread-badge-solved {
  color: var(--n-success);
  border-color: color-mix(in srgb, var(--n-success) 35%, transparent);
  background: color-mix(in srgb, var(--n-success) 10%, var(--n-card));
}
.neighborly-badge-locked {
  color: var(--n-warning);
  border-color: color-mix(in srgb, var(--n-warning) 35%, transparent);
  background: color-mix(in srgb, var(--n-warning) 10%, var(--n-card));
}

/* Thread list layout */
.neighborly-thread-table-header {
  display: grid;
  grid-template-columns: 1fr 90px 140px;
  gap: 12px;
  padding: 10px 12px;
  color: var(--n-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--n-border);
}

.neighborly-thread-list { list-style: none; margin: 0; padding: 0; }
.neighborly-thread-item { border-bottom: 1px solid var(--n-border); }
.neighborly-thread-item:last-child { border-bottom: 0; }

.neighborly-thread-row {
  display: grid;
  grid-template-columns: 1fr 90px 140px;
  gap: 12px;
  padding: 12px;
  align-items: center;
  border-radius: 12px;
  transition: background .12s ease;
}

.neighborly-thread-item:hover .neighborly-thread-row {
  background: color-mix(in srgb, var(--n-accent) 6%, var(--n-card));
}

.neighborly-thread-title-line { margin: 0; }

/* Thread title link, keep readable, do not go neon on hover */
.neighborly a.neighborly-thread-link {
  font-weight: 850;
  font-size: 16px;
  letter-spacing: -0.01em;
  color: var(--n-text) !important;
  text-decoration: none;
}
.neighborly a.neighborly-thread-link:hover {
  color: var(--n-text) !important;
  text-decoration: underline;
}

.neighborly-thread-subline { margin-top: 6px; color: var(--n-muted); font-size: 14px; }

.neighborly-last-activity-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--n-chip);
  color: var(--n-text);
  font-weight: 850;
  font-size: 13px;
  border: 1px solid transparent;
}
.neighborly-last-activity-link:hover { border-color: var(--n-border); text-decoration: none; }

/* Thread view (this is what your template uses) */
.neighborly-thread-card { padding: 16px; }

.neighborly-thread-header { margin-bottom: 14px; }
.neighborly-thread-header-top {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
}

.neighborly-thread-title {
  font-weight: 900;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--n-text);
  margin: 0;
}

.neighborly-thread-meta,
.neighborly-thread-meta-line {
  color: var(--n-muted);
  font-size: 14px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.neighborly-thread-body,
.neighborly-thread-content {
  margin-top: 12px;
  font-size: 16px;
  color: var(--n-text);
}

/* Reply list */
.neighborly-replies-list { list-style: none; margin: 0; padding: 0; }
.neighborly-reply-item {
  background: var(--n-card);
  border: 1px solid var(--n-border);
  border-radius: var(--n-radius);
  padding: 12px;
  margin-bottom: 10px;
}

.neighborly-reply-header {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.neighborly-reply-author {
  font-weight: 850;
  color: var(--n-text);
}

.neighborly-reply-meta {
  color: var(--n-muted);
  font-size: 13px;
}

/* Forms */
.neighborly-form,
.neighborly-reply-form,
.neighborly-new-thread-form {
  background: var(--n-card);
  border: 1px solid var(--n-border);
  border-radius: var(--n-radius);
  padding: 14px;
}

.neighborly-form label,
.neighborly-reply-form label,
.neighborly-new-thread-form label {
  display: block;
  font-weight: 850;
  font-size: 14px;
  margin-bottom: 6px;
  color: var(--n-text);
}

.neighborly-form input[type="text"],
.neighborly-form select,
.neighborly-form textarea,
.neighborly-reply-form input[type="text"],
.neighborly-reply-form select,
.neighborly-reply-form textarea,
.neighborly-new-thread-form input[type="text"],
.neighborly-new-thread-form select,
.neighborly-new-thread-form textarea {
  width: 100%;
  border: 1px solid var(--n-border);
  background: var(--n-surface-2);
  color: var(--n-text);
  border-radius: var(--n-radius-sm);
  padding: 10px 12px;
  font-size: 15px;
}

.neighborly-form textarea,
.neighborly-reply-form textarea,
.neighborly-new-thread-form textarea { min-height: 120px; resize: vertical; }

@media (max-width: 720px) {
  .neighborly .neighborly-container { padding: 14px 12px; }
  .neighborly-thread-table-header { display: none; }
  .neighborly-thread-row { grid-template-columns: 1fr; gap: 8px; }
  .neighborly-thread-title { font-size: 20px; }
}


/* Moderation + report bar */
.neighborly .neighborly-modbar {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: flex-start;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--n-border);
  border-radius: var(--n-radius);
  background: var(--n-card);
}

.neighborly .neighborly-modblock {
  flex: 1 1 280px;
  min-width: 260px;
}

.neighborly .neighborly-modtitle {
  margin: 0 0 10px 0;
  font-size: 14px;
  color: var(--n-text);
}

.neighborly .neighborly-modform {
  display: grid;
  gap: 10px;
}

.neighborly .neighborly-field > span {
  display: block;
  font-size: 12px;
  color: var(--n-muted);
  margin-bottom: 6px;
}

.neighborly .neighborly-modform input[type="text"],
.neighborly .neighborly-modform textarea {
  width: 100%;
}

.neighborly .neighborly-help {
  color: var(--n-muted);
  font-size: 12px;
}

.neighborly .neighborly-checkbox {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 14px;
}

/* Locked banner */
.neighborly .neighborly-lock-banner {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--n-warning) 35%, var(--n-border));
  border-radius: var(--n-radius);
  background: color-mix(in srgb, var(--n-warning) 10%, var(--n-card));
}

.neighborly .neighborly-lock-message {
  margin-top: 8px;
}

/* Reply report details in actions */
.neighborly .neighborly-report-reply summary {
  cursor: pointer;
  list-style: none;
}

.neighborly .neighborly-report-reply summary::-webkit-details-marker {
  display: none;
}

.neighborly .neighborly-report-reply[open] {
  padding: 10px;
  border: 1px solid var(--n-border);
  border-radius: var(--n-radius-sm);
  background: var(--n-surface-2);
}

.neighborly .neighborly-report-form {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.neighborly .neighborly-report-form input[type="text"] {
  width: 100%;
}


/* Inline action forms (e.g., Delete reply) */
.neighborly-inline-form{
  display:inline;
  margin:0;
  padding:0;
}
.neighborly-link-danger{
  color:#b32d2e;
  background:transparent;
  border:0;
  padding:0;
  cursor:pointer;
  text-decoration:underline;
  font:inherit;
}
.neighborly-link-danger:hover{
  color:#8a2425;
}

/* Forum category pills */
.neighborly .neighborly-forum-categories{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
  margin-top:10px;
}
.neighborly .neighborly-forum-categories-label{
  color: var(--n-muted);
  font-size: 14px;
}
.neighborly .neighborly-forum-category-pills{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
}
.neighborly a.neighborly-forum-category-link{
  display:inline-flex;
  align-items:center;
  padding:7px 12px;
  border-radius:999px;
  border:1px solid var(--n-border);
  background: var(--n-chip);
  color: var(--n-text);
  text-decoration:none;
  font-size: 14px;
  line-height: 1;
}
.neighborly a.neighborly-forum-category-link:hover{
  text-decoration:none;
  background: color-mix(in srgb, var(--n-text) 10%, transparent);
}
.neighborly a.neighborly-forum-category-link.is-active{
  background: var(--n-accent);
  border-color: var(--n-accent);
  color: #ffffff;
}
.neighborly a.neighborly-forum-category-link.is-active:hover{
  background: color-mix(in srgb, var(--n-accent) 85%, #000000);
}

@media (max-width: 640px){
  .neighborly .neighborly-forum-categories{
    gap:8px;
  }
  .neighborly .neighborly-forum-category-pills{
    flex-wrap:nowrap;
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
    padding-bottom:6px;
    max-width: 100%;
  }
  .neighborly a.neighborly-forum-category-link{
    white-space:nowrap;
  }
}

/* Forum category index */
.neighborly-forum-categories {
    margin-bottom: 16px;
}

.neighborly-section-title {
    margin: 0 0 12px 0;
    font-size: 18px;
}

.neighborly-category-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.neighborly-category-row {
    display: block;
    padding: 12px 14px;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 10px;
    text-decoration: none;
}

.neighborly-category-row:hover {
    border-color: rgba(0,0,0,0.18);
}

.neighborly-category-name {
    font-weight: 700;
    margin-bottom: 4px;
}

.neighborly-category-desc {
    opacity: 0.9;
    margin-bottom: 8px;
}

.neighborly-category-meta {
    display: flex;
    gap: 12px;
    font-size: 13px;
    opacity: 0.85;
    flex-wrap: wrap;
}

