@charset "UTF-8";

/* ===============================================
   新潟学習社 レスポンシブ対応 CSS (2025)
   =============================================== */

html, body {
    overflow-x: hidden; /* 横スクロールを防ぐため */
}

/* デスクトップ用（948px以上）でハンバーガーメニューを非表示 */
.hamburger-menu {
    display: none;
}

.menu-overlay {
    display: none;
}

div#information div#information-inner div#info-top {
    background-size: contain;
}

/* デスクトップではモバイル用コピーライトを非表示 */
div#footer p.mobile-copyright {
    display: none;
}

/* デスクトップではモバイル用CTAを非表示 */
div#css-only .mobile-cta {
    display: none;
}

/* デスクトップでは会社概要メニューを非表示 */
#menu1g {
    display: none;
}

/* 固定CTA（デスクトップでは非表示） */
.fixed-cta {
    display: none;
}

#header div#title {
    white-space: nowrap; /* タイトルの改行を防ぐ */
}

/* タブレット・小さいPC用のスタイル */
@media (max-width: 948px) {
    body {
        background-color: #FFF;
    }
    
    #main-wrap {
        width: 100%;
        margin: 0;
        padding: 0 10px;
        box-sizing: border-box;
    }
    
    #main-wrap-bottom {
        width: 100%;
        margin: 0;
        padding: 0 10px;
        box-sizing: border-box;
    }
    
    #main,
    #main-bottom {
        width: 100%;
        max-width: 948px;
        margin: 0 auto;
    }
    
    /* ヘッダー */
    #header {
        width: 100vw;
        margin-left: -10px;
        margin-right: -10px;
        position: relative;
        background-image: url(../img/sp_header_bg.jpg);
        background-repeat: repeat-x;
        background-position: center;
        background-size: auto 100%;
    }
    
    #header div#header-contents {
        height: 60px;
        width: 100%;
        border-bottom: solid 0px transparent !important;
    }
    
    #header div#header-contents div#header-l,
    #header div#header-contents div#header-c,
    #header div#header-contents div#header-r {
        float: left;
        width: auto;
        height: auto;
        margin: 0;
        padding: 10px 0;
        text-align: center;
        display: block;
        /* 背景画像をタブレット用にサイズ調整 */
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
    }
    
    #header div#header-contents div#header-l {
        width: 243px;
        height: 49px;
        margin: 10px 15px 15px;
        background-image: url(../img/sp_headerBG-L.svg);
        cursor: pointer;
    }
    
    #header div#header-contents div#header-c {
        width: 356px;
        height: 40px;
        margin: 25px 0 0 15px;
        background-image: url(../img/sp_headerBG-C.png);
    }
    
    #header div#header-contents div#header-r {
        height: 90px;
        background-image: url(../img/headerBG-R.jpg);
        display: none; /* タブレットでは非表示 */
    }
    
    /* ハンバーガーメニューボタン */
    .hamburger-menu {
        display: block;
        position: fixed;
        top: 34px;
        right: 15px;
        width: 30px;
        height: 30px;
        cursor: pointer;
        z-index: 2002;
        background: none;
        border: none;
        padding: 0;
        transition: top 0.3s ease;
    }
    
    /* スクロール時のハンバーガーメニューボタン */
    .hamburger-menu.scrolled {
        top: 10px;
        width: 46px;
        height: 46px;
        background-color: #1E50A2;
        border-radius: 50%;
        padding: 6px 9px;
    }
    
    /* スクロール時かつメニューが開いているときのパディング調整 */
    .hamburger-menu.scrolled.active {
        padding: 7px 9px;
    }
    
    /* スクロール時のハンバーガーメニューの罫線を白に */
    .hamburger-menu.scrolled span {
        background-color: #fff;
    }
    
    .hamburger-menu span {
        display: block;
        width: 30px;   /* 中心で交わるサイズに調整 */
        height: 3px;
        background-color: #231815;
        margin: 5px 0;
        transition: 0.3s;
        transform-origin: center;
    }
    
    /* ハンバーガーメニューがアクティブ時のアニメーション */
    .hamburger-menu.active span:nth-child(1) {
        transform: rotate(45deg) translate(2.5px, 2.5px);   /* 中心で交わるように調整 */
    }
    
    .hamburger-menu.active span:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger-menu.active span:nth-child(3) {
        transform: rotate(-45deg) translate(8.5px, -8.5px);   /* 中心で交わるように調整 */
    }
    
    /* パネル画像 */
    div#panel {
        width: 100%;
        height: auto;
        margin: 5px 0;
    }
    
    div#panel img {
        width: 100%;
        height: auto;
        max-width: 948px;
    }
    
    /* メニューをハンバーガーメニュー内に格納 */
    div#css-only {
        position: fixed;
        top: 0;
        right: -100%;
        width: 300px;
        height: 100vh;
        background-color: #fff;
        box-shadow: -2px 0 5px rgba(0,0,0,0.1);
        transition: right 0.3s ease;
        z-index: 2001;
        overflow-y: auto;
        padding-top: 0;
        padding-bottom: 120px; /* 固定CTAの高さ + 20px */
    }
    
    div#css-only.active {
        right: 0;
    }
    
    /* メニュー上部のロゴ */
    div#css-only .menu-logo {
        display: block;
        width: 210px;
        height: 63px;
        margin: 10px 0 20px 15px;
        background-image: url(../img/sp_headerBG-L.svg);
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
        cursor: pointer;
        position: relative;
    }
    
    div#css-only .menu-logo a {
        display: block;
        width: 100%;
        height: 100%;
        position: absolute;
        top: 0;
        left: 0;
        text-indent: -10000px;
        overflow: hidden;
    }
    
    /* CTA部分のスタイル */
    div#css-only .mobile-cta {
        display: block;
        position: static;
        width: calc(100% - 40px);
        max-width: 323px;
        margin: 40px auto 200px auto;
        height: 0;
        padding-bottom: 30.40%; /* 197/648 = 0.3040 = 30.40% */
    }
    
    div#css-only .mobile-cta a {
        display: block;
        width: 100%;
        height: 100px;
        background-image: url(../img/cp_menu_cta.jpg);
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
        text-indent: -10000px;
        overflow: hidden;
        text-decoration: none;
        color: transparent;
        position: relative;
        top: 0;
        left: 0;
    }
    
    div#css-only .mobile-cta .cta-text,
    div#css-only .mobile-cta .cta-phone,
    div#css-only .mobile-cta .cta-time {
        display: none;
    }
    
    /* メニューオーバーレイ */
    .menu-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0,0,0,0.5);
        z-index: 999;
    }
    
    .menu-overlay.active {
        display: block;
    }
    
    div#css-only ul {
        width: 100%;
        display: block;
        margin: 0;
        padding: 0;
        list-style: none;
    }
    
    div#css-only li.parent,
    div#css-only li.parent.edge {
        width: 100%;
        height: auto;
        float: none;
        position: static;
        border-bottom: 1px solid #fff;
        margin-bottom: 0;
    }
    
    /* メニュー項目の幅を100%に設定 */
    div#css-only li#menu1a,
    div#css-only li#menu1b,
    div#css-only li#menu1c,
    div#css-only li#menu1d,
    div#css-only li#menu1e,
    div#css-only li#menu1f {
        width: 100% !important;
    }
    
    /* メニュー項目のpadding調整と左詰め */
    div#css-only li#menu1a a,
    div#css-only li#menu1b a,
    div#css-only li#menu1d a,
    div#css-only li#menu1e a,
    div#css-only li#menu1f a,
    div#css-only li#menu1g a {
        padding: 25px 0 25px 20px !important;
        text-align: left !important;
    }
    
    /* クラス・料金メニューは通常のflexboxレイアウトを使用 */
    div#css-only li#menu1c a {
        text-align: left !important;
        position: relative;
    }
    
    /* クラス・料金メニューの右端にドロップダウンアイコンを追加 */
    div#css-only li#menu1c a::after {
        content: '';
        position: absolute;
        top: 50%;
        right: 20px;
        width: 35px;
        height: 35px;
        background-image: url(../img/sp_menu_down.png);
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
        transform: translateY(-50%);
        cursor: pointer;
        transition: transform 0.3s ease;
    }
    
    /* サブメニューが開いている時のアイコン回転 */
    div#css-only li#menu1c.active a::after {
        transform: translateY(-50%) rotate(180deg);
    }
    
    div#css-only li.parent a {
        width: 100%;
        height: 80px;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        background: #fff;
        color: #1e50a2;
        text-decoration: none;
        line-height: 1;
        text-align: left;
        font-size: 22px;
        font-weight: bold;
        padding: 0 20px;
        box-sizing: border-box;
        border: none;
        text-indent: 0;
        background-image: url(../img/sp_menu_line.jpg);
        background-repeat: no-repeat;
        background-position: bottom center;
        background-size: 100% auto;
    }
    
    /* 最初のメニュー項目（学習社の魅力）の上にも線を追加 */
    div#css-only li#menu1a a {
        background-image: url(../img/sp_menu_line.jpg), url(../img/sp_menu_line.jpg);
        background-repeat: no-repeat, no-repeat;
        background-position: top center, bottom center;
        background-size: 100% auto, 100% auto;
    }
    
    div#css-only li.parent a:hover {
        background-color: #f5f5f5;
        color: #1e50a2;
        background-image: url(../img/sp_menu_line.jpg);
        background-repeat: no-repeat;
        background-position: bottom center;
        background-size: 100% auto;
    }
    
    /* メニュー項目のhoverエフェクトを無効化（タブレット用） */
    div#css-only li#menu1a a:hover,
    div#css-only li#menu1b a:hover,
    div#css-only li#menu1c a:hover,
    div#css-only li#menu1d a:hover,
    div#css-only li#menu1e a:hover,
    div#css-only li#menu1f a:hover,
    div#css-only li#menu1g a:hover {
        background-image: url(../img/sp_menu_line.jpg) !important;
        background-position: bottom center !important;
        background-size: 100% auto !important;
        background-repeat: no-repeat !important;
        background-color: #f5f5f5 !important;
        color: #1e50a2 !important;
    }
    
    /* 学習社の魅力のhover時も上下に線を表示 */
    div#css-only li#menu1a a:hover {
        background-image: url(../img/sp_menu_line.jpg), url(../img/sp_menu_line.jpg) !important;
        background-position: top center, bottom center !important;
        background-size: 100% auto, 100% auto !important;
        background-repeat: no-repeat, no-repeat !important;
        background-color: #f5f5f5 !important;
        color: #1e50a2 !important;
    }
    
    div#css-only li.parent span {
        display: inline;
        text-indent: 0;
    }
    
    /* サブメニュー */
    div#css-only li.parent ul {
        visibility: visible;
        position: static;
        width: 100%;
        background: #f9f9f9;
        margin: 0;
        border: none;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    div#css-only li.parent.active ul {
        max-height: 450px;
    }
    
    div#css-only ul.child {
        width: 100%;
        border: none;
        background: #f9f9f9;
    }
    
    div#css-only ul.child li {
        width: 100%;
        border: none;
        background: #f9f9f9;
        border-bottom: 1px solid #eee;
    }
    
    div#css-only ul.child li a {
        width: 100%;
        padding: 10px 0 10px 50px !important;
        background: #f9f9f9;
        color: #666;
        font-size: 20px;
        text-align: left;
        height: auto;
        line-height: 1.4;
        font-weight: normal;
        position: relative;
    }
    
    /* サブメニュー項目の先頭にアイコンを追加 */
    div#css-only ul.child li a::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 20px;
        width: 20px;
        height: 20px;
        background-image: url(../img/sp_menu_child_icon.png);
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
        transform: translateY(-50%);
    }
    
    /* サブメニューではドロップダウンアイコンを非表示 */
    div#css-only ul.child li a::after {
        display: none;
    }
    
    /* サブメニュー内のspan要素の左paddingを0に設定 */
    div#css-only ul.child li a span {
        padding-left: 0px;
    }
    
    div#css-only ul.child li a:hover {
        background: #e0e0e0;
        color: #FF3300;
    }
    
    /* コンテンツエリア */
    div#contents {
        width: 100%;
        padding: 10px;
        box-sizing: border-box;
    }
    
    /* div#contents内のpタグのフォントサイズ（タブレット用） */
    div#contents p {
        font-size: 16px;
    }
    
    div#contents div#contents-L,
    div#contents div#contents-R {
        width: 100%;
        float: none;
        margin: 0;
    }
    
    /* 左側コンテンツのバナー類（タブレット用） */
    div#infant,
    div#smartcourse,
    div#elementary,
    div#highgrade,
    div#specialindividual {
        width: 100%;
        margin-bottom: 10px;
        position: relative;
    }
    
    div#infant a {
        width: 100%;
        height: 0;
        padding-bottom: 42.20%; /* 295/699 = 0.4220 = 42.20% */
        display: block;
        background-image: url(../img/sp_infantBG.jpg);
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
        position: relative;
        text-indent: -10000px;
        overflow: hidden;
    }
    
    div#smartcourse a {
        width: 100%;
        height: 0;
        padding-bottom: 46.57%; /* 326/700 = 0.4657 = 46.57% */
        display: block;
        background-image: url(../img/sp_smartcourseBG.jpg);
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
        position: relative;
        text-indent: -10000px;
        overflow: hidden;
    }
    
    div#elementary a {
        width: 100%;
        height: 0;
        padding-bottom: 46.43%; /* 325/700 = 0.4643 = 46.43% */
        display: block;
        background-image: url(../img/sp_classBG.jpg);
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
        position: relative;
        text-indent: -10000px;
        overflow: hidden;
    }
    
    div#highgrade a {
        width: 100%;
        height: 0;
        padding-bottom: 46.57%; /* 326/700 = 0.4657 = 46.57% */
        display: block;
        background-image: url(../img/sp_highgradeBG.jpg);
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
        position: relative;
        text-indent: -10000px;
        overflow: hidden;
    }
    
    div#specialindividual a {
        width: 100%;
        height: 0;
        padding-bottom: 46.43%; /* 325/700 = 0.4643 = 46.43% */
        display: block;
        background-image: url(../img/sp_specialindividualBG.jpg);
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
        position: relative;
        text-indent: -10000px;
        overflow: hidden;
    }
    
    /* バナーのhover/activeエフェクトを無効化（タブレット用） */
    div#infant a:hover,
    div#smartcourse a:hover,
    div#elementary a:hover,
    div#highgrade a:hover,
    div#specialindividual a:hover,
    div#infant a:active,
    div#smartcourse a:active,
    div#elementary a:active,
    div#highgrade a:active,
    div#specialindividual a:active {
        transform: none;
        opacity: 1;
        filter: none;
        transition: none;
        background-position: center !important;
    }
    
    /* div#infant専用のhover無効化 */
    div#infant a:hover {
        background-image: url(../img/sp_infantBG.jpg) !important;
        background-size: contain !important;
        background-repeat: no-repeat !important;
        background-position: center !important;
    }
    
    /* div#smartcourse専用のhover無効化 */
    div#smartcourse a:hover {
        background-image: url(../img/sp_smartcourseBG.jpg) !important;
        background-size: contain !important;
        background-repeat: no-repeat !important;
        background-position: center !important;
    }
    
    /* div#elementary専用のhover無効化 */
    div#elementary a:hover {
        background-image: url(../img/sp_classBG.jpg) !important;
        background-size: contain !important;
        background-repeat: no-repeat !important;
        background-position: center !important;
    }
    
    /* div#highgrade専用のhover無効化 */
    div#highgrade a:hover {
        background-image: url(../img/sp_highgradeBG.jpg) !important;
        background-size: contain !important;
        background-repeat: no-repeat !important;
        background-position: center !important;
    }
    
    /* div#specialindividual専用のhover無効化 */
    div#specialindividual a:hover {
        background-image: url(../img/sp_specialindividualBG.jpg) !important;
        background-size: contain !important;
        background-repeat: no-repeat !important;
        background-position: center !important;
    }
    
    /* div#contents内のpタグのフォントサイズ調整（タブレット用） */
    div#contents p {
        font-size: 16px;
    }
    
    /* 右側コンテンツ */
    #course {
        width: 100% !important;
        display: none;
    }
    
    #course ul {
        width: 100% !important;
        height: auto;
    }
    
    #course h3 {
        margin-bottom: 0px !important;
    }
    
    #course h3 img {
        width: 100% !important;
        height: auto !important;
    }
    
    #course li {
        margin-left: 0 !important;
    }
    
    #course li#course-li0 {
        width: 100% !important;
        height: 0;
        padding-bottom: 38.24%; /* 130/340 = 0.3824 = 38.24% */
        background-size: contain !important;
        background-position: top center !important;
        background-repeat: no-repeat !important;
        position: relative;
    }
    
    #course li#course-li0 a {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        display: block;
        text-indent: -10000px;
        overflow: hidden;
        background-size: cover;
    }
    
    #course li#course-li0 a:hover {
        background-position: top center !important;
    }
    
    /* お知らせ */
    div#information {
        width: calc(100% - 10px);
    }
    
    div#information div#information-inner {
        width: calc(100% - 6px);
    }
    
    div#information div#information-inner div#info-top {
        width: calc(100% - 6px);
        border-bottom: 2px solid #bd64a4;
        background-image: url(../img/sp_info-top.jpg);
        background-repeat: no-repeat;
        background-size: 111px;
    }
    
    div#information iframe {
        width: 100% !important;
    }
    
    /* 中学準備 */
    div#classjunior {
        width: 100%;
        margin-bottom: 10px;
        position: relative;
    }
    
    div#classjunior a {
        width: 100%;
        height: 0;
        padding-bottom: 43.29%; /* 303/700 = 0.4329 = 43.29% */
        display: block;
        background-image: url(../img/sp_classjuniorBG.jpg);
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
        position: relative;
        text-indent: -10000px;
        overflow: hidden;
    }
    
    div#classjunior a:hover {
        background-image: url(../img/sp_classjuniorBG.jpg) !important;
        background-size: contain !important;
        background-repeat: no-repeat !important;
        background-position: center !important;
    }
    
    /* フッター */
    div#footer {
        width: 100vw !important;
        margin-left: -5px;
        margin-right: -5px;
        height: auto;
        background-size: cover;
        margin-top: 0;
        padding: 0 0 10px;
        margin-bottom: 40px; /* タブレット用: 固定CTAの高さ + 余白 */
        background-image: none;
        background-color: #fff;
    }
    
    div#footer div#footer-link {
        display: flex;
        padding: 0 15px;
        width: 100%;
        justify-content: space-between;
    }
    
    div#footer div#footer-link div#footer-link-r {
        display: flex;
        padding-right: 50px;
    }
    
    div#footer div#footer-l,
    div#footer div#footer-r {
        width: 100%;
        float: none;
        text-align: center;
    }
    
    div#footer div#footer-l {
        height: 180px;
    }
    
    div#footer p.mobile-copyright {
        font-size: 10px;
        text-align: center;
        margin-top: 20px;
        display: block;
    }
    
    div#footer div#footer-r {
        display: none;
    }
    
    /* フッターコピーライト */
    #main-bottom div#footer-copyright {
        width: 100%;
    }
    
    #main-wrap-bottom {
        display: none;
    }

    #header div#header-contents div#header-l div.home {
        display: none;  /* タブレット以下ではホームボタンを非表示 */
    }
    
    /* 固定CTA（タブレット用） */
    .fixed-cta {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        z-index: 2000;
        background-color: rgba(255, 255, 255, 0.8);
        padding: 10px 20px;
        flex-direction: row;
        gap: 20px;
        justify-content: center;
        align-items: center;
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .fixed-cta-item {
        display: block;
        cursor: pointer;
        transition: transform 0.2s ease;
        text-decoration: none;
        color: inherit;
        text-align: center;
        flex: 1;
    }
    
    .fixed-cta-item:hover {
        transform: scale(1.05);
        text-decoration: none;
    }
    
    .fixed-cta-item img {
        display: block;
        width: 100%;
        height: auto;
        margin: 0 auto;
    }
}


/* スマートフォン用のスタイル */
@media (max-width: 600px) { 
    
    body {
        font-size: 14px;
        line-height: 1.4;
        background-color: #FFF;
    }
    
    /* メインラッパー */
    #main-wrap,
    #main-wrap-bottom {
        width: 100%;
        margin: 0;
        padding: 0 5px;
        box-sizing: border-box;
        border: none;
    }
    
    #main,
    #main-bottom {
        width: 100%;
        padding: 0;
    }
    
    /* ヘッダー */
    #header {
        width: 100vw;
        margin-left: -5px;
        margin-right: -5px;
        background-image: url(../img/sp_header_bg.jpg);
        background-repeat: no-repeat;
        background-position: center;
        background-size: cover;
    }
    
    #header div#title {
        padding: 5px 10px;
        text-align: left;
    }
    
    #header div#title h1 {
        font-size: 16px;
        margin: 0;
    }
    
    #header div#header-contents {
        height: auto;
        width: 100%;
        border-bottom: solid 2px #1E50A2;
    }
    
    #header div#header-contents div#header-l,
    #header div#header-contents div#header-c,
    #header div#header-contents div#header-r {
        float: none;
        width: 100%;
        height: auto;
        margin: 0;
        padding: 10px 0;
        text-align: center;
        display: block;
        /* 背景画像をモバイル用にサイズ調整 */
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
    }
    
    #header div#header-contents div#header-l {
        width: 243px;
        height: 49px;
        margin: 10px 15px 15px;
        background-image: url(../img/sp_headerBG-L.svg);
        cursor: pointer;
    }
    
    #header div#header-contents div#header-c {
        width: calc(100% - 30px);
        height: auto;
        aspect-ratio: 356 / 40;
        margin: 0 15px 15px 15px;
        background-image: url(../img/sp_headerBG-C.png);
        display: block; /* スマートフォンでも表示 */
    }
    
    #header div#header-contents div#header-r {
        height: 90px;
        background-image: url(../img/headerBG-R.jpg);
        display: none; /* スマートフォンでも非表示 */
    }
    
    /* パネル画像 */
    div#panel {
        width: 100%;
        height: auto;
        margin: 5px 0;
        overflow: visible;
    }
    
    div#panel img {
        width: 100%;
        height: auto;
        max-width: none;
    }
    
    div#panel map {
        display: none; /* スマホではイメージマップを無効化 */
    }
    
    /* ハンバーガーメニューボタン（スマホ用調整） */
    .hamburger-menu {
        display: block;
        position: fixed;
        top: 43px;
        right: 10px;
        width: 35px;
        height: 35px;
        transition: top 0.3s ease;
    }
    
    /* スクロール時のハンバーガーメニューボタン（スマホ用） */
    .hamburger-menu.scrolled {
        top: 10px;
        width: 46px;
        height: 46px;
        background-color: #1E50A2;
        border-radius: 50%;
        padding: 6px 9px;
    }
    
    /* スクロール時かつメニューが開いているときのパディング調整（スマホ用） */
    .hamburger-menu.scrolled.active {
        padding: 7px 9px;
    }
    
    /* スクロール時のハンバーガーメニューの罫線を白に（スマホ用） */
    .hamburger-menu.scrolled span {
        background-color: #fff;
    }
    
    .hamburger-menu span {
        width: 28px;   /* タブレットと同じサイズに統一 */
        height: 4px;
        margin: 6px 0;
    }
    
    /* スマートフォン用のハンバーガーメニューアニメーション */
    .hamburger-menu.active span:nth-child(1) {
        transform: rotate(45deg) translate(5.5px, 5.5px);   /* タブレットと同じ値に統一 */
    }
    
    .hamburger-menu.active span:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger-menu.active span:nth-child(3) {
        transform: rotate(-45deg) translate(8.5px, -8.5px);   /* タブレットと同じ値に統一 */
    }
    
    /* ナビゲーションメニュー */
    div#css-only {
        position: fixed;
        top: 0;
        right: -100%;
        width: 300px;
        height: 100vh;
        background-color: #fff;
        box-shadow: -2px 0 5px rgba(0,0,0,0.1);
        transition: right 0.3s ease;
        z-index: 2001;
        overflow-y: auto;
        padding-top: 0;
        padding-bottom: 200px; /* スマホ用: 固定CTAとの重なりを避けるため */
    }
    
    div#css-only.active {
        right: 0;
    }
    
    /* メニュー上部のロゴ */
    div#css-only .menu-logo {
        display: block;
        width: 210px;
        height: 63px;
        margin: 10px 0 20px 15px;
        background-image: url(../img/sp_headerBG-L.svg);
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
        cursor: pointer;
        position: relative;
    }
    
    div#css-only .menu-logo a {
        display: block;
        width: 100%;
        height: 100%;
        position: absolute;
        top: 0;
        left: 0;
        text-indent: -10000px;
        overflow: hidden;
    }
    
    /* メニューオーバーレイ */
    .menu-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0,0,0,0.5);
        z-index: 999;
    }
    
    .menu-overlay.active {
        display: block;
    }
    
    div#css-only ul {
        width: 100%;
        display: block;
        margin: 0;
        padding: 0;
    }
    
    div#css-only li.parent,
    div#css-only li.parent.edge {
        width: 100%;
        height: auto;
        float: none;
        position: static;
        margin-bottom: 0;
        border-bottom: 1px solid #fff;
    }
    
    /* メニュー項目の幅を100%に設定 */
    div#css-only li#menu1a,
    div#css-only li#menu1b,
    div#css-only li#menu1c,
    div#css-only li#menu1d,
    div#css-only li#menu1e,
    div#css-only li#menu1f,
    div#css-only li#menu1g {
        width: 100% !important;
    }
    
    /* メニュー項目のpadding調整と左詰め（スマホ用） */
    div#css-only li#menu1a a,
    div#css-only li#menu1b a,
    div#css-only li#menu1d a,
    div#css-only li#menu1e a,
    div#css-only li#menu1f a,
    div#css-only li#menu1g a {
        padding: 25px 0 25px 20px !important;
        text-align: left !important;
    }
    
    /* クラス・料金メニューは通常のflexboxレイアウトを使用（スマホ用） */
    div#css-only li#menu1c a {
        text-align: left !important;
        position: relative;
    }
    
    /* クラス・料金メニューの右端にドロップダウンアイコンを追加（スマホ用） */
    div#css-only li#menu1c a::after {
        content: '';
        position: absolute;
        top: 50%;
        right: 20px;
        width: 35px;
        height: 35px;
        background-image: url(../img/sp_menu_down.png);
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
        transform: translateY(-50%);
        cursor: pointer;
        transition: transform 0.3s ease;
    }
    
    /* サブメニューが開いている時のアイコン回転（スマホ用） */
    div#css-only li#menu1c.active a::after {
        transform: translateY(-50%) rotate(180deg);
    }
    
    div#css-only li.parent a {
        width: 100%;
        height: 80px;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        background: #fff;
        color: #1e50a2;
        text-decoration: none;
        line-height: 1;
        text-align: left;
        font-size: 22px;
        font-weight: bold;
        border-radius: 0;
        box-sizing: border-box;
        border: none;
        background-image: url(../img/sp_menu_line.jpg);
        background-repeat: no-repeat;
        background-position: bottom center;
        background-size: 100% auto;
    }
    
    /* 最初のメニュー項目（学習社の魅力）の上にも線を追加（スマホ用） */
    div#css-only li#menu1a a {
        background-image: url(../img/sp_menu_line.jpg), url(../img/sp_menu_line.jpg);
        background-repeat: no-repeat, no-repeat;
        background-position: top center, bottom center;
        background-size: 100% auto, 100% auto;
    }
    
    div#css-only li.parent a:hover {
        background-color: #f5f5f5;
        color: #1e50a2;
        background-image: url(../img/sp_menu_line.jpg);
        background-repeat: no-repeat;
        background-position: bottom center;
        background-size: 100% auto;
    }
    
    /* メニュー項目のhoverエフェクトを無効化（スマホ用） */
    div#css-only li#menu1a a:hover,
    div#css-only li#menu1b a:hover,
    div#css-only li#menu1c a:hover,
    div#css-only li#menu1d a:hover,
    div#css-only li#menu1e a:hover,
    div#css-only li#menu1f a:hover,
    div#css-only li#menu1g a:hover {
        background-image: url(../img/sp_menu_line.jpg) !important;
        background-position: bottom center !important;
        background-size: 100% auto !important;
        background-repeat: no-repeat !important;
        background-color: #fff !important;
        color: #1e50a2 !important;
    }
    
    /* 学習社の魅力のhover時も上下に線を表示（スマホ用） */
    div#css-only li#menu1a a:hover {
        background-image: url(../img/sp_menu_line.jpg), url(../img/sp_menu_line.jpg) !important;
        background-position: top center, bottom center !important;
        background-size: 100% auto, 100% auto !important;
        background-repeat: no-repeat, no-repeat !important;
        background-color: #fff !important;
        color: #1e50a2 !important;
    }
    
    /* モバイルでは会社概要メニューを表示 */
    #menu1g {
        display: block !important;
    }
    
    /* CTA部分のスタイル（スマホ用） */
    div#css-only .mobile-cta {
        display: block;
        position: static;
        width: calc(100% - 40px);
        max-width: 323px;
        margin: 40px auto 0 auto;
        height: 0;
        padding-bottom: 30.40%; /* 197/648 = 0.3040 = 30.40% */
    }
    
    div#css-only .mobile-cta a {
        display: block;
        width: 100%;
        height: 100px;
        background-image: url(../img/cp_menu_cta.jpg);
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
        text-indent: -10000px;
        overflow: hidden;
        text-decoration: none;
        color: transparent;
        position: relative;
        top: 0;
        left: 0;
    }
    
    div#css-only .mobile-cta .cta-text,
    div#css-only .mobile-cta .cta-phone,
    div#css-only .mobile-cta .cta-time {
        display: none;
    }
    
    div#css-only li.parent span {
        display: inline;
        text-indent: 0;
    }
    
    /* ドロップダウンメニューをアコーディオン風に */
    div#css-only li.parent ul {
        visibility: visible;
        position: static;
        width: 100%;
        background: #f0f0f0;
        border-radius: 0 0 5px 5px;
        margin-top: -2px;
        border: none;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    div#css-only li.parent.active ul {
        max-height: 450px;
    }
    
    div#css-only ul.child {
        width: 100%;
        border: none;
        background: #f0f0f0;
    }
    
    div#css-only ul.child li {
        width: 100%;
        border: none;
        background: #f0f0f0;
        border-bottom: 1px solid #ddd;
    }
    
    div#css-only ul.child li a {
        width: 100%;
        padding: 10px 0 10px 50px !important;
        background: #f0f0f0;
        color: #1E50A2;
        font-size: 20px;
        text-align: left;
        border-radius: 0;
        height: auto;
        line-height: 1.4;
        position: relative;
    }
    
    /* サブメニュー項目の先頭にアイコンを追加（スマホ用） */
    div#css-only ul.child li a::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 20px;
        width: 20px;
        height: 20px;
        background-image: url(../img/sp_menu_child_icon.png);
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
        transform: translateY(-50%);
    }
    
    /* サブメニューではドロップダウンアイコンを非表示（スマホ用） */
    div#css-only ul.child li a::after {
        display: none;
    }
    
    /* サブメニュー内のspan要素の左paddingを0に設定（スマホ用） */
    div#css-only ul.child li a span {
        padding-left: 0px;
    }
    
    div#css-only ul.child li a:hover {
        background: #e0e0e0;
        color: #FF3300;
    }
    
    /* コンテンツエリア */
    div#contents {
        width: 100%;
        padding: 10px 10px 20px 10px;
        box-sizing: border-box;
    }
    
    div#contents div#contents-L,
    div#contents div#contents-R {
        width: 100%;
        float: none;
        margin: 0;
        padding: 0;
    }
    
    /* 左側コンテンツのボタン類 */
    div#infant,
    div#smartcourse,
    div#elementary,
    div#highgrade,
    div#specialindividual {
        width: 100%;
        margin-bottom: 10px;
        position: relative;
    }
    
    div#infant a {
        width: 100%;
        height: 0;
        padding-bottom: 42.20%; /* 295/699 = 0.4220 = 42.20% */
        display: block;
        background-image: url(../img/sp_infantBG.jpg);
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
        position: relative;
        text-indent: -10000px;
        overflow: hidden;
    }
    
    div#smartcourse a {
        width: 100%;
        height: 0;
        padding-bottom: 46.57%; /* 326/700 = 0.4657 = 46.57% */
        display: block;
        background-image: url(../img/sp_smartcourseBG.jpg);
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
        position: relative;
        text-indent: -10000px;
        overflow: hidden;
    }
    
    div#elementary a {
        width: 100%;
        height: 0;
        padding-bottom: 46.43%; /* 325/700 = 0.4643 = 46.43% */
        display: block;
        background-image: url(../img/sp_classBG.jpg);
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
        position: relative;
        text-indent: -10000px;
        overflow: hidden;
    }
    
    div#highgrade a {
        width: 100%;
        height: 0;
        padding-bottom: 46.57%; /* 326/700 = 0.4657 = 46.57% */
        display: block;
        background-image: url(../img/sp_highgradeBG.jpg);
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
        position: relative;
        text-indent: -10000px;
        overflow: hidden;
    }
    
    div#specialindividual a {
        width: 100%;
        height: 0;
        padding-bottom: 46.43%; /* 325/700 = 0.4643 = 46.43% */
        display: block;
        background-image: url(../img/sp_specialindividualBG.jpg);
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
        position: relative;
        text-indent: -10000px;
        overflow: hidden;
    }
    
    /* バナーのhover/activeエフェクトを無効化（スマホ用） */
    div#infant a:hover,
    div#smartcourse a:hover,
    div#elementary a:hover,
    div#highgrade a:hover,
    div#specialindividual a:hover,
    div#infant a:active,
    div#smartcourse a:active,
    div#elementary a:active,
    div#highgrade a:active,
    div#specialindividual a:active {
        transform: none;
        opacity: 1;
        filter: none;
        transition: none;
        background-position: center !important;
    }
    
    /* div#infant専用のhover無効化 */
    div#infant a:hover {
        background-image: url(../img/sp_infantBG.jpg) !important;
        background-size: contain !important;
        background-repeat: no-repeat !important;
        background-position: center !important;
    }
    
    /* div#smartcourse専用のhover無効化 */
    div#smartcourse a:hover {
        background-image: url(../img/sp_smartcourseBG.jpg) !important;
        background-size: contain !important;
        background-repeat: no-repeat !important;
        background-position: center !important;
    }
    
    /* div#elementary専用のhover無効化 */
    div#elementary a:hover {
        background-image: url(../img/sp_classBG.jpg) !important;
        background-size: contain !important;
        background-repeat: no-repeat !important;
        background-position: center !important;
    }
    
    /* div#highgrade専用のhover無効化 */
    div#highgrade a:hover {
        background-image: url(../img/sp_highgradeBG.jpg) !important;
        background-size: contain !important;
        background-repeat: no-repeat !important;
        background-position: center !important;
    }
    
    /* div#specialindividual専用のhover無効化 */
    div#specialindividual a:hover {
        background-image: url(../img/sp_specialindividualBG.jpg) !important;
        background-size: contain !important;
        background-repeat: no-repeat !important;
        background-position: center !important;
    }
    
    /* 右側コンテンツ */
    #course {
        width: 100% !important;
        margin-bottom: 15px;
        display: none;
    }
    
    #course ul {
        width: 100% !important;
        height: auto;
    }
    
    #course h3 {
        margin-bottom: 0px !important;
    }
    
    #course li {
        width: 100%;
        height: 80px;
        margin: 0 0 5px 0;
        margin-left: 0 !important;
    }
    
    #course li#course-li0 {
        width: 100% !important;
        height: 0;
        padding-bottom: 38.24%; /* 130/340 = 0.3824 = 38.24% */
        background-size: contain !important;
        background-position: top center !important;
        background-repeat: no-repeat !important;
        position: relative;
        margin: 0 0 10px 0;
    }
    
    #course li#course-li0 a {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        display: block;
        text-indent: -10000px;
        overflow: hidden;
        padding-top: 0;
        background-size: cover;
    }
    
    #course li#course-li0 a:hover {
        background-position: top center !important;
    }
    
    #course li a {
        width: 100%;
        height: 80px;
        padding-top: 80px;
        background-size: cover;
        background-position: center;
        font-size: 12px;
    }
    
    /* お知らせ */
    div#information {
        width: calc(100% - 0px);
        padding: 5px;
        margin-bottom: 25px;
    }
    
    div#information div#information-inner {
        width: calc(100% - 0px);
        padding: 5px;
        box-sizing: border-box;
    }
    
    div#information div#information-inner div#info-top {
        width: calc(100% - 0px);
        border-bottom: 2px solid #bd64a4;
        background-image: url(../img/sp_info-top.jpg);
        background-repeat: no-repeat;
        background-size: 111px;
    }
    
    div#information iframe {
        width: 100% !important;
        height: 120px;
    }
    
    /* 中学準備 */
    div#classjunior {
        width: 100%;
        margin-bottom: 15px;
        position: relative;
    }
    
    div#classjunior a {
        width: 100%;
        height: 0;
        padding-bottom: 43.29%; /* 303/700 = 0.4329 = 43.29% */
        display: block;
        background-image: url(../img/sp_classjuniorBG.jpg);
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
        position: relative;
        text-indent: -10000px;
        overflow: hidden;
    }
    
    div#classjunior a:hover {
        background-image: url(../img/sp_classjuniorBG.jpg) !important;
        background-size: contain !important;
        background-repeat: no-repeat !important;
        background-position: center !important;
    }
    
    div#classjunior .classjunior-text {
        font-size: 14px;
        padding: 5px;
        text-align: left;
    }
    
    /* フッター */
    div#footer {
        width: 100%;
        height: auto;
        margin-top: 0;
        padding: 0 0 10px;
        margin-bottom: 150px; /* スマホ用: 固定CTAの高さ + 余白 */
        background-size: cover;
        background-position: center;
        background-image: none;
        background-color: #fff;
    }
    
    div#footer div#footer-link {
        width: 100%;
        height: auto;
        text-align: center;
        padding: 0 15px;
        display: flex;
    }
    
    div#footer div#footer-link div#footer-link-l,
    div#footer div#footer-link div#footer-link-r {
        width: 100%;
        float: none;
        padding: 5px 0;
        text-align: center;
    }
    
    div#footer div#footer-link div#footer-link-r {
        display: flex;
    }
    
    div#footer div#footer-link div#footer-link-r a {
        display: inline-block;
        margin: 0 5px;
        float: none;
    }
    
    div#footer div#footer-l {
        width: 100%;
        float: none;
        text-align: center;
        padding: 10px 0;
        height: 180px;
    }
    
    div#footer p.mobile-copyright {
        font-size: 10px;
        text-align: center;
        margin-top: 20px;
        display: block;
    }
    
    div#footer div#footer-r {
        width: 100%;
        float: none;
        background-position: center top;
        background-size: contain;
        background-repeat: no-repeat;
        height: 120px;
        padding: 10px 0;
        display: none;
    }
    
    div#footer p {
        margin: 5px 10px;
        font-size: 13px;
        text-align: center;
    }
    
    div#footer p.title {
        font-size: 21px;
        margin-top: 10px;
    }
    
    /* フッターコピーライト */
    #main-bottom div#footer-copyright {
        width: 100%;
        padding: 10px 5px;
        text-align: center;
    }
    
    #main-wrap-bottom {
        display: none;
    }
    
    /* パンくずリスト */
    div#bread {
        width: 100%;
        height: auto;
        padding: 5px 10px;
        font-size: 12px;
        box-sizing: border-box;
    }
    
    /* div#contents内のpタグのフォントサイズ調整（スマホ用） */
    div#contents p {
        font-size: 16px;
    }
    
    /* このページのトップへボタン */
    #topcontrol {
        display: none; /* スマホでは非表示 */
    }
    
    /* テーブルのレスポンシブ化 */
    table {
        width: 100%;
        font-size: 13px;
        border-collapse: collapse;
    }
    
    td, th {
        padding: 8px 4px;
        word-wrap: break-word;
    }
    
    /* 画像の最大幅制限 */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* フォームの調整 */
    input, textarea, select {
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* 横スクロールの防止 */
    body {
        overflow-x: hidden;
    }
    
    * {
        box-sizing: border-box;
    }
    
    /* 固定CTAのスマホ用調整 */
    .fixed-cta {
        display: flex;
        padding: 10px 15px;
        gap: 10px;
        left: 0;
        width: 100%;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
    
    .fixed-cta-item img {
        width: 100%;
        height: auto;
        margin: 0 auto;
    }
    
    /* ヘッダータイトルの右マージン調整 */
    #header div#title h1 {
        margin-right: 10px !important;
    }
}

/* 極小画面用（320px以下） */
@media (max-width: 320px) {
    body {
        font-size: 13px;
    }
    
    div#css-only li.parent a {
        font-size: 22px;
        height: 80px;
        line-height: 1;
    }
    
    div#footer p {
        font-size: 12px;
    }
    
    div#footer p.title {
        font-size: 14px;
    }
}