body {
    /*font-family: 'M PLUS Rounded 1c', sans-serif; /*これを追加！ */
    /*font-family: 'Lato', 'Noto Sans JP', sans-serif; /* これを追加！ */
    
  font-family: "Zen Maru Gothic", sans-serif;
  font-weight: 500;
  font-style: normal;
    /* margin: 20px; */
    margin: 0; /* bodyのデフォルトマージンをなくす */
    padding: 0; /* bodyのデフォルトパディングも念のためなくす */
    background-color: #e9ecef; /* 少し落ち着いた背景色 */
    color: #333;
    
}
#scrollToTopBtn {
    display: none; /* 最初は非表示 */
    position: fixed; /* 画面に固定 */
    bottom: 20px; /* 画面下から20px */
    right: 20px; /* 画面右から20px */
    z-index: 99; /* 他の要素より手前に */
    border: none; /* ボーダーなし */
    outline: none; /* フォーカス時のアウトラインなし */
    background-color: rgba(0, 0, 0, 0.5); /* 半透明の黒背景 */
    color: white; /* 文字色 */
    cursor: pointer; /* マウスオーバーでカーソルをポインターに */
    padding: 15px; /* パディング */
    border-radius: 10px; /* 角を丸く */
    font-size: 18px; /* フォントサイズ */
     transition: background-color 0.3s, opacity 0.3s, transform 0.5s ease-in-out;
}


/* hoverの設定 */

#scrollToTopBtn:hover {
    background-color: rgba(97, 167, 124, 0.6); /* ホバー時の背景色 */
    opacity: 1; /* ホバー時に不透明にしたい場合など */
    transform: rotateY(360deg); /* ホバー時の回転 */
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #005b36;
}

h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #0056b3;
}


/* headerの基本スタイル */
.site-header {
    background-color: #a8d1da; /* 優しい水色 */
    color: #333; /* 文字色は少し濃いめに */
    padding: 15px 0;
  
    border-bottom: 3px solid #ffffff; /* 少し濃いめの優しい青 */
    margin-bottom: 30px;
    width: 100%;
    
    
}

.header-container {
    /* max-width: 1200px; */
    /* margin: 0 auto; */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.site-title {
    margin: 0;
    font-size: 2.8em;
    font-weight: bold;
    letter-spacing: 1px;
    color: #fff;
}

/* ナビゲーションメニューのスタイル */
.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

.main-nav li {
    margin-left: 25px;
}

.main-nav a {
    color: #333; /* リンクの色もサイト名に合わせて調整 */
    text-decoration: none;
    font-weight: 500;
    font-size: 1em;
    transition: color 0.3s ease;
}

.main-nav a:hover {
    color: #555; /* ホバー時に少し濃い色に */
}

/* メインコンテンツ全体のグリッドレイアウト！ */
.main-content-grid {
    display: grid;
    /* 1fr はお知らせ、3fr はカードグリッドのエリア */
    /* この比率は表示を見ながら調整してもいいな。例えば、250px 1fr とか */
    grid-template-columns: 1fr 3fr; 
    gap: 30px; /* グリッド間の隙間 */
    max-width: 1200px; /* サイト全体の最大幅に合わせて調整だぜ */
    margin: 30px auto; /* 上下の余白と中央寄せ */
    padding: 0 20px; /* 左右のパディング */
}



/* お知らせセクションのスタイル */
.update-section {
    background-color: #fff;
    border: 1px solid #cce5ff;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

.update-section h3 {
    color: #0056b3;
    margin-top: 0;
    margin-bottom: 15px;
    text-align: center;
    font-size: 1.5em;
}

.update-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.update-section li {
    padding: 10px 0;
    border-bottom: 1px dashed #eee;
    font-size: 0.95em;
    color: #555;
}

.update-section li:last-child {
    border-bottom: none; /* 最後の項目は下線なし */
}

.update-section .update-date {
    font-weight: bold;
    color: #0056b3;
    margin-right: 10px;
    white-space: nowrap; /* 日付が改行されないように */
}


@media screen and (max-width: 768px) {
    .main-content-grid {
        grid-template-columns: 1fr; /* スマホでは縦並び */
        gap: 20px;
        padding: 0 15px; /* スマホでは左右のパディングを少し狭め */
    }

    /* ★お知らせエリアの位置はそのまま維持する（order: 1 で上部表示）★ */
    .update-section {
        order: 1; 
    }

    .card-area-wrapper { /* カードエリア全体を移動 */
        order: 2; 
    }
    
    /* ヘッダーコンテナのレイアウトを縦並びにする */
    .header-container {
        flex-direction: column; /* 要素を縦に並べる */
        align-items: center; /* 縦並びの時に中央揃え */
        text-align: center; /* テキストも中央揃え */
        
        /* ★修正点1: 幅を100%に設定し、子要素が広がるようにする★ */
        width: 100%;
        box-sizing: border-box; /* paddingを含めた幅を100%にする */
        padding: 0 15px; /* 左右のパディングをモバイル用に調整 */
    }

    /* サイト名のマージンを調整 */
    .site-title {
        margin-bottom: 15px; 
        font-size: 2em; 
    }

    /* ★修正点2: .main-nav も幅を100%にする★ */
    /* これが無いと、flex-direction: column の影響で幅が制限される可能性がある */
    .main-nav {
        width: 100%;
    }

   /* ナビゲーションリスト (ul) をCSS Gridで2列にする */
    .main-nav ul {
        display: grid; 
        grid-template-columns: repeat(2, 1fr); 
        gap: 8px; 
        
        padding: 0; 
        list-style: none; 
        
        /* ★修正点3: 親要素が100%になったので、こちらも100%に設定★ */
        width: 100%;
        max-width: none; 
        margin: 0 auto 10px auto; 
    }

    /* リスト項目 (li) の調整 */
    .main-nav li {
        margin: 0; 
        text-align: center; 
    }

    /* リンク (a) のスタイル調整 */
    .main-nav a {
        display: block; 
        padding: 8px 5px; 
        font-size: 0.9em; 
        text-decoration: none;
        
        border: 1px solid #a8d1da; 
        border-radius: 5px;
        background-color: #ffffff;
        transition: background-color 0.3s;
    }
    
    .main-nav a:hover {
        background-color: #f0f0f0;
    }
}
/* ↑↑↑ ここまでスマホ対応のメディアクエリ ↑↑↑ */

/* ==================================== */
/* ★ タブレット対応（769px ～ 1000px） ★ */
/* ==================================== */

@media screen and (min-width: 769px) and (max-width: 1000px) {
    /* ヘッダーコンテナ（ロゴとメニュー）は横並びを維持 */
    .header-container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        width: 90%; /* 幅を少し広げる */
        padding: 10px 0;
    }
    
    /* サイトタイトルを少し小さく */
    .site-title {
        font-size: 2.2em;
    }

    /* ナビゲーションコンテナ */
    .main-nav {
        /* ここでメニューの幅を制限し、折り返しを誘発する */
        max-width: 380px; /* 4項目が2列に収まる程度の幅に制限 */
        width: 50%; /* ロゴとのバランス調整 */
    }

    /* ナビゲーションリスト (ul) をCSS Gridで2列にする */
    .main-nav ul {
        display: grid;
        grid-template-columns: repeat(2, 1fr); /* 2列を均等幅に設定 */
        gap: 8px; /* 項目間の隙間 */
        
        /* PC用のflex設定を上書き */
        list-style: none;
        padding: 0;
        margin: 0;
        
        /* 項目を右寄せにするために、ul自体は左寄せのままにしておく */
    }

    /* リスト項目 (li) の調整 */
    .main-nav li {
        margin: 0; /* PC用のマージンをリセット */
        text-align: center;
    }
    
    /* リンク (a) のスタイル調整 */
    .main-nav a {
        padding: 8px 5px; 
        font-size: 0.95em;
        border: 1px solid #a8d1da; 
        border-radius: 5px;
        background-color: #ffffff;
        display: block;
    }

    /* お知らせセクション（左カラム）の調整 */
    .update-section {
        padding: 15px;
    }

    /* カードエリア（右カラム）の調整 */
    .card-area-wrapper { min-height: 0;
    }

    /* カードグリッド自体の調整 */
    .card-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
        gap: 15px; /* 隙間調整 */
    }

    h2 {
        font-size: 1.8em;
    }
   
    
    .header-container {
        padding: 0 10px; /* 左右のパディング */
    }
}

/* 新しく追加したカードエリア全体のラッパー */
.card-area-wrapper{
  min-height: 0;
    
} 


/* .card-grid のスタイル */
.card-grid {
    display: grid;
    /* 最小280px、最大1frで自動調整 */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
    gap: 15px;
    padding: 10px;
}


/* #year-filter のスタイル */
#year-filter {
    /* 枠のスタイル */
    border: 2px solid #7cbcdb; /* 優しめの青色の枠 */
    border-radius: 8px; /* 角を少し丸くする */

    /* 背景色 */
    background-color: #f0f8ff; /* 優しい水色っぽい背景 */

    /* 文字の色とサイズ */
    color: #333; /* 文字の色 */
    font-size: 1em; /* 文字の大きさ */
    padding: 10px 15px; /* 内側の余白 */
    font-family: "Zen Maru Gothic", sans-serif;

    /* カーソルを合わせた時の変化（任意） */
    transition: all 0.3s ease; /* ホバー時のアニメーション */
    cursor: pointer;
}

#year-filter:hover {
    border-color: #5a9bd4; /* ホバー時に枠の色を濃くする */
    background-color: #e0f0ff; /* ホバー時に背景色を少し変える */
}


.card {
    background-color: #fff;
    border: 1px solid #cce5ff; /* 明るい青のボーダー */
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* 影を強調 */
    padding: 20px;
    text-align: center;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out; /* ホバーエフェクト */
}

.card:hover {
    transform: translateY(-5px); /* 少し浮き上がる */
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2); /* 影をさらに強調 */
}

.card h2 {
    margin-top: 0;
    color: #0056b3;
    font-size: 1.5em;
    margin-bottom: 10px;
}

.card p {
    color: #666;
    font-size: 0.9em;
    min-height: 40px; /* カード内のテキストの高さを揃える */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: left;
}

.view-details {
    background-color: #4f5152;
    opacity: 60%;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px; /* 角を丸く */
    cursor: pointer;
    font-size: 1em;
    margin-top: 15px;
    transition: background-color 0.3s ease;
}

.view-details:hover {
    background-color: #0056b3;
}

/* モーダル関連のスタイル */
.modal {
    display: none; /* 最初は非表示 */
    position: fixed; /* 画面全体を覆う */
    z-index: 1000; /* 他の要素より手前に表示 */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; /* コンテンツがはみ出たらスクロール可能に */
    background-color: rgba(0, 0, 0, 0.6); /* 半透明の黒を少し濃く */
    /*display: flex; Flexboxで中央寄せ*/
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #fefefe;
    padding: 30px;
    border-radius: 10px;
    width: 90%; /* モーダルの幅を少し広めに */
    max-width: 600px; /* 最大幅を設定 */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: fadeIn 0.3s ease-out; /* アニメーションを追加 */
    text-align: left; /* 左寄せ */
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

#imageModal {
    /* 画像が拡大して、このdivからはみ出したらスクロールできるようになる */
    overflow: auto; 
    
    
    max-height: 70vh; /* または 400px など具体的なピクセル値 */
    
    /* その他、画像とボタンの配置を整えるためのスタイル*/
    margin-top: 20px; /* 他のテキスト要素との間に余白 */
    padding: 10px; /* 内側の余白 */
    background-color: #eee; /* 分かりやすいように背景色 */
    border-radius: 8px; /* 角を丸く */
}

#modalImage {
    /* 画像自体も親要素からはみ出さないように初期設定しておく */
    max-width: 100%; 
    height: auto; /* アスペクト比を維持 */
    display: block; /* 余計な余白をなくすため */
    margin: 0 auto; /* 中央寄せ */
}

.close-button {
    color: #999;
    float: right;
    font-size: 32px;
    font-weight: bold;
    position: absolute; /* モーダルコンテンツの右上に配置 */
    top: 10px;
    right: 20px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-button:hover,
.close-button:focus {
    color: #333;
}

#modal-term {
    color: #0056b3;
    font-size: 1.8em;
    margin-bottom: 10px;
}

#modal-meaning {
    font-size: 1.1em;
    color: #555;
    margin-bottom: 15px;
}

#modal-explanation {
    font-size: 1em;
    line-height: 1.6;
    color: #444;
}

/* フッターの基本スタイル */
.site-footer {
    background-color: #a8d1da; /* ヘッダーと同じ色とか */
    color: #333; /* 文字色 */
    padding: 20px 0;
    text-align: center; /* 中央寄せ */
    margin-top: 50px; /* 上との余白 */
    border-top: 3px solid #ffffff; /* ヘッダーと似たボーダー */
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.site-footer p {
    margin: 0;
    font-size: 0.9em;
}

/* フッター内のナビゲーションがあれば */
.site-footer .footer-nav ul {
    list-style: none;
    padding: 0;
    margin-top: 10px;
}

.site-footer .footer-nav li {
    display: inline;
    margin: 0 10px;
}

.site-footer .footer-nav a {
    color: #333;
    text-decoration: none;
}

.site-footer .footer-nav a:hover {
    text-decoration: underline;
}


/* テキスト内に埋め込まれた時事用語のリンクスタイル */
.timeline-term-in-text {
    font-weight: 700;
    color: #3f51b5; /* 用語を強調 */
    cursor: pointer;
    text-decoration: underline; /* 下線をつけてリンクだと示す */
}

.timeline-term-in-text:hover {
    color: #ff9800; /* ホバーで色を変えてフィードバック */
}


/* ==================================== */
/* ★ タイムライン（年表）のデザイン - PC/タブレット ★ */
/* ==================================== */

/* 【修正点1：マージンの修正】 main-content-timelineに左右パディングを追加 */
.main-content-timeline {
    padding: 0 10px; 
}

.timeline-table {
    width: 96%; /* 左右に余白を持たせる */
    max-width: 1000px; /* ここまでは中央寄せ */
    margin: 30px auto;
    border-collapse: collapse; 
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background-color: #fff;
}

.timeline-table tbody tr {
    transition: background-color 0.3s;
    /* ★修正点1: 行全体のクリックカーソルを削除★ */
    cursor: default; /* または、この行自体を削除 */ 
}

/* ホバー時のハイライトは残す（これがクリック可能と誤解される可能性があるが、今回は残す前提） */
.timeline-table tbody tr:hover {
    background-color: #f0f4ff; 
}

.timeline-table tbody td {
    padding: 10px 15px;
    border: 1px solid #eee;
    vertical-align: top;
    line-height: 1.6;
}

/* 年代のセル */
.timeline-year {
    width: 20%; 
    min-width: 80px;
    max-width: 150px;
    text-align: center;
    font-weight: 700;
    background-color: #c9e8f3;
}

/* 用語のセル（残りの幅を取る） */
.timeline-term {
    width: 80%;
    text-align: left;
}

/* 【用語名と概要のスタイル】 */
/* ここには、クリック可能だと分かるようにカーソルを残す */
.timeline-term-name {
    /* ... (その他のスタイル) ... */
    cursor: pointer; /* ★修正点2: クリックできる要素には残す★ */
}

/* テキスト内に埋め込まれた時事用語のリンクスタイル */
.timeline-term-in-text {
    /* ... (その他のスタイル) ... */
    cursor: pointer; /* ★修正点3: クリックできる要素には残す★ */
}
/* ==================================== */
/* ★ スマホ対応（PCスタイル維持＋幅縮小） - 修正版 ★ */
/* ==================================== */

@media screen and (max-width: 768px) {
    /* 【修正点2：モバイル時の幅を画面いっぱいに】 */
    .timeline-table {
        width: 98%; /* 左右のわずかな余白を残す */
        margin: 20px auto; 
    }
    
    /* 【修正点3：display: blockなどの縦積みロジックをすべて削除】 */

    /* 【修正点4：文字サイズを少し調整し、狭い幅に対応】 */
    .timeline-table thead th {
        padding: 8px 10px;
        font-size: 1.0em;
    }

    .timeline-table tbody td {
        padding: 8px 10px;
    }

    .timeline-year {
        width: 20%; /* 幅の割合は維持 */
        min-width: 60px; /* 最小幅も少し狭く */
    }
    
    .timeline-term {
        width: 80%; /* 幅の割合は維持 */
    }

    .timeline-term-name {
        font-size: 1.0em;
        margin-bottom: 2px;
    }

    .timeline-description-summary {
        font-size: 0.8em; /* 概要を小さくしてスペースを確保 */
    }
}