/* =========================================
   COMMENT UI
   全記事共通のコメント欄整理
   ========================================= */

/* コメント全体 */
#comments {
  margin-top: 40px;
  padding: 28px 0 32px;
  background: rgba(0, 0, 0, 0.025);
}

/* 上の「｜コメント」は消す */
#comments > .c-secTitle,
#comments > .p-commentArea__title,
#comments > .comments-title,
#comments > .l-articleBottom__title,
section#comments > h2.c-secTitle,
section#comments > h2.l-articleBottom__title {
  display: none !important;
}


/* 「コメントする」は残す */
#comments .comment-reply-title,
#comments #reply-title {
  display: block !important;
  margin: 0 0 18px;
  padding: 0;
  font-size: 16px;
  line-height: 1.4;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.72);
  border: 0;
}

/* 「コメント一覧（x件）」も残す */
#comments .comments-title {
  display: block !important;
  margin: 28px 0 14px;
  padding: 0;
  font-size: 15px;
  line-height: 1.4;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.62);
}

/* コメントフォーム全体
   外側の大きい箱感を消す */
#comments .p-commentArea,
#comments .comment-respond,
#comments #respond,
#comments .comment-form {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

/* フォームの幅 */
#comments .comment-respond,
#comments #respond {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px !important;
  box-sizing: border-box;
}

/* 一覧も同じ幅 */
#comments .comments-title,
#comments .comment-list,
#comments .children,
#comments .comment-navigation {
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
  box-sizing: border-box;
}

/* ラベルは基本消す */
#comments label {
  display: none !important;
}

/* cookies同意だけ残す */
#comments .comment-form-cookies-consent label {
  display: inline !important;
}

/* 必須マークは消す */
#comments .required {
  display: none !important;
}

/* 元の注意書きは隠す → iボタン側へ */
#comments .comment-notes,
#comments .form-allowed-tags,
#comments .akismet_comment_form_privacy_notice,
#comments .comment-form-attachment__file-size-notice,
#comments .comment-form-attachment__file-types-notice,
#comments .comment-form-attachment__autoembed-links-notice,
#comments .comment-form-attachment__drop-area {
  display: none !important;
}

/* 入力欄共通 */
#comments textarea,
#comments input[type="text"],
#comments input[type="email"],
#comments input[type="url"] {
  width: 100%;
  box-sizing: border-box;
  border: 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 0;
  background: transparent;
  color: rgba(0, 0, 0, 0.82);
  font-size: 14px;
  line-height: 1.6;
  box-shadow: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

/* テキストエリア */
#comments textarea {
  min-height: 120px;
  padding: 12px 0;
  resize: vertical;
}

/* 名前・メール・URL */
#comments input[type="text"],
#comments input[type="email"],
#comments input[type="url"] {
  height: 42px;
  padding: 0;
}

/* フォーカス */
#comments textarea:focus,
#comments input[type="text"]:focus,
#comments input[type="email"]:focus,
#comments input[type="url"]:focus {
  outline: none;
  border-bottom-color: rgba(0, 0, 0, 0.28);
  background: transparent;
  box-shadow: none;
}

/* プレースホルダー */
#comments textarea::placeholder,
#comments input[type="text"]::placeholder,
#comments input[type="email"]::placeholder,
#comments input[type="url"]::placeholder {
  color: rgba(0, 0, 0, 0.34);
}

/* 各項目の余白 */
#comments .comment-form-comment,
#comments .comment-form-author,
#comments .comment-form-email,
#comments .comment-form-url,
#comments .comment-form-attachment {
  margin-bottom: 18px;
}

/* 名前欄左のグレー丸を消す */
#comments .comment-form-author::before,
#comments .comment-form-author::after,
#comments .comment-form-author i,
#comments .comment-form-author svg,
#comments .comment-form-author [class*="icon"] {
  display: none !important;
  content: none !important;
}

#comments .comment-form-author {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
}

/* 一覧側の左のグレー丸も消す */
#comments .comment-author img,
#comments .comment-author .avatar,
#comments .comment-author [class*="avatar"],
#comments .comment-author::before,
#comments .comment-author::after {
  display: none !important;
  content: none !important;
}

#comments .comment-author {
  padding-left: 0 !important;
  min-height: 0 !important;
}

