/**
 * WP Thread Comments - メインスタイルシート
 */

/* ============================================
   コメントコンテナ
============================================ */
.wtc-comments-wrapper {
  max-width: 900px;
  margin: 40px auto;
  padding: 20px;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
}

/* ヘッダー */
.wtc-comments-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 15px;
  border-bottom: 2px solid #e5e5e5;
}

.wtc-comments-title {
  font-size: 20px;
  font-weight: 600;
  margin: 0;
  color: #1a1a1b;
}

/* ============================================
   ソートメニュー
============================================ */
.wtc-sort-menu {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wtc-sort-menu label {
  font-size: 14px;
  color: #7c7c7c;
  margin: 0;
}

.wtc-sort-select {
  padding: 6px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background-color: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.wtc-sort-select:hover {
  border-color: #999;
}

.wtc-sort-select:focus {
  outline: none;
  border-color: #0079d3;
  box-shadow: 0 0 0 1px #0079d3;
}

/* ============================================
   コメントフォーム
============================================ */
.wtc-main-comment-form {
  margin-bottom: 30px;
}

.wtc-comment-form {
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 15px;
}

.wtc-form-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.wtc-input {
  flex: 1;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.wtc-input:focus {
  outline: none;
  border-color: #0079d3;
}

.wtc-textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  min-height: 100px;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.wtc-textarea:focus {
  outline: none;
  border-color: #0079d3;
}

.wtc-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.wtc-form-actions {
  display: flex;
  gap: 10px;
}

.wtc-submit-btn,
.wtc-cancel-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
}

.wtc-submit-btn {
  background-color: #0079d3;
  color: #fff;
}

.wtc-submit-btn:hover {
  background-color: #0060a8;
}

.wtc-cancel-btn {
  background-color: #edeff1;
  color: #1a1a1b;
}

.wtc-cancel-btn:hover {
  background-color: #d7dadc;
}

/* ============================================
   コメントリスト
============================================ */
.wtc-comments-list {
  margin-top: 20px;
}

.wtc-no-comments {
  text-align: center;
  padding: 40px 20px;
  color: #7c7c7c;
}

/* ============================================
   個別コメント
============================================ */
.wtc-comment {
  position: relative;
  margin-bottom: 15px;
  padding: 12px;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  transition: all 0.2s;
}

.wtc-comment:hover {
  border-color: #999;
}

/* 新規投稿コメントのハイライト（黄色を避け、自然な淡色でフェード） */
.wtc-new-comment-highlight {
  animation: wtc-new-comment-glow 2s ease-out;
}

@keyframes wtc-new-comment-glow {
  0% {
    background-color: rgba(210, 244, 255, 0.85);
    border-color: rgba(0, 121, 211, 0.35);
    box-shadow: 0 0 0 3px rgba(0, 121, 211, 0.12);
  }
  100% {
    background-color: transparent;
    border-color: transparent;
    box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
  }
}

/* 返信（子コメント）は控えめに：背景無し＋左ボーダーだけフェード */
.wtc-new-reply-highlight {
  animation: wtc-new-reply-pulse 2s ease-out;
}

@keyframes wtc-new-reply-pulse {
  0% {
    border-left-color: rgba(0, 121, 211, 0.6);
    box-shadow: -3px 0 0 0 rgba(0, 121, 211, 0.18);
  }
  100% {
    border-left-color: transparent;
    box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
  }
}

/* 階層表示用のインデント */
.wtc-children {
  margin-left: 30px;
  margin-top: 10px;
}

/* スコアに応じた色分け */
.wtc-score-high {
  border-left: 3px solid #ff4500;
}

.wtc-score-medium {
  border-left: 3px solid #ff8b60;
}

.wtc-score-negative {
  border-left: 3px solid #7193ff;
}

.wtc-score-low {
  border-left: 3px solid #5a75cc;
}

/* コメントヘッダー */
.wtc-comment-header {
  margin-bottom: 10px;
}

.wtc-comment-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wtc-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.wtc-author {
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1b;
}

.wtc-date {
  font-size: 12px;
  color: #7c7c7c;
}

/* コメント本文 */
.wtc-comment-body {
  margin-left: 42px;
}

.wtc-comment-content {
  margin-bottom: 10px;
  color: #1a1a1b;
  line-height: 1.5;
  word-wrap: break-word;
}

.wtc-comment-content p {
  margin: 0 0 10px;
}

.wtc-comment-content p:last-child {
  margin-bottom: 0;
}

/* ============================================
   コメントアクション
============================================ */
.wtc-comment-actions {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: 8px;
}

/* 投票ボタン */
.wtc-voting {
  display: flex;
  align-items: center;
  gap: 5px;
}

.wtc-vote-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  background: transparent;
  color: #878a8c;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.wtc-vote-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  display: block;
}

/* キンクマっぽい色合い（黒のまま） */
.wtc-like-btn .wtc-icon-img {
  /* filter: none; */
}

/* 同じトーンの青系 */
.wtc-reply-btn .wtc-icon-img {
  filter: invert(70%) sepia(30%) saturate(1000%) hue-rotate(180deg)
    brightness(100%);
}

.wtc-floating-heart {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  pointer-events: none;
  animation: wtc-float-up 0.8s ease-out forwards;
  z-index: 100;

  background-color: #fa8ea4; /* やわらかい赤 */
  -webkit-mask-image: url(../img/heart.svg);
  mask-image: url(../img/heart.svg);
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}

@keyframes wtc-float-up {
  0% {
    transform: translate(-50%, -50%) translateY(0) scale(0.5);
    opacity: 0;
  }
  50% {
    transform: translate(-50%, -50%) translateY(-15px) scale(1.2);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) translateY(-30px) scale(1);
    opacity: 0;
  }
}

/* パーティクル用スタイル */
.wtc-particle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  background-color: #fa8ea4; /* やわらかい赤 */
  pointer-events: none;
  z-index: 90;
  border-radius: 50%;
  opacity: 0;
}

.wtc-particle-heart {
  -webkit-mask-image: url(../img/heart.svg);
  mask-image: url(../img/heart.svg);
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  border-radius: 0; /* ハート画像使うので丸み解除 */
}

@keyframes wtc-splash {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 1;
  }
  100% {
    transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty)))
      scale(1.5);
    opacity: 0;
  }
}

.wtc-vote-btn:hover {
  background-color: #f6f7f8;
  border-radius: 2px;
}

.wtc-like-btn:hover,
.wtc-like-btn.voted {
  color: #e0245e;
}

.wtc-icon-img {
  vertical-align: middle;
}

.wtc-like-btn svg,
.wtc-like-btn .wtc-icon-img {
  transition: transform 0.2s;
}

.wtc-like-btn:active svg,
.wtc-like-btn:active .wtc-icon-img {
  transform: scale(1.2);
}

.wtc-vote-score {
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1b;
  min-width: 5px;
  text-align: center;
}

/* 返信ボタン */
.wtc-reply-btn,
.wtc-collapse-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border: none;
  background: transparent;
  color: #878a8c;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 2px;
  transition: background-color 0.2s;
}

.wtc-reply-btn:hover,
.wtc-collapse-btn:hover {
  background-color: #f6f7f8;
}

/* 折りたたみ機能 */
.wtc-comment.collapsed .wtc-comment-header,
.wtc-comment.collapsed .wtc-comment-body,
.wtc-comment.collapsed .wtc-reply-form-container,
.wtc-comment.collapsed .wtc-children {
  display: none;
}

.wtc-collapse-icon {
  transition: transform 0.2s;
}

.wtc-comment.collapsed .wtc-collapse-icon {
  transform: rotate(-90deg);
}

/* 返信フォームコンテナ */
.wtc-reply-form-container {
  margin-top: 10px;
}

/* ============================================
   ローディング
============================================ */
.wtc-loading {
  text-align: center;
  padding: 40px 20px;
}

.wtc-spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 15px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #0079d3;
  border-radius: 50%;
  animation: wtc-spin 1s linear infinite;
}

@keyframes wtc-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ページネーション */
.wtc-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  margin-top: 24px;
  padding: 12px 0;
}

.wtc-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background-color: #fff;
  color: #1a1a1b;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.wtc-page-btn:hover:not([disabled]):not(.wtc-page-active) {
  background-color: #f6f7f8;
  border-color: #999;
}

.wtc-page-btn[disabled] {
  opacity: 0.4;
  cursor: default;
}

.wtc-page-active {
  background-color: #0079d3;
  border-color: #0079d3;
  color: #fff;
  font-weight: 600;
  cursor: default;
}

.wtc-page-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  color: #7c7c7c;
  font-size: 14px;
}

.wtc-page-numbers {
  display: flex;
  gap: 4px;
}

.wtc-page-prev,
.wtc-page-next {
  font-weight: 600;
}

/* コメントクローズメッセージ */
.wtc-comments-closed {
  padding: 20px;
  background-color: #f6f7f8;
  border-radius: 4px;
  text-align: center;
  color: #7c7c7c;
}

/* ============================================
   レスポンシブデザイン
============================================ */
@media (max-width: 768px) {
  .wtc-comments-wrapper {
    padding: 10px;
  }

  .wtc-comments-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .wtc-children {
    margin-left: 15px;
  }

  .wtc-form-row {
    flex-direction: column;
  }

  .wtc-comment-body {
    margin-left: 0;
  }

  .wtc-comment-meta {
    flex-wrap: wrap;
  }
}

/* ============================================
   スコア更新アニメーション
============================================ */
.wtc-score-update {
  animation: wtc-score-pop 0.3s ease;
}

@keyframes wtc-score-pop {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.3);
  }
  100% {
    transform: scale(1);
  }
}

/* ============================================
   承認待ち通知
============================================ */
.wtc-pending-notice {
  padding: 12px 16px;
  margin: 10px 0;
  background-color: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 4px;
  color: #856404;
  font-size: 14px;
}

.wtc-pending-notice p {
  margin: 0;
}

/* 文字数カウンター */
.wtc-char-counter {
  font-size: 12px;
  color: #999;
  white-space: nowrap;
}

.wtc-char-counter.wtc-char-over {
  color: #e53935;
  font-weight: bold;
}

/* ============================================
   コメント付き投稿一覧 [wtc_commented_posts]
============================================ */
.wtc-commented-posts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.wtc-cp-card {
  display: flex;
  flex-direction: column;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  background: #fff;
  transition: box-shadow 0.2s, transform 0.2s;
}

.wtc-cp-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.wtc-cp-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #f0f0f0;
}

.wtc-cp-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.wtc-cp-no-thumbnail {
  width: 100%;
  height: 100%;
  background: #e0e0e0;
}

.wtc-cp-info {
  padding: 12px 16px;
}

.wtc-cp-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.wtc-cp-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #888;
}
