/* 全体のリセットと共通設定 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
}

body {
    min-height: 100vh;
    background-color: #ffffff;
    /* 背景の下部にうっすら見えるブルーのグラデーション層を再現 */
    background-image: 
        radial-gradient(circle at 0% 100%, #e0f2fe 0%, transparent 40%),
        radial-gradient(circle at 100% 100%, #e0f2fe 0%, transparent 40%);
    color: #1e293b;
    overflow-x: hidden;
}

/* ヘッダーのスタイリング */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 20px 40px;

    position: fixed;
    top: 0;
    left: 0;
    width: 100%;

    background-color: #ffffff;

    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);

    z-index: 1000;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.2rem;
    font-weight: bold;
    color: #1e3a8a;
}

.logo-txt a {
    text-decoration: none;
    color: #2563eb;
}

.logo svg {
    color: #2563eb;
}

.nav-years {
    display: flex;
    gap: 15px;
}

.year-btn {
    text-decoration: none;
    color: #1e3a8a;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 8px 24px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.year-btn:hover {
    border-color: #2563eb;
    background-color: #f8fafc;
}

/* メインコンテンツエリア */
.container {

    max-width: 1200px;
    margin: 0 auto;

    padding: 120px 20px 80px;
}

/* ヒーロー（見出し）セクション */
.hero {
    text-align: center;
    margin-bottom: 60px;
}

.main-title {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    color: #1e3a8a;
    line-height: 1.3;
    margin-bottom: 20px;
}

/* 画像の「完全網羅」の鮮やかな青のグラデーションを再現 */
.main-title .highlight {
    background: linear-gradient(to right, #3b82f6, #1d4ed8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sub-title {
    font-size: 1.6rem;
    color: #334155;
    letter-spacing: 0.05em;
}

/* カードグリッド構造 */
.card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    justify-content: center;
    align-items: start;
    max-width: 1050px;
    margin: 0 auto;
}

/* 各カードのスタイリング */
.card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 40px 30px 30px 30px;
    text-align: center;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.02), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(37, 99, 235, 0.06);
}

/* 丸いアイコンエリア */
.icon-wrapper {
    width: 80px;
    height: 80px;
    background-color: #eff6ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px auto;
}

.card-icon {
    width: 50px;
    height: 50px;
}

.card h2 {
    font-size: 1.4rem;
    color: #1e3a8a;
    margin-bottom: 12px;
}

/* タイトル下の青いライン */
.divider {
    width: 24px;
    height: 2px;
    background-color: #2563eb;
    margin: 0 auto 20px auto;
}

/* 単元リスト */
.topic-list {
    list-style: none;
    margin-bottom: 35px;
    display: grid;
    grid-template-columns: repeat(2, max-content);

    justify-content: center;

    column-gap: 25px;
    row-gap: 10px;

    list-style: none;
    padding: 0;
    margin-top: 35px;
}

.topic-list li {
    font-size: 1.1rem;
    color: #334155;
    margin-bottom: 12px;
}

/* ボタン（グラデーションとホバー効果） */
.cta-button {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: #ffffff;
    font-weight: 500;
    padding: 12px 0;
    width: 100%;
    border-radius: 25px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
    transition: all 0.3s ease;
    position: relative;
}

.cta-button:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
}

.cta-button .arrow {
    position: absolute;
    right: 24px;
    font-size: 1.1rem;
    transition: transform 0.2s ease;
}

.cta-button:hover .arrow {
    transform: translateX(4px);
}

/* ヘッダー右側のテキストリンク形式のナビゲーション */
.nav-years-text {
    display: flex;
    gap: 25px;
}

.year-text-link {
    text-decoration: none;
    color: #475569; /* 通常時は落ち着いたグレー */
    font-size: 1rem;
    font-weight: bold;
    transition: color 0.2s ease;
}

.year-text-link:hover,
.year-text-link.active {
    color: #2563eb; /* アクティブ・ホバー時は鮮やかな青 */
}

/* ページタイトルエリア */
.page-title-section {
    text-align: center;
    margin-bottom: 50px;
}

.page-title {
    font-size: 2.2rem;
    color: #0f172a;
    font-weight: 800;
    margin-bottom: 12px;
}

.title-underline {
    width: 40px;
    height: 3px;
    background-color: #3b82f6;
    margin: 0 auto;
    border-radius: 2px;
}

/* 3×3のグリッドレイアウト */
.unit-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    max-width: 960px; /* 画像のすっきりした縦長比率に合わせるため少しタイトに調整 */
    margin: 0 auto;
}

/* 単元カードのスタイリング */
.unit-card {
    background: #ffffff;
    border: 1px solid #f1f5f9; /* より繊細で細い境界線 */
    border-radius: 12px;
    padding: 35px 25px 25px 25px;
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.01), 0 2px 4px -1px rgba(0, 0, 0, 0.01);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.unit-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 20px -5px rgba(0, 0, 0, 0.05);
}

/* 単元カード内アイコン */
.unit-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 25px auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.unit-icon svg {
    width: 100%;
    height: 100%;
}

.unit-card h3 {
    font-size: 1.25rem;
    color: #1e293b;
    font-weight: 700;
    margin-bottom: 25px;
}

/* 単元カード用ボタン（長円形・青背景白文字） */
.unit-btn {
    display: inline-block;
    text-decoration: none;
    background-color: #3b82f6;
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 10px 0;
    width: 85%; /* ボタンの横幅をカードに対して少し狭めてスマートに */
    border-radius: 20px;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.unit-btn:hover {
    background-color: #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

/* ==================================================
   詳細分野選択ページ
   probability.html
================================================== */


/* 固定ヘッダーの下にコンテンツが隠れないようにする */
.detail-container {
    padding-top: 110px;
}


/* ------------------------------
   パンくずリスト
------------------------------ */

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 12px;

    max-width: 1180px;
    margin: 0 auto 28px;

    color: #64748b;
    font-size: 0.95rem;
}

.breadcrumb a {
    color: #2563eb;
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.breadcrumb-arrow {
    color: #94a3b8;
}


/* ------------------------------
   ページ上部
------------------------------ */

.detail-hero {
    display: flex;
    align-items: center;
    gap: 28px;

    max-width: 1180px;
    margin: 0 auto 50px;
}


/*
    既存の .unit-icon を再利用しつつ、
    メインアイコンのみサイズと背景を変更
*/
.detail-main-icon {
    flex-shrink: 0;

    width: 100px;
    height: 100px;
    margin: 0;

    padding: 14px;

    background-color: #f8fbff;
    border: 1px solid #dbeafe;
    border-radius: 18px;
}

.detail-label {
    margin-bottom: 5px;

    color: #2563eb;
    font-size: 0.9rem;
    font-weight: 700;
}

.detail-title {
    margin-bottom: 10px;

    color: #0f172a;
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.detail-description {
    color: #475569;
    font-size: 1rem;
    line-height: 1.8;
}


/* ------------------------------
   分野一覧の見出し
------------------------------ */

.detail-unit-section {
    max-width: 1180px;
    margin: 0 auto;
}

.detail-section-heading {
    margin-bottom: 24px;
}

.detail-section-heading h2 {
    color: #0f172a;
    font-size: 1.45rem;
    font-weight: 800;
}

.detail-section-line {
    width: 44px;
    height: 3px;

    margin-top: 10px;

    background-color: #3b82f6;
    border-radius: 999px;
}


/* ------------------------------
   詳細分野のカード一覧
------------------------------ */

/*
    既存の .unit-grid を使用し、
    詳細ページでは4列に上書きする
*/
.detail-unit-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));

    max-width: none;
    gap: 28px;
}


/*
    既存の .unit-card を基本デザインとして使用
*/
.detail-unit-card {
    display: flex;
    flex-direction: column;
    align-items: center;

    min-height: 310px;
    padding: 28px 24px 22px;
}


/*
    カードによってタイトルの文字数や
    説明文の長さが違っても、ボタン位置を揃える
*/
.detail-unit-card .detail-unit-btn {
    margin-top: auto;
}


/* カード内のアイコン */
.detail-card-icon {
    width: 74px;
    height: 74px;

    margin-bottom: 18px;
    padding: 13px;

    background-color: #eff6ff;
    border-radius: 50%;
}


/* 既存の.unit-card h3を一部調整 */
.detail-unit-card h3 {
    min-height: 30px;
    margin-bottom: 12px;

    color: #172554;
    line-height: 1.4;
}


/* カード内の説明文 */
.detail-card-description {
    margin-bottom: 22px;

    color: #64748b;
    font-size: 0.92rem;
    line-height: 1.75;
    text-align: center;
}


/*
    既存の .unit-btn を再利用し、
    矢印を含む横並びにする
*/
.detail-unit-btn {
    display: flex;
    justify-content: center;
    align-items: center;

    position: relative;

    width: 100%;
    padding: 11px 40px 11px 20px;

    background: linear-gradient(
        135deg,
        #3b82f6 0%,
        #1d4ed8 100%
    );

    border-radius: 999px;
}


/* ボタン右側の矢印 */
.detail-arrow {
    position: absolute;
    right: 20px;

    transition: transform 0.2s ease;
}

.detail-unit-btn:hover .detail-arrow {
    transform: translateX(4px);
}


/* ------------------------------
   一覧へ戻るリンク
------------------------------ */

.detail-back-area {
    max-width: 1180px;
    margin: 34px auto 0;
}

.detail-back-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;

    color: #2563eb;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;

    transition:
        color 0.2s ease,
        transform 0.2s ease;
}

.detail-back-link:hover {
    color: #1d4ed8;
    transform: translateX(-3px);
}


/* ==================================================
   詳細分野ページのレスポンシブ対応
================================================== */


/* 小さめのパソコン・タブレット */
@media (max-width: 1050px) {

    .detail-unit-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}


/* スマートフォン */
@media (max-width: 600px) {

    .detail-container {
        padding-top: 100px;
    }

    .breadcrumb {
        margin-bottom: 22px;
        font-size: 0.85rem;
    }

    .detail-hero {
        align-items: flex-start;
        gap: 18px;
        margin-bottom: 38px;
    }

    .detail-main-icon {
        width: 76px;
        height: 76px;
        padding: 10px;
        border-radius: 14px;
    }

    .detail-title {
        font-size: 1.8rem;
    }

    .detail-description {
        font-size: 0.9rem;
        line-height: 1.7;
    }

    .detail-unit-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .detail-unit-card {
        min-height: 290px;
    }

}

.card,
.unit-card {
    opacity: 0;
    translate: 0 30px;

    animation: card-fade-up 0.7s ease-out forwards;

    /* カーソルを載せたときの動き */
    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;
}


/* フェードインアニメーション */
@keyframes card-fade-up {

    from {
        opacity: 0;
        translate: 0 30px;
    }

    to {
        opacity: 1;
        translate: 0 0;
    }

}


/* カーソルを載せたときに少し上げる */
.card:hover {
    transform: translateY(-4px);

    box-shadow:
        0 20px 25px -5px rgba(37, 99, 235, 0.08),
        0 10px 15px -6px rgba(37, 99, 235, 0.06);
}


.unit-card:hover {
    transform: translateY(-4px);

    box-shadow:
        0 12px 20px -5px rgba(15, 23, 42, 0.08),
        0 6px 10px -6px rgba(15, 23, 42, 0.05);
}

/* レスポンシブ対応（タブレット・スマホ用） */
@media (max-width: 900px) {
    .unit-grid {
        grid-template-columns: repeat(2, 1fr); /* 画面が狭くなったら2列に */
        gap: 20px;
    }
}

@media (max-width: 600px) {
    .nav-years-text {
        gap: 15px;
        font-size: 0.9rem;
    }
    .unit-grid {
        grid-template-columns: 1fr; /* スマホでは1列に */
    }
    .page-title {
        font-size: 1.8rem;
    }
}

/* レスポンシブ対応（スマホ表示時に縦並びにする） */
@media (max-width: 768px) {
    .header {
        padding: 20px;
    }
    .main-title {
        font-size: 2.3rem;
    }
    .card-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
    }
}