/* =========================================================
   TECRITA content.css（最小・装飾薄め）
   - 目的：文章/画像/表/引用/コード/フォーム等の「最低限の読みやすさ」を親テーマで固定
   - レイアウト（幅/align）は blocks.css が主担当。ここでは触らない。
========================================================= */

/* 対象スコープ（Classic + Block の両方をカバー） */
:where(.entry-content, .wp-block-post-content){
  /* テーマ側の行間が未定義でも破綻しない保険 */
  line-height: 1.8;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* ---------------------------------------------------------
  1) 見出し：余白の基準だけ固定（装飾はしない）
--------------------------------------------------------- */
:where(.entry-content, .wp-block-post-content) :where(h1,h2,h3,h4,h5,h6){
  line-height: 1.35;
  margin: 1.6em 0 0.6em;
}
:where(.entry-content, .wp-block-post-content) :where(h1){
  margin-top: 0; /* タイトルは別管理の前提 */
}

/* ---------------------------------------------------------
  2) 段落・リスト：読みやすさの最小
--------------------------------------------------------- */
:where(.entry-content, .wp-block-post-content) :where(p){
  margin: 0 0 1.1em;
}

:where(.entry-content, .wp-block-post-content) :where(ul,ol){
  margin: 0 0 1.1em;
  padding-left: 1.4em;
}

:where(.entry-content, .wp-block-post-content) :where(li){
  margin: 0.25em 0;
}

/* ネストリストが詰まりすぎないように */
:where(.entry-content, .wp-block-post-content) :where(ul ul, ul ol, ol ul, ol ol){
  margin-top: 0.6em;
  margin-bottom: 0.6em;
}

/* Lists: 端揃え + 段差は li で作る（Arkhe思想） */
:where(.entry-content, .wp-block-post-content) :where(ul, ol){
  margin: 0 0 1.2em;
  padding-left: 0;              /* ul/ol自体はズラさない */
  list-style-position: outside; /* マーカーは外 */
}

/* 段差（インデント）は li に持たせる */
:where(.entry-content, .wp-block-post-content) :where(ul, ol) > li{
  margin-left: 1.25em;          /* ←ここが“余白” */
}

/* ネストは段階的に少し浅く */
:where(.entry-content, .wp-block-post-content) :where(ul ul, ul ol, ol ul, ol ol) > li{
  margin-left: 1.1em;
}

/* ---------------------------------------------------------
  3) 画像・キャプション：崩れ防止
--------------------------------------------------------- */
:where(.entry-content, .wp-block-post-content) :where(img, video){
  max-width: 100%;
  height: auto;
}

:where(.entry-content, .wp-block-post-content) :where(figure){
  margin: 0 0 1.1em;
}

:where(.entry-content, .wp-block-post-content) :where(figcaption){
  margin-top: 0.5em;
  font-size: 0.9em;
  line-height: 1.6;
  opacity: 0.85;
}

/* WPブロック画像の余白が不安定な場合の保険 */
:where(.entry-content, .wp-block-post-content) :where(.wp-block-image){
  margin: 0 0 1.1em;
}

/* ---------------------------------------------------------
  4) 引用・区切り線：最低限の判別
--------------------------------------------------------- */
:where(.entry-content, .wp-block-post-content) :where(blockquote){
  margin: 0 0 1.1em;
  padding-left: 1em;
  border-left: 3px solid rgba(0,0,0,.14);
}

:where(.entry-content, .wp-block-post-content) :where(hr){
  margin: 2em 0;
  border: 0;
  border-top: 1px solid rgba(0,0,0,.12);
}


/* ---------------------------------------------------------
  5) コード：読みやすさ優先（色は最小）
--------------------------------------------------------- */
:where(.entry-content, .wp-block-post-content) :where(code, kbd, samp){
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.95em;
}

:where(.entry-content, .wp-block-post-content) :where(p code, li code){
  padding: 0.1em 0.35em;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 4px;
  background: rgba(0,0,0,.04);
}

:where(.entry-content, .wp-block-post-content) :where(pre){
  margin: 0 0 1.1em;
  padding: 12px 14px;
  overflow: auto;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 8px;
  background: rgba(0,0,0,.04);
}

