/* 投稿ページ右側のカテゴリ導線に限定。画像内ラベルは対象外。 */
body.single #sidebar .widget a[href*="/category/"]:not(.cat-label) {
  position: relative;
  display: block;
  box-sizing: border-box;
  min-height: 42px;
  margin: 0 0 7px;
  padding: 10px 28px 10px 12px !important;
  border: 1px solid #333;
  border-radius: 8px;
  background: #191919;
  color: #fff !important;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.6;
  text-align: left;
  text-decoration: none !important;
  overflow-wrap: anywhere;
  transition: background-color .18s ease, border-color .18s ease;
}

body.single #sidebar .widget a[href*="/category/"]:not(.cat-label)::after {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  content: "\203a";
  color: #ff7a00;
  font-size: 20px;
  line-height: 1;
}

body.single #sidebar .widget a[href*="/category/"]:not(.cat-label):hover,
body.single #sidebar .widget a[href*="/category/"]:not(.cat-label)[aria-current] {
  border-color: #ff7a00;
  background: #302116;
}

body.single #sidebar .widget a[href*="/category/"]:not(.cat-label):focus-visible {
  outline: 2px solid #ff7a00;
  outline-offset: 2px;
}

/* 標準カテゴリウィジェット・ブロックのリスト余白を除く。 */
body.single #sidebar .widget_categories ul,
body.single #sidebar .wp-block-categories-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

body.single #sidebar .widget_categories li,
body.single #sidebar .wp-block-categories-list li {
  margin: 0;
  padding: 0;
}

/* 記事末尾の関連記事画像。画像自体の比率と全体表示を維持。 */
body.single .related-entry-card-thumb img {
  object-fit: contain;
  object-position: center;
}

/* 関連記事タイトル: 余白を外側へ移し、4行目の一部表示を防ぐ。 */
body.single .related-entry-card-content {
  margin: 0 !important;
  padding: 12px 10px 10px !important;
  height: auto !important;
  min-height: 0;
  min-width: 0;
  box-sizing: border-box;
}

body.single .related-entry-card-title {
  display: -webkit-box !important;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden !important;
  text-overflow: ellipsis;
  white-space: normal;
  overflow-wrap: anywhere;
  margin: 0 !important;
  padding: 0 !important;
  border: 0;
  box-sizing: content-box;
  font-size: 13px !important;
  line-height: 1.5 !important;
  height: 4.5em !important;
  min-height: 4.5em !important;
  max-height: 4.5em !important;
  flex: 0 0 auto;
}

body.single .related-entry-card-title a {
  font-size: inherit !important;
  line-height: inherit !important;
}
