/**
 * polls.css
 * -----------------------------------------------------------------------
 * 투표 위젯 스타일. index.html(style.css)과 폴 페이지(site.css) 양쪽에서
 * 같이 쓰이므로, 두 곳 모두에 정의된 :root 변수만 사용한다.
 */

.poll {
  --opt-color: var(--flame);
  position: relative;
  z-index: 1;
  text-align: left;
}

/* hidden 속성은 브라우저 기본 스타일(display:none)로 동작하는데, 아래에서
   .poll-options에 display:grid, .poll-results에 display:flex를 주는 순간
   그 기본값을 덮어써서 숨겨지지 않는다. 그래서 명시적으로 다시 눌러준다. */
.poll [hidden],
.poll[hidden] {
  display: none !important;
}

/* ===== 머리말 ===== */
.poll-kicker {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--flame);
  margin-bottom: 8px;
}

.poll-question {
  font-family: "Euljiro", "Black Han Sans", "Noto Sans KR", sans-serif;
  color: var(--cream);
  margin: 0 0 16px;
  line-height: 1.4;
}

.poll--compact .poll-question {
  font-size: 17px;
  margin-bottom: 12px;
}

.poll--full .poll-question {
  font-size: 30px;
  margin-bottom: 24px;
}

/* ===== 선택지 버튼 ===== */
.poll-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.poll-options.is-voting {
  pointer-events: none;
}

.poll-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 14px 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--cream);
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.poll-option:hover {
  border-color: var(--opt-color);
  background: rgba(255, 255, 255, 0.09);
  transform: translateY(-2px);
}

.poll-option.is-selected {
  border-color: var(--opt-color);
  background: color-mix(in srgb, var(--opt-color) 22%, transparent);
}

.poll-option-emoji {
  font-size: 24px;
  line-height: 1.2;
}

.poll--full .poll-option {
  padding: 22px 16px;
}

.poll--full .poll-option-emoji {
  font-size: 34px;
}

.poll-option-label {
  font-weight: 700;
  font-size: 15px;
}

.poll--full .poll-option-label {
  font-size: 19px;
}

.poll-option-sub {
  font-size: 11px;
  color: var(--muted-2);
  line-height: 1.4;
}

.poll--full .poll-option-sub {
  font-size: 13px;
}

/* ===== 결과 막대 ===== */
.poll-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.poll-bar {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid transparent;
}

.poll-bar.is-mine {
  border-color: var(--opt-color);
}

.poll-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: color-mix(in srgb, var(--opt-color) 45%, transparent);
  transition: width 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.poll-bar.is-mine .poll-bar-fill {
  background: color-mix(in srgb, var(--opt-color) 80%, transparent);
}

.poll-bar-text {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  font-size: 14px;
  font-weight: 700;
  color: var(--cream);
}

.poll--full .poll-bar-text {
  padding: 18px 20px;
  font-size: 16px;
}

.poll-bar-pct {
  font-family: "Euljiro", "Black Han Sans", "Noto Sans KR", sans-serif;
  font-size: 17px;
}

.poll--full .poll-bar-pct {
  font-size: 22px;
}

.poll-total {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted-2);
}

/* ===== 액션 ===== */
.poll-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

.poll-btn {
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--cream);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.poll-btn:hover {
  background: rgba(255, 255, 255, 0.13);
}

.poll-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.poll-btn--primary {
  color: var(--ink);
  background: linear-gradient(135deg, var(--flame), var(--red));
  border-color: transparent;
}

.poll-btn--primary:hover {
  background: linear-gradient(135deg, var(--flame), var(--red));
  filter: brightness(1.08);
}

.poll-more {
  font-size: 12px;
  color: var(--muted-2);
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.poll-more:hover {
  color: var(--flame);
  border-color: var(--flame);
}

.poll-status {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--flame);
}

.poll-note {
  margin: 12px 0 0;
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted-2);
}

