/* ============================================================
   Lexoft — Q&A (Питання-відповіді)
   ============================================================ */

.qa-hero { background: linear-gradient(180deg, var(--accent-soft), #fff); border-bottom: 1px solid var(--line); padding: 30px 0 44px; }
.qa-hero .breadcrumbs { margin-bottom: 24px; }
.qa-hero-grid { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.qa-hero h1 { font-size: clamp(30px, 4.2vw, 42px); font-weight: 800; letter-spacing: -.03em; line-height: 1.1; color: var(--ink); }
.qa-hero p { font-size: 17.5px; color: var(--ink-2); margin-top: 12px; max-width: 600px; line-height: 1.55; }
.qa-hero .btn svg { width: 18px; height: 18px; }
.qa-stats { display: flex; gap: 28px; margin-top: 22px; }
.qa-stats .st b { font-size: 21px; font-weight: 800; color: var(--ink); letter-spacing: -.02em; }
.qa-stats .st span { font-size: 13px; color: var(--ink-3); display: block; }

/* Layout */
.qa-layout { display: grid; grid-template-columns: 1fr 300px; gap: 48px; align-items: start; padding-top: 34px; }
.qa-main { min-width: 0; }

/* Toolbar */
.qa-toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.qa-search { flex: 1; min-width: 220px; display: flex; align-items: center; gap: 9px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; transition: .16s; }
.qa-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.qa-search svg { width: 18px; height: 18px; color: var(--ink-4); flex-shrink: 0; }
.qa-search input { border: none; outline: none; background: none; font-family: inherit; font-size: 15px; width: 100%; color: var(--ink); }
.qa-sort { display: flex; gap: 4px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
.qa-sort button { font-size: 13.5px; font-weight: 600; color: var(--ink-3); padding: 7px 13px; border-radius: 7px; transition: .14s; white-space: nowrap; }
.qa-sort button:hover { color: var(--ink); }
.qa-sort button.active { background: #fff; color: var(--accent); box-shadow: var(--sh-1); }

/* Category filter chips */
.qa-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.qa-chip { font-size: 13.5px; font-weight: 600; color: var(--ink-2); background: #fff; border: 1px solid var(--line); padding: 8px 15px; border-radius: 100px; transition: .14s; }
.qa-chip:hover { border-color: var(--accent-soft-2); color: var(--accent); }
.qa-chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Question card */
.q-list { display: flex; flex-direction: column; gap: 14px; }
.q-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; transition: .16s; }
.q-card:hover { border-color: var(--accent-soft-2); box-shadow: var(--sh-2); }
.q-card.is-new { border-color: var(--accent-soft-2); box-shadow: 0 0 0 3px var(--accent-soft); }
.q-head { display: flex; gap: 16px; padding: 20px 22px; cursor: pointer; align-items: flex-start; }
.q-votes { display: flex; flex-direction: column; align-items: center; gap: 1px; flex-shrink: 0; width: 46px; padding-top: 2px; }
.q-votes button { width: 30px; height: 26px; border-radius: 7px; display: grid; place-items: center; color: var(--ink-4); transition: .12s; }
.q-votes button:hover { background: var(--accent-soft); color: var(--accent); }
.q-votes button svg { width: 17px; height: 17px; }
.q-votes .vc { font-size: 16px; font-weight: 800; color: var(--ink); }
.q-votes.voted .up { color: var(--accent); }

.q-body { flex: 1; min-width: 0; }
.q-top { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; flex-wrap: wrap; }
.q-cat { font-size: 11.5px; font-weight: 700; color: var(--accent-dark); background: var(--accent-soft); padding: 3px 10px; border-radius: 100px; text-transform: uppercase; letter-spacing: .02em; }
.q-solved { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; color: var(--green); background: var(--green-soft); padding: 3px 9px; border-radius: 100px; }
.q-solved svg { width: 12px; height: 12px; }
.q-title { font-size: 18.5px; font-weight: 700; color: var(--ink); line-height: 1.32; letter-spacing: -.01em; }
.q-card:hover .q-title { color: var(--accent); }
.q-excerpt { font-size: 14.5px; color: var(--ink-2); margin-top: 7px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.q-meta { display: flex; align-items: center; gap: 14px; margin-top: 14px; font-size: 13px; color: var(--ink-3); flex-wrap: wrap; }
.q-asker { display: flex; align-items: center; gap: 8px; }
.q-asker .qa-av { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 11px; flex-shrink: 0; }
.q-asker b { color: var(--ink-2); font-weight: 600; }
.q-meta .qm { display: inline-flex; align-items: center; gap: 5px; }
.q-meta .qm svg { width: 14px; height: 14px; color: var(--ink-4); }
.q-meta .ans-count { color: var(--accent); font-weight: 600; }
.q-chev { width: 22px; height: 22px; color: var(--ink-4); flex-shrink: 0; transition: transform .25s; margin-top: 2px; }
.q-card.open .q-chev { transform: rotate(180deg); color: var(--accent); }

/* Answers (collapsible) */
.q-answers { max-height: 0; overflow: hidden; transition: max-height .35s ease; border-top: 1px solid transparent; }
.q-card.open .q-answers { border-top-color: var(--line); }
.q-answers-inner { padding: 8px 22px 22px; }
.q-full { font-size: 15px; color: var(--ink-2); line-height: 1.65; padding: 16px 0 18px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.answer { display: flex; gap: 14px; padding: 16px 0; }
.answer + .answer { border-top: 1px solid var(--line); }
.answer .a-av { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.answer .a-name { font-size: 14.5px; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 7px; }
.answer .a-name .ed { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; color: #fff; background: var(--accent); padding: 2px 8px; border-radius: 100px; }
.answer .a-name .ed svg { width: 11px; height: 11px; }
.answer .a-role { font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.answer .a-text { font-size: 15px; color: var(--ink-2); line-height: 1.65; margin-top: 9px; }
.answer .a-text a { color: var(--accent); font-weight: 500; text-decoration: underline; text-underline-offset: 2px; }
.answer .a-foot { display: flex; align-items: center; gap: 16px; margin-top: 12px; font-size: 12.5px; color: var(--ink-3); }
.answer .a-foot button { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-3); font-weight: 600; transition: .12s; }
.answer .a-foot button:hover { color: var(--accent); }
.answer .a-foot button svg { width: 15px; height: 15px; }

.q-reply { display: flex; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.q-reply .qr-av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px; flex-shrink: 0; background: var(--ink-3); }
.q-reply input { flex: 1; border: 1px solid var(--line); border-radius: 9px; padding: 10px 14px; font-family: inherit; font-size: 14px; outline: none; transition: .14s; }
.q-reply input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.q-reply .btn { flex-shrink: 0; }

.q-empty { text-align: center; padding: 60px 20px; color: var(--ink-3); }
.q-empty svg { width: 44px; height: 44px; color: var(--line-2); margin: 0 auto 14px; }
.q-empty p { font-size: 15px; }

/* Sidebar */
.qa-sidebar { position: sticky; top: calc(var(--header-h) + 24px); display: flex; flex-direction: column; gap: 22px; }
.qa-how { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; }
.qa-how h3 { font-size: 15px; font-weight: 700; color: var(--ink); margin-bottom: 16px; }
.qa-how-step { display: flex; gap: 12px; margin-bottom: 14px; }
.qa-how-step:last-child { margin-bottom: 0; }
.qa-how-step .n { width: 26px; height: 26px; border-radius: 8px; background: var(--accent); color: #fff; font-size: 13px; font-weight: 700; display: grid; place-items: center; flex-shrink: 0; }
.qa-how-step p { font-size: 13.5px; color: var(--ink-2); line-height: 1.45; }
.qa-how-step p b { color: var(--ink); font-weight: 700; }

.qa-toptags { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; }
.qa-toptags h3 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin-bottom: 14px; }
.qa-toptags a { display: flex; align-items: center; justify-content: space-between; font-size: 14px; color: var(--ink-2); padding: 8px 0; border-bottom: 1px solid var(--line); transition: .12s; font-weight: 500; }
.qa-toptags a:last-child { border-bottom: none; }
.qa-toptags a:hover { color: var(--accent); }
.qa-toptags a .n { font-size: 12.5px; color: var(--ink-4); background: var(--bg-2); padding: 2px 9px; border-radius: 100px; }

/* ============================================================
   Ask modal
   ============================================================ */
.ask-overlay { position: fixed; inset: 0; z-index: 500; background: rgba(15,27,45,.5); backdrop-filter: blur(4px); display: flex; align-items: flex-start; justify-content: center; padding: 56px 24px 24px; opacity: 0; transition: opacity .2s; overflow-y: auto; }
.ask-overlay.show { opacity: 1; }
.ask-modal { width: 100%; max-width: 580px; background: #fff; border-radius: var(--r-xl); box-shadow: var(--sh-3); padding: 30px 32px 28px; position: relative; transform: translateY(10px); transition: transform .22s; }
.ask-overlay.show .ask-modal { transform: none; }
.ask-close { position: absolute; top: 18px; right: 18px; width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: var(--ink-3); transition: .14s; }
.ask-close:hover { background: var(--bg-2); color: var(--ink); }
.ask-close svg { width: 19px; height: 19px; }
.ask-modal h2 { font-size: 23px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); }
.ask-modal .ask-sub { font-size: 14.5px; color: var(--ink-3); margin-top: 7px; line-height: 1.5; }
.ask-field { margin-top: 20px; }
.ask-field label { display: block; font-size: 13.5px; font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.ask-field label .req { color: var(--red); }
.ask-field input, .ask-field textarea, .ask-field select { width: 100%; border: 1.5px solid var(--line); border-radius: 10px; padding: 12px 14px; font-family: inherit; font-size: 15px; color: var(--ink); outline: none; transition: .14s; background: #fff; }
.ask-field input:focus, .ask-field textarea:focus, .ask-field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ask-field textarea { resize: vertical; min-height: 110px; line-height: 1.55; }
.ask-field .hint { font-size: 12.5px; color: var(--ink-4); margin-top: 6px; }
.ask-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.ask-foot .who { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--ink-3); }
.ask-foot .who .w-av { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 11px; }
.ask-actions { display: flex; gap: 10px; }

@media (max-width: 980px) {
  .qa-layout { grid-template-columns: 1fr; gap: 34px; }
  .qa-sidebar { position: static; flex-direction: row; flex-wrap: wrap; }
  .qa-sidebar > * { flex: 1; min-width: 260px; }
}
@media (max-width: 600px) {
  .qa-sort { width: 100%; }
  .qa-sort button { flex: 1; text-align: center; }
  .q-votes { width: 38px; }
  .qa-sidebar { flex-direction: column; }
}

/* Fix: [hidden] must override display:flex so the transparent overlay doesn't block clicks */
.ask-overlay[hidden] { display: none !important; }
