/* The base theme adds vertical padding to entry-content on pages. On the front page,
   remove only that container padding so the full-width hero starts directly below the header. */
body.home .entry-content {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}
body.home .entry-content > .yks-hero {
  margin-top: 0 !important;
}
/* === 追加修正 2026-07-22 === */
body.home main {
  padding-top: 0 !important;
}
/* ヘッダー直下の残り空白(#content-wのpadding-top)も除去 */
body.home #content-w {
  padding-top: 0 !important;
}
/* === ヒーローの高さ圧縮 2026-07-22 ===
   PC: 16:9(約925px)は縦に大きすぎるため、高さを画面の6割程度に抑える */
body.home .entry-content > .yks-hero,
.yks-hero {
  aspect-ratio: auto !important;
  min-height: clamp(380px, 44vh, 520px) !important;
  padding-top: clamp(2.5rem, 4vw, 4rem) !important;
  padding-bottom: clamp(2.5rem, 4vw, 4rem) !important;
}
@media (max-width: 760px) {
  /* スマホ: 白オーバーレイを縦グラデーションにして画像(下側)をはっきり見せる */
  body.home .entry-content > .yks-hero,
  .yks-hero {
    background-image:
      linear-gradient(180deg,
        rgba(255,255,255,.96) 0%,
        rgba(255,255,255,.92) 34%,
        rgba(255,255,255,.55) 48%,
        rgba(255,255,255,.06) 62%,
        rgba(255,255,255,0) 100%),
      url("https://yoikuhihelp.info/wp-content/plugins/youikuhi-hero-image-restorer/assets/hero-parent-child.webp") !important;
    background-position: center bottom !important;
    /* スマホも縦を圧縮: テキスト+画像下部が1画面に収まる高さ */
    min-height: 0 !important;
    padding: 2rem 1.25rem 10rem !important;
    margin-bottom: 2rem !important;
  }
}

/* ==========================================================================
   === スマホ読みやすさ改善 2026-07-23 (v3) ===
   読者の大半がスマホのため、モバイルでの文字組み・余白・要素間隔を最適化
   ========================================================================== */
@media (max-width: 760px) {

  /* --- 本文の文字組み: 快適なサイズと行間、段落間に十分な余白 --- */
  .post .entry-content p,
  .page .entry-content p {
    font-size: 16.5px !important;
    line-height: 1.9 !important;
    margin-bottom: 1.4em !important;
    letter-spacing: 0.02em;
  }

  /* --- 本文の左右余白を少し広げ、視線の圧迫感を減らす --- */
  main {
    padding-left: 18px !important;
    padding-right: 18px !important;
  }

  /* --- 見出し: 前後の余白をしっかり取り、区切りを明確に(記事ページ限定、トップページには適用しない) --- */
  body.single-post .entry-content h2 {
    font-size: 20px !important;
    line-height: 1.5 !important;
    margin-top: 3em !important;
    margin-bottom: 1.2em !important;
    padding: 0.6em 0.8em !important;
    background: #fdf5f6 !important;
    border-left: 4px solid #e58a97 !important;
    border-bottom: none !important;
    border-radius: 4px;
  }
  body.single-post .entry-content h3 {
    font-size: 18px !important;
    line-height: 1.5 !important;
    margin-top: 2.4em !important;
    margin-bottom: 1em !important;
  }
  body.single-post .entry-content h4 {
    font-size: 16.5px !important;
    margin-top: 2em !important;
    margin-bottom: 0.9em !important;
  }

  /* --- リスト: 行間と項目間の余白 --- */
  .post .entry-content ul li,
  .post .entry-content ol li {
    font-size: 16px !important;
    line-height: 1.8 !important;
    margin-bottom: 0.6em !important;
  }

  /* --- 囲みボックス(mybox/ポイント/注意): 内側の余白を確保 --- */
  .post .entry-content .st-mybox-class,
  .post .entry-content [class*="st-mybox"] {
    padding: 1.1em 1em !important;
    margin: 1.8em 0 !important;
    line-height: 1.8 !important;
  }
  .post .entry-content .st-cmemo,
  .post .entry-content .st-memobox,
  .post .entry-content .st-point-box,
  .post .entry-content [class*="st-message-box"] {
    padding: 1em !important;
    margin: 1.8em 0 !important;
    line-height: 1.8 !important;
  }

  /* --- 吹き出し: 顔を小さくして吹き出し本体を広く --- */
  .st-kaiwa-box {
    margin: 1.8em 0 !important;
  }
  .st-kaiwa-face {
    width: 56px !important;
  }
  .st-kaiwa-face img {
    width: 56px !important;
    height: 56px !important;
  }
  .st-kaiwa-hukidashi {
    margin-left: 12px !important;
    padding: 0.9em 1em !important;
    font-size: 15.5px !important;
    line-height: 1.75 !important;
  }

  /* --- 表: スマホでは横スクロール可能に --- */
  .post .entry-content table {
    display: block;
    width: 100% !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 14.5px !important;
  }
  .post .entry-content table th,
  .post .entry-content table td {
    padding: 0.6em 0.7em !important;
    white-space: nowrap;
  }

  /* --- 画像: 余白と角丸で本文と馴染ませる --- */
  .post .entry-content figure,
  .post .entry-content p > img {
    margin: 1.6em 0 !important;
  }

  /* --- 引用・例文ブロック --- */
  .post .entry-content blockquote {
    padding: 1em !important;
    margin: 1.6em 0 !important;
    font-size: 15.5px !important;
    line-height: 1.8 !important;
  }
}

/* --- ヒーローの100vwフルワイド化による横スクロール・画面の横揺れ防止 ---
   100vwはスクロールバー幅を含むためスマホで横はみ出しが発生する。
   html/body両方で横方向のスクロールを確実に禁止し、画面が左右に動かないよう固定する */
/* 注: overflow-x:hidden を body に掛けると環境によっては body がスクロールコンテナ化して
   「画面内でさらにスクロールできる」状態になるため、clipを使用する(スクロールコンテナを作らない) */
html {
  overflow-x: clip !important;
}
body.home {
  overflow-x: clip !important;
  max-width: 100% !important;
}
/* ヒーロー自体のはみ出しも抑止: 100vwではなく親幅基準でフルワイド化 */
@media (max-width: 760px) {
  body.home .entry-content > .yks-hero {
    width: auto !important;
    margin-left: -18px !important;
    margin-right: -18px !important;
  }
}

/* --- トップページ: セクション見出しはインラインスタイルを尊重し、
   上記の記事用h2カード風スタイルやテーマのh2背景を打ち消す --- */
body.home .entry-content h2 {
  background: transparent !important;
  border-left: none !important;
  padding: 0 !important;
}

/* --- トップページ: テーマのh2飾り下線(::after)を非表示にしてセクションデザインをクリーンに --- */
body.home .entry-content h2::after,
body.home .entry-content h2::before {
  display: none !important;
  content: none !important;
}
body.home .entry-content h2 {
  border-bottom: none !important;
}

/* --- PC側も本文の行間を少し改善(全体の読みやすさ向上) --- */
.post .entry-content p {
  line-height: 1.85;
}
