/* ==========================================================================
   顧客事例(case)・イベント(event) 本文の共通タイポグラフィ
   ブロックエディタの標準ブロック（見出し・引用・テーブル・画像・リスト）を
   自動装飾する。事例・イベント個別のCSSクラスの追加は不要。

   公開ページでは .hr-article-content、編集画面(ブロックエディタ)では
   .editor-styles-wrapper がそれぞれの本文ラッパーになるため、
   :is() でどちらにも同じスタイルが当たるようにしている。
   ========================================================================== */

.hr-article-content,
.editor-styles-wrapper {
  letter-spacing: 0.1em;
  line-height: 1.9;
}

:is(.hr-article-content, .editor-styles-wrapper) p {
  margin: 1.5em 0;
}

/* H2: 左ボーダー見出し */
:is(.hr-article-content, .editor-styles-wrapper) h2 {
  border-left: 4px solid var(--wp--preset--color--accent);
  padding-left: 1rem;
  margin: 3rem 0 1.5rem;
  font-size: 24px;
  font-weight: bold;
  line-height: 1.5;
}

/* H3: 丸数字（自動連番）付き見出し
   連番はCSSカウンターではなく、data-hr-h3-num属性（公開ページ側はPHP、
   編集画面側はJSで算出）を表示するだけにしている。CSSの counter-reset を
   特定のH3から再スタートさせても後続の兄弟要素に連番が正しく引き継がれない
   ケースがあったため、番号そのものは常にJS/PHP側で確定させる方式に変更した。 */
:is(.hr-article-content, .editor-styles-wrapper) h3 {
  display: flex;
  align-items: center;
  gap: 0.75em;
  margin: 2.5rem 0 1.25rem;
  font-size: 20px;
  font-weight: bold;
  line-height: 1.5;
}
:is(.hr-article-content, .editor-styles-wrapper) h3::before {
  content: attr(data-hr-h3-num);
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.8em;
  height: 1.8em;
  border-radius: 50%;
  background: var(--wp--preset--color--contrast);
  color: var(--wp--preset--color--base);
  font-size: 0.875rem;
}

/* 引用（コールアウト） */
:is(.hr-article-content, .editor-styles-wrapper) blockquote {
  background: #f2f2f2;
  border-left: 4px solid var(--wp--preset--color--accent);
  border-radius: 0;
  padding: 1.5rem 2rem;
  margin: 2rem 0;
  font-size: 1.25rem;
  font-weight: bold;
  font-style: normal;
  line-height: 1.6;
}
:is(.hr-article-content, .editor-styles-wrapper) blockquote p {
  margin: 0;
  font-style: normal;
}
:is(.hr-article-content, .editor-styles-wrapper) blockquote.is-style-large,
:is(.hr-article-content, .editor-styles-wrapper) blockquote.is-large,
:is(.hr-article-content, .editor-styles-wrapper) blockquote.is-style-large p,
:is(.hr-article-content, .editor-styles-wrapper) blockquote.is-large p {
  font-style: normal;
}

/* テーブル（企業概要など） */
:is(.hr-article-content, .editor-styles-wrapper) table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 1rem;
}
:is(.hr-article-content, .editor-styles-wrapper) table th,
:is(.hr-article-content, .editor-styles-wrapper) table td {
  border: none;
  border-bottom: 1px solid #f2f2f2;
  padding: 1.25rem 1.5rem;
  text-align: left;
  vertical-align: top;
}
:is(.hr-article-content, .editor-styles-wrapper) table tr:last-child th,
:is(.hr-article-content, .editor-styles-wrapper) table tr:last-child td {
  border-bottom: none;
}
:is(.hr-article-content, .editor-styles-wrapper) table th,
:is(.hr-article-content, .editor-styles-wrapper) table td:first-child {
  background: #f2f2f2;
  font-weight: bold;
  width: 200px;
  white-space: nowrap;
}

/* 画像＋キャプション（テーブルブロックも <figure> で囲まれるため .wp-block-image に限定する） */
:is(.hr-article-content, .editor-styles-wrapper) figure.wp-block-image {
  border: none;
  margin: 2rem 0;
}
:is(.hr-article-content, .editor-styles-wrapper) figure.wp-block-image img {
  display: block;
  width: 100%;
  height: auto;
}
:is(.hr-article-content, .editor-styles-wrapper) figure.wp-block-image figcaption {
  background: var(--wp--preset--color--base);
  padding: 0.75rem 1rem;
  text-align: center;
  font-size: 0.875rem;
  letter-spacing: 0.05em;
}

/* リスト（グレーボックス＋金色ドット）
   追加CSSクラスの指定は不要。通常の「リスト」ブロックを使うだけで自動的に適用される */
:is(.hr-article-content, .editor-styles-wrapper) ul:not(.wp-block-gallery) {
  margin: 1.5rem 0;
  padding: 0;
}
:is(.hr-article-content, .editor-styles-wrapper) ul:not(.wp-block-gallery) li {
  position: relative;
  list-style: none;
  background: #FAFAFA;
  color: #1C1C1C;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  padding: 14px 18px 14px 34px;
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: bold;
}
:is(.hr-article-content, .editor-styles-wrapper) ul:not(.wp-block-gallery) li:last-child {
  margin-bottom: 0;
}
:is(.hr-article-content, .editor-styles-wrapper) ul:not(.wp-block-gallery) li::before {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 50%;
  background: var(--wp--preset--color--accent);
}

@media screen and (max-width: 768px) {
  :is(.hr-article-content, .editor-styles-wrapper) blockquote {
    padding: 1.25rem 1.25rem;
    font-size: 1.0625rem;
  }
  :is(.hr-article-content, .editor-styles-wrapper) table th,
  :is(.hr-article-content, .editor-styles-wrapper) table td {
    padding: 0.75rem 1rem;
  }
  :is(.hr-article-content, .editor-styles-wrapper) table th,
  :is(.hr-article-content, .editor-styles-wrapper) table td:first-child {
    width: 120px;
  }
}