/* 添付ラベルだけ残す */
#comments .comment-form-attachment__label {
  display: inline-block !important;
  margin-bottom: 8px;
  font-size: 12px;
  color: rgba(0, 0, 0, 0.5);
}

/* 追加項目トグル */
#comments .comment-extra-toggle {
  all: unset;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 2px 0 18px;
  cursor: pointer;
  font-size: 12px;
  line-height: 1.4;
  color: rgba(0, 0, 0, 0.48);
}

#comments .comment-extra-toggle:hover {
  color: rgba(0, 0, 0, 0.72);
}

#comments .comment-extra-toggle::before {
  content: "＋";
  font-size: 13px;
  line-height: 1;
}

#comments .comment-extra-fields {
  display: none;
  margin-top: -4px;
}

#comments .comment-extra-fields.active {
  display: block;
}

/* cookies同意 */
#comments .comment-form-cookies-consent {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.7;
  color: rgba(0, 0, 0, 0.52);
}

/* 送信ボタンまわり */
#comments .form-submit {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}

/* 送信ボタン */
#comments .submit,
#comments input[type="submit"] {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: none;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
  color: rgba(0, 0, 0, 0.78);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

#comments .submit:hover,
#comments input[type="submit"]:hover {
  background: rgba(0, 0, 0, 0.14);
  transform: translateY(-1px);
}

/* iボタン：送信ボタンの横 */
.comment-help-wrap {
  display: inline-flex;
  align-items: center;
  position: relative;
  margin: 0;
}

.comment-help-toggle {
  all: unset;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;

  font-size: 12px;
  line-height: 1;
  color: rgba(0, 0, 0, 0.42);
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.08);
  transition: background 0.2s ease, color 0.2s ease;
}

.comment-help-toggle:hover {
  color: rgba(0, 0, 0, 0.7);
  background: rgba(0, 0, 0, 0.07);
}

.comment-help-panel {
  position: absolute;
  left: calc(100% + 8px);
  bottom: 0;
  z-index: 20;

  display: none;
  width: min(320px, calc(100vw - 48px));
  padding: 12px 14px;

  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);

  font-size: 12px;
  line-height: 1.75;
  color: rgba(0, 0, 0, 0.62);
  white-space: normal;
  box-sizing: border-box;
}

.comment-help-panel.active {
  display: block;
}

.comment-help-panel p {
  margin: 0;
}

.comment-help-panel p + p {
  margin-top: 8px;
}

/* コメント一覧 */
#comments .comment-list,
#comments .children {
  margin-top: 24px;
  list-style: none;
}

#comments .comment-body {
  padding: 16px 0 0;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  background: transparent;
}

/* 名前と本文 */
#comments .comment-author,
#comments .fn {
  color: rgba(0, 0, 0, 0.72);
  font-weight: 600;
}

#comments .comment-metadata,
#comments .comment-metadata a,
#comments .comment-awaiting-moderation {
  color: rgba(0, 0, 0, 0.42);
  font-size: 12px;
}

#comments .comment-content {
  color: rgba(0, 0, 0, 0.72);
  line-height: 1.9;
  font-size: 14px;
}

/* 返信リンク */
#comments .comment-reply-link {
  font-size: 12px;
  color: rgba(0, 0, 0, 0.52);
  text-decoration: none;
}

#comments .comment-reply-link:hover {
  color: rgba(0, 0, 0, 0.78);
}

/* 返信中のフォーム */
#comments .comment-respond.is-replying,
#comments #respond.is-replying {
  margin-top: 18px;
  padding-top: 12px !important;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

/* キャンセル返信リンク */
#comments #cancel-comment-reply-link {
  display: inline-block;
  margin-left: 10px;
  font-size: 12px;
  color: rgba(0, 0, 0, 0.46);
  text-decoration: none;
}

#comments #cancel-comment-reply-link:hover {
  color: rgba(0, 0, 0, 0.72);
}

