* {
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans JP', "Kiwi Maru", sans-serif;
    margin: 0;
    padding: 0;
    background-color: #629159; /* 背景色 */
    color: #f1f1f1; /* 明るい文字色 */
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../images/bg.png');
    background-size: cover;
    background-position: center center;
    background-repeat: repeat; /* 背景画像を繰り返し表示 */
    background-attachment: scroll; /* スクロールに合わせて背景が動く */
    z-index: -1; /* コンテンツの背後に表示 */
}
body, html {
    overflow-x: hidden;
    width: 100%;
    height: 100%;
}
/* 追従するトップメニュー */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.8); /* 半透明の黒 */
    color: white;
    padding: 0px 0; /* 上下の余白を狭くする */
    text-align: center;
    z-index: 100;
    display: flex; /* Flexboxを使用してアイテムを並べる */
    justify-content: center; /* 横並び */
    align-items: center; /* アイテムを縦方向に中央揃え */
    height: auto; /* 高さを自動調整 */
}

nav a {
    color: white;
    padding: 14px 20px;
    text-decoration: none;
    font-size: 18px;
    font-weight: bold;
}

nav a:hover {
    background-color: #4b7a41; /* 濃い緑 */
}

/* ハンバーガーアイコン */
.hamburger-icon {
    display: none; /* デスクトップでは非表示 */
    cursor: pointer;
    font-size: 30px;
    color: white;
    position: absolute; /* アイコンを固定位置に配置 */
    right: 20px; /* 右端に配置 */
    top: 10px; /* 上端に配置 */
    background-color: rgba(0, 0, 0, 0.5); /* 黒で50%透過の背景 */
    padding: 10px; /* アイコン周りの余白 */
    border-radius: 5px; /* 角を丸める */
    pointer-events: auto; /* アイコンがクリックできるように */
    z-index: 1001; /* メニューの上に表示 */
}

/* モバイル向けの最適化 */
@media (max-width: 768px) {
    /* メニューアイテムを非表示にする */
    .nav-links {
        display: none;
        list-style: none;
        width: 100%;
        text-align: left; /* 左寄せに変更 */
        padding: 0; /* 上下の余白をなくす */
    }

    /* ハンバーガーアイコンの表示 */
    .hamburger-icon {
        display: block; /* モバイルで表示 */
        right: 20px; /* 右端に固定 */
        top: 10px; /* 上端に配置 */
    }

    /* メニューが表示された時に適用する */
    .nav-links.show {
        display: block;
        width: 100%; /* メニュー幅を100%に広げる */
    }

    /* メニュー項目を縦に並べる */
    .nav-links li {
        width: 100%;
    }

    .nav-links a {
        display: block;
        padding: 12px 20px;
        font-size: 16px;
    }
}
/* フッター */
footer {
    text-align: center;
    padding: 20px;
    background-color: #1b2a1f; /* ダークグリーン */
    color: white;
    font-size: 0.9rem;
    margin-top: 40px;
}

/* リンクの色 */
footer a {
    color: #a1c349;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}
/* フッターのスタイル */
.footer {
    background-color: black; /* 背景色を黒に */
    padding: 20px 0;
    text-align: center; /* リンクを中央揃え */
}

.footer-container {
    max-width: 1200px; /* 最大幅を1200pxに設定 */
    margin: 0 auto; /* 中央に配置 */
    padding: 0 20px; /* 左右に少し余白 */
}

.footer-links {
    list-style: none; /* リストマーカーを削除 */
    padding: 0;
    margin: 0;
    display: flex; /* 横並びに */
    flex-wrap: wrap; /* 画面幅に応じて折り返し */
    justify-content: center; /* 中央揃え */
}

.footer-links li {
    margin: 10px 15px; /* リンク間に適切なマージンを設定 */
}

.footer-link {
    text-decoration: none; /* 下線を消す */
    color: white; /* 文字色を白に */
    font-size: 1.2rem;
    transition: color 0.3s ease-in-out; /* ホバー時の色変更をスムーズに */
}

.footer-link:hover {
    color: #a1c349; /* ホバー時に色を変更 */
}

.copyright {
    margin-top: 20px; /* 上に少し余白 */
    color: white; /* 文字色を白に */
    font-size: 1rem; /* 少し小さめのフォント */
}
/* モバイル用の最適化 */
@media (max-width: 768px) {
    .footer-links {
        display: block; /* リンクを縦並びに */
        margin-top: 20px; /* 上に少し余白を追加 */
    }

    .footer-links li {
        margin: 10px 0; /* リンク間に少し余白を追加 */
    }

    .footer-link {
        font-size: 1.1rem; /* モバイルでは少し小さく */
        margin-bottom: 10px; /* ボタンの下に少し余白 */
    }

    .copyright {
        font-size: 0.9rem; /* モバイルでは少し小さく */
        margin-top: 30px; /* 上に余白を追加 */
    }
}
/* メインコンテンツ */
.main-content {
    display: flex; /* フレックスレイアウト */
    justify-content: space-between;
    margin: 30px 120px; /* 両側のマージン */
    gap: 20px; /* サイドバーとメインコンテンツの間隔 */
}

.articles {
    flex: 3; /* メインコンテンツは3/4の幅 */
    display: grid; /* グリッドレイアウト */
    grid-template-columns: repeat(2, 1fr); /* 2列のレイアウト */
    gap: 20px;
}

.sidebar {
    flex: 1; /* サイドバーは1/4の幅 */
    background-color: #ffffff;
    padding: 25px;
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.1);
    border-radius: 15px;
}

/* 記事のスタイル */
article {
    background-color: #f0f0f0;
    padding: 25px;
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
    border-radius: 15px;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

article img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    margin-bottom: 15px;
}

article h2 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: #1e2a23;
    font-family: 'Arial', sans-serif;
}

article p {
    font-size: 1rem;
    color: #666;
    margin-bottom: 15px;
    flex-grow: 1;
}

article a {
    text-decoration: none;
    color: #ffffff;
    font-weight: bold;
    padding: 10px 15px;
    border-radius: 5px;
    background-color: #58a55d;
    transition: background-color 0.3s ease;
    align-self: flex-start; /* ボタンを左に寄せる */
}

article a:hover {
    background-color: #40693e;
}

article:hover {
    transform: translateY(-8px); /* ホバー時に浮き上がる */
}


/* ヘッダー */
header {
    color: #f1f1f1;
    padding: 40px;
    text-align: center;
    border-bottom: 5px solid white;
}

header h1 {
    font-size: 3.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px black;
}

header h2 {
    font-size: 2.2rem;
    color: #f1f1f1;
    font-weight: normal;
    margin-top: 10px;
}
header p{
  font-size: 1.2rem;
  text-shadow: 1px 1px 2px black;
}

.topp {
    margin-top: 100px;
}

/* モバイル向けスタイル */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column; /* モバイルでは1列に変更 */
        margin: 20px;
    }

    .articles {
        grid-template-columns: 1fr; /* モバイルでは1列に変更 */
    }

    header h1 {
        font-size: 2rem;
    }

    header h2 {
        font-size: 1.8rem;
    }
    header p{
      font-size: 0.8rem;
    }

    .topp {
        margin-top: 20px;
    }
}

@media (max-width: 480px) {
    article h2 {
        font-size: 1.6rem;
    }

    article p {
        font-size: 1rem;
    }

    article a {
        font-size: 1rem;
    }

}
/* サイドバーの基本設定 */
.sidebar {
    background-color: white;
    padding: 20px;
    width: 250px;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
    color: #333;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.1); /* サイドバーに軽い影を追加 */
    border-radius: 8px;
}

/* カテゴリごとに囲む */
.sidebar h3 {
    background-color: #CCFFA0;
    padding: 12px;
    border-radius: 6px;
    margin: 0 0 15px 0;
    text-align: center;
    font-size: 1.3em;
    font-weight: bold;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1); /* カテゴリヘッダーに影を追加 */
}

/* カテゴリ内のリスト */
.sidebar ul {
    padding: 0;
    list-style: none;
    margin: 0;
}

/* 各リンクのスタイル */
.sidebar ul li {
    margin-bottom: 12px;
}

/* リンク */
.sidebar a {
    color: #006600;
    text-decoration: none;
    font-size: 1.1em;
    display: block;
    padding: 8px 0;
    border-bottom: 2px dotted #006600; /* デフォルトで点線を表示 */
    transition: all 0.3s ease; /* スムーズなホバー効果 */
}

/* リンクにホバー時の効果 */
.sidebar a:hover {
    color: #00cc00;
    border-bottom: 2px solid #00cc00; /* ホバー時に点線から太い線に変更 */
    padding-left: 10px; /* 左に少し余白を追加して強調 */
    font-weight: bold; /* ホバー時に文字を太く */
}

/* リンクの色を変更し、ホバー時にスタイルを変更 */
.sidebar a:visited {
    color: #339933;
}

.sidebar a:active {
    color: #004d00;
}

/* リストアイテム間のスペース */
.sidebar ul li a {
    display: block;
    padding: 8px 0;
    font-weight: normal;
}
/* モバイル用サイドバー設定 */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;  /* サイドバーをフルスクリーンにする */
        padding: 10px;  /* 余白を少し減らす */
        box-shadow: none;  /* 影を削除 */
        border-radius: 0;  /* 角丸を削除 */
    }

    .sidebar h3 {
        font-size: 1.1em;  /* 見出しのフォントサイズを小さくする */
        padding: 8px;  /* パディングを減らす */
    }

    .sidebar ul li {
        margin-bottom: 8px;  /* アイテム間の余白を少し小さくする */
    }

    .sidebar a {
        font-size: 1em;  /* リンクのフォントサイズを少し小さくする */
    }
}
