/* Community questions (pages_questions.py, lib/community-html.js, questions.js): the list, a thread, the reply box,
   and on Answers pages the ask box and "Was this helpful?" (ask.js). Reddit's shape in the site's own clothes: a vote
   column beside each post, a meta line, replies nested two levels with a rule down the left. Built only from the
   tokens in theme.css and the cards, buttons, fields and dialogs of pages.css, so day and night are the same CSS.
   Phone first; wider screens get more room, not a different layout. */

/* a button's or a form's own display must not undo [hidden] */
.questions-page [hidden], .ask-box[hidden], .ask-box [hidden], .helpful[hidden] { display: none; }

/* ---------- the list ---------- */
.q-head .lede { margin-bottom: 1rem; }
.q-head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.2rem; margin: 0 0 1rem; }
.q-mode { margin: 0 0 1rem; }
.q-choices { display: grid; gap: .6rem; margin: 0 0 1.2rem; }
.q-choice { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.q-choice-label { margin-right: .3rem; font: 600 .9rem/1.4 var(--font-sans); color: var(--ink-3); }
:lang(pa) .q-choice-label { font-family: var(--font-gurmukhi-sans); font-size: 1rem; }
.q-choice .chip { min-height: var(--tap); text-decoration: none; }
.q-choice .chip:hover { color: var(--ink); border-color: var(--accent); }
.q-choice .chip[aria-current="page"] { color: var(--accent-ink); border-color: var(--accent); background: var(--accent-soft); }

.q-list { display: grid; gap: .6rem; margin: 0; padding: 0; list-style: none; }
.q-item { display: grid; grid-template-columns: 2.6rem 1fr; gap: .2rem .8rem; align-items: start; padding: .8rem 1rem .8rem .6rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); box-shadow: var(--shadow-1); }
.q-score { margin: 0; display: grid; justify-items: center; color: var(--ink-3); }
.q-score > span { display: grid; justify-items: center; }
.q-score-n { font: 700 1rem/1.3 var(--font-sans); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.page-main .q-title { margin: 0; font: 500 1.2rem/1.35 var(--font-display); }
html:lang(pa) .page-main .q-title, .q-title a:lang(pa) { font: 700 1.2rem/1.6 var(--font-gurmukhi); }
.q-title a { color: var(--ink); text-decoration: none; }
.q-title a:hover { color: var(--accent-ink); text-decoration: underline; text-underline-offset: .2em; }
.q-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .8rem; margin: 1.6rem 0 0; }
.q-page-n { color: var(--ink-3); font: 600 .95rem/1.4 var(--font-sans); }
:lang(pa) .q-page-n { font-family: var(--font-gurmukhi-sans); }
.q-empty { color: var(--ink-2); }

/* ---------- the meta line, labels and flags (list and thread) ---------- */
.post-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .5rem; margin: .35rem 0 0;
  font: 500 .9rem/1.5 var(--font-sans); color: var(--ink-3); }
:lang(pa) .post-meta { font-family: var(--font-gurmukhi-sans); font-size: 1rem; line-height: 1.65; }
.post-meta .sep { opacity: .7; }
.post-meta a { color: inherit; text-decoration: none; }
.post-meta a:hover { color: var(--accent-ink); text-decoration: underline; }
.post-label { padding: 0 .5rem; color: var(--ink-2); border: 1px solid var(--line-2); border-radius: var(--r-pill); }
.post-label.is-seeded { color: var(--brass); border-color: color-mix(in srgb, var(--brass) 50%, transparent); }
.post-who { color: var(--ink-2); font-weight: 600; }
.post-who.is-gone { font-weight: 500; font-style: italic; }
.post-badge, .q-yours { padding: 0 .45rem; font-size: .82rem; font-weight: 600; color: var(--accent-ink); background: var(--accent-soft); border-radius: var(--r-pill); }
.post-flag { font-weight: 600; color: var(--ink-2); }
.post-flag.is-sourced { color: var(--st-with); }

/* ---------- the vote column ---------- */
.vote { display: grid; justify-items: center; align-content: start; gap: .1rem; }
.vote-btn { display: inline-grid; place-items: center; width: var(--tap); height: var(--tap); padding: 0; color: var(--ink-3);
  background: none; border: 1px solid transparent; border-radius: 50%; cursor: pointer;
  transition: color var(--dur-1) var(--ease), background-color var(--dur-1) var(--ease); }
