@charset "UTF-8";

/* =========================================================
   0. リセット / ベース
   ========================================================= */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-family: 'Noto Sans JP', 'メイリオ', 'Meiryo', 'Hiragino Kaku Gothic Pro', 'ヒラギノ角ゴ Pro W3', 'Osaka', 'ＭＳ Ｐゴシック', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 0;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, p{
    margin: 0;
    padding: 0;
}

/* PC / スマホ 出し分け（<br class="only_desktop">, <br class="only_mobile"> 等で使用） */
.only_desktop { display: inline; }
.only_mobile  { display: none; }

/* =========================================================
   1. CSS変数（配色・フォント）
   ========================================================= */
:root {
    --font-jp: 'Zen Kaku Gothic New', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', sans-serif;
    --font-hand: 'Kiwi Maru', 'Zen Kaku Gothic New', sans-serif;
    --font-round: "M PLUS Rounded 1c", "Zen Maru Gothic", "BIZ UDPMaru", sans-serif;
    --line: #c5c4ec;
}
/* 5年生 */
#sho5 {
    background-color: rgba(240, 140, 0, 0.4);
    --grade-h2: #8e80b6;/*#434242;*/
    --grade: #f08c00;
    --grade-soft: rgba(204, 191, 172, 0.1);
    --grade-soft2: rgba(240, 140, 0, 0.22);
    --grade-mid: rgba(240, 140, 0, 0.40);
    --grade-text: #ad6500;
    --grade-visited: #816636;
    --grade-list:#6ad1c8;/*ワークテスト（音声）の罫線*/
}

/* 6年生 */
#sho6 {
    background-color: rgba(0, 108, 184, 0.4);
    --grade-h2: #8e80b6;/*#434242;*/
    --grade: #006cb8;
    --grade-soft: rgba(153, 183, 204, 0.1);
    --grade-soft2: rgba(0, 108, 184, 0.22);
    --grade-mid: rgba(0, 108, 184, 0.40);
    --grade-text: #006bb6;
    --grade-visited: #2a6a92;
    --grade-list:#6ad1c8;/*ワークテスト（音声）の罫線*/

}

/* =========================================================
   2. リンク
   ========================================================= */
a { color: #0066c0; }
a:hover { color: #333; font-weight: bold; }
a:visited { color: #0066c0; font-weight: bold; }

/* =========================================================
   3. レイアウト（main まわり）
   ========================================================= */
main {
    max-width: 980px;
    width: calc(100% - 2rem);
    margin: 10px auto;
    background-color: #FFF;
    border-radius: 0.5rem;
    padding: 1rem 1rem 4rem;
}

/* 幅の狭いページ用バリエーション（テスト音声ページなど） */
main.short {
    max-width: 560px;
    width: 90%;
    margin: 10px auto;
    background-color: #FFF;
    border-radius: 0.5rem;
    padding: 1rem 1rem 3rem;
}

main .topimg {
    width: 100%;
    border-radius: 0.5rem;
}

main h2 {
    text-align: center;
    font-size: 1.618rem;
    margin:1rem 0;
    /*color: var(--grade);*/
}

/* main.short の中身を中央寄せするフレーム（旧 .wrap） */
.content-frame {
    width: 100%;
    display: flex;
    justify-content: center;
}

/* =========================================================
   4. パンくず（旧 .bred / .gy）
   ========================================================= */
.breadcrumb {
    font-size: 0.8rem;
    margin: 1rem 1rem 2rem;
}
.breadcrumb--stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.45rem 0;
    max-width: calc(100% - 2rem);
}
.breadcrumb--stack .crumb {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
    min-height: 1.6em;
}
.breadcrumb--stack a {
    white-space: normal;
    display: inline-block;
}

/* グレーのピル型に見せるバリエーション（旧 .gy と併用していたもの） */
.breadcrumb.pill-gray {
    background-color: #eee;
    color: #333;
    padding: 0.2rem 1.4rem;
    border-radius: 50px;
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
}

/* 汎用ピルバッジ（黄色）：他ページから参照される可能性あり。名称のみ .yl → .pill-yellow に変更 */
.pill-yellow {
    background-color: #ecaf1f;
    color: #ffffff;
    padding: 0 10px;
    border-radius: 50px;
}

/* =========================================================
   5. フッター
   ========================================================= */
.site-footer {
    border-top: 1px solid #eee;
    text-align: center;
    font-size: 0.8rem;
    color: #2B2620;
    padding: 1.25rem 0 0;
    margin-top: auto;
    background: #fff;
}
.site-footer p { margin: 0.2rem; }

/* =========================================================
   6. トップページ：教科選択
   ========================================================= */
.subject {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
}
.subject div {
    width: 44%;
    margin-bottom: 2rem;
    border-radius: 0.5rem;
}
.subject div a {
    display: block;
    text-align: center;
    text-decoration: none;
    padding: 3rem 0;
    font-size: 1.618rem;
    color: #FFF;
}
.subject div.eng { background-color: rgba(142, 128, 182, 1); }
.subject div.engex { background-color: rgba(182, 128, 142, 1); }

p.caution {
    text-align: right;
    margin-right: 1rem;
    font-size: 0.8rem;
}

/* =========================================================
   7. 各学年 教科ページ（見出し・バッジ）
   ========================================================= */
main h3.eng {
    text-align: center;
    font-size: clamp(1.45rem, 1.27rem + 0.72vw, 1.85rem);
    color: var(--grade-h2);
    border-bottom: 1px dotted var(--line);
    padding: 0 0 0.4rem;
    margin-bottom: 1rem;
    font-family: "JetBrains Mono", sans-serif;
    font-optical-sizing: auto;
    font-weight: 700;
    font-style: normal;
    letter-spacing: 0.02em;
}
main h3.eng .subject-badge {
    font-family: "M PLUS Rounded 1c", sans-serif;
}
main h3.eng .nihongo-de {
    font-family:var(--font-jp);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.04em;
}
main h3 span { font-size: 1rem; letter-spacing: 0;}
main h3 + p {
    padding: 1rem;
    margin-top: -0.3rem;
    font-size: clamp(0.9rem, 0.791rem + 0.55vw, 1.2rem);
}

.subject-badge {
    display: inline-block;
    background-image: linear-gradient(-25deg, #a27ac9 0%, #9070af 100%);
    color: #fff;
    font-size: clamp(0.7rem, 0.627rem + 0.36vw, 0.9rem);
    font-weight: 500;
    letter-spacing: 0.25em;
    padding: 0.05em 0.75em;
    border-radius: 2px;
    vertical-align: middle;
    margin-right: 0.6em;
    font-family: "M PLUS Rounded 1c", sans-serif;
    transform: rotate(0.03deg);
}

/* =========================================================
   8. 月号選択
   ========================================================= */
ul.issue {
    display: flex;
    list-style: none;
    flex-wrap: wrap;
    justify-content: center;
    margin: 0;
    padding: 0;
    gap: 9px;
}
ul.issue li {
    width: 24%;
    border-radius: 0.5rem;
    margin-bottom: 1.2rem;
}
ul.issue li a {
    display: block;
    text-align: center;
    text-decoration: none;
    padding: 1rem 0;
    font-size: clamp(1.4rem, 1.327rem + 0.36vw, 1.6rem);
    color: #FFF;
}
ul.issue li:hover {
    transform: translateY(3px);
    background: #887baa;
}

/* 月号選択（6分割レイアウト） */
ul.issue6 {
    display: flex;
    list-style: none;
    flex-wrap: wrap;
    position: relative;
    justify-content: center;
    vertical-align: middle;
    margin: 0;
    padding: 0;
}
ul.issue6 li {
    width: 15%;
    margin-bottom: 2rem;
    border-radius: 0.5rem;
}
ul.issue6 li a {
    display: block;
    text-align: center;
    text-decoration: none;
    padding: 0.6rem 0;
    font-size: 1.618rem;
    color: #FFF;
}

/* 教科・学年ごとの配色（issue / issue6 共通） */
ul.eng li { background-color: rgba(142, 128, 182, 0.8); }
ul.sho5 li { background-color: rgba(240, 140, 0, 0.4); }
ul.sho6 li { background-color: rgba(0, 108, 184, 0.4); }

/* =========================================================
   9. 英語 絵じてん 画像リンク
   ========================================================= */
.ejiten a {
    background-color: rgba(142, 128, 182, 0.2);
    display: block;
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: 0.5rem;
    text-align: center;
    text-decoration: none;
}
.ejiten a:hover { transform: translateY(3px); }
.ejiten span {
    margin-left: 1rem;
    font-size: 1.2rem;
    display: inline-block;
}
.ejiten img { width: 200px; }

/* =========================================================
   10. 教科書（出版社）選択
   ========================================================= */
ul.publisher {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem 1rem;
    list-style: none;
    margin: 0;
    padding: 2rem 3rem;
    justify-items: center;

}
ul.publisher:has(li:only-child) {
    grid-template-columns: 1fr;
    justify-items: center;
}
ul.publisher.single {
    grid-template-columns: 1fr;
    justify-items: center;
    padding-left: 0;
    padding-right: 0;
}
ul.publisher li {
    width: 100%;
    margin: 0;
    border-radius: 0.5rem;
    align-items: center;
}
ul.publisher li:only-child {
    width: min(320px, 75%);
    margin: 0 auto;
    background-image: linear-gradient(to top, rgba(116, 140, 210, 0.95) 0%, rgba(156, 130, 192, 0.9) 100%);
}
ul.publisher li:hover {
    transform: translateY(3px);
    background: #887baa;
}
ul.publisher li:only-child:hover {
    background: #887baa;
}

ul.publisher.test-block {
    padding-top: 1rem;
    padding-bottom: 1rem;
}
ul.publisher.test-block li {
    background-image: linear-gradient(to top, rgba(121, 149, 216, 0.96) 0%, rgba(142, 128, 182, 0.82) 100%);
    border: 1px solid rgba(121, 149, 216, 0.5);
}
ul.publisher.test-block li:hover {
    background: #887baa;
}
ul.publisher li a {
    display: block;
    text-align: center;
    text-decoration: none;
    padding: 1rem 0;
    font-size: 1.618rem;
    color: #FFF;
}
/* 教科書名に添える小さい注記（旧: style="font-size:70%" のインライン指定） */
.publisher-note {
    font-size: 70%;
    font-family: "JetBrains Mono", sans-serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
}

/* =========================================================
   11. コンテンツ選択（ワーク／テスト 等）
   ========================================================= */
ul.contents {
    display: flex;
    list-style: none;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    margin: 2.5rem 0 3rem;
    padding: 0;
}
ul.contents li {
    width: 340px;
    border-radius: 0.5rem;
    border: 2px solid;
}
ul.contents li a {
    display: block;
    text-align: center;
    text-decoration: none;
    padding: 2rem 0;
    font-size: 1.25rem;
}
/* ワーク（縦長）とテスト（横長）を横並びにしたとき、
   アスペクト比が違っても高さを揃えて見た目を揃える。
   幅ではなく高さを基準にすることで、画像ごとに幅指定を
   分けていた .work 修飾クラスが不要になった。
   カード自体も 260px の固定幅にして、main の広さに引っ張られて
   間延びしないようにしている（項目数が少ないページでも均整が取れる）。 */
ul.contents li a img {
    display: block;
    height: clamp(140px, 22vw, 220px);
    width: auto;
    max-width: 92%;
    border: 1px solid #ccc;
    margin: 1rem auto 0.4rem;
}

ul.eng2 li { border-color: rgba(142, 128, 182, 0.8); }
ul.eng2 li:hover {
    transform: translateY(3px);
    background: var(--grade-soft);
}

/* =========================================================
   12. 最終コンテンツページ
   ========================================================= */
main h4 {
    text-align: center;
    font-size: 1.25rem;
    margin: 1rem 0 0.8rem;
}
main h5 {
    font-size: 1rem;
    margin: 10px;
    padding: 5px;
    background-color: var(--grade, rgba(240, 140, 0, 0.80));
    color: white;
}


/* =========================================================
   13. 汎用余白ユーティリティ
   ========================================================= */
.mb4 { margin-bottom: 4px; }
.mb10 { margin-bottom: 10px; }
.mb20 { margin-bottom: 20px; }
.mb30 { margin-bottom: 30px; }
.mb40 { margin-bottom: 40px; }
.mb50 { margin-bottom: 50px; }

/* セクション間のスペーサー（旧: 空リストで height:2.5rem を確保していたもの） */
.section-spacer {
    height: 2.5rem;
}

audio { width: 400px; }

/* =========================================================
   17. 汎用配置
   ========================================================= */
.wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    height: 100%;
    width: 100%;
}

/* =========================================================
   18. 音声リスト（テスト・ワークの解答音声など）
   旧クラス名: list_answer-wrap → audio-list
              list_answer      → audio-list__title
              list_answer01    → audio-list__item
              list_answer01end → audio-list__item--last
              list_answer-img  → audio-list__image
   ========================================================= */
.audio-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.audio-list__title {
    position: relative;
    text-shadow: 0 0 5px white;
    padding: 0.6em;
    margin-top: 2rem;
    margin-bottom: 2px;
    font-size: 1.1em;
    font-weight: bold;
    letter-spacing: 0.06em;
}
.audio-list__issue-badge {
    display: inline-block;
    margin-left: 0.35em;
    padding: 0.1em 0.45em;
    border-radius: 2px;
    background: #adadad;/*var(--grade-list, #f08c00);*/
    color: #fff;
    font-size: 0.65em;
    font-weight: 500;
    letter-spacing: 0;
    line-height: 1.4;
    text-shadow: none;
    vertical-align: middle;
}
.audio-list__title::before {
    content: "";
    width: 1px;
    height: 10px;
    display: inline-block;
    position: relative;
    margin-right: 0.2em;
    background-size: contain;
    background-repeat: no-repeat;
    vertical-align: top;
}
.audio-list__title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 7px;
    background: repeating-linear-gradient(
        -45deg,
        var(--grade-list, #f08c00),
        var(--grade-list, #f08c00) 2px,
        rgba(255, 255, 255, 0.9) 2px,
        rgba(255, 255, 255, 0.9) 4px
    );
}

.audio-list__item {
    background: #f8fafa60;
    margin-bottom: 2px;
    padding: 0.8em 0.6em;
    font-size: 0.9em;
    border-bottom: dotted 1px #5f6b6b94;
    text-align: center;
}
.audio-list__item:last-child,
.audio-list__item--last {
    background: #f8fafa60;
    margin-bottom: 32px;
    padding: 0.6em;
    font-size: 0.9em;
    border-bottom: dotted 1px #5f6b6b94;
    text-align: center;
}
.audio-list__image {
    margin-bottom: 32px;
    border-radius: 0.5rem;
    text-align: center;
}

/* 見出し用の余白調整バリエーション（旧 .list_answer_m, .list_answer_m01） */
.audio-list--compact-title {
    display: block;
    height: 2.5rem;
    margin: 0;
    padding: 0;
    font-size: 0;
    line-height: 0;
    border: none;
    background: none;
}
.audio-list--compact-item {
    background: #e7e9e9c4;
    margin-bottom: 5px;
    padding: 10px;
    font-size: 18px;
    border-bottom: dotted 2px #5f6b6bad;
}

/* =========================================================
   19. 丸囲み・枠囲みテキスト
   ========================================================= */
/* ▶ などのアイコン文字を丸背景で囲む（旧 span.pbmaru） */
.icon-chip {
    padding: 0.03rem 0.3rem 0rem 0.3rem; /* 枠と文字の空間 */
    margin: 0px 4px 1px 4px; /* 枠の外の空間 */
    border: solid 1px #e9e7e7;
    border-radius: 50px;
    background-color: #f2f2f2;
}
/* 枠線つきの丸囲み文字（旧 span.pb） */
.text-boxed {
    border: solid 1px #bdb9b9;
    border-radius: 4px;
    padding: 0.07rem;
    margin: 0.2rem;
}
/* 太字の丸囲み文字（旧 .kakomu_maru） */
.text-circled {
    padding: 0.03rem 0.3rem 0rem 0.3rem;
    margin: 0 4px 1px 4px;
    border: 1px solid #777;
    border-radius: 50px;
    font-family: inherit;
    font-size: 1em;
    font-weight: bold;
    color: #333;
    vertical-align: middle;
}
/* 枠なしの強調文字（旧 .kakomu_none） */
.text-emphasis {
    padding: 0.03rem 0.2rem;
    margin: 0 4px 0px 4px;
    font-family: inherit;
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
    vertical-align: middle;
}

/* =========================================================
   20. 画像拡大モーダル
   ========================================================= */
.image-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    padding: 24px;
}
.image-modal.is-open {
    display: flex;
}
.image-modal-content {
    max-width: min(92vw, 900px);
    max-height: 90vh;
    object-fit: contain;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}
.image-modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: #333;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}
body.modal-open {
    overflow: hidden;
}


@media screen and (max-width: 560px) {
    audio { width: 100%; }
    main h3.eng .nihongo-de { font-size: 1.1rem;}
}

/* 768px（iPad Mini など）もPCと同じレイアウトで表示するため、
   560〜959px専用の上書き（main の幅94%指定やヘッダーの縮小など）は廃止。
   560px以上はすべてPCと同じ表示になり、559px以下のみスマホ向けの
   レイアウトに切り替わる。 */

@media screen and (max-width: 559px) {
    header,
    main { width: 94%; }
    header h1 { width: 100%; }
    header h1 br { display: inline-block; }
    header h1 a { font-size: 2rem; }
    header h1 a img { width: 8rem; }
    header nav a { width: 100%; }
    header.level02 h1 { width: 100%; }
    header.level02 h1 a {
        font-size: 1.4rem;
        text-align: center;
    }
    header.level02 h1 a img { width: 5.5rem; }
    header.level02 nav { width: 100%; }

    .only_desktop { display: none; }
    .only_mobile  { display: inline; }

    main h4 {
        text-align: center;
        font-size: 1rem;
    }
    .grade div { width: 45%; }
    p.caution {
        text-align: left;
        margin-left: 1rem;
    }
    ul.issue { display: block; }
    ul.issue li {
        width: 90%;
        margin: 0 auto 1.4rem;
    }
    .ejiten a img {
        width: 150px;
        margin-bottom: 1rem;
    }
    ul.publisher {
        gap: 1rem;
        padding:0;
    }
    ul.publisher li {
        width: 100%;
        margin-bottom: 0;
    }
    ul.publisher li a { font-size: 1.2rem; }

    @media (max-width: 560px) {
        ul.publisher {
            grid-template-columns: 1fr;
        }
    }
    ul.contents li {
        width: 92%;
    }

}
