/*
 * ブロックエディタ用のスタイル（フロント表示とエディタ画面の両方で読み込む）
 *
 * ・すべてのルールは「ブロックスタイル（.is-style-shigaku-*）」か、ブロックのテーブルに旧クラス名を付けたもの
 *   （figure.wp-block-table.table_list など）にだけ当たる。旧サイトから移したコンテンツ（クラシック／カスタム HTML）には当たらない。
 * ・.entry-body など、フロント固有の親要素に依存しない（エディタ画面でも同じ見た目になる）。
 * ・色は style.css の変数を使い、エディタ画面では変数がないため、フォールバック値を付ける。
 *
 * 使い方: ブロックを選び、右パネルの「スタイル」から選ぶ。
 *   テーブル : 「史学会：項目と値の一覧」「史学会：見出し付きの表」
 *   グループ : 「史学会：お知らせ枠」
 *   画像     : 「史学会：枠つき」
 *   ボタン   : 「史学会：赤」
 *   リスト   : 「史学会：赤い角印」
 */

/* ---------- テーブル: 項目と値の一覧（旧 table_list 相当）---------- */
.wp-block-table.is-style-shigaku-list,
.wp-block-table.table_list { margin: 0 0 1.2rem; }
.wp-block-table.is-style-shigaku-list table,
.wp-block-table.table_list table { table-layout: auto; width: 100%; border-collapse: collapse; border: 1px solid #e6dfd1; background: rgba(255, 255, 255, .55); }
.wp-block-table.is-style-shigaku-list td, .wp-block-table.is-style-shigaku-list th,
.wp-block-table.table_list td, .wp-block-table.table_list th { border: 0; border-bottom: 1px solid #e6dfd1; padding: .55rem .6rem; vertical-align: top; line-height: 1.6; text-align: left; }
.wp-block-table.is-style-shigaku-list tbody tr:nth-child(even) td,
.wp-block-table.table_list tbody tr:nth-child(even) td { background: rgba(203, 190, 173, .18); }
.wp-block-table.is-style-shigaku-list tbody tr:hover td,
.wp-block-table.table_list tbody tr:hover td { background: rgba(153, 0, 0, .05); }
/* 左の列は項目名: 折り返さず、茶色の太字、先頭に赤い » */
.wp-block-table.is-style-shigaku-list td:first-child,
.wp-block-table.table_list td:first-child { white-space: nowrap; width: 1%; position: relative; padding-left: 1.4rem; font-size: .92em; font-weight: bold; color: #7b5a4a; }
.wp-block-table.is-style-shigaku-list td:first-child::before,
.wp-block-table.table_list td:first-child::before { content: "»"; position: absolute; left: .45rem; top: .45rem; color: var(--shigaku-red, #990000); font-size: 1.1em; line-height: 1.4; }
.wp-block-table.is-style-shigaku-list a,
.wp-block-table.table_list a { text-decoration: none; border-bottom: 1px solid rgba(153, 0, 0, .35); }
.wp-block-table.is-style-shigaku-list a:hover,
.wp-block-table.table_list a:hover { border-bottom-color: var(--shigaku-red, #990000); }
@media (max-width: 767px) {
	.wp-block-table.is-style-shigaku-list td, .wp-block-table.table_list td { display: block; width: auto; border-bottom: 0; padding: .2rem .6rem; }
	.wp-block-table.is-style-shigaku-list td:first-child, .wp-block-table.table_list td:first-child { width: auto; padding-top: .5rem; }
	.wp-block-table.is-style-shigaku-list tr, .wp-block-table.table_list tr { display: block; border-bottom: 1px solid #e6dfd1; }
}

/* ---------- テーブル: 見出し付きの表（旧 table_type2 相当）---------- */
.wp-block-table.is-style-shigaku-head,
.wp-block-table.table_type2 { margin: 0 0 1.2rem; }
.wp-block-table.is-style-shigaku-head table,
.wp-block-table.table_type2 table { table-layout: auto; width: 100%; border-collapse: collapse; border: 0; background: rgba(255, 255, 255, .55); }
.wp-block-table.is-style-shigaku-head td, .wp-block-table.is-style-shigaku-head th,
.wp-block-table.table_type2 td, .wp-block-table.table_type2 th { border: 0; border-bottom: 1px solid #e6dfd1; padding: 4px 8px; vertical-align: top; text-align: left; font-weight: normal; }
/* 見出し行（テーブルブロックの「ヘッダーセクション」をオンにする） */
.wp-block-table.is-style-shigaku-head thead th,
.wp-block-table.table_type2 thead th { background: linear-gradient(to bottom, #a89a8d, #85725f); color: #fff; font-weight: bold; border-bottom: 0; padding: 5px 10px; }
.wp-block-table.is-style-shigaku-head thead,
.wp-block-table.table_type2 thead { border-bottom: 0; }
/* 本文側の見出しセル（行見出し）は薄い色 */
.wp-block-table.is-style-shigaku-head tbody th,
.wp-block-table.table_type2 tbody th { background: #efe9dd; font-weight: bold; color: #4a3a30; }
.wp-block-table.is-style-shigaku-head tfoot td,
.wp-block-table.table_type2 tfoot td { background: #efe9dd; font-weight: bold; }
.wp-block-table.is-style-shigaku-head figcaption,
.wp-block-table.table_type2 figcaption { font-size: .85rem; color: #6b5a4e; text-align: left; }

/* ---------- グループ: お知らせ枠（旧 box2 相当）---------- */
.wp-block-group.is-style-shigaku-notice {
	background: #fffaf3; border: 1px solid var(--shigaku-red, #990000); border-left-width: 6px; border-radius: 3px;
	padding: .8rem 1rem; margin: .2rem 0 1rem; font-size: .95rem; box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
}
.wp-block-group.is-style-shigaku-notice > * { margin-top: 0 !important; margin-bottom: .5rem !important; line-height: 1.75; }
.wp-block-group.is-style-shigaku-notice > *:last-child { margin-bottom: 0 !important; }

/* ---------- 画像: 枠つき（旧 pframe 相当）---------- */
.wp-block-image.is-style-shigaku-frame img { border: 1px solid var(--shigaku-beige, #bba695); box-shadow: 0 0 3px #999; max-width: 100%; height: auto; }

/* ---------- ボタン: 赤 ---------- */
.wp-block-button.is-style-shigaku-red .wp-block-button__link { background: var(--shigaku-red, #990000); color: #fff; border: 0; border-radius: 3px; padding: .5rem 1.6rem; font-weight: bold; text-decoration: none; }
.wp-block-button.is-style-shigaku-red .wp-block-button__link:hover { background: var(--shigaku-dark, #660000); color: #fff; }

/* ---------- リスト: 赤い角印 ---------- */
ul.is-style-shigaku-square { list-style: none; padding-left: 0; }
ul.is-style-shigaku-square > li { position: relative; padding: .3rem 0 .3rem 1rem; }
ul.is-style-shigaku-square > li::before { content: ""; position: absolute; left: 0; top: 1em; width: 5px; height: 5px; background: var(--shigaku-red, #990000); }
