/* ====================================================================
   見出し（H1-H6）のフォントサイズ調整
   ==================================================================== */
/* PC表示での見出し調整 */
/* 料金・レッスン内容（固定ページタイトル）のサイズ調整 */
.site-main article.page .entry-header h1.entry-title { /* ★このセレクタを追加または修正★ */
    font-size: 2.0rem !important; /* !important を追加して確実に上書き */
    line-height: 1.2;
    margin-bottom: 20px;
}
/* その他のH1タグ（ブログ記事タイトルなど） */
h1 {
    font-size: 2.2rem;
    line-height: 1.2;
    margin-bottom: 25px;
}
h2 {
    font-size: 1.8rem;
    line-height: 1.3;
    margin-bottom: 20px;
}
h3 {
    font-size: 1.5rem;
    line-height: 1.4;
    margin-bottom: 18px;
}
h4 {
    font-size: 1.3rem;
    line-height: 1.4;
    margin-bottom: 15px;
}
h5 {
    font-size: 1.1rem;
    line-height: 1.5;
    margin-bottom: 12px;
}
h6 {
    font-size: 1.0rem;
    line-height: 1.5;
    margin-bottom: 10px;
}

/* ====================================================================
   教材画像のレスポンシブ表示用CSS
   ==================================================================== */
/* PC表示での画像表示 */
.image-container {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
    margin: 20px 0;
    padding: 0 10px; /* 左右にパディングを追加 */
    box-sizing: border-box; /* パディングを含めて計算 */
}

.image-container .wp-block-image {
    flex: 1;
    min-width: 280px;
    max-width: 500px;
    cursor: pointer; /* クリック可能であることを示す */
    box-sizing: border-box; /* パディングを含めて計算 */
}

.image-container .wp-block-image img {
    width: 100%;
    height: auto;
    max-height: 250px;
    object-fit: contain; /* 画像の切れを防ぐ */
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s ease; /* ホバー効果 */
    display: block; /* ブロック要素として表示 */
}

.image-container .wp-block-image img:hover {
    transform: scale(1.02);
}

/* ポップアップ用のスタイル */
.image-popup {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    cursor: pointer;
}

.image-popup img {
    display: block;
    margin: auto;
    max-width: 90%;
    max-height: 90%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.image-popup .close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10000;
}

.image-popup .close:hover {
    color: #ccc;
}

/* ====================================================================
   レスポンシブデザイン調整 (メディアクエリ)
   ==================================================================== */
/* タブレット・中型PC (最大幅 1024px) */
@media (max-width: 1024px) {
    /* 料金・レッスン内容（固定ページタイトル）のサイズ調整 (1024px以下) */
    .site-main article.page .entry-header h1.entry-title { /* ★このセレクタを追加または修正★ */
        font-size: 1.8rem !important;
    }
    h1 {
        font-size: 2.0rem;
    }
    h2 {
        font-size: 1.6rem;
    }
    h3 {
        font-size: 1.4rem;
    }
    h4 {
        font-size: 1.2rem;
    }
    h5 {
        font-size: 1.0rem;
    }
    h6 {
        font-size: 0.9rem;
    }
    
    /* 画像表示調整 (1024px以下) */
    .image-container {
        padding: 0 15px; /* パディングを少し増やす */
    }
    
    .image-container .wp-block-image img {
        max-height: 220px;
    }
}

/* 小型タブレット・大型スマホ横向き (最大幅 768px) */
@media (max-width: 768px) {
    /* 料金・レッスン内容（固定ページタイトル）のサイズ調整 (768px以下) */
    .site-main article.page .entry-header h1.entry-title { /* ★このセレクタを追加または修正★ */
        font-size: 1.6rem !important;
    }
    h1 {
        font-size: 1.8rem;
    }
    h2 {
        font-size: 1.5rem;
    }
    h3 {
        font-size: 1.3rem;
    }
    h4 {
        font-size: 1.1rem;
    }
    h5 {
        font-size: 0.95rem;
    }
    h6 {
        font-size: 0.85rem;
    }
    
    /* 画像表示調整 (768px以下) - 縦並びに変更 */
    .image-container {
        flex-direction: column;
        align-items: center;
        gap: 15px;
        padding: 0 15px; /* 左右にパディング */
        margin: 15px 0;
    }
    
    .image-container .wp-block-image {
        width: 100%;
        max-width: 400px;
        margin: 0; /* マージンをリセット */
    }
    
    .image-container .wp-block-image img {
        height: 200px;
        max-height: none;
        object-fit: cover; /* 小さい画面では余白なしで表示 */
    }
}

/* スマホ (最大幅 480px) - iPhone 13 mini対応強化 */
@media screen and (max-width: 480px) {
    /* 料金・レッスン内容（固定ページタイトル）のサイズ調整 (480px以下) */
    .site-main article.page .entry-header h1.entry-title { /* ★このセレクタを追加または修正★ */
        font-size: 1.4rem !important; /* 固定ページのタイトル */
        line-height: 1.3;
        margin-bottom: 15px;
    }
    h1 {
        font-size: 1.6rem; /* その他のH1 */
        line-height: 1.4;
        margin-bottom: 18px;
    }
    h2 {
        font-size: 1.3rem;
        line-height: 1.5;
        margin-bottom: 15px;
    }
    h3 {
        font-size: 1.1rem;
        line-height: 1.5;
        margin-bottom: 12px;
    }
    h4 {
        font-size: 1.0rem;
        line-height: 1.5;
        margin-bottom: 10px;
    }
    h5 {
        font-size: 0.9rem;
        line-height: 1.5;
        margin-bottom: 8px;
    }
    h6 {
        font-size: 0.8rem;
        line-height: 1.5;
        margin-bottom: 5px;
    }
    
    /* 画像表示調整 (480px以下) - スマホ最適化 */
    .image-container {
        gap: 10px;
        margin: 15px 0;
        padding: 0 15px; /* 左右の余白を確保 */
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .image-container .wp-block-image {
        width: 100%;
        max-width: 100%; /* 最大幅を100%に設定 */
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }
    
    .image-container .wp-block-image img {
        width: 100%;
        height: 180px;
        max-height: none;
        object-fit: cover; /* スマホでは余白なしで表示 */
        border-radius: 6px;
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }
    
    /* ポップアップのスマホ調整 */
    .image-popup img {
        max-width: 95%;
        max-height: 95%;
    }
    
    .image-popup .close {
        top: 10px;
        right: 20px;
        font-size: 25px;
    }
}

/* iPhone 13 mini 専用調整 (390px以下) */
@media screen and (max-width: 390px) {
    .image-container {
        padding: 0 10px; /* より狭いパディング */
        margin: 10px 0;
    }
    
    .image-container .wp-block-image {
        width: calc(100% - 0px); /* 完全に幅を制御 */
        max-width: calc(100% - 0px);
    }
    
    .image-container .wp-block-image img {
        width: 100%;
        height: 160px; /* 高さを少し小さく */
        border-radius: 4px;
    }
    
    /* ポップアップの調整 */
    .image-popup img {
        max-width: 98%;
        max-height: 98%;
    }
    
    .image-popup .close {
        top: 5px;
        right: 15px;
        font-size: 22px;
    }
}