/* ===== 댓글 ===== */
.poll-comments {
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.poll-comments-title {
  font-family: "Euljiro", "Black Han Sans", "Noto Sans KR", sans-serif;
  font-size: 20px;
  color: var(--cream);
  margin: 0 0 14px;
}

.poll-comment-form {
  display: flex;
  gap: 8px;
}

.poll-comment-input {
  flex: 1;
  min-width: 0;
  padding: 13px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: var(--cream);
  font-family: inherit;
  font-size: 14px;
}

.poll-comment-input::placeholder {
  color: var(--muted-2);
}

.poll-comment-input:focus {
  outline: none;
  border-color: var(--flame);
}

.poll-nick {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--muted-2);
}

.poll-nick strong {
  color: var(--muted);
  font-weight: 700;
}

.poll-link-btn {
  padding: 0;
  border: none;
  background: none;
  color: var(--muted-2);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
}

.poll-link-btn:hover {
  color: var(--flame);
}

.poll-comment-list {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.poll-comment {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.poll-comment--empty {
  color: var(--muted-2);
  font-size: 13px;
  background: none;
  border-style: dashed;
}

.poll-comment-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 11px;
  color: var(--muted-2);
}

.poll-comment-side {
  padding: 3px 9px;
  border-radius: 999px;
  font-weight: 700;
  color: var(--opt-color);
  border: 1px solid var(--opt-color);
}

.poll-comment-nick {
  color: var(--muted);
  font-weight: 700;
}

.poll-comment-time {
  margin-left: auto;
}

.poll-comment-report {
  font-size: 11px;
}

.poll-comment-body {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--cream);
  word-break: break-word;
}

/* ===== 추천 피드 카드에 심는 초소형 투표 ===== */
.card-poll {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 320px;
  margin-top: 14px;
}

.card-poll [hidden] {
  display: none !important;
}

.card-poll-teaser {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 16px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--cream);
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  transition: background 0.15s ease, transform 0.15s ease;
}

.card-poll-teaser:hover,
.card-poll-teaser:active {
  background: rgba(0, 0, 0, 0.58);
  transform: translateY(-1px);
}

.card-poll-teaser-emoji {
  font-size: 16px;
  letter-spacing: -2px;
}

.card-poll-choose {
  display: flex;
  gap: 8px;
}

.card-poll-choice {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 13px 8px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(6px);
  border: 1px solid color-mix(in srgb, var(--opt-color) 55%, transparent);
  color: var(--cream);
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  transition: background 0.15s ease, transform 0.15s ease;
}

.card-poll-choice:hover,
.card-poll-choice:active {
  background: color-mix(in srgb, var(--opt-color) 30%, rgba(0, 0, 0, 0.42));
  transform: translateY(-1px);
}

.card-poll-choice-emoji {
  font-size: 17px;
}

.card-poll-result {
  display: block;
}

.card-poll-result-bar {
  display: flex;
  height: 32px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.card-poll-result-fill {
  display: block;
  height: 100%;
  width: 0;
  transition: width 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  opacity: 0.85;
}

.card-poll-result-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 7px;
  font-size: 11px;
}

.card-poll-result-label {
  font-weight: 700;
  color: var(--cream);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.card-poll-result-badge {
  flex-shrink: 0;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 107, 53, 0.2);
  color: var(--flame);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.04em;
}

/* ===== 홈 화면에 얹히는 카드 ===== */
.home-poll {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 320px;
  margin-top: 26px;
  padding: 16px 18px 18px;
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(43, 24, 16, 0.9), rgba(28, 20, 16, 0.75));
  border: 1px solid rgba(255, 255, 255, 0.09);
}

/* ===== 폴 목록 페이지 ===== */
.poll-index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.poll-index-card {
  display: block;
  padding: 24px;
  border-radius: 20px;
  background: linear-gradient(160deg, var(--ink-2), var(--ink));
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.poll-index-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.2);
}

.poll-index-q {
  font-family: "Euljiro", "Black Han Sans", "Noto Sans KR", sans-serif;
  font-size: 19px;
  color: var(--cream);
  margin: 0 0 10px;
  line-height: 1.4;
}

.poll-index-vs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.poll-index-vs em {
  font-style: normal;
  color: var(--muted-2);
}

@media (max-width: 420px) {
  .poll--full .poll-question {
    font-size: 24px;
  }
  .poll-comment-form {
    flex-direction: column;
  }
  .poll-comment-input {
    width: 100%;
  }
}