.vote-btn:hover:not(:disabled) { color: var(--accent-ink); background: var(--accent-soft); }
.vote-btn[aria-pressed="true"] { color: var(--accent-ink); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.vote-down[aria-pressed="true"] { color: var(--river); background: color-mix(in srgb, var(--river) 16%, transparent); border-color: color-mix(in srgb, var(--river) 55%, transparent); }
.vote-btn:disabled { cursor: default; opacity: .45; }
.vote-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.vote-ico { width: 1.25rem; height: 1.25rem; fill: currentColor; }
.q-score .vote-ico { width: 1rem; height: 1rem; opacity: .6; }
.vote-score { font: 700 1rem/1.2 var(--font-sans); color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------- a thread ---------- */
.q-thread { display: grid; gap: 1.2rem; }
.post { display: grid; grid-template-columns: var(--tap) minmax(0, 1fr); gap: .2rem .7rem; align-items: start; }
.post.is-deleted { grid-template-columns: minmax(0, 1fr); }
.q-post { padding: 1.1rem 1.1rem 1.2rem .5rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow-2); }
.q-post.is-deleted { padding-left: 1.1rem; }
.page-main .q-post h1 { margin: .1rem 0 .2rem; font-size: clamp(1.6rem, 3.6vw, 2.3rem); line-height: 1.18; }
html:lang(pa) .page-main .q-post h1, .page-main .q-post h1:lang(pa) { font: 700 clamp(1.6rem, 3.6vw, 2.3rem)/1.4 var(--font-gurmukhi); }
.post-main { min-width: 0; }
.post-text { margin: .7rem 0 0; max-width: 66ch; white-space: pre-line; overflow-wrap: anywhere; font: 400 1.08rem/1.65 var(--font-body); color: var(--ink); }
.post-text:lang(pa), :lang(pa) > .post-text { font-family: var(--font-gurmukhi); font-size: 1.15rem; line-height: 1.85; }
.post-text a { color: var(--accent-ink); }
.post-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .9rem; margin: .5rem 0 0; }
.link-btn { min-height: var(--tap); padding: 0 .2rem; font: 600 .92rem/1.3 var(--font-sans); color: var(--ink-3); background: none; border: 0; cursor: pointer; }
:lang(pa) .link-btn { font-family: var(--font-gurmukhi-sans); font-size: 1.02rem; }
.link-btn:hover:not(:disabled) { color: var(--accent-ink); text-decoration: underline; text-underline-offset: .2em; }
.link-btn:disabled { cursor: default; }
.link-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-xs); }
.q-sure { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; flex-basis: 100%; }
.q-notice, .q-held, .q-note { margin: .6rem 0 0; padding: .55rem .8rem; font-size: .95rem; color: var(--ink-2); background: var(--surface-2); border-radius: var(--r-s); }
.q-held { color: var(--accent-ink); }
.q-note { margin: 0; }

/* the sourced page: the site's own voice, set apart from readers' posts */
.q-sourced { padding: 1rem 1.2rem; background: color-mix(in srgb, var(--st-with) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--st-with) 45%, var(--line)); border-radius: var(--r-m); }
.q-sourced .eyebrow { margin: 0; color: var(--st-with); }
.q-sourced-title { margin: .2rem 0 .3rem; font: 500 1.2rem/1.35 var(--font-display); }
:lang(pa) .q-sourced-title { font: 700 1.2rem/1.6 var(--font-gurmukhi); }
.q-sourced p:last-child { margin: 0; font-size: .95rem; }

/* replies, two levels, with a rule down the left */
.page-main .q-replies h2 { margin: .6rem 0 .8rem; }
.r-list, .r-children { margin: 0; padding: 0; list-style: none; }
.r-list { display: grid; gap: .9rem; }
.r-item { min-width: 0; }
.r-post { padding: .6rem .2rem .4rem 0; }
.r-children { margin: .3rem 0 0 calc(var(--tap) / 2 - 1px); padding-left: .8rem; border-left: 2px solid var(--line-2); display: grid; gap: .5rem; }
.r-children:empty { display: none; }
.r-item.is-mine > .r-post .vote-score { color: var(--ink-3); }
.r-reply-slot:empty { display: none; }
.r-reply-slot { margin: .4rem 0 0 calc(var(--tap) + .7rem); }
.r-reply-foot { margin: 1.4rem 0 0; }
.q-reply-form, .q-edit { display: grid; gap: .6rem; margin: .4rem 0 0; padding: 0; }
.q-reply-form .fix-actions, .q-edit .fix-actions { justify-content: flex-start; }
.q-hint { margin: 0; font-size: .9rem; }
.q-status { margin: 0; min-height: 1.4em; font-weight: 600; color: var(--accent-ink); }
.q-status:empty { min-height: 0; }
.q-human:empty { display: none; }

/* dialogs: the site's correction form (pages.css .fix), with a radio list for the reasons */
.q-reasons { display: grid; gap: .35rem; margin: 0; padding: 0; border: 0; }
.q-reasons legend { margin: 0 0 .4rem; padding: 0; font-weight: 600; }
:lang(pa) .q-reasons legend { font-size: 1.08rem; }
.q-reasons .check { min-height: var(--tap); }
.field select { width: 100%; min-height: var(--tap); padding: .5rem .7rem; font: 400 1.02rem/1.4 var(--font-sans); color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r-s); }
.field select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.q-gate-sign { margin: 0; }

/* ---------- the community rules ---------- */
.q-rules { padding-left: 1.4rem; }
.q-rules li { margin: 0 0 .7rem; }

/* ---------- on Answers pages: the ask box and "Was this helpful?" (ask.js) ---------- */
.helpful { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin: 2rem 0 0; padding: 1rem 0 0; border-top: 1px solid var(--line); }
.helpful-q { margin: 0; font: 600 1rem/1.4 var(--font-sans); color: var(--ink-2); }
:lang(pa) .helpful-q { font-family: var(--font-gurmukhi-sans); font-size: 1.1rem; }
.helpful-btns { display: flex; gap: .5rem; }
.helpful .q-status { flex-basis: 100%; }
.ask-box { margin: 2rem 0 0; padding: 1.2rem 1.3rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow-1); }
.page-main .ask-box h2 { margin: 0 0 .4rem; }
.ask-box > p { margin: 0 0 .8rem; }
.ask-form { display: grid; gap: .8rem; }
.ask-form .fix-actions { margin: 0; justify-content: flex-start; }
.ask-more { margin: 1rem 0 0; }
.ask-trap { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (min-width: 761px) {
  .q-choices { grid-template-columns: auto auto; justify-content: space-between; }
  .q-item { grid-template-columns: 3rem 1fr; padding: .9rem 1.2rem .9rem .7rem; }
  .q-title, .page-main .q-title { font-size: 1.3rem; }
}
@media (max-width: 760px) {
  .q-post { padding: .9rem .8rem 1rem .2rem; border-radius: var(--r-m); }
  .r-children { padding-left: .55rem; }
  .r-reply-slot { margin-left: 0; }
  .ask-box { padding: 1rem; border-radius: var(--r-m); }
}
