/*
 * Лайки, оценки комментариев, закладки и опрос (lib/reactions) — своё, не из шаблона DLE; стили самого опроса —
 * из poll.tpl старого шаблона wol.su (там они были встроены в шаблон), радио-кнопки — только внутри опроса.
 */

/* ── подвал карточки и статьи: лайк и закладка ── */
.react-host { position: relative; }
.article_footer .react-like, .article_footer .react-fav { cursor: pointer; }
/* Уже лайкнул / в закладках — как отмеченный пункт на wol.su (`li.active > i`): цвет сайта и кружок под иконкой. */
.article_footer .react-like.is-active i, .article_footer .react-fav.is-active i {
  color: var(--maincolor, #3394e6);
  background: color-mix(in srgb, var(--t-accent, #f11a36) 12%, transparent);
}
.article_footer .react-like.is-active .ratingtypeplus { color: var(--maincolor, #3394e6); }
/* Наведение — как у остальных пунктов подвала (responsive.css). Правило шаблона wol.su ловит кнопку лайка DLE по
   `a[onclick]`, у наших кнопок onclick в разметке нет — поэтому повторено для них. */
@media (hover: hover) {
  .article_footer ul > li:hover > .react-like, .article_footer ul > li:hover > .react-fav { color: var(--maincolor); }
  .article_footer ul > li:hover > .react-like > i, .article_footer ul > li:hover > .react-fav > i {
    background: color-mix(in srgb, var(--t-accent, #f11a36) 12%, transparent);
  }
}
.article_footer .react-like[aria-busy], .article_footer .react-fav[aria-busy] { opacity: 0.6; }
/* Закладка в подвале статьи — справа, вместе с просмотрами: отступ «до конца строки» берёт она, а не просмотры. */
main article .article_footer ul > li.story-fav { margin-left: auto; }
main article .article_footer ul > li.story-fav + li:last-child { margin-left: 0; }

/* ── подсказка у кнопки: «войдите», «слишком часто», «добавлено в закладки» ── */
.react-hint {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  display: flex;
  gap: 8px;
  align-items: center;
  width: max-content;
  max-width: min(320px, 80vw);
  padding: 8px 10px;
  border-radius: var(--borderradius, 6px);
  background: var(--color2, #222);
  color: var(--textcolor, #ddd);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  font-size: 13px;
  line-height: 1.35;
  white-space: normal;
  text-transform: none;
  font-weight: normal;
}
.react-hint a { color: var(--maincolor, #3394e6); font-weight: bold; }
.react-hint__close {
  margin-left: auto;
  padding: 0 2px;
  border: 0;
  background: none;
  color: inherit;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
}
.react-hint__close:hover { opacity: 1; }

/* ── комментарий: плюс и минус ── */
.com_rating .cm-vote {
  display: inline-flex;
  padding: 2px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  opacity: 0.7;
}
.com_rating .cm-vote:hover, .com_rating .cm-vote:focus-visible { opacity: 1; }
.com_rating .cm-vote.is-active { opacity: 1; color: #4fb200; }
.com_rating .cm-vote--down.is-active { color: #f11a36; }
.com_rating .react-hint { left: auto; right: 0; }

/* ── опрос (poll.tpl) ── */
.poll_container {display: grid; gap: 20px; margin: 0 auto; padding: 20px; max-width: 600px; background-color: var(--color2); border-radius: var(--borderradius); line-height: 1.3; position: relative;}
.poll_container .text-center {font-size: clamp(16px, 4vw, 22px); font-weight: bold; text-align: center;}
.vote_list .poll_answers {display: grid; gap: 20px;}
.vote_list .pollanswer {display: flex; gap: 20px; align-items: center;}
.vote_list .pollanswer input {width: auto; flex: none;}
.vote_list .pollanswer label {width: 100%; cursor: pointer;}
.poll_container .poll_btns {display: flex; gap: 20px; flex-wrap: wrap;}
.poll_btns .btn[type="submit"] {color: var(--color_white); background-color: var(--maincolor);}
.poll_btns .btn[type="submit"]:hover {background-color: var(--maincolordark);}
.poll_btns .btn[type="submit"]:disabled {opacity: 0.6; cursor: default;}
.poll_container input[type="radio"], .poll_container input[type="checkbox"] {-webkit-appearance: none;appearance: none;width: 18px;height: 18px;border: 2px solid var(--color_lightgray);border-radius: 50%;background-color: var(--color_white);position: relative;cursor: pointer;transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;}
.poll_container input[type="checkbox"] {border-radius: 4px;}
.poll_container input[type="radio"]:checked, .poll_container input[type="checkbox"]:checked {background-color: var(--maincolor);border-color: var(--maincolor);}
.poll_container input[type="radio"]::after, .poll_container input[type="checkbox"]::after {content: '';position: absolute;top: 50%;left: 50%;width: 8px;height: 8px;background-color: var(--color_white);border-radius: 50%;transform: translate(-50%, -50%) scale(0);transition: transform 0.2s ease-in-out;}
.poll_container input[type="checkbox"]::after {border-radius: 2px;}
.poll_container input[type="radio"]:checked::after, .poll_container input[type="checkbox"]:checked::after {transform: translate(-50%, -50%) scale(1);}
.poll_container input[type="radio"]:hover:not(:disabled), .poll_container input[type="checkbox"]:hover:not(:disabled) {background-color: var(--maincolordark);border-color: var(--color3);}
.poll_container input:active:not(:disabled) {transform: scale(0.95);}

/* итоги: ответ, число и полоса (полосы — .pollprogress из fullpage.css) */
.poll_results {display: grid; gap: 14px;}
.poll_result {display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: baseline;}
.poll_result .pollprogress {grid-column: 1 / -1; margin: 0;}
.poll_result__num {white-space: nowrap; opacity: 0.8; font-size: 14px;}
.poll_result.is-mine .poll_result__text {font-weight: bold;}
.poll_result__mine {font-weight: normal; opacity: 0.7; font-size: 13px;}
.poll_container .vote_votes {text-align: center;}
.poll_container .poll_link {padding: 0; border: 0; background: none; color: var(--maincolor); font: inherit; cursor: pointer; text-decoration: underline;}
.poll_container .react-hint {top: auto; bottom: 12px; left: 50%; transform: translateX(-50%);}

/* Телефон: подсказка — полосой внизу экрана, а не у кнопки (у правого края она уходила бы за экран). */
@media (max-width: 768px) {
  .react-hint, .com_rating .react-hint, .poll_container .react-hint {
    position: fixed;
    top: auto;
    right: 12px;
    bottom: 16px;
    left: 12px;
    width: auto;
    max-width: none;
    transform: none;
  }
}
