/* 学べることセクション用スタイル */
.learning-content {
    padding: 0;
    /* 余白なしで画面いっぱいに */
    position: relative;
    overflow: hidden;
    min-height: 700px;
    /* 最低高さを設定 */
    /* セクション全体に背景画像を設定 */
    background-image: url('../../images/merit001.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    /* 背景画像を中央に配置、画面いっぱいに表示 */
}

/* 細かいドットパターンのオーバーレイ */
.learning-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* 非常に細かいドットパターンのみ */
    background-image:
        /* きめ細かいドットパターン */
        radial-gradient(circle, rgba(26, 41, 66, 0.4) 0.8px, transparent 0.8px);
    /* ドットのサイズと間隔をさらに小さく、密集度を上げる */
    background-size: 2.5px 2.5px;
    background-position: 0 0;
    z-index: 1;
}

/* 右側に向かってドットが薄くなるグラデーションマスク */
.learning-content::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right,
            transparent 0%,
            rgba(26, 41, 66, 0.05) 20%,
            rgba(26, 41, 66, 0.4) 60%,
            rgba(26, 41, 66, 1.0) 100%);
    z-index: 1;
}

/* フレックスコンテナ */
.learning-flex-container {
    display: flex;
    width: 100%;
    min-height: 700px;
    /* 最低高さを設定 */
    position: relative;
    z-index: 2;
    /* 背景画像とオーバーレイの上に配置 */
}

/* 左側透明エリア */
.learning-content-left {
    flex: 0.4;
    /* 40%幅 */
    /* 完全に透明 */
    background: transparent;
}

/* 右側コンテンツエリア - 背景を透明に変更 */
.learning-content-right {
    flex: 0.6;
    /* 60%幅 */
    background-color: transparent;
    /* 透明背景に変更 */
    padding: 70px 5%;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* 中央配置 */
    justify-content: center;
    position: relative;
    box-shadow: none;
    /* 影を削除 */
}

.learning-content-right h2 {
    text-align: center;
    margin-bottom: 40px;
    font-weight: 700;
    font-size: 2.5rem;
    color: #ffffff;
    /* 純白に設定 */
    position: relative;
    width: 100%;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
    /* テキストシャドウを強調 */
}

.learning-content-right h2::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #ffffff, rgba(255, 255, 255, 0.2));
    /* グラデーションを白に変更 */
    border-radius: 4px;
}

/* グリッドレイアウト */
.content-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    /* 2列 */
    grid-template-rows: repeat(3, auto);
    /* 3行 */
    gap: 25px;
    width: 100%;
    max-width: 800px;
    position: relative;
}

/* カードスタイル - 白背景のままキープ */
.content-card {
    background-color: #ffffff;
    border-radius: 10px;
    overflow: visible;
    /* 展開時にはみ出しを許可 */
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.4s ease;
    display: flex;
    align-items: center;
    height: auto;
    min-height: 100px;
    position: relative;
    /* 相対位置指定 */
    border: 1px solid rgba(0, 0, 0, 0.05);
    cursor: pointer;
    /* カードをクリック可能にする */
    z-index: 1;
    /* 通常時のz-index */
}

.content-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(78, 84, 200, 0.15);
    border-color: rgba(78, 84, 200, 0.1);
}

.content-card.expanded {
    z-index: 10;
    /* 展開時はより前面に */
    overflow: visible;
}

/* カードヘッダー - h3とアイコンを横並びに */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 10px 0;
}

/* 展開アイコン */
.expand-icon {
    display: flex;
    align-items: center;
    margin-left: 10px;
    color: #4e54c8;
    transition: transform 0.3s ease;
}

.expand-icon svg {
    stroke: #4e54c8;
}

/* 展開時のアイコン回転 */
.content-card.expanded .expand-icon {
    transform: rotate(180deg);
}

/* アイコンスタイル */
.card-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #4e54c8 0%, #8f94fb 100%);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 15px;
    box-shadow: 0 5px 10px rgba(78, 84, 200, 0.2);
    flex-shrink: 0;
}

.card-icon svg {
    width: 24px;
    height: 24px;
    stroke: #ffffff;
}

/* カードコンテンツ */
.card-content {
    flex: 1;
    text-align: left;
    /* テキストを左寄せに */
    padding-right: 15px;
    padding-left: 0;
    position: relative;
    /* 相対位置指定 */
    width: 100%;
}

.card-content h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    color: #1a2942;
}

/* 詳細テキスト - 絶対位置で下部に展開 */
.card-details {
    height: 0;
    opacity: 0;
    overflow: hidden;
    transition: opacity 0.3s ease, height 0.3s ease;
    padding: 0;
    position: absolute;
    top: 100%;
    /* カードの下部から開始 */
    left: 0;
    right: 0;
    width: 100%;
    background-color: #ffffff;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.05);
    z-index: 2;
}

.card-details p {
    margin: 0;
    padding: 15px;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #555;
    text-align: left;
}

/* 展開時のスタイル */
.content-card.expanded {
    border-radius: 10px 10px 0 0;
    /* 下部の角を角ばらせる */
}

.content-card.expanded .card-details {
    height: auto;
    opacity: 1;
    padding: 0 0 10px 0;
}

/* アニメーション効果 */
@keyframes cardSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content-card {
    animation: cardSlideIn 0.6s ease forwards;
    opacity: 0;
}

.content-card:nth-child(1) {
    animation-delay: 0.1s;
}

.content-card:nth-child(2) {
    animation-delay: 0.2s;
}

.content-card:nth-child(3) {
    animation-delay: 0.3s;
}

.content-card:nth-child(4) {
    animation-delay: 0.4s;
}

.content-card:nth-child(5) {
    animation-delay: 0.5s;
}

.content-card:nth-child(6) {
    animation-delay: 0.6s;
}

/* レスポンシブデザイン */
@media (max-width: 1024px) {
    .learning-content {
        /* 背景画像の位置をタブレット用に調整 */
        background-position: 25% center;
    }

    .learning-flex-container {
        flex-direction: column;
    }

    .learning-content-left {
        display: none;
        /* モバイル表示では左側透明エリアを非表示 */
    }

    .learning-content-right {
        flex: none;
        width: 100%;
        padding: 60px 5%;
    }

    .content-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .learning-content {
        /* 背景画像の位置をモバイル用にさらに調整 */
        background-position: 35% center;
    }

    .content-list {
        grid-template-columns: 1fr;
        /* 1列に変更 */
    }
}

@media (max-width: 600px) {
    .learning-content-right h2 {
        font-size: 2rem;
    }

    .content-card {
        height: auto;
        padding: 15px 0;
        flex-direction: column;
        text-align: center;
    }

    .card-icon {
        margin: 0 auto 10px;
    }

    .card-content {
        padding-right: 0;
    }

    .content-list {
        gap: 15px;
    }
}