/* 平成医療学園テーマ：記事フロント用CSS（本家/SWELLの記事デザインを自前クラスで再現） */

/* ── サイトカラールール（役割ベース・思想11） ── */
:root {
    --hm-blue:  #4694d1; /* 見出し・構造アクセント（水色＝本家キーカラー --key-color） */
    --hm-link:  #4694d1; /* リンク・強調（水色に統一） */
    --hm-tint:  #eef5fa; /* 薄い背景（薄水色） */
    --hm-tint2: #eff3f6; /* 薄い背景（グレー寄り） */
}

/* ── 親サイトの「器」に含まれる、記事ページでは不要な要素を非表示 ──
   HTMLは削らずCSSで隠す（多バイト文字化け・消し残しを避けるため・思想12） ── */
#top_title_area,   /* 内部ページのタイトル帯（ページ見出し＋背景画像） */
#breadcrumb,       /* SWELL標準パンくず（テーマ側パンくずと重複するため） */
#main_visual,      /* トップのメインビジュアル（トップを雛形にした場合） */
.p-blogParts {     /* トップの本文外ウィジェット（Events / News 等） */
    display: none !important;
}

/* タイトル帯/メインビジュアルを隠した分、本文エリア上部の余白（SWELLの .l-content
   padding-top:4em ≒ 64px）が過剰になるため控えめに詰める。
   #content（id+class）で指定し、雛形の body クラスによらず確実に効かせる */
#content {
    padding-top: 24px !important;
}



/* ── ベースタイポグラフィ（親サイト準拠） ── */
main {
    font-size: 16px;
    line-height: 1.8;
    letter-spacing: 0.08em;
    color: #333;
    font-family: "Noto Sans JP", "游ゴシック体", YuGothic, "游ゴシック", "Yu Gothic", sans-serif;
    font-weight: 500;
}

/* ── 記事コンテナ ── */
.hm-article {
    max-width: 1000px !important;
    margin: 24px auto 48px !important;
    padding: 0 5% 8px !important;
    background: #fff !important;
    border: none !important;
    border-radius: 0 !important;
}

.hm-article .entry-title {
    float: none !important; /* 本体common.cssの裸 h1{float:left}（ヘッダーロゴ用）の打ち消し。
                               @importインライン化(v1.0.2)で下層CSSが記事にも効くようになったため */
    font-size: 28px;
    font-weight: 700;
    line-height: 1.5;
    margin: 0 0 16px;
    color: #1f5b8d; /* ディープネイビー（C案セット） */
}

.hm-article .entry-dates {
    font-size: 13px;
    color: #999;
    margin-bottom: 24px;
}

.hm-article .entry-dates span + span::before {
    content: "／";
    margin: 0 0.5em;
}

.hm-article .post-thumbnail {
    margin-bottom: 32px;
}

.hm-article .post-thumbnail img {
    width: 100% !important;
    max-width: min(740px, 100%) !important; /* アイキャッチは最大740px。
                                               運用ルール: アイキャッチ画像は横幅740pxで作成→原寸(等倍)表示で最も綺麗。
                                               図解は横幅700pxで作成（下の700pxルールで等倍表示） */
    height: auto !important;
    display: block !important;
    margin: 0 auto !important;
    border-radius: 8px !important;
}

/* ── 見出し（C案：ブルーバンドセット・本体サイトの角丸作法） ── */
/* h2: 平成医療学園ブルーのバンド（角丸8px・白抜き） */
.hm-article h2 {
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.4;
    margin: 40px 0 18px;
    padding: 12px 18px;
    background: var(--hm-blue);
    border: none;
    border-radius: 8px;
}

/* h3: 薄水色バンド（角丸6px・ネイビー文字） */
.hm-article h3 {
    color: #1f5b8d;
    font-size: 20px; /* 文字サイズ規約適用(v1.1.1): 21→20px */
    font-weight: 700;
    line-height: 1.4;
    margin: 32px 0 12px;
    padding: 8px 14px;
    background: var(--hm-tint);
    border: none;
    border-radius: 6px;
}

/* h4: シアンの点線下線（文字幅にフィット） */
.hm-article h4 {
    display: table;
    color: #333;
    font-size: 18px; /* 文字サイズ規約適用(v1.1.1): 19→18px */
    font-weight: 700;
    line-height: 1.4;
    margin: 28px 0 10px;
    padding: 0 2px 6px;
    background: none;
    border: none;
    border-bottom: 2px dotted #f48700;
}

.hm-article h5 {
    color: #1f5b8d;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.5;
    margin: 22px 0 10px;
}

.hm-article h6 {
    color: #4E4E4E;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.5;
    margin: 18px 0 8px;
}

/* ── 本文・リンク ── */
.hm-article p {
    font-size: 16px;
    line-height: 1.75;
    margin: 0 0 20px;
    color: #333;
}

.hm-article a {
    color: var(--hm-link);
    text-decoration: underline;
    transition: opacity 0.3s;
}

.hm-article a:hover {
    opacity: 0.6;
}

.hm-article strong {
    color: var(--hm-link);
    font-weight: 700;
}

/* ── リスト（v1.0.9: 平成医療学園ブルーのマーカー装飾）──
   ul  = ブルーの丸マーカー（ネストはシアンの小丸）
   ol  = ブルー太字の数字
   ※プラグイン側の装飾ブロック（box-list等）は自前のマーカーで上書きする */
.hm-article ul {
    margin: 0 0 20px;
    padding-left: 2px;
    list-style: none;
}

.hm-article ol {
    margin: 0 0 20px;
    padding-left: 2px;
    list-style: none;
    counter-reset: hm-ol;
}

.hm-article ul > li {
    position: relative;
    padding-left: 1.25em;
}

.hm-article ul > li::before {
    content: "";
    position: absolute;
    left: 3px;
    top: 0.62em;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--hm-blue);
}

.hm-article ul ul,
.hm-article ol ol,
.hm-article ul ol,
.hm-article ol ul {
    margin: 0.25em 0 0;
    list-style: none;
}

.hm-article ul ul > li::before {
    width: 6px;
    height: 6px;
    top: 0.7em;
    background: #f48700;
}

.hm-article ol > li {
    position: relative;
    padding-left: 1.7em;
    counter-increment: hm-ol;
}

.hm-article ol > li::before {
    content: counter(hm-ol) ".";
    position: absolute;
    left: 2px;
    top: 0;
    color: var(--hm-blue);
    font-weight: 700;
}

.hm-article li {
    font-size: 16px;
    line-height: 1.7;
    margin: 0.25em 0;
    padding-top: 0;
    padding-bottom: 0;
    color: #333;
}

.hm-article li > ul,
.hm-article li > ol {
    margin: 0.25em 0 0;
}

/* ── 画像 ──
   ・本来サイズで表示(拡大しない＝粗くならない)
   ・デバイス幅が画像より狭い場合は100%に縮小
   ・デフォルトで中央表示
*/
.hm-article img {
    max-width: 100%;
    height: auto;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* Gutenbergの画像ブロック */
.hm-article .wp-block-image {
    margin: 24px auto;
    text-align: center;
}
.hm-article .wp-block-image img {
    display: inline-block;
    max-width: 100%;
    height: auto;
}

/* 画像は元サイズで表示し、拡大しない（粗くならないように）。
   ・コンテンツ幅より大きい画像 → 縮小（max-width:100%）
   ・小さい画像（例:500px） → そのままの幅で表示（width:auto）
   ・画面が画像幅より狭い → 100%に縮小
   ※ 全幅(alignfull)・幅広(alignwide)は意図的に幅100%にするため除外
   ※ 本体サイト取込CSSの img { max-width:100%; display:block } 系（要素セレクタ）に確実に勝つため !important を使用。
      手動リサイズ画像（インラインwidth指定あり）はセレクタから除外して尊重する（v1.0.10） */
.hm-article .wp-block-image:not(.alignfull):not(.alignwide) img:not([style*="width"]),
.hm-article p > img:not([style*="width"]) {
    width: auto !important;
    max-width: min(700px, 100%) !important; /* 図解は最大700px（v1.0.12：段落直下のimgにも適用） */
    height: auto !important;
}
/* 段落直下の画像（MD原稿由来の <p><img></p>）も中央寄せ */
.hm-article p > img {
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Gutenberg align 指定を尊重（右寄せ・左寄せが選ばれた場合） */
.hm-article .wp-block-image.alignleft {
    text-align: left;
    margin: 0 24px 16px 0;
}
.hm-article .wp-block-image.alignleft img {
    margin: 0;
}
.hm-article .wp-block-image.alignright {
    text-align: right;
    margin: 0 0 16px 24px;
}
.hm-article .wp-block-image.alignright img {
    margin: 0;
}

/* キャプションを控えめに */
.hm-article .wp-block-image figcaption {
    font-size: 12px;
    color: #666;
    text-align: center;
    margin-top: 8px;
    line-height: 1.5;
}

/* ── blockquote（本家準拠：グレー背景＋二重線の左罫） ── */
.hm-article blockquote {
    position: relative;
    margin: 20px 0;
    padding: 16px 24px 16px 32px;
    border: none;
    background: #f7f7f7;
    color: #4E4E4E;
    font-style: normal;
    font-size: 15px;
    line-height: 1.75;
}
.hm-article blockquote::before {
    content: "";
    position: absolute;
    left: 16px;
    top: 16px;
    width: 5px;
    height: calc(100% - 32px);
    border-left: 1px solid rgba(180, 180, 180, 0.75);
    border-right: 1px solid rgba(180, 180, 180, 0.75);
}

.hm-article blockquote p:last-child {
    margin-bottom: 0;
}

/* ── table（本体トーン + スマホ横スクロール対応） ── */
.hm-article table,
.hm-article .wp-block-table table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin: 20px 0 !important;
    font-size: 15px !important;
    line-height: 1.7 !important;
    word-break: break-word;
    table-layout: auto !important;
}

/* th: 青ヘッダー白文字（!important で強制。Gutenbergのインライン色も打ち消す） */
.hm-article th,
.hm-article thead th,
.hm-article tr th,
.hm-article tr:first-child th,
.hm-article .wp-block-table th,
.hm-article .wp-block-table thead th {
    background: var(--hm-blue) !important;
    background-color: var(--hm-blue) !important;
    color: #fff !important;
    padding: 12px !important;
    text-align: left !important;
    font-weight: 700 !important;
    font-size: 15px !important;
    line-height: 1.5 !important;
    border: 1px solid var(--hm-blue) !important;
    vertical-align: middle !important;
}

.hm-article td,
.hm-article .wp-block-table td {
    padding: 12px !important;
    border: 1px solid #dcdcdc !important;
    text-align: left;
    font-size: 15px;
    line-height: 1.7;
    color: #333;
    vertical-align: middle;
    background: #fff;
}

/* 偶数行の td のみストライプ */
.hm-article tbody tr:nth-child(even) td,
.hm-article table > tr:nth-child(even) td {
    background: var(--hm-tint) !important;
}

.hm-article tbody tr:hover td {
    background: var(--hm-tint2) !important;
}

/* ── レスポンシブテーブル（WPブロック自動対応） ── */
.hm-article .wp-block-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 2em 0;
}

.hm-article .wp-block-table table {
    margin: 0;
}

/* has-fixed-layout：まず100%に収める → 溢れたらスクロール */
.hm-article .wp-block-table .has-fixed-layout {
    table-layout: auto;
    width: 100%;
}

/* 多列テーブル：先頭列を固定 */
.hm-article .wp-block-table th:first-child,
.hm-article .wp-block-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    background: var(--hm-tint2);
    box-shadow: 2px 0 4px rgba(0,0,0,0.06);
}

.hm-article .wp-block-table td:first-child {
    background: #fff;
}

.hm-article .wp-block-table tr:hover td:first-child,
.hm-article .wp-block-table tr:hover th:first-child {
    background: var(--hm-tint);
}

/* ── 親サイトCSSリセット（font-size:10px）の上書き ── */
.hm-article code,
.hm-article pre,
.hm-article dfn,
.hm-article em,
.hm-article span,
.hm-article sub,
.hm-article sup,
.hm-article dl,
.hm-article dt,
.hm-article dd {
    font-size: inherit;
    line-height: inherit;
    font-family: inherit;
}

.hm-article code,
.hm-article pre {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.9em;
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
}

.hm-article pre {
    padding: 1em;
    overflow-x: auto;
    line-height: 1.6;
}

.hm-article em {
    font-style: italic;
}

.hm-article figcaption,
.hm-article .wp-element-caption,
.hm-article caption,
.hm-article cite,
.hm-article small,
.hm-article figure,
.hm-article address {
    font-size: 14px;
    line-height: 1.7;
    color: #4E4E4E;
    font-family: "Noto Sans JP", "游ゴシック体", YuGothic, sans-serif;
    font-weight: 500;
}

.hm-article figcaption,
.hm-article .wp-element-caption {
    margin-top: 0.8em;
    text-align: center;
}

/* スマホ：さらにコンパクト化 */
@media (max-width: 768px) {
    .hm-article .wp-block-table {
        position: relative;
    }
    /* 右端にグラデーション：スクロール可能なことを視覚的に示す */
    .hm-article .wp-block-table::after {
        content: '';
        position: absolute;
        right: 0;
        top: 0;
        width: 24px;
        height: 100%;
        background: linear-gradient(to left, rgba(0, 104, 177, 0.12), transparent);
        pointer-events: none;
    }
    /* スクロール可能な table に限り「←スクロール→」表示 */
    .hm-article .wp-block-table {
        padding-top: 22px;
    }
    .hm-article .wp-block-table::before {
        content: '← スクロールできます →';
        display: block;
        position: absolute;
        top: 0;
        right: 4px;
        font-size: 11px;
        color: var(--hm-link);
        padding: 2px 0 0 0;
        letter-spacing: 0.03em;
    }
}

/* ── カード一覧（トップ・アーカイブ） ── */
.hm-card-grid {
    max-width: 1000px !important;
    margin: 24px auto 40px !important;
    padding: 0 20px !important;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}
.archive-hero + .hm-card-grid {
    margin-top: 32px !important;
}
.archive-hero + .hm-article {
    margin-top: 32px !important;
}

.hm-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e4eaee;
    border-top: 4px solid var(--hm-blue); /* 案3: 上辺水色アクセント（業者カードとお揃い） */
    border-radius: 10px;
    overflow: visible; /* 右上タグを外にはみ出させるため */
    text-decoration: none;
    color: #333;
    transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}

.hm-card:hover {
    box-shadow: 0 6px 22px rgba(29, 66, 148, 0.12);
    border-color: #d3dde4;
    border-top-color: var(--hm-blue);
    transform: translateY(-2px);
}

/* 右上カテゴリタグ（橙・垂れ下がり） */
.hm-card__tag {
    position: absolute;
    top: -4px;
    right: 14px;
    z-index: 2;
    background: #f48700;
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
    line-height: 1.4;
    padding: 4px 10px 3px;
    border-radius: 0 0 7px 7px;
}

.hm-card__thumb {
    aspect-ratio: 740 / 416; /* アイキャッチ比率（740x416）で統一 */
    overflow: hidden;
}
.hm-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hm-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 13px 16px 13px;
}

.hm-card__title {
    flex: 1;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.5;
    margin: 0;
    text-align: left; /* 本体CSS h2{text-align:center} の打ち消し */
    color: #1f5b8d;
    transition: color 0.2s;
}
.hm-card:hover .hm-card__title {
    color: var(--hm-link);
}

.hm-card__date {
    margin-top: 10px;
    font-size: 11.5px;
    color: #8a91a0;
}

/* ── アーカイブタイトル ── */
.archive-hero {
    max-width: 1000px;
    margin: 24px auto 0;
    padding: 24px 20px 0;
    text-align: center;
}
.archive-title {
    font-size: 30px;
    font-weight: 700;
    color: var(--hm-blue);
    letter-spacing: .08em;
    line-height: 1.4;
    margin: 0;
}

/* ── 404：トップへ戻るボタン ── */
.hm-article .hm-back-home {
    display: inline-block;
    margin-top: 8px;
    padding: 12px 28px;
    background: var(--hm-blue);
    color: #fff !important;
    border-radius: 6px;
    text-decoration: none !important;
    font-weight: 700;
    transition: background 0.2s;
}
.hm-article .hm-back-home:hover {
    background: var(--hm-link);
}

/* ── ナビゲーション ── */
.nav-links {
    max-width: 1000px;
    margin: 24px auto;
    padding: 0 20px;
    font-size: 14px;
}

.nav-links a {
    color: var(--hm-link);
}

/* ── レスポンシブ ── */
@media (max-width: 768px) {
    /* 文字サイズ規約適用(v1.1.1): main直指定はガワ（本体ヘッダー等）に波及するため
       .hm-article スコープに変更 */
    .hm-article {
        font-size: 15px;
        margin: 16px 12px 24px !important;
        padding: 0 16px 8px !important;
    }

    .hm-article .entry-title {
        font-size: 21px; /* 文字サイズ規約適用(v1.1.1): 18→21px。
                            SPでh1(18)<h2(20)の階層逆転（つるかめ系フォーク元由来）を解消 */
    }

    .hm-article p {
        font-size: 15px;
        line-height: 1.8;
    }

    .hm-article h2 {
        font-size: 20px;
        margin: 30px 0 15px;
        padding: 10px 14px;
    }

    .hm-article h3 {
        font-size: 17px;
        margin: 24px 0 12px;
        padding: 7px 12px;
    }

    .hm-article h4 {
        font-size: 16px;
        margin: 22px 0 10px;
        padding: 0 2px 5px;
    }

    .hm-article h5 {
        font-size: 15px;
    }

    .hm-article h6 {
        font-size: 14px;
    }

    /* リストボックスのpaddingを縮めて可読性確保 */
    .hm-article ul,
    .hm-article ol {
        padding: 20px 25px 12px;
        padding-left: 40px; /* マーカー分確保 */
    }

    .hm-article ul > li,
    .hm-article ol > li {
        font-size: 14px;
        line-height: 1.6;
    }

    /* テーブル：セル詰めて小フォントで対応 */
    .hm-article th,
    .hm-article td {
        padding: 9px 12px; /* 文字サイズ規約適用(v1.1.1) */
        font-size: 13px;
        line-height: 1.5;
    }

    .hm-article blockquote {
        font-size: 14px;
        padding: 12px 16px;
    }

    .hm-card-grid {
        margin-top: 24px !important;
        grid-template-columns: 1fr;
    }

    .hm-card__title {
        font-size: 15px;
    }

    .archive-hero {
        padding: 24px 16px 0 !important;
    }
    .archive-title {
        font-size: 24px !important;
        letter-spacing: .12em !important;
    }
    .archive-title::after {
        width: 80px !important;
        height: 6px !important;
    }
    .archive-desc {
        font-size: 13px !important;
        margin-top: 16px !important;
    }
}

/* ============================================================
   親サイト（www.heisei-iryo-gakuen.ac.jp）適用CSS
   ============================================================
   親サイト（SWELL）のHTMLを借りる運用で、本文に不要な親テーマ由来の
   装飾を打ち消す。管理画面「追加CSS」欄に書く代わりにテーマに組み込む（WAF回避）。
   ============================================================ */

/* グローバルナビの「スタッフブログ」current ハイライトを打ち消し */
.headnavi.current {
    color: inherit !important;
    font-weight: normal !important;
    border-bottom: none !important;
    background: none !important;
}

/* サイドバー除去後、記事本体を全幅に */
.flexcontents--contents {
    display: block !important;
    width: 100% !important;
}
.article {
    width: 100% !important;
    max-width: 1000px !important;
    margin: 0 auto !important;
    padding: 40px 20px !important;
}

/* ============================================================
   パンくずリスト（本家 #pankuzu 帯と同デザイン・v1.0.5）
   グレー全幅帯（#E6E6E6）・センター寄せ・「＞」シェブロン区切り。
   #contents（.inner max-1200px）内から画面幅いっぱいに広げるため
   フルブリード（margin: calc(50% - 50vw)）を使う。
   本家 #wrapper { overflow:hidden } があるため横スクロールは出ない。
   表示位置は SEO設定 > パンくず > 表示位置（既定: コンテンツ下部）。
   ============================================================ */
.p-breadcrumb {
    display: flex;              /* v1.0.8: 上下センターをflexで確実に取る */
    align-items: center;
    justify-content: center;
    min-height: 2.6em;
    width: 100vw;
    max-width: 100vw; /* 本体 html * { max-width:100% } による親幅キャップの打ち消し */
    margin: 48px 0 0 calc(50% - 50vw); /* 記事末尾との間隔。下は0でフッター密着 */
    padding: 0 1em;
    background: #E6E6E6;
    font-size: 16px;
    line-height: 1; /* 行ボックス由来の上下ズレを排除 */
}
/* #contents（.inner）の overflow:hidden がフルブリード帯をクリップするため解除。
   横スクロールは本家 #wrapper { overflow:hidden } が引き続き防止する */
body #contents.inner {
    overflow: visible !important;
    padding-bottom: 0 !important; /* 本家 padding-bottom:5em を除去し、パンくず帯をフッターに密着（v1.0.7） */
}
/* パンくず帯が無いページ（記事一覧・アーカイブ）はカードグリッド側で下余白を確保 */
.hm-card-grid {
    margin-bottom: 64px;
}
.p-breadcrumb__list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center; /* 本家帯と同じセンター寄せ */
    margin: 0 !important;  /* 本体 body #contents ol { margin-bottom:1.2em } の打ち消し（上下センター用） */
    padding: 0 !important;
    list-style: none;
}
.p-breadcrumb__item {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
    font-size: 16px !important; /* 本体CSSの article li{font-size:20px} がli直接指定のため、
                                   コンテナ継承では効かない。li側で明示上書きする */
    font-weight: 600;           /* 本家 #pankuzu { font-weight:600 } に合わせる */
    line-height: 1 !important;  /* v1.0.8: flexセンター精度のため */
    background: none !important;
}
/* 区切りの「＞」: 本家 #pankuzu a::after と同じ細シェブロン（border回転） */
.p-breadcrumb__item + .p-breadcrumb__item::before {
    content: "";
    display: inline-block;
    width: 0.4em;
    height: 0.4em;
    margin: 0 0.9em;
    border-top: 2px solid #333;
    border-right: 2px solid #333;
    transform: rotate(45deg);
}
.p-breadcrumb__text {
    color: #333;
    text-decoration: none;
}
a.p-breadcrumb__text:hover {
    text-decoration: underline;
}
.p-breadcrumb__item:last-child .p-breadcrumb__text {
    color: #333;
}
@media (max-width: 768px) {
    .p-breadcrumb {
        font-size: 13px;
        padding: 0.4em 12px;
        margin-top: 24px;
    }
    .p-breadcrumb__item {
        font-size: 13px !important;
    }
}

/* 本家ガワ側パンくず（TOP > プライバシーポリシー）の保険殺し（v1.0.5）
   除外セレクタ #pankuzu 未設定・キャッシュ未再生成でも表示させない */
#pankuzu {
    display: none !important;
}

/* ── テーブル直後の小サイズ文字（v1.0.10）──
   エディタでフォントサイズ「小」を設定した段落がテーブル直後に来た場合、
   テーブルとの間隔を詰めて注釈らしく見せる */
.hm-article .wp-block-table + p.has-small-font-size,
.hm-article figure.wp-block-table + p.has-small-font-size,
.hm-article table + p.has-small-font-size,
.hm-article .hmc-table-wrap + p.has-small-font-size {
    margin-top: -12px; /* テーブルのmargin-bottom 20pxと相殺し実質8px */
    font-size: 13px;
    color: #777;
    line-height: 1.6;
}

/* ─────────────────────────────────────────────
   本体下層CSSの欠落補完（parent-fix）
   .footer_ban のスタイルは本体の style.css（トップ用）にのみ存在し、
   下層用 page.css＋@import群には未定義。そのため本体下層は
   フッターバナー（ban_ymg_education.jpg=3000x1600等）が原寸表示で崩れる。
   ガワを /about（下層）から取得している本テーマでも同じ崩れが出るため、
   トップ用の定義をそのまま補完する。値は本体 style.css L463-484 と同一。
   ───────────────────────────────────────────── */
.footer_ban { width: 1200px; margin: 0 auto; }
.footer_ban .cf { display: flex; justify-content: flex-start; align-items: center; margin-bottom: 3em; }
.footer_ban a { width: 12%; margin-right: 10px; }
.footer_ban a img { width: 100%; }
@media screen and (max-width:768px) {
    .footer_ban { width: 80%; margin: 0 auto; }
    .footer_ban .cf { flex-wrap: wrap; justify-content: space-between; text-align: center; }
    .footer_ban a { width: 40%; }
    .footer_ban a img { width: 100%; }
}

/* ── 本体下層CSS（common.css インライン化分）の裸要素セレクタ打ち消し ──
   common.css には本体ヘッダーロゴ用の裸 h1{float:left} / h1 img{width:395px;height:58.5px}
   があり、@importインライン化(v1.0.2)後は記事側にも効いてしまう。
   記事内の h1（entry-title 以外の h1 が本文に来た場合も含む）を保険で打ち消す。 */
.hm-article h1 {
    float: none !important;
}
.hm-article h1 img {
    width: auto !important;
    height: auto !important;
}

/* ============================================================
   本体CSS（www.heisei-iryo-gakuen.ac.jp /assets2024）打ち消し
   本家下層は body #contents h2 等の高詳細度セレクタ＋一部!important
   で見出しを装飾しているため、#contents 内へ挿入される記事側で
   より高い詳細度（body #contents .hm-article …）で再宣言する。
   値はテーマ標準（上記 .hm-article 各定義）と同一に揃えること。
   ============================================================ */

/* h2: 本体の 36px／中央寄せ／水色 !important／padding0.55em を打ち消し */
body #contents .hm-article h2 {
    color: #fff !important; /* 本体 color: var(--key-color) !important への対抗 */
    font-size: 22px;
    font-weight: 700;
    text-align: left;
    margin: 40px 0 18px;
    padding: 12px 18px;
}
body #contents .hm-article h2:first-child {
    margin-top: 40px; /* 本体 h2:first-child { margin-top:1em } の打ち消し */
}

/* h3: 本体の 22px fw500 margin-top2.4em を打ち消し */
body #contents .hm-article h3 {
    font-size: 20px; /* 文字サイズ規約適用(v1.1.1) */
    font-weight: 700;
    margin: 32px 0 12px;
    padding: 8px 14px;
}

/* h4: 本体の 36px／中央／水色／下線バー(::before) を打ち消し */
body #contents .hm-article h4 {
    font-size: 18px; /* 文字サイズ規約適用(v1.1.1) */
    font-weight: 700;
    color: #333;
    text-align: left;
    position: static;
    margin: 28px 0 10px;
    padding: 0 2px 6px;
}
body #contents .hm-article h4::before {
    content: none;
}

/* h5/h6: 本体の 26px fw700・heading_5系装飾を打ち消し */
body #contents .hm-article h5 {
    font-size: 16px;
    border-left: none;
    display: block;
    margin: 22px 0 10px;
    padding: 0;
}
body #contents .hm-article h6 {
    font-size: 15px;
    margin: 18px 0 8px;
}

/* 本文: 本体の p/li 18px・p:first-child margin-top:30px を打ち消し */
body #contents .hm-article p {
    font-size: 16px;
    line-height: 1.75;
    margin: 0 0 20px;
}
body #contents .hm-article p:first-child {
    margin-top: 0;
}
body #contents .hm-article li {
    font-size: 16px;
}

/* 可読性: 本体の html * { word-break: break-all } を打ち消し */
.hm-article,
.hm-article * {
    word-break: normal;
    overflow-wrap: break-word;
}

/* ============================================================
   ガワh1→div変換後のヘッダーロゴ復元（v1.0.2）
   本家CSSの body header h1 系ルールは div 化で外れるため、
   data-hm-was-h1 属性に対して本家 common.css の写しを当てる。
   ============================================================ */
body header div[data-hm-was-h1] {
    padding: 0 12px;
    line-height: 1;
}
body header div[data-hm-was-h1] img {
    height: 76px;
}
@media screen and (max-width: 1329px) {
    body header div[data-hm-was-h1] img {
        height: 60px;
    }
}
@media screen and (max-width: 780px) {
    body header div[data-hm-was-h1] img {
        height: 45px;
    }
}
@media screen and (max-width: 520px) {
    body header div[data-hm-was-h1] {
        width: 70%; /* ボタン2つ(アクセスと開閉) */
        padding: 0 12px 0 5px;
    }
    body header div[data-hm-was-h1] img {
        height: auto;
        padding: 4px 0 2px;
    }
}

/* ============================================================
   記事カードへの本体CSS直撃打ち消し（v1.0.9）
   本家 body #contents h2 { 36px/中央/水色!important/padding0.55em } と
   #contents a { 青#086ec9・下線 } がカードに当たるため、
   より高い詳細度（body #contents .hm-card …）でテーマ標準値を再宣言。
   値は上記 .hm-card 系の定義と同一に揃えること。
   ============================================================ */
body #contents a.hm-card {
    color: inherit;
    text-decoration: none; /* 本家 #contents a の下線打ち消し */
}
body #contents .hm-card .hm-card__title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.5;
    margin: 0;
    padding: 0;
    text-align: left;
    color: #1f5b8d !important; /* 本家 color: var(--key-color)!important への対抗 */
}
body #contents .hm-card:hover .hm-card__title {
    color: var(--hm-link) !important;
}
body #contents .hm-card .hm-card__date {
    font-size: 11.5px;
    color: #8a91a0;
    text-decoration: none;
}
@media (max-width: 768px) {
    body #contents .hm-card .hm-card__title {
        font-size: 15px;
    }
}
