/* ========================================
   小学部専用CSS
   以後、elementary.html は common.css と本ファイルのみを参照
   ======================================== */

/* ページ固有のヒーロー画像 */
.page-elementary .hero-background img {
    content: url('../images/courses-elementary-new.jpg');
}

/* =============================
    Hero 上側フチ細く見える問題対策
    共通CSSの .hero-background { margin-top:-5px; } を打ち消し、
    画像周囲の枠線が全辺均等に見えるようにする。
    ============================= */
.page-elementary .hero-background { margin-top: 20px !important; }

/* 上フチ視認性補強：全く見えないケース対策で薄い輪郭線を追加 */
.page-elementary .hero-background img { box-shadow: 0 8px 25px rgba(245,230,211,0.4), 0 0 0 1px rgba(0,0,0,0.05); }


/* ページ固有のスタイル調整余地（現状未使用。必要時ここに追記） */

/* PC版：小学部のヒーロータイトル調整 */
@media (min-width: 880px) {
    .page-elementary .hero-title {
        text-align: center;
    }
    
    .page-elementary .hero-title br:first-of-type {
        display: block;
        margin-bottom: 8px;
    }
}

/* 2行以上のヒーロー説明文をさらに下げる（elementary.html専用） */
.page-elementary .hero-description.multiline {
    margin-top: 230px !important;
}

/* インラインスタイルの外部化 */
.logo a {
    text-decoration: none;
    color: inherit;
}

/* ヒーローセクションのスタイル統一 */
.page-elementary .hero-description { margin-top: 200px; }

.elementary-container-center {
    text-align: center;
}

.elementary-feature-description {
    margin-top: 20px;
    text-align: center;
    padding: 20px;
    background-color: #f0f2f5;
    border-radius: 8px;
    border-left: 4px solid var(--main-color);
}

.elementary-feature-description h3 {
    color: var(--main-color);
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.elementary-feature-description p {
    line-height: 1.8;
    margin-bottom: 10px;
}

.elementary-feature-description p:last-child {
    line-height: 1.8;
    font-size: 0.95rem;
    color: #666;
}

/* PC表示での小学部の特徴テキストサイズ調整 */
@media (min-width: 880px) {
    .page-elementary .elementary-feature-description h3 {
        font-size: 1.2rem;
    }
    
    .page-elementary .elementary-feature-description p {
        font-size: 0.95rem;
    }
}

.elementary-button-container {
    text-align: center;
    margin-top: 40px;
}

/* 小学部専用の表スタイル - PC表示 */
@media (min-width: 880px) {
    /* PC表示でcourse-list-bandsのカードを大きくする */
    .page-elementary .course-list-bands {
        gap: 25px;
        max-width: 900px;
    }
    
    .page-elementary .course-list-bands li {
        padding: 18px 35px;
        font-size: 1.1rem;
        min-width: 320px;
    }
    
    /* PC表示で画像と特徴テキストを横並びに配置 */
    .page-elementary .course-list-image {
        display: flex;
        align-items: stretch;
        gap: 30px;
        margin-top: 20px;
        text-align: left;
        width: 100%;
        max-width: 100%;
    }
    
    .page-elementary .course-list-image img {
        width: calc(50% - 15px) !important;
        max-width: calc(50% - 15px) !important;
        flex-shrink: 0;
        object-fit: cover;
        height: auto;
    }
    
    .page-elementary .elementary-feature-description {
        width: calc(50% - 15px) !important;
        flex-shrink: 0;
        margin-top: 0;
        text-align: center;
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-height: 0;
    }
    
    .page-elementary .table-image {
        display: block;
        text-align: center;
        margin-bottom: 30px;
    }
    
    .page-elementary .table-image .image-caption {
        margin-top: 15px;
        font-size: 0.95rem;
        color: #666;
        font-style: italic;
        text-align: center;
    }
    
    /* PC表示でtable-featureセクションの下部マージンを標準化 */
    .page-elementary .table-feature {
        margin-bottom: 30px;
    }
    
    /* PC表示でachievementsセクションの上部マージン調整は撤回（共通仕様に委譲） */
    .page-elementary #achievements {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    /* 小学部ページの#achievementsセクションの見出し余白調整（PC版） */
    .page-elementary #achievements .section-title {
        margin-bottom: 80px !important;
    }
    
    /* PC表示で中学受験コースの概要の見出しの上部マージンを調整 */
    .page-elementary .exam-course-overview {
        margin-top: 80px; /* 写真と見出しの間隔を確保 */
    }
    
    .elementary-table-container {
        max-width: 1000px;
        margin: 20px auto 0 auto;
        text-align: center;
    }
    
    .elementary-table {
        width: 100%;
        border-collapse: collapse;
        border-radius: 8px;
        overflow: hidden;
        box-shadow: 0 4px 15px rgba(0,0,0,0.08);
        background-color: white;
        table-layout: fixed;
    }
    
    .elementary-table thead {
        background-color: #8BC34A;
        color: white;
    }
    
    .elementary-table th {
        padding: 25px 20px;
        text-align: center;
        font-size: 1.1rem;
        font-weight: 700;
        border: 1px solid #eee;
    }
    
    .elementary-table tbody tr {
        border-bottom: 1px solid #eee;
        display: table-row;
    }
    
    .elementary-table tbody tr:nth-child(even) {
        background-color: #f9f9f9;
    }
    
    .elementary-table td {
        padding: 25px 20px;
        vertical-align: middle;
        border: 1px solid #eee;
        text-align: center;
        display: table-cell;
    }
    
    .elementary-table .grade-cell {
        width: 150px;
        font-weight: 700;
        background-color: #f9f9f9;
        color: #8BC34A;
        font-size: 1.1rem;
        display: table-cell;
    }
    
    .elementary-table .subject-cell {
        width: 250px;
        font-weight: 700;
        color: #333;
        font-size: 1rem;
    }
    
    .elementary-table .content-cell {
        text-align: left;
        color: #666;
        font-size: 0.95rem;
        line-height: 1.6;
    }
    
    .elementary-table .grade-separator {
        border-top: 3px solid #8BC34A;
    }
    
    /* PC表示での表示制御 */
    .elementary-table .show-pc {
        display: table-row;
    }
    
    .elementary-table .show-mobile {
        display: none;
    }
}

/* モバイル対応 */
@media (max-width: 879px) {
    .elementary-table-container {
        margin: 20px auto;
        width: 100%;
        max-width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    .elementary-table {
        box-shadow: none;
        border-radius: 0;
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
    }
    
    .elementary-table thead {
        display: none;
    }
    
    .elementary-table tbody tr {
        display: block;
        margin-bottom: 1em;
        background-color: white;
        border-radius: 8px;
        padding: 1em;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
    
    .elementary-table td {
        display: block;
        text-align: center;
        border: none;
        padding: 10px 0;
    }
    
    .elementary-table .grade-cell {
        font-size: 1.2rem;
        font-weight: bold;
        color: #8BC34A;
        background: none;
        padding: 15px 0;
        border-bottom: 2px solid #e0e0e0;
        margin-bottom: 10px;
    }
    
    .elementary-table .subject-cell {
        font-weight: 700;
        color: #333;
        margin-bottom: 5px;
    }
    
    .elementary-table .content-cell {
        text-align: center;
        color: #666;
        line-height: 1.6;
    }
    
    .elementary-table .grade-separator {
        border-top: 3px solid #8BC34A;
        margin-top: 1em;
        padding-top: 1em;
    }
    
    /* モバイル表示での表示制御 */
    .elementary-table .show-pc {
        display: none;
    }
    
    .elementary-table .show-mobile {
        display: block;
    }
    
    /* モバイル表示でtable-featureセクションの下部マージンを標準化 */
    .page-elementary .table-feature {
        margin-bottom: 20px;
    }
    
    /* モバイル表示でachievementsセクションの上部マージン調整は撤回（共通仕様に委譲） */
    .page-elementary #achievements {
        margin-top: 0;
    }

    /* 小学部ページの#achievementsセクションの見出し余白調整（モバイル版） */
    .page-elementary #achievements .section-title {
        margin-bottom: 50px !important;
    }
    
    /* セクション余白の共通仕様に合わせる */
    .page-elementary section {
        padding: 60px 0;
        padding-top: 0px !important;
    }
    
    .page-elementary #about {
        padding-bottom: 38px !important; /* 1cm（約38px）に統一 */
    }
    
    /* モバイル表示で中学受験コースの概要の見出しの上部マージンを調整 */
    .page-elementary .exam-course-overview {
        margin-top: 30px; /* 他のセクションと同じ余白に調整 */
    }
    
    /* モバイル表示でヒーローセクションのタイトル余白を調整 */
    .page-elementary .hero-title {
        margin-top: 60px !important; /* ヘッダーとの間隔を確保 */
    }
    
    /* モバイル表示で各コースのご紹介セクションの上部マージンを調整 */
    .page-elementary #about {
        margin-top: 30px; /* ヒーローセクションとの間隔を確保 */
    }
    
    /* モバイル表示で画像を1つだけ表示（縦並び） */
    .page-elementary .course-list-image {
        display: block;
        text-align: center;
        margin-top: 30px;
    }
    
    .page-elementary .course-list-image img {
        width: 80%;
        max-width: 400px;
        border-radius: 8px;
    }
    
    .page-elementary .elementary-feature-description {
        margin-top: 20px;
        text-align: center;
    }
    
    .page-elementary .table-image {
        display: block;
        text-align: center;
        margin-bottom: 20px;
    }
    
    /* モバイル表示での特徴説明のスタイル調整 */
    .page-elementary .elementary-feature-description {
        margin: 20px 10px 0 10px;
        padding: 15px;
    }
    
    .page-elementary .elementary-feature-description h3 {
        font-size: 1.2rem;
    }
    
    .page-elementary .elementary-feature-description p {
        font-size: 1.2rem;
    }
}

/* タブレットポートレート表示での概要テーブル幅調整 */
@media (min-width: 480px) and (max-width: 879px) {
    .elementary-table-container {
        max-width: 90%;
        margin: 20px auto;
    }
    
    .elementary-table {
        max-width: 100%;
    }
    
}

/* =============================
   style.cssから移行した設定
   ============================= */

/* Elementary Page Specific Styles */
.page-elementary .course-list-image, .page-elementary .table-image {
    flex: 1;
}

@media (min-width: 880px) {
    .page-elementary .course-list-image {
        margin-top: 30px; /* カードと画像の間隔を縮小 */
    }
}

.page-elementary .table-image img {
    width: 80%;
    max-width: 600px;
    border-radius: 8px;
}



.show-mobile {
    display: none;
}

@media (min-width: 880px) {
    .elementary-table .show-pc {
        display: table-row !important;
    }
    
    .elementary-table .show-mobile {
        display: none !important;
    }
}

@media (max-width: 879px) {
    /* elementary-table の背景パターン/オーバーレイを無効化し、全面を白に統一 */
    .page-elementary .elementary-table tbody tr { 
        background-color: #fff !important; 
    }
    .page-elementary .elementary-table tr,
    .page-elementary .elementary-table td {
        background-image: none !important;
        background-color: transparent !important;
    }
    .page-elementary .elementary-table tr::before,
    .page-elementary .elementary-table tr::after {
        content: none !important;
        display: none !important;
    }

    /* モバイル表示での表示制御 */
    .elementary-table .show-pc {
        display: none !important;
    }
    
    .elementary-table .show-mobile {
        display: block !important;
    }

    .page-elementary .course-list-feature, .page-elementary .table-feature {
        flex-direction: column;
    }
    .page-elementary .table-feature .table-image {
        display: block; /* モバイルでも2つ目の画像を表示 */
        text-align: center;
        margin-bottom: 20px;
    }

    /* Responsive Table to Cards */
    .page-elementary .elementary-table thead {
        display: none; /* PCのヘッダーを隠す */
    }
    .page-elementary .elementary-table tbody {
        display: block;
        margin-bottom: 0.5em; /* 余白を削減 */
        border: 1px solid #ddd;
        border-radius: 8px;
        padding: 1em;
        box-shadow: 0 2px 5px rgba(0,0,0,0.05);
        background-color: #f9f9f9;
        position: relative;
    }
    
    /* 各学年の行にbg-pattern.svgを背景として表示 */
    .page-elementary .elementary-table tr {
        display: block;
        margin-bottom: 0.5em;
        position: relative;
        background-color: #fefefe; /* 背景色を薄く */
        border-radius: 8px;
        padding: 1em;
        margin-bottom: 1em;
        overflow: hidden; /* 装飾要素がはみ出さないように */
    }
    
    /* 最後の学年（6年）のカードの余白を調整 */
    .page-elementary .elementary-table tr:last-child {
        margin-bottom: 0.5em; /* 最後のカードの余白を削減 */
    }
    
    /* すべての学年の行にbg-pattern.svgを背景として表示 */
    .page-elementary .elementary-table tr,
    .page-elementary .elementary-table td {
        position: relative;
        background-image: url('../images/bg-pattern.svg') !important;
        background-repeat: no-repeat !important;
        background-position: center !important;
        background-size: 200px 200px !important;
        background-blend-mode: normal !important;
        background-color: transparent !important;
        z-index: 1;
    }
    
    /* 背景パターンの上に半透明のオーバーレイを追加 */
    .page-elementary .elementary-table tr::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(255, 255, 255, 0.9); /* 白い半透明オーバーレイ */
        z-index: -1;
        border-radius: 8px;
    }
    
    /* 背景パターンの上にさらに薄いオーバーレイを追加 */
    .page-elementary .elementary-table tr::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(248, 249, 250, 0.7); /* さらに薄いオーバーレイ */
        z-index: -2;
        border-radius: 8px;
    }
    
    /* 学年区切り線のスタイル */
    .page-elementary .elementary-table tr.grade-separator {
        border-top: 3px solid #8BC34A;
        margin-top: 1em;
        padding-top: 1em;
    }
    
    /* 各学年の行のスタイル */
    .page-elementary .elementary-table tr {
        display: block;
        margin-bottom: 1em;
        background-color: #fefefe;
        border-radius: 8px;
        padding: 1em;
        position: relative;
    }
    
    /* 各セルのスタイル */
    .page-elementary .elementary-table td {
        display: block;
        text-align: center;
        border: none;
        padding: 10px 0;
        position: relative;
    }
    
    /* rowspanを持つセルのスタイル */
    .page-elementary .elementary-table td[rowspan] {
        display: block;
        text-align: center;
        border: none;
        padding: 15px 0;
        margin-bottom: 10px;
        position: relative;
    }
    
    /* rowspanを持つセルの前に学年ラベルを追加 */
    .page-elementary .elementary-table td[rowspan]::before {
        content: attr(data-label);
        display: block;
        font-weight: bold;
        color: #8BC34A;
        margin-bottom: 5px;
    }
    
    /* 学年セルのスタイル */
    .page-elementary .elementary-table td[data-label="学年"] {
        font-size: 1.2rem;
        font-weight: bold;
        color: #8BC34A;
        background: none;
        padding: 15px 0;
        border-bottom: 2px solid #e0e0e0;
        margin-bottom: 10px;
        position: relative;
    }
    
    /* 学年セル内のモバイル表示用ラベル */
    .page-elementary .elementary-table td[data-label="学年"] .show-mobile {
        display: block;
        font-weight: bold;
        color: #8BC34A;
        margin-bottom: 5px;
    }
    
    /* 学年セル内のモバイル表示用ラベルの強調 */
    .page-elementary .elementary-table td[data-label="学年"] .show-mobile strong {
        color: #8BC34A;
    }
    
    /* 科目と内容セルのスタイル */
    .page-elementary .elementary-table td[data-label="科目"],
    .page-elementary .elementary-table td[data-label="内容"] {
        display: block;
        text-align: center;
        border: none;
        padding: 10px 0;
        position: relative;
    }
    
    /* 最初の行と学年区切り線の特別なスタイル */
    .page-elementary .elementary-table tr:first-child,
    .page-elementary .elementary-table tr.grade-separator {
        border-top: 3px solid #8BC34A;
        margin-top: 1em;
        padding-top: 1em;
        position: relative;
    }
    
    /* 最初の行と学年区切り線の前に装飾を追加 */
    .page-elementary .elementary-table tr:first-child::before,
    .page-elementary .elementary-table tr.grade-separator::before {
        content: '';
        position: absolute;
        top: -3px;
        left: 0;
        right: 0;
        height: 3px;
        background: linear-gradient(90deg, transparent, #8BC34A, transparent);
        border-radius: 2px;
        z-index: 2;
    }
    
    /* 各セルの前にラベルを追加 */
    .page-elementary .elementary-table td::before {
        content: attr(data-label);
        display: block;
        font-weight: bold;
        color: #333;
        margin-bottom: 5px;
    }
}

/* 小学部専用のコースリストバンド */
.course-list-bands {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    padding: 0;
    margin: 30px 0;
    list-style: none;
}

.course-list-bands li {
    background-color: var(--cream-color);
    padding: 15px 25px;
    border-radius: 25px;
    font-weight: 700;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
    width: 350px; /* 固定幅で統一 */
    min-width: 350px; /* 最小幅も統一 */
    max-width: 350px; /* 最大幅も統一 */
    list-style: none !important;
    list-style-type: none !important;
}

/* Elementary Page: 2x2 Grid for Course List on PC */
@media (min-width: 880px) {
    .page-elementary .course-list-bands {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
        width: 100%;
        max-width: 100%; /* コンテンツ幅いっぱいを使用 */
        margin: 0 auto; /* グリッド自体を中央に配置 */
    }
    
    .page-elementary .course-list-bands li {
        width: auto;
        min-width: auto;
        max-width: none;
        padding: 25px 30px;
        font-size: 1.2rem;
    }
}

/* Elementary Page: Mobile Course List */
@media (max-width: 879px) {
    body.page-elementary .course-list-bands {
        display: flex;
        flex-direction: column;
        align-items: center; /* Center the items horizontally */
        gap: 15px; /* Add space between the cards */
        padding-left: 0; /* Remove default list padding */
    }

    body.page-elementary .course-list-bands li {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        margin: 0;
        text-align: center;
        display: block;
        float: none;
    }
}

/* 小学部専用のachievementsセクションのカードスタイル */
.page-elementary .achievements-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    text-align: center;
    margin-bottom: 30px;
}

.page-elementary .achievement-card {
    background-color: var(--cream-color);
    padding: 15px 20px;
    border-radius: 8px;
    font-weight: 700;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.page-elementary .achievement-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* 小学部専用のachievementsセクションのボタン */
.page-elementary #achievements .button-container .btn {
    background-color: var(--main-color);
    color: white;
    padding: 12px 30px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s ease;
    display: inline-block;
    margin-top: 30px;
}

.page-elementary #achievements .button-container .btn:hover {
    background-color: var(--main-color-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
} 

/* --- Elementary: Mobile final overrides for overview table background --- */
@media (max-width: 879px) {
    /* テーブル全体は白、行内の透過・パターン・オーバーレイは無効化 */
    .page-elementary .elementary-table tbody tr {
        background-color: #fff !important;
    }
    .page-elementary .elementary-table tr,
    .page-elementary .elementary-table td {
        background-image: none !important;
        background-color: transparent !important;
    }
    .page-elementary .elementary-table tr::before,
    .page-elementary .elementary-table tr::after {
        content: none !important;
        display: none !important;
    }
} 