/*
  The poll and the comments under a page (decision 0076), on top of site.css
  (the tokens, .button) and news.css. Copied to site/assets/discussion.css by
  npm run news:build. Readers 40–70 on phones, most inside Facebook's own
  browser: answers and buttons at least 3 rem tall, text never under 16 px,
  one column. Sizes in rem, so the phone's own text size carries.
*/

.talk { margin: 2.25rem 0 0; scroll-margin-top: 1rem; }
.talk [hidden] { display: none; }

/* ---------- The poll ---------- */

.poll { background: var(--card); border: 1px solid var(--hair); border-top: 5px solid var(--navy); border-radius: 12px; padding: 1.1rem 1.1rem 0.9rem; margin: 0 0 2rem; }
.talk__eyebrow { margin: 0 0 0.35rem; font-family: var(--mono); font-size: 0.85rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--navy-2); }
/* .talk before the class: a page's own h2 rule (a party page's, with its line under) must not reach these */
.talk .poll__question { margin: 0 0 0.9rem; padding: 0; border: 0; font-size: 1.45rem; line-height: 1.2; letter-spacing: -0.02em; font-weight: 650; }
.poll__answers { display: grid; gap: 0.55rem; }
.poll__answer { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; width: 100%; min-height: 3.4rem; padding: 0.7rem 1rem; overflow: hidden; font: inherit; font-size: 1.15rem; font-weight: 600; line-height: 1.25; text-align: left; color: var(--ink); background: #fff; border: 2px solid var(--navy); border-radius: 10px; cursor: pointer; -webkit-appearance: none; appearance: none; -webkit-tap-highlight-color: transparent; }
.poll__answer:hover { background: #eef4fc; }
.poll__answer:focus-visible { outline: 3px solid var(--navy-2); outline-offset: 2px; }
.poll__answer[disabled] { color: var(--ink); cursor: default; opacity: 1; }
.poll__bar { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--mist); transition: width 0.5s ease; }
.poll__label, .poll__share { position: relative; }
.poll__share { flex: none; font-weight: 650; font-variant-numeric: tabular-nums; }
.poll--voted .poll__answer { border-color: var(--hair); background: #fff; }
.poll--voted .poll__answer.is-mine { border-color: var(--navy); }
.poll--voted .poll__answer.is-mine .poll__bar { background: var(--light); }
.poll--voted .poll__answer.is-mine .poll__label::after { content: " ✓"; }
.poll__note { margin: 0.7rem 0 0; font-size: 1rem; color: var(--ink-2); }
.poll__change { padding: 0.35rem 0; font: inherit; color: var(--navy-2); background: none; border: 0; text-decoration: underline; cursor: pointer; }
@media (prefers-reduced-motion: reduce) { .poll__bar { transition: none; } }

/* ---------- The comment box ---------- */

.talk .talk__heading { margin: 0 0 0.8rem; padding-bottom: 0.45rem; font-size: 1.35rem; line-height: 1.2; letter-spacing: -0.02em; font-weight: 650; border-bottom: 2px solid var(--night); }
.talk__count { font-weight: 500; color: var(--ink-2); }
.talk__noscript { margin: 0 0 1rem; font-size: 1rem; color: var(--ink-2); }

.comment-form { margin: 0 0 1.5rem; }
.comment-form__label { display: block; margin: 0 0 0.4rem; font-size: 1.1rem; font-weight: 600; }
.comment-form__label--name { margin-top: 0.75rem; }
.comment-form__label span { font-weight: 400; color: var(--ink-2); }
.comment-form__text, .comment-form__name { display: block; width: 100%; padding: 0.7rem 0.9rem; font: inherit; font-size: 1.15rem; line-height: 1.4; color: var(--ink); background: #fff; border: 2px solid var(--ink); border-radius: 12px; -webkit-appearance: none; appearance: none; }
.comment-form__text { min-height: 6.5rem; resize: vertical; }
.comment-form__name { max-width: 22rem; min-height: 3.25rem; }
.comment-form__name::placeholder { color: var(--ink-2); opacity: 1; }
.comment-form__text:focus, .comment-form__name:focus { outline: 3px solid var(--navy-2); outline-offset: 2px; }
.comment-form__message { margin: 0.6rem 0 0; font-size: 1.05rem; font-weight: 600; color: var(--alert); }
.comment-form__message.is-ok { color: var(--for); }
.comment-form__send { max-width: 22rem; }

/* ---------- The comments ---------- */

.comments { margin: 0; padding: 0; list-style: none; }
.comment { padding: 0.9rem 0; border-top: 1px solid var(--hair); }
.comments > .comment:first-child { border-top: 0; }
.comment__head { margin: 0 0 0.25rem; font-size: 1rem; color: var(--ink-2); }
.comment__name { color: var(--ink); font-weight: 650; }
.comment__body { margin: 0; font-size: 1.15rem; line-height: 1.45; white-space: pre-line; overflow-wrap: anywhere; }
.comment__reply { margin: 0.2rem 0 0; padding: 0.45rem 0; min-height: 2.5rem; font: inherit; font-size: 1rem; font-weight: 600; color: var(--navy-2); background: none; border: 0; cursor: pointer; }
.comment__reply:hover { text-decoration: underline; }
.comments--replies { margin: 0.35rem 0 0 0.25rem; padding-left: 0.9rem; border-left: 3px solid var(--mist); }
.comments--replies:empty { display: none; }
.comments--replies .comment { padding: 0.65rem 0; }
.comment--new { animation: comment-new 2.4s ease-out; }
@keyframes comment-new { from { background: #dcebfb; box-shadow: 0 0 0 0.5rem #dcebfb; } to { background: transparent; box-shadow: 0 0 0 0.5rem transparent; } }
@media (prefers-reduced-motion: reduce) { .comment--new { animation: none; } }
.comments__empty { margin: 0; font-size: 1.05rem; color: var(--ink-2); }
/* A long list: the first ten, then a button for all of them (discussion.js folds it; without the script all show) */
.comments--folded > .comment:nth-child(n+11) { display: none; }
.comments__more { display: block; width: 100%; min-height: 3.4rem; margin: 0.5rem 0 0; padding: 0.7rem 1rem; font: inherit; font-size: 1.1rem; font-weight: 650; color: var(--navy); background: #fff; border: 2px solid var(--navy); border-radius: 12px; cursor: pointer; }
.comments__more:hover { background: #eef4fc; }

.reply-form { margin: 0.5rem 0 0.25rem; }
.reply-form .comment-form__text { min-height: 4.5rem; }
.reply-form__buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1.25rem; }
.reply-form__buttons .button { flex: 1 1 12rem; min-height: 3.25rem; }
.reply-form__cancel { min-height: 3rem; margin-top: 0.75rem; padding: 0.5rem 0.25rem; font: inherit; font-size: 1.05rem; color: var(--ink-2); background: none; border: 0; text-decoration: underline; cursor: pointer; }

/* On a party page the block follows the last section */
.party .talk { margin-top: 2.5rem; }
