/* ==========================================================
 * 釧路町 お知らせ(投稿)記事 読みやすさ調整
 * 対象: 投稿の個別ページのみ (body.single-post)
 *   - 固定ページ・トップ・一覧・商品ページには影響しません
 *   - サイドバー・ページャー・ヘッダー/フッターも対象外
 *   - 本文エリア (.textarea) と記事タイトル (h1) のみ調整
 * 追加先: 外観 > カスタマイズ > 追加CSS
 *        または cld/assets/css/ に置いて functions.php で読み込み
 * ========================================================== */

body.single-post main.single {
  --post-brand: #214996;
  --post-brand-light: #eef2fa;
  --post-text: #2b2f33;
  --post-line: #dfe4ec;
}

/* ---------- 記事タイトル ---------- */
body.single-post main.single .page-main h1.h2 {
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
  line-height: 1.5;
  font-weight: 700;
  color: var(--post-text);
  margin: 0 0 .75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--post-line);
}

/* 掲載日 */
body.single-post main.single .page-main h1.h2 + p.text-end {
  margin: 0 0 1.5rem;
  color: #6b7480;
}

/* ---------- 本文ベース ---------- */
body.single-post main.single .textarea {
  font-size: 1rem;              /* サイズ指定のない段落: 14px → 16px */
  line-height: 1.9;
  color: var(--post-text);
  letter-spacing: .02em;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* 段落
 * 文字サイズはエディタの指定(「中」=20px など)をそのまま使う。
 * 余白は文字サイズ基準(em)なので、サイズが変わっても比率は保たれる。 */
body.single-post main.single .textarea p {
  line-height: 1.9;
  margin: 0 0 1em;
}
/* 空の段落が作る不自然な空白を消す */
body.single-post main.single .textarea p:empty {
  display: none;
}

/* ---------- 見出し ---------- */
/* 大見出し h2: 大きめの太字 + 細い下線のみ */
body.single-post main.single .textarea h2 {
  font-size: clamp(1.3125rem, 1.15rem + .6vw, 1.5rem);
  font-weight: 700;
  line-height: 1.6;
  letter-spacing: .03em;
  color: var(--post-brand);
  padding-bottom: .6em;
  margin: 3.5em 0 1.25em;
  border-bottom: 1px solid var(--post-line);
}

/* 中見出し h3: 線なし、黒系の太字 (h2の青と区別) */
body.single-post main.single .textarea h3 {
  font-size: clamp(1.125rem, 1.05rem + .3vw, 1.25rem);
  font-weight: 700;
  line-height: 1.6;
  color: var(--post-text);
  margin: 2.5em 0 .75em;
}

/* 小見出し h4: 太字のみ */
body.single-post main.single .textarea h4 {
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.6;
  color: var(--post-text);
  margin: 2em 0 .5em;
}

/* 見出し直後・先頭の余白調整 */
body.single-post main.single .textarea > :first-child {
  margin-top: 0;
}
body.single-post main.single .textarea h2 + h3,
body.single-post main.single .textarea h3 + h4 {
  margin-top: 1.25em;
}

/* ---------- 強調・リンク ---------- */
body.single-post main.single .textarea strong {
  font-weight: 700;
}
body.single-post main.single .textarea a {
  color: var(--post-brand);
  text-decoration: underline;
  text-underline-offset: .2em;
}
body.single-post main.single .textarea a:hover {
  text-decoration: none;
  opacity: .8;
}

/* ---------- リスト ---------- */
body.single-post main.single .textarea ul,
body.single-post main.single .textarea ol {
  margin: 0 0 1.75em;
  padding-left: 1.75em;
}
body.single-post main.single .textarea li {
  line-height: 1.8;
  margin-bottom: .5em;
}
body.single-post main.single .textarea li::marker {
  color: var(--post-brand);
}

/* ---------- 画像・表・引用・区切り ---------- */
body.single-post main.single .textarea img {
  max-width: 100%;
  height: auto;
}
body.single-post main.single .textarea figure {
  margin: 2em 0;
}
body.single-post main.single .textarea figcaption {
  font-size: .875rem;
  color: #6b7480;
  text-align: center;
  margin-top: .5em;
}
body.single-post main.single .textarea table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 2em;
  font-size: .9375rem;
}
body.single-post main.single .textarea th,
body.single-post main.single .textarea td {
  border: 1px solid var(--post-line);
  padding: .75em 1em;
  line-height: 1.7;
}
body.single-post main.single .textarea th {
  background: var(--post-brand-light);
  font-weight: 700;
}
body.single-post main.single .textarea blockquote {
  margin: 2em 0;
  padding: 1em 1.25em;
  background: #f6f7f9;
  border-left: 4px solid var(--post-line);
}
body.single-post main.single .textarea hr {
  margin: 2.5em 0;
  border: 0;
  border-top: 1px solid var(--post-line);
  opacity: 1;
}

/* ---------- スマホ ---------- */
@media (max-width: 767.98px) {
  body.single-post main.single .textarea,
  body.single-post main.single .textarea p {
    line-height: 1.8;
  }
  body.single-post main.single .textarea h2 {
    margin-top: 2.75em;
  }
  body.single-post main.single .textarea table {
    display: block;
    overflow-x: auto;
  }
}
