/* Q&A — list / detail / ask page. Folosim tokens lh-* din global.css. */

/* ── Shared chrome ────────────────────────────────────────────────────── */
.qa, .qa-noua {
  max-width: 760px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 4rem;
  font-family: var(--lh-font-sans);
}
.qa-detail {
  max-width: 820px;
  margin: 0 auto;
  padding: 1rem 1.5rem 4rem;
  font-family: var(--lh-font-sans);
}

.qa-crumbs {
  display: flex; align-items: center; gap: .4rem;
  font-size: .8rem; color: var(--lh-muted);
  margin-bottom: 1.25rem; flex-wrap: wrap;
}
.qa-crumbs a { color: var(--lh-muted); text-decoration: none; }
.qa-crumbs a:hover { color: var(--lh-primary); text-decoration: underline; }
.qa-crumb-sep { color: #cbd5e1; }
.qa-crumb-current { color: var(--lh-text); font-weight: 500; }

.qa-dot { color: #cbd5e1; padding: 0 .15rem; }

/* ── Status badges + category chips (used everywhere) ─────────────────── */
.qa-status {
  display: inline-block;
  font-size: .66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .12rem .45rem;
  border-radius: 999px;
}
.qa-status-open     { background: #fef3c7; color: #92400e; }
.qa-status-answered { background: #ecfdf5; color: #047857; }
.qa-status-closed   { background: #f3f4f6; color: #4b5563; }

.qa-cat-chip {
  display: inline-block;
  font-size: .72rem;
  font-weight: 600;
  padding: .15rem .55rem;
  border-radius: 999px;
  background: rgba(26,84,144,.08);
  color: var(--lh-primary);
  text-decoration: none;
}
.qa-cat-chip:hover { background: rgba(26,84,144,.14); }

.qa-code-chip {
  display: inline-block;
  font-size: .72rem;
  font-weight: 500;
  padding: .12rem .5rem;
  margin: 0 .25rem .25rem 0;
  border-radius: 4px;
  background: var(--lh-accent);
  color: var(--lh-text);
  text-decoration: none;
  border: 1px solid var(--lh-border);
  font-family: var(--lh-font-sans);
}
.qa-code-chip:hover { border-color: var(--lh-primary); color: var(--lh-primary); }

/* Inline code references inside bodies — discreet underline-on-hover */
.lh-code-ref {
  color: var(--lh-primary);
  text-decoration: none;
  border-bottom: 1px dashed currentColor;
}
.lh-code-ref:hover { background: rgba(26,84,144,.06); }

/* ── List page head ───────────────────────────────────────────────────── */
.qa-list-head { margin-bottom: 1.5rem; }
.qa-h1 {
  margin: 0 0 .35rem;
  font-size: 1.9rem;
  letter-spacing: -.02em;
  font-weight: 700;
  font-family: var(--lh-font-serif);
}
.qa-lede { margin: 0; color: var(--lh-muted); font-size: .95rem; max-width: 60ch; line-height: 1.5; }

/* Category tabs (matches /articole pattern) */
.qa-cat-tabs {
  display: flex; flex-wrap: wrap; gap: .3rem;
  padding: 1rem 0 1.5rem;
  border-bottom: 1px solid var(--lh-border);
  overflow-x: auto;
  scrollbar-width: none;
}
.qa-cat-tabs::-webkit-scrollbar { display: none; }
.qa-tab {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .35rem .7rem;
  font-size: .8rem;
  color: var(--lh-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
  transition: color .12s, background .12s;
}
.qa-tab:hover { color: var(--lh-primary); background: var(--lh-accent); }
.qa-tab.is-active { background: var(--lh-primary); color: #fff; font-weight: 600; }
.qa-tab-count { font-size: .68rem; opacity: .65; font-variant-numeric: tabular-nums; }
.qa-tab.is-active .qa-tab-count { opacity: .75; }

/* Toolbar (status toggle + sort + CTA) */
.qa-toolbar {
  display: flex; align-items: center; gap: .75rem;
  flex-wrap: wrap;
  margin: 1.25rem 0;
}
.qa-toggle-group {
  display: inline-flex;
  background: var(--lh-accent);
  border-radius: 6px;
  padding: 2px;
}
.qa-toggle {
  padding: .3rem .7rem; font-size: .78rem;
  color: var(--lh-muted); text-decoration: none;
  border-radius: 4px;
}
.qa-toggle:hover { color: var(--lh-text); }
.qa-toggle.is-active { background: #fff; color: var(--lh-text); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.qa-sort-label { font-size: .78rem; color: var(--lh-muted); display: flex; align-items: center; gap: .4rem; }
.qa-sort {
  font: inherit; font-size: .82rem;
  padding: .25rem .4rem; border: 1px solid var(--lh-border); border-radius: 4px;
  background: #fff;
}
.qa-ask-cta { margin-left: auto; }

/* ── Feed (single column, reading-list pattern) ──────────────────────── */
.qa-feed { list-style: none; margin: 0; padding: 0; }
.qa-row {
  padding: 1.65rem 0;
  border-bottom: 1px solid var(--lh-border);
}
.qa-row:last-child { border-bottom: 0; }
.qa-row-link { display: block; text-decoration: none; color: inherit; }

.qa-row-meta {
  display: flex; align-items: center; gap: .4rem;
  font-size: .75rem;
  color: var(--lh-muted);
  flex-wrap: wrap;
  margin-bottom: .45rem;
}
.qa-row-meta-dot { color: #cbd5e1; }
.qa-row-meta strong { color: var(--lh-text); font-weight: 700; }

.qa-dot-status {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.qa-dot-open     { background: #f59e0b; }
.qa-dot-answered { background: #047857; }
.qa-dot-closed   { background: #9ca3af; }

.qa-row-title {
  margin: 0 0 .35rem;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.25;
  color: var(--lh-text);
  font-family: var(--lh-font-serif);
  transition: color .12s;
}
.qa-row-link:hover .qa-row-title { color: var(--lh-primary); }

.qa-row-excerpt {
  margin: 0 0 .85rem;
  font-family: var(--lh-font-serif);
  font-size: 1rem;
  color: var(--lh-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.qa-row-byline { font-size: .8rem; color: var(--lh-muted); }
.qa-row-byline strong { color: var(--lh-text); font-weight: 600; }

.qa-row.is-featured { padding-top: .5rem; }
.qa-row.is-featured .qa-row-title { font-size: 1.7rem; line-height: 1.2; letter-spacing: -.015em; }
.qa-row.is-featured .qa-row-excerpt { font-size: 1.05rem; -webkit-line-clamp: 3; }

.qa-empty {
  background: #fff; border: 1px dashed var(--lh-border); border-radius: 12px;
  padding: 3rem 1.5rem; text-align: center;
}
.qa-empty p { color: var(--lh-muted); margin: 0 0 1rem; }

/* ── Detail page ──────────────────────────────────────────────────────── */
.qa-detail { max-width: 820px; }

.qa-q-head {
  background: #fff; border: 1px solid var(--lh-border); border-radius: 12px;
  padding: 1.5rem; margin-bottom: .65rem;
}
.qa-q-meta { display: flex; gap: .5rem; margin-bottom: .5rem; flex-wrap: wrap; }
.qa-q-title { margin: 0 0 .65rem; font-size: 1.65rem; line-height: 1.25; letter-spacing: -.01em; }
.qa-q-author-line { font-size: .82rem; color: var(--lh-muted); display: flex; gap: .25rem; flex-wrap: wrap; }
.qa-q-author-line strong { color: var(--lh-text); font-weight: 600; }

.qa-q-body {
  background: #fff; border: 1px solid var(--lh-border); border-radius: 12px;
  padding: 1.5rem; margin-bottom: 2rem;
  font-family: var(--lh-font-serif);
  font-size: 1rem; line-height: 1.65; color: #1f2937;
}
.qa-q-body p { margin: 0 0 .85rem; }
.qa-q-body p:last-child { margin-bottom: 0; }
.qa-q-refs {
  margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--lh-border);
  font-family: var(--lh-font-sans);
}
.qa-q-refs-label {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--lh-muted); margin-right: .5rem;
}

/* Answers */
.qa-answers-head {
  display: flex; align-items: baseline; gap: 1rem; margin-bottom: 1rem;
  padding: 0 .25rem;
}
.qa-answers-head h2 { margin: 0; font-size: 1.2rem; }
.qa-answers-sort-note { margin: 0; font-size: .78rem; color: var(--lh-muted); }
.qa-no-answers {
  background: #fffbeb; border: 1px solid #fcd34d;
  border-radius: 12px; padding: 1rem 1.25rem; margin-bottom: 1rem;
  font-size: .9rem; color: #78350f;
}
.qa-no-answers p { margin: 0; }
.qa-no-answers p + p { margin-top: .25rem; }

.qa-answer-list { list-style: none; margin: 0; padding: 0; }
.qa-answer {
  display: grid;
  grid-template-columns: 50px 1fr;
  gap: 1rem;
  background: #fff; border: 1px solid var(--lh-border); border-radius: 12px;
  padding: 1.25rem; margin-bottom: .75rem;
}
.qa-answer.is-accepted { border-color: #047857; box-shadow: 0 0 0 1px #047857 inset; }
.qa-accepted-banner {
  display: inline-block;
  background: #ecfdf5; color: #047857;
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  padding: .2rem .55rem; border-radius: 999px; margin-bottom: .65rem;
}

.qa-answer-vote {
  display: flex; flex-direction: column; align-items: center; gap: .25rem;
  color: var(--lh-muted);
}
.qa-vote-btn {
  background: none; border: 1px solid var(--lh-border); border-radius: 4px;
  width: 32px; height: 28px;
  font-size: 1rem; color: var(--lh-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s, border-color .12s, color .12s;
}
.qa-vote-btn:hover { color: var(--lh-primary); border-color: var(--lh-primary); }
.qa-vote-btn.is-voted { background: var(--lh-primary); color: #fff; border-color: var(--lh-primary); }
.qa-vote-count { font-weight: 700; font-size: .9rem; color: var(--lh-text); font-variant-numeric: tabular-nums; }

.qa-answer-body { min-width: 0; font-family: var(--lh-font-serif); font-size: .98rem; line-height: 1.65; color: #1f2937; }
.qa-answer-body p { margin: 0 0 .8rem; }
.qa-answer-body p:last-of-type { margin-bottom: 1rem; }

.qa-answer-footer {
  display: flex; align-items: center; gap: 1rem;
  padding-top: .85rem; border-top: 1px solid var(--lh-border);
  font-family: var(--lh-font-sans); margin-top: .65rem;
}
.qa-answer-author {
  display: flex; align-items: center; gap: .55rem;
  text-decoration: none; color: inherit; flex: 1; min-width: 0;
}
.qa-answer-author img,
.qa-answer-author-avatar-stub {
  width: 38px; height: 38px;
  border-radius: 50%; object-fit: cover; flex-shrink: 0;
  background: var(--lh-accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: var(--lh-muted);
  font-size: .9rem;
}
.qa-answer-author-meta { display: flex; flex-direction: column; min-width: 0; }
.qa-answer-author-name { font-weight: 600; font-size: .82rem; color: var(--lh-text); }
.qa-answer-author-type { font-size: .7rem; color: var(--lh-muted); text-transform: capitalize; }
.qa-author-pro:hover .qa-answer-author-name { color: var(--lh-primary); }
.qa-verified-mini {
  display: inline-block; width: 14px; height: 14px;
  border-radius: 50%; background: #047857; color: #fff;
  font-size: 9px; font-weight: 700;
  text-align: center; line-height: 14px;
  margin-left: .25rem;
}
.qa-answer-date { font-size: .72rem; color: var(--lh-muted); }

/* Reply form */
.qa-reply {
  background: #fff; border: 1px solid var(--lh-border); border-radius: 12px;
  padding: 1.5rem; margin-top: 1.5rem;
}
.qa-reply h3 { margin: 0 0 .35rem; font-size: 1.1rem; }
.qa-reply-help { margin: 0 0 1rem; font-size: .82rem; color: var(--lh-muted); line-height: 1.45; }

/* Related */
.qa-related {
  background: var(--lh-accent); border-radius: 12px; padding: 1.25rem; margin-top: 2rem;
}
.qa-related h3 { margin: 0 0 .65rem; font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--lh-muted); }
.qa-related ul { list-style: none; margin: 0; padding: 0; }
.qa-related li {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: .55rem 0; border-bottom: 1px solid var(--lh-border);
}
.qa-related li:last-child { border-bottom: 0; }
.qa-related a { color: var(--lh-text); text-decoration: none; font-size: .88rem; flex: 1; min-width: 0; }
.qa-related a:hover { color: var(--lh-primary); }
.qa-related-count { font-size: .72rem; color: var(--lh-muted); white-space: nowrap; }

/* ── Form (shared) ────────────────────────────────────────────────────── */
.qa-form { display: flex; flex-direction: column; gap: 1rem; position: relative; }
.qa-form-row {
  display: grid; gap: 1rem;
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 600px) { .qa-form-row { grid-template-columns: 1fr; } }
.qa-form-field { display: flex; flex-direction: column; gap: .25rem; }
.qa-form-field label {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .04em;
  font-weight: 600; color: var(--lh-muted);
}
.qa-form-optional { text-transform: none; font-weight: 400; color: #9ca3af; letter-spacing: 0; }
.qa-form-field input,
.qa-form-field textarea,
.qa-form-field select {
  width: 100%; font: inherit; font-size: .92rem;
  padding: .55rem .65rem;
  border: 1px solid var(--lh-border); border-radius: var(--lh-radius);
  background: #fff; resize: vertical;
}
.qa-form-field textarea { font-family: var(--lh-font-serif); }
.qa-form-field input:focus,
.qa-form-field textarea:focus,
.qa-form-field select:focus {
  outline: none; border-color: var(--lh-primary);
  box-shadow: 0 0 0 3px rgba(26,84,144,.1);
}
.qa-form-field input[aria-invalid="true"],
.qa-form-field textarea[aria-invalid="true"],
.qa-form-field select[aria-invalid="true"] {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220,38,38,.1);
}
.qa-form-hint { font-size: .72rem; color: var(--lh-muted); }
.qa-form-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.qa-form-feedback {
  margin: 0; font-size: .85rem;
  padding: .65rem .85rem; border-radius: 6px;
}
.qa-form-feedback.is-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.qa-form-feedback.is-error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.qa-form-disclaimer { margin: 0; font-size: .72rem; color: var(--lh-muted); line-height: 1.45; }
.qa-form-disclaimer a { color: var(--lh-muted); text-decoration: underline; }

/* ── Ask page layout ──────────────────────────────────────────────────── */
.qa-noua-head { margin-bottom: 1.5rem; }
.qa-noua-head h1 { margin: 0 0 .35rem; font-size: 1.65rem; letter-spacing: -.01em; }
.qa-noua-body {
  display: grid; gap: 1.5rem;
  grid-template-columns: 1fr 280px;
  align-items: start;
}
.qa-noua-form {
  background: #fff; border: 1px solid var(--lh-border); border-radius: 12px;
  padding: 1.5rem;
}
.qa-noua-tips {
  background: var(--lh-accent); border-radius: 12px;
  padding: 1.25rem 1.5rem;
  position: sticky; top: 1rem;
}
.qa-noua-tips h2 { margin: 0 0 .85rem; font-size: 1rem; }
.qa-noua-tips ol { margin: 0; padding-left: 1.1rem; font-size: .85rem; color: #374151; line-height: 1.55; }
.qa-noua-tips li { margin-bottom: .65rem; }

/* ── Mobile responsive ────────────────────────────────────────────────── */
@media (max-width: 880px) {
  .qa-body { grid-template-columns: 1fr; }
  .qa-sidebar { position: static; }
  .qa-noua-body { grid-template-columns: 1fr; }
  .qa-noua-tips { position: static; }
  .qa-page-head { flex-direction: column; align-items: stretch; }
  .qa-page-head .lh-btn { align-self: flex-start; }
}
@media (max-width: 580px) {
  .qa, .qa-detail, .qa-noua { padding: .75rem 1rem 3rem; }
  .qa-item { grid-template-columns: 1fr; padding: 1rem; }
  .qa-item-stats {
    border-right: 0; border-bottom: 1px solid var(--lh-border);
    padding: 0 0 .65rem; flex-direction: row; justify-content: flex-start; gap: 1.5rem;
  }
  .qa-answer { grid-template-columns: 40px 1fr; gap: .65rem; padding: 1rem; }
  .qa-vote-btn { width: 28px; height: 24px; font-size: .85rem; }
  .qa-q-head, .qa-q-body, .qa-reply, .qa-noua-form { padding: 1rem; }
  .qa-q-title { font-size: 1.3rem; }
  .qa-answer-footer { flex-wrap: wrap; gap: .65rem; }
}