/* スマホ */
@media (max-width: 768px) {
  #comments {
    margin-top: 32px;
    padding: 24px 0 28px;
  }

  #comments .comment-respond,
  #comments #respond,
  #comments .comments-title,
  #comments .comment-list,
  #comments .children,
  #comments .comment-navigation {
    padding-left: 16px;
    padding-right: 16px;
  }

  #comments .comment-reply-title,
  #comments #reply-title {
    font-size: 15px;
    margin-bottom: 14px;
  }

  #comments .comments-title {
    font-size: 14px;
    margin-top: 24px;
  }

  #comments textarea {
    min-height: 110px;
    padding: 10px 0;
    font-size: 13px;
  }

  #comments input[type="text"],
  #comments input[type="email"],
  #comments input[type="url"] {
    height: 40px;
    font-size: 13px;
  }

  .comment-help-panel {
    left: auto;
    right: 0;
    bottom: calc(100% + 8px);
    width: min(300px, calc(100vw - 32px));
    font-size: 11px;
    line-height: 1.7;
  }

  #comments .comment-content {
    font-size: 13px;
  }
}

.comment-help-panel {
  position: absolute;
  left: calc(100% + 158px);
  bottom: 0;
  z-index: 20;

  display: none;
  width: min(320px, calc(100vw - 48px));
  padding: 12px 14px;

  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);

  font-size: 12px;
  line-height: 1.75;
  color: rgba(0, 0, 0, 0.62);
  white-space: normal;
  box-sizing: border-box;
}

#comments .comments-title {
  margin-top: 40px;
}

#comments #cancel-comment-reply-link {
  display: none;
  margin-left: 10px;
  font-size: 12px;
  color: rgba(0, 0, 0, 0.46);
  text-decoration: none;
}

#comments #cancel-comment-reply-link:hover {
  color: rgba(0, 0, 0, 0.72);
}

#comments hr,
#comments .comment-body,
#comments .comment-respond,
#comments #respond,
#comments .comment-list,
#comments .comments-title {
  border-top: none !important;
}

#comments .comment-respond,
#comments #respond,
#comments .comment-list,
#comments .comments-title {
  border-bottom: none !important;
}

#comments .comments-title {
  margin-top: 48px !important;
}


#comments .comments-title {
  margin-top: 40px !important;
  margin-bottom: 12px !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  border-top: none !important;
  border-bottom: none !important;
}

#comments .comments-title + .comment-list,
#comments .comments-title + ol.comment-list,
#comments .comments-title + ul.comment-list {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

#comments hr,
#comments .comment-list,
#comments .comments-title,
#comments .comment-body {
  border-top: none !important;
}


/* =========================================
   コメントまわり 最終調整
   ========================================= */

/* ① 共有の「…」を元に戻す
   comment-ui.css が他のボタン全体に触って崩れた可能性を打ち消す */
.is-illust-post .illust-more-btn {
  all: unset;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 28px !important;
  height: 28px !important;
  margin-left: 10px !important;
  font-size: 22px !important;
  line-height: 1 !important;
  color: rgba(0, 0, 0, 0.5) !important;
  cursor: pointer !important;
  vertical-align: middle !important;
}

.is-illust-post .illust-share-wrap {
  display: inline-flex !important;
  align-items: center !important;
  vertical-align: middle !important;
  margin-left: 10px !important;
}

/* ② iボタンのパネルを確実に見えるようにする */
.comment-help-wrap {
  display: inline-flex !important;
  align-items: center !important;
  position: relative !important;
  margin-left: 10px !important;
}

.comment-help-panel {
  display: none !important;
  position: absolute !important;
  left: calc(100% + 158px) !important;
  bottom: 0 !important;
  right: auto !important;
  top: auto !important;
  z-index: 999 !important;
  width: min(320px, calc(100vw - 48px)) !important;
  padding: 12px 14px !important;
  border-radius: 12px !important;
  background: #fff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12) !important;
  font-size: 12px !important;
  line-height: 1.75 !important;
  color: rgba(0, 0, 0, 0.62) !important;
  white-space: normal !important;
  box-sizing: border-box !important;
}

.comment-help-panel.active {
  display: block !important;
}

/* スマホでは右上に出す */
@media (max-width: 768px) {
  .comment-help-panel {
    left: auto !important;
    right: 0 !important;
    bottom: calc(100% + 8px) !important;
    width: min(300px, calc(100vw - 32px)) !important;
  }
}

/* ③ コメント入力欄とコメント一覧の境目をはっきりさせる */
#comments .comments-title {
  margin-top: 56px !important;
  padding-top: 18px !important;
  border-top: 1px solid rgba(0, 0, 0, 0.08) !important;
}

/* コメント一覧側は線の直後に始まるように */
#comments .comments-title + .comment-list,
#comments .comments-title + ol.comment-list,
#comments .comments-title + ul.comment-list {
  margin-top: 10px !important;
  padding-top: 0 !important;
}

/* ④ 通常時の「コメントする」は左揃え
   返信時だけ少し下げる */
#comments .comment-reply-title,
#comments #reply-title {
  margin-left: 0 !important;
  padding-left: 0 !important;
}

#comments .comment-respond.is-replying .comment-reply-title,
#comments .comment-respond.is-replying #reply-title,
#comments #respond.is-replying .comment-reply-title,
#comments #respond.is-replying #reply-title {
  margin-left: 12px !important;
}


/* =========================================
   追加微調整
   ========================================= */

/* i のポップアップをさらに右へ */
.comment-help-panel {
  left: calc(100% + 258px) !important;
}

/* スマホでは引き続き右上に出す */
@media (max-width: 768px) {
  .comment-help-panel {
    left: auto !important;
    right: 0 !important;
    bottom: calc(100% + 8px) !important;
  }
}

/* 通常時の「コメントする」を左揃え・余白整理 */
#comments .comment-respond:not(.is-replying) #reply-title,
#comments .comment-respond:not(.is-replying) .comment-reply-title,
#comments #respond:not(.is-replying) #reply-title,
#comments #respond:not(.is-replying) .comment-reply-title {
  margin: 0 0 24px 0 !important;
  padding: 0 !important;
  transform: none !important;
  text-indent: 0 !important;
  position: static !important;
  left: auto !important;
}

/* 返信中だけ少し下げる */
#comments .comment-respond.is-replying #reply-title,
#comments .comment-respond.is-replying .comment-reply-title,
#comments #respond.is-replying #reply-title,
#comments #respond.is-replying .comment-reply-title {
  margin: 0 0 24px 12px !important;
  padding: 0 !important;
}

/* 「コメントする」ブロックの下にもう少し余白 */
#comments .comment-respond,
#comments #respond {
  margin-bottom: 12px !important;
}

/* 「コメント一覧」との区切りをわかりやすく */
#comments .comments-title {
  margin-top: 56px !important;
  padding-top: 20px !important;
  border-top: 1px solid rgba(0, 0, 0, 0.08) !important;
}



/* =========================================
   コメント欄 微修正（スマホ優先）
   ========================================= */

/* 1) i のポップアップをスマホでもさらに右へ */
@media (max-width: 768px) {
  #comments .comment-help-panel {
    left: auto !important;
    right: -100px !important;
    bottom: calc(100% + 8px) !important;
  }
}

/* 2) 通常時の「コメントする」を左揃えに戻す */
#comments #respond:not(.is-replying),
#comments .comment-respond:not(.is-replying) {
  padding-left: 16px !important;
  padding-right: 16px !important;
}

#comments #respond:not(.is-replying) #reply-title,
#comments #respond:not(.is-replying) .comment-reply-title,
#comments .comment-respond:not(.is-replying) #reply-title,
#comments .comment-respond:not(.is-replying) .comment-reply-title {
  margin: 0 0 20px 0 !important;
  padding: 0 !important;
  text-indent: 0 !important;
  transform: none !important;
  left: auto !important;
}

/* 3) 返信中だけ少し下げる */
#comments #respond.is-replying #reply-title,
#comments #respond.is-replying .comment-reply-title,
#comments .comment-respond.is-replying #reply-title,
#comments .comment-respond.is-replying .comment-reply-title {
  margin: 0 0 20px 12px !important;
  padding: 0 !important;
}

/* 4) 「コメントする」ブロックと「コメント一覧」を離す */
#comments .comments-title {
  margin-top: 56px !important;
  padding-top: 18px !important;
  border-top: 1px solid rgba(0, 0, 0, 0.08) !important;
}

/* 5) 「コメント一覧」の直前・直後の余計な線を消す */
#comments .comments-title::before,
#comments .comments-title::after,
#comments .comment-reply-title::before,
#comments .comment-reply-title::after,
#comments #reply-title::before,
#comments #reply-title::after {
  display: none !important;
  content: none !important;
}