/* ===== Web拍手 (webclap.css) ===== */

.rwc-area{
  text-align: center;
}

.rwc-wrapper {
  position: relative;
  display: inline-block;
}

/* 拍手済み状態（.webclap-btn に追加） */
.webclap-btn.rwc-clap-btn {
  cursor: pointer;
  background: none;
  user-select: none;
  margin: auto;
  white-space: nowrap;
  font-size: 0.875rem;
}

.webclap-label {
  font-family: var(--font-mincho);
}

.webclap-btn.rwc-clap-btn:disabled {
  opacity: 0.72;
  cursor: wait;
}

.webclap-btn.is-clapped {
  border-color: #f0a020;
  color: #f0a020;
}

.webclap-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.2em;
  margin-left: 0.6em;
  padding: 0.18em 0.5em;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 0.78rem;
  line-height: 1;
}

/* メッセージボックス（吹き出し） */
.rwc-message-box {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 30vw;
  min-width: 320px;
  background-color: #2e2923;
  border: 1px solid #4a4540;
  border-radius: 6px;
  box-shadow: 0 6px 16px rgba(0,0,0,.6);
  z-index: 99999;
  font-family: var(--font-ui);;
}

/* 吹き出し矢印（上向き） */
.rwc-message-box::before,
.rwc-message-box::after {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 20px;
  border: solid transparent;
  pointer-events: none;
}

.rwc-message-box::before {
  border-width: 11px;
  border-bottom-color: #4a4540;
}

.rwc-message-box::after {
  border-width: 10px;
  left: 21px;
  border-bottom-color: #2e2923;
  text-align: left;
}

.rwc-message-box-inner {
  padding: 14px;
  position: relative;
}

/* 閉じるボタン */
.rwc-close {
  position: absolute;
  right: -10px;
  top: -10px;
  width: 22px;
  height: 22px;
  background: #4a4540;
  border: 1px solid #666;
  border-radius: 50%;
  color: #ccc;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.rwc-close:hover { background: #5a5550; color: #fff; }

/* お礼メッセージ */
.rwc-thanks-msg {
  color: #e0e0e0;
  font-size: 0.813rem;
  margin-bottom: 10px;
  line-height: 1.5;
  text-align: left;
}

.rwc-thanks-img {
  display: none !important;
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  margin-bottom: 10px;
  border-radius: 4px;
}

.rwc-favorite{
  text-align: center;
  background-color: #1C1A17;
  border: 1px solid #4a4540;
  border-radius: 4px;
  padding: 5px 8px;
}

/* ☆評価 */
.rwc-rating {
  display: flex;
  gap: 2px;
  margin-bottom: 10px;
  cursor: pointer;
  user-select: none;
  font-size: 1.2rem;
  padding: 5px;
  justify-content: center;
}

.rwc-star {
  font-size: 22px;
  color: #666;
  transition: color 0.08s;
  line-height: 1;
}

.rwc-star.is-active,
.rwc-star:hover {
  color: #f0a020;
}

/* フォーム入力 */
.rwc-input {
  display: block;
  width: 100%;
  padding: 5px 8px;
  margin-bottom: 8px;
  font-size: 0.813rem ;
  font-family: inherit;
  line-height: 1.4;
  color: #e0e0e0;
  background-color: #1c1a17;
  border: 1px solid #4a4540;
  border-radius: 4px;
  box-sizing: border-box;
  transition: border-color 0.15s;
}

.rwc-input[hidden] {
  display: none;
}

.rwc-input:focus {
  outline: none;
  border-color: #888;
  background-color: #201e1b;
}

.rwc-textarea {
  height: auto;
  min-height: 6em;
  resize: vertical;
}

/* 送信ボタン */
.rwc-submit-btn {
  display: block;
  width: 100%;
  padding: 5px 10px;
  font-size: 0.813rem;
  font-family: inherit;
  background: #4a7ab0;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
}

.rwc-submit-btn:hover { background: #3a6090; }

/* 結果メッセージ */
.rwc-msg {
  font-size: 0.813rem;
  margin-top: 8px;
  padding: 6px 8px;
  border-radius: 4px;
}

.rwc-msg--success {
  color: #c8e5c0;
  background-color: #1e3020;
  border: 1px solid #3a5040;
}

.rwc-msg--error {
  color: #f0c0c0;
  background-color: #3a1820;
  border: 1px solid #5a2830;
}

/* ===== 配置コンテキスト別調整 ===== */

/* 個別記事: コンテンツ下 */
.single-webclap {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--color-card-divider, rgba(255,255,255,0.08));
}

.single-webclap .rwc-wrapper {
  display: block;
}

.single-webclap .rwc-message-box {
  position: static;
  width: min(100%, 36rem);
  min-width: 0;
  margin: 10px auto 0;
  text-align: left;
}

.single-webclap .rwc-message-box::before,
.single-webclap .rwc-message-box::after {
  left: 48px;
}

/* ===== ブックマーク一覧ページ ===== */
.bookmarks-page {
  padding: 40px;
  max-width: 920px;
}

.bookmarks-page h1 {
  font-size: 18px;
  margin-bottom: 20px;
  color: var(--color-text-muted);
}

.bookmarks-empty {
  color: var(--color-text-muted);
  font-size: 14px;
}

.bookmark-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px 14px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.bookmark-item {
  position: relative;
  min-width: 0;
}

.bookmark-card {
  display: block;
  min-width: 0;
  height: 100%;
  padding: 8px;
  border: 1px solid var(--color-card-divider);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--color-text-primary);
  text-decoration: none;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.bookmark-card:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.045);
}

.bookmark-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  object-fit: cover;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
}

.bookmark-thumb--empty {
  border: 1px dashed rgba(255, 255, 255, 0.12);
}

.bookmark-title {
  display: block;
  margin-top: 8px;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.45;
  color: var(--color-text-primary);
}

.bookmark-card:hover .bookmark-title { color: #ccc; }

.bookmark-remove {
  position: absolute;
  top: -8px;
  right: -8px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 50%;
  background: rgba(25, 25, 25, 0.92);
  color: rgba(255, 255, 255, 0.86);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
}

.bookmark-remove:hover {
  border-color: rgba(255, 210, 210, 0.78);
  color: #f0c0c0;
}

@media (max-width: 599px) {
  .bookmarks-page {
    padding: 28px 16px 48px;
  }

  .bookmark-list {
    gap: 16px 10px;
  }

  .bookmark-card {
    padding: 6px;
  }

  .bookmark-title {
    font-size: 11px;
  }
}
