/* ========================================
   小学校受験コース専用CSS
   ======================================== */

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

/* =============================
    Hero 上側フチ細く見える問題対策
    共通CSSの .hero-background { margin-top:-5px; } がヘッダー下に潜り込み
    上フチ(枠線+余白)が部分的に隠れて薄く見えるため、このページでは打ち消す。
    ============================= */
.page-exam .hero-background { margin-top: 16px !important; }

/* 上フチ視認性補強：薄く見える場合の微かな影 */
.page-exam .hero-background img { box-shadow: 0 8px 25px rgba(245,230,211,0.4), 0 0 0 1px rgba(0,0,0,0.04); }


/* ページ固有のヒーローテキスト調整が必要な場合ここに追加 */

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

/* ヘッダーロゴのサイズ調整 */
.page-exam header .logo-main img {
    width: 160px;
    height: 120px;
    object-fit: contain;
}


/* --- Exam Page Specific Styles --- */
.page-exam .curriculum-feature {
    margin-bottom: 150px !important; /* 下余白をさらに増加して重なりを防止 */
    max-width: 1000px !important; /* 最大幅を制限 */
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 0 !important; /* common.cssのsection paddingを上書き */
}

.page-exam .curriculum-feature .curriculum-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important; /* 2列 */
    grid-template-rows: auto auto !important; /* 各行はコンテンツ高さに合わせる */
    gap: 30px !important; /* グリッド間の余白 */
    height: auto !important; /* 固定高さを撤廃 */
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 市松模様の配置 */
.page-exam .curriculum-feature .curriculum-text-detail {
    grid-column: 2 !important; /* 上段右（画像→テキスト） */
    grid-row: 1 !important;
    background-color: var(--cream-color) !important;
    padding: 30px !important;
    border-radius: 8px !important;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08) !important;
    display: flex !important;
    align-items: center !important;
    margin: 0 !important;
}

.page-exam .curriculum-feature .curriculum-image-new {
    grid-column: 1 !important; /* 上段左（画像→テキスト） */
    grid-row: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
}

.page-exam .curriculum-feature .curriculum-text-montessori {
    grid-column: 1 !important;
    grid-row: 2 !important;
    background-color: var(--cream-color) !important;
    padding: 30px !important;
    border-radius: 8px !important;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08) !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    margin: 0 !important;
}

.page-exam .curriculum-feature .curriculum-image-existing {
    grid-column: 2 !important;
    grid-row: 2 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* グリッド内の画像スタイル */
.page-exam .curriculum-feature .curriculum-item img {
    width: 100% !important;
    height: auto !important; /* 画像は比率を保って高さ自動 */
    border-radius: 8px !important;
    object-fit: cover !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* テキストスタイル */
.page-exam .curriculum-feature .curriculum-text-montessori h3 {
    font-size: 1.6rem !important;
    color: var(--main-color) !important;
    margin-bottom: 20px !important;
    text-align: center !important;
}

.page-exam .curriculum-feature .curriculum-text-montessori p {
    font-size: 1rem !important;
    line-height: 1.8 !important;
    color: var(--text-color-light) !important;
    text-align: justify !important;
    margin-bottom: 20px !important;
}

.page-exam .curriculum-feature .curriculum-text-detail p {
    font-size: 1rem !important;
    line-height: 1.7 !important;
    color: var(--text-color-light) !important;
    text-align: left !important;
    margin: 0 !important;
}

.page-exam #tuition-info p {
    text-align: center;
    font-size: 1.1rem;
    line-height: 2;
}

/* Zephyr Goals 基本設定 */
.zephyr-goals {
    margin-bottom: 40px;
}

.zephyr-goals h3 {
    font-size: 1.5rem;
    color: var(--main-color);
    text-align: center;
    margin-bottom: 20px;
}

.zephyr-goals ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

.zephyr-goals li {
    background-color: var(--cream-color);
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 700;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.zephyr-goals .goals-supplement {
    text-align: center;
    margin-top: 30px;
    line-height: 2;
    font-weight: 600;
}

/* PC: #tuition-info 上余白を約1cm(≈38px)削減 */
@media (min-width: 880px) {
    .page-exam #tuition-info { padding-top: 12px !important; }
    .page-exam #achievements { padding-top: 12px !important; }
}

/* 合格実績セクションのPC版見出し装飾 */
.page-exam #achievements .section-title::before { background-image: url('../images/balloons.svg'); width: 120px; height: 120px; transform: translateY(-50%) rotate(-10deg); }
.page-exam #achievements .section-title::after  { background-image: url('../images/shojo.svg'); width: 90px; height: 90px; transform: translateY(-50%) rotate(10deg); }

/* モバイル: #tuition-info 上余白も圧縮 (既定60px想定 → 30px) */
@media (max-width: 879px) {
    .page-exam #tuition-info { padding-top: 30px !important; }
    .page-exam #achievements { padding-top: 30px !important; }
}

/* Features 基本設定 */
.page-exam #about .features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* PCでは3列、スマホでは1列に */
    gap: 30px;
    text-align: center;
    margin-top: 50px !important; /* 上余白を追加して重なりを防止 */
}

#about .feature-item {
    background-color: var(--cream-color);
    padding: 30px 15px; /* 左右の余白を調整 */
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08); /* 影を強調 */
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex; /* 追加 */
    flex-direction: column; /* 追加 */
    align-items: center; /* 中央揃え */
}

#about .feature-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

#about .feature-item img {
    border-radius: 8px; /* 四角に */
    margin-bottom: 20px;
    background-color: transparent; /* 背景色を透明に */
    padding: 0; /* パディングを削除 */
    width: 200px; /* 幅をさらに大きく */
    height: 200px; /* 高さをさらに大きく */
    object-fit: cover; /* 画像の表示方法 */
    align-self: center; /* 中央揃え */
}

#about .feature-item h3 {
    font-size: 1.6rem; /* サイズを大きく */
    color: var(--main-color);
    margin-bottom: 15px;
}

/* トップページ以外の#aboutセクションに適用 */
body:not(.page-index) #about .feature-item p,
.course-card-content p {
    min-height: 120px;
    text-align: justify;
}

/* ボタンスタイル */
.btn {
    display: inline-block;
    padding: 12px 30px;
    background-color: var(--accent-color);
    color: var(--text-color);
    text-decoration: none;
    border-radius: 5px;
    font-weight: 700;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border: none;
    cursor: pointer;
}

.btn:hover {
    background-color: var(--accent-color-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0,0,0,0.15);
}

.btn.btn-primary {
    background-color: var(--main-color);
    color: var(--white);
}

.btn.btn-primary:hover {
    background-color: var(--main-color-dark);
}

/* モバイル対応 */
@media (max-width: 879px) {
    .page-exam .curriculum-feature {
        margin-bottom: 100px !important; /* モバイルでも下余白をさらに増加 */
        padding: 0 20px !important;
    }
    
    .page-exam .curriculum-feature .curriculum-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 20px !important;
        height: auto !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .page-exam .curriculum-feature .curriculum-item {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* 並び順: 画像 → テキスト → 画像 → テキスト */
    .page-exam .curriculum-feature .curriculum-image-new { order: 1 !important; }
    .page-exam .curriculum-feature .curriculum-text-detail { order: 2 !important; }
    .page-exam .curriculum-feature .curriculum-image-existing { order: 3 !important; }
    .page-exam .curriculum-feature .curriculum-text-montessori { order: 4 !important; }
    
    .page-exam .curriculum-feature .curriculum-text-montessori {
        padding: 20px !important;
        text-align: center !important;
        background-color: var(--cream-color) !important;
        border-radius: 8px !important;
        box-shadow: 0 5px 15px rgba(0,0,0,0.08) !important;
    }
    
    .page-exam .curriculum-feature .curriculum-text-montessori h3 {
        font-size: 1.5rem !important;
        margin-bottom: 15px !important;
    }
    
    .page-exam .curriculum-feature .curriculum-text-montessori p {
        font-size: 1rem !important;
        line-height: 1.6 !important;
        text-align: left !important;
        margin-bottom: 15px !important;
    }
    
    .page-exam .curriculum-feature .curriculum-text-detail {
        padding: 20px !important;
        background-color: var(--cream-color) !important;
        border-radius: 8px !important;
        box-shadow: 0 5px 15px rgba(0,0,0,0.08) !important;
    }
    
    /* 追加テキストのフォントをモンテッソーリと揃える */
    .page-exam .curriculum-feature .curriculum-text-detail p {
        font-size: 1rem !important; /* .curriculum-text-montessori p と同一 */
        line-height: 1.6 !important;
    }
    
    .page-exam .curriculum-feature .curriculum-item img {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: 250px !important;
        object-fit: cover !important;
        border-radius: 8px !important;
        display: block !important;
    }
}

/* スマホランドスケープ対応 */
@media (min-width: 480px) and (max-width: 768px) {
    .page-exam .curriculum-feature .curriculum-item img {
        height: auto !important; /* 自然な縦横比を保持 */
        max-height: none !important; /* 高さ制限を解除 */
    }
}

/* タブレット・スマホランドスケープ対応 */
@media (min-width: 768px) and (max-width: 1024px) {
    .page-exam .curriculum-feature .curriculum-item img {
        height: auto !important; /* 自然な縦横比を保持 */
        max-height: none !important; /* 高さ制限を解除 */
    }
}
    
    .page-exam .zephyr-goals ul li {
        width: 100%;
        box-sizing: border-box;
        padding: 15px 20px; /* 余白を増加 */
        text-align: center; /* テキストを中央揃えに */
        font-size: 1.2rem; /* さらに大きく */
        line-height: 1.4; /* 行間を調整 */
    }
    
    .page-exam .zephyr-goals h3 {
        font-size: 1.4rem; /* 以前のサイズに戻す */
        margin-bottom: 15px;
    }
    
    #about .feature-item img {
        width: 150px; /* モバイルでは少し小さく */
        height: 150px;
    }
    
    @media (max-width: 879px) {
        .page-exam #about .features {
            grid-template-columns: 1fr; /* モバイルでは1列 */
            gap: 20px;
            padding: 0 20px;
            margin-top: 30px !important; /* モバイルでも上余白を追加 */
        }
    }
    
    #about .feature-item {
        padding: 20px 15px;
    }
    
    #about .feature-item h3 {
        font-size: 1.5rem; /* 以前のサイズに戻す */
    }
    
    #about .feature-item p {
        font-size: 1.0rem; /* 以前のサイズに戻す */
        min-height: auto;
    }
    
    
    /* カードの文字サイズを大きくし、2行表示で中央寄せ */
    .page-exam #about .feature-item h3 {
        font-size: 1.5rem !important; /* 以前のサイズに戻す */
        margin-bottom: 20px;
        line-height: 1.3;
    }
    
    .page-exam #about .feature-item p {
        font-size: 1.2rem !important; /* キャプション/本文を大きく */
        min-height: auto;
        text-align: center;
        line-height: 1.6;
        margin-bottom: 0;
    }
    
    /* ペーパーテスト対策セクションのモバイル表示調整 */
    #tuition-info .section-title::before { 
        top: 50% !important; 
        left: 0 !important; 
        transform: translateY(-50%) rotate(-15deg) scale(0.8); 
        z-index: -1 !important; 
        width: 60px !important; 
        height: 60px !important; 
    }
    #tuition-info .section-title::after { 
        top: 50% !important; 
        right: 0 !important; 
        transform: translateY(-50%) rotate(15deg) scale(0.8); 
        z-index: -1 !important; 
        width: 60px !important; 
        height: 60px !important; 
    }
    
    /* 合格実績セクションのモバイル表示調整 */
    #achievements .section-title::before { 
        top: 50% !important; 
        left: 0 !important; 
        transform: translateY(-50%) rotate(-10deg) scale(0.8); 
        z-index: -1 !important; 
        width: 60px !important; 
        height: 60px !important; 
    }
    #achievements .section-title::after { 
        top: 50% !important; 
        right: 0 !important; 
        transform: translateY(-50%) rotate(10deg) scale(0.8); 
        z-index: -1 !important; 
        width: 60px !important; 
        height: 60px !important; 
    }
}

/* PCは初期定義（auto-fit, minmax(280px, 1fr)）が有効になるよう競合を解消 */