/* ============================================================
   Table of Contents
   ============================================================ */
.toc-widget {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px 28px 24px;
  margin: var(--space-8) 0;
  box-shadow: none;
  display: block;
  max-width: 100%;
}

/* タイトル行：「もくじ」中央＋右に[閉じる] */
.toc-widget__title {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border-light);
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
}

/* [▲閉じる] トグルボタン */
.toc-widget__toggle {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  white-space: nowrap;
  font-weight: 400;
  font-family: var(--font-body);
}

.toc-widget__toggle::before { content: '['; }
.toc-widget__toggle::after  { content: ']'; }

.toc-widget__toggle:hover {
  color: var(--color-primary);
}

.toc-widget__title-text::before {
  content: none;
}

/* リスト本体 */
.toc-widget__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* H2 アイテム */
.toc-widget__item {
  margin-bottom: 6px;
  list-style: none;
}

.toc-widget__item::before,
.toc-widget__item::marker {
  content: none;
  display: none;
}

.toc-widget__item a {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--color-text);
  text-decoration: none;
  display: flex;
  align-items: baseline;
  gap: 8px;
  line-height: 1.55;
  padding: 5px 4px;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast), background var(--transition-fast);
}

/* 番号ラベル（1 | / 1-1 |） */
.toc-widget__num {
  flex-shrink: 0;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-primary);
  font-family: var(--font-heading);
  white-space: nowrap;
}

.toc-widget__text {
  flex: 1;
}

.toc-widget__item a:hover {
  color: var(--color-primary);
  background: var(--color-beige);
}

/* アクティブ */
.toc-widget__item a.is-active {
  color: var(--color-primary);
  font-weight: 500;
}

.toc-widget__item a.is-active .toc-widget__num {
  color: var(--color-primary-dark);
}

/* H3 アイテム */
.toc-widget__item--h3 {
  padding-left: 32px;
  margin-bottom: 1px;
}

/* H2の直後に来る最初のH3の前に1マス余白 */
.toc-widget__item + .toc-widget__item--h3 {
  margin-top: 6px;
}

/* H3の後にH2が来る場合（章の区切り）に余白 */
.toc-widget__item--h3 + .toc-widget__item {
  margin-top: 10px;
}

.toc-widget__item--h3 a {
  font-size: 0.8125rem;
  color: var(--color-text-light);
  gap: 6px;
  padding: 3px 4px;
}

.toc-widget__item--h3 .toc-widget__num {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-muted);
}

/* 折りたたみ */
.toc-widget__list.is-collapsed {
  display: none;
}

/* スマホ */
@media (max-width: 768px) {
  .toc-widget {
    padding: 16px 20px 20px;
  }
}
/* ============================================================
   Share Buttons
   ============================================================ */
.share-buttons {
  display: flex;
  gap: var(--space-3);
  margin: var(--space-8) 0;
  flex-wrap: wrap;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-white);
  transition: opacity var(--transition-fast);
}

.share-btn:hover {
  opacity: 0.85;
}

.share-btn--twitter,
.share-btn--x        { background: #000; }
.share-btn--facebook { background: #1877F2; }
.share-btn--line     { background: #06C755; }
.share-btn--copy     { background: var(--color-text-light); }

/* ============================================================
   Author Box
   ============================================================ */
.author-box {
  background: var(--color-beige);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  display: flex;
  gap: var(--space-5);
  align-items: flex-start;
  margin: var(--space-10) 0;
}

.author-box__avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.author-box__name {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.author-box__bio {
  font-size: var(--text-sm);
  color: var(--color-text-light);
  line-height: 1.7;
  margin-bottom: 0;
}

/* ============================================================
   Notice / Info Box (for post content)
   ============================================================ */
.post-content .notice {
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  margin: var(--space-6) 0;
  font-size: var(--text-sm);
  line-height: 1.7;
}

.post-content .notice--info {
  background: rgba(126, 154, 104, 0.1);
  border-left: 4px solid var(--color-accent-green);
}

.post-content .notice--warn {
  background: rgba(200, 149, 108, 0.1);
  border-left: 4px solid var(--color-accent-warm);
}

/* ============================================================
   Comments
   ============================================================ */
.comment-list {
  list-style: none;
}

.comment {
  padding: var(--space-5) 0;
  border-bottom: 1px solid var(--color-border-light);
}

.comment__header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.comment__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
}

.comment__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.comment__author {
  font-weight: 500;
  font-size: var(--text-sm);
}

.comment__date {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.comment__body {
  font-size: var(--text-sm);
  line-height: 1.8;
  margin-bottom: 0;
}

.comment-respond {
  margin-top: var(--space-8);
}

.comment-reply-title {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 500;
  margin-bottom: var(--space-5);
}

.comment-form label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  margin-bottom: var(--space-2);
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-white);
  color: var(--color-text);
  font-size: var(--text-sm);
  outline: none;
  transition: border-color var(--transition-fast);
  margin-bottom: var(--space-4);
}

.comment-form input:focus,
.comment-form textarea:focus {
  border-color: var(--color-primary);
}

.comment-form textarea {
  min-height: 120px;
  resize: vertical;
}

.comment-form .form-submit .submit {
  padding: var(--space-3) var(--space-6);
  background: var(--color-primary);
  color: var(--color-white);
  border: none;
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.comment-form .form-submit .submit:hover {
  background: var(--color-primary-dark);
}

/* ============================================================
   Print Styles
   ============================================================ */
@media print {
  .site-header,
  .site-footer,
  .sidebar,
  .back-to-top,
  .post-nav,
  .related-posts,
  .share-buttons {
    display: none !important;
  }

  .content-sidebar-wrap {
    grid-template-columns: 1fr !important;
  }

  body {
    font-size: 12pt;
    color: #000;
  }

  a { text-decoration: underline; }
}