:where(.entry-content, .wp-block-post-content) :where(pre code){
  background: transparent;
  border: 0;
  padding: 0;
  font-size: 0.9em;
}

/* ---------------------------------------------------------
  6) テーブル：最低限の可読性 + SP横スクロール
--------------------------------------------------------- */
:where(.entry-content, .wp-block-post-content) :where(table){
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.2em;
}

:where(.entry-content, .wp-block-post-content) :where(th, td){
  border: 1px solid rgba(0,0,0,.12);
  padding: 10px 12px;
  vertical-align: top;
}

:where(.entry-content, .wp-block-post-content) :where(th){
  font-weight: 700;
  background: rgba(0,0,0,.03);
}

/* ブロックテーブルは overflow が出やすいので保険 */
:where(.entry-content, .wp-block-post-content) :where(.wp-block-table){
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
:where(.entry-content, .wp-block-post-content) :where(.wp-block-table table){
  min-width: 640px; /* 小さすぎて潰れるのを防止（必要なら子テーマで調整） */
}

/* ---------------------------------------------------------
  7) リンク：装飾は最小、判別できる状態だけ保証
--------------------------------------------------------- */
:where(.entry-content, .wp-block-post-content) :where(a){
  text-decoration-thickness: from-font;
  text-underline-offset: 0.14em;
}

/* ---------------------------------------------------------
  8) フォーム（WP標準 + 汎用）：最低限の入力UI
--------------------------------------------------------- */
:where(.entry-content, .wp-block-post-content) :where(input, select, textarea){
  font: inherit;
  color: inherit;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(0,0,0,.18);
  border-radius: 8px;
  padding: 3px 12px;
  background: #fff;
}

:where(.entry-content, .wp-block-post-content) :where(textarea){
  min-height: 140px;
  resize: vertical;
}

:where(.entry-content, .wp-block-post-content) :where(input[type="checkbox"], input[type="radio"]){
  width: auto;
  margin-right: 0.35em;
  vertical-align: middle;
}

:where(.entry-content, .wp-block-post-content) :where(button, input[type="submit"], input[type="button"], input[type="reset"]){
  font: inherit;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.18);
  padding: 10px 14px;
  background: rgba(0,0,0,.04);
  cursor: pointer;
}

:where(.entry-content, .wp-block-post-content) :where(input[type="submit"]){
  max-width: 200px;
  width: 200px;
  display: block;
  margin: 0 auto;
}

:where(.entry-content, .wp-block-post-content) :where(button:hover, input[type="submit"]:hover, input[type="button"]:hover, input[type="reset"]:hover){
  background: rgba(0,0,0,.07);
}



/* WP検索ブロック（見た目の最小整形） */
:where(.entry-content, .wp-block-post-content) .wp-block-search{
  margin: 0 0 1.2em;
}
:where(.entry-content, .wp-block-post-content) .wp-block-search__inside-wrapper{
  gap: 10px;
}
:where(.entry-content, .wp-block-post-content) .wp-block-search__input{
  width: 100%;
}
:where(.entry-content, .wp-block-post-content) .wp-block-search__button{
  width: auto;
  white-space: nowrap;
}

/* フォーカス可視化（アクセシビリティ最低限） */
:where(.entry-content, .wp-block-post-content) :where(a, button, input, select, textarea):focus-visible{
  outline: 2px solid rgba(0,0,0,.45);
  outline-offset: 2px;
}

/* ---------------------------------------------------------
  9) コメント（classic）：最低限の余白
--------------------------------------------------------- */
:where(.comment-list){
  margin: 0;
  padding: 0;
  list-style: none;
}
:where(.comment-list .comment){
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 12px;
  background: rgba(0,0,0,.02);
}
:where(.comment-meta){
  font-size: 0.92em;
  opacity: 0.85;
  margin-bottom: 8px;
}
:where(.comment-content p){
  margin: 0 0 0.9em;
}

/* ---------------------------------------------------------
  10) “よくある崩れ”の保険（親テーマ最小）
--------------------------------------------------------- */
/* URLが長いときの横はみ出し保険 */
:where(.entry-content, .wp-block-post-content) :where(a){
  word-break: break-word;
}

/* 画像がinlineで下に余白が出る環境の保険 */
:where(.entry-content, .wp-block-post-content) :where(img){
  display: block;
}
