/* -------------------------------------- */
/* 修正後の基本設定とヘッダー */
/* -------------------------------------- */
body {
    font-family: Arial, sans-serif;
    /* エラー修正: magin -> margin */
    margin: 0; 
    padding: 0;
    background-color: #f5f5f5;
}

header, nav ,main, footer{
padding: 1rem;
}


header{
background-color: #333;
color: #fff;
}

nav{
background-color: #333;
color: #fff;
}

nav ul{
list-style: none;
display: flex;
justify-content: space-between;
padding: 0;
margin: 0;
}

nav li a{
color: #fff;
text-decoration:none;
padding: 1rem;
display: block;
}

nav li a:hover{
background-color #999;
}

main{
padding: 1rem
}

article{
background-color: #fff;
padding: 1rem;
margin-bottom: 1rem;
border-radius: 5px;
box-shadow: 2px; @2px; 5px;
rgba(0,0,0,0,3);
}

article h2{
margin-top: 0;
}

footer{
background-color: #666;
color: #fff
margin-top: @1rem;
text-align: center;
}


.card-wrapper {

  display: flex;

  margin-bottom: 24px;


}

img {
width: 200px;
height: 150px;
}

.card {
  display: flex;
  background-color: #e0e0e0;
  flex-direction: column;
  width: 200px;
}

.card-content {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.card-text {
  flex-grow: 1;
}

.card-gap{
  width: 50px;
}

/* -------------------------------------- */
/* カテゴリリンクの修正 (Flexboxの機能を生かす) */
/* -------------------------------------- */
.category-links {
    display: flex;
    flex-wrap: wrap; 
    gap: 20px; 
    justify-content: center; 
    padding: 30px 0;
}

.category-item {
    display: flex;
    align-items: center;
    justify-content: center;
    /* 幅を狭めて、1行に2つ並びやすくする (Flexboxの利点を生かす) */
    width: 240px; 
    height: 60px; 
    
    border: 3px solid #333; 
    border-radius: 30px; 
    text-decoration: none;
    font-size: 1.1em;
    font-weight: bold;
    color: #333;
    transition: background-color 0.3s;
}


/* ホバー時のデザイン（クリック誘導） */
.category-item:hover {
    background-color: #eee;
    color: #000;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

header {
    position: relative;
    width: 100%;
    height: 300px; /* 高さを調整可能 */
    background-image: url('novel-image.jpeg'); /* ヘッダー画像を指定 */
    background-size: cover; /* 画像をヘッダーいっぱいに表示 */
    background-position: center; /* 画像の中心を表示 */
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    font-family: 'Arial', sans-serif;
  }

  /* ヘッダー上のロゴやテキスト */
  header h1 {
    font-size: 3rem;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
    margin: 0;
  }



  /* ヘッダー下にオーバーレイをつけてスタイリッシュ感アップ */
  header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3); /* 半透明の黒オーバーレイ */
    z-index: 1;
  }

  /* ヘッダー内コンテンツはオーバーレイより前面に配置 */
  header > * {
    position: relative;
    z-index: 2;
  }

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px; /* 余白を追加 */
}

@media screen and (max-width: 600px){
    
    
    header {
    position: relative;
    width: 100%;
    height: 300px; /* 高さを調整可能 */
    background-image: url('novel-image.jpeg'); /* ヘッダー画像を指定 */
    background-size: cover; /* 画像をヘッダーいっぱいに表示 */
    background-position: center; /* 画像の中心を表示 */
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    font-family: 'Arial', sans-serif;
  }

  /* ヘッダー上のロゴやテキスト */
  header h1 {
    font-size: 3rem;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
    margin: 0;
  }



  /* ヘッダー下にオーバーレイをつけてスタイリッシュ感アップ */
  header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3); /* 半透明の黒オーバーレイ */
    z-index: 1;
  }

  /* ヘッダー内コンテンツはオーバーレイより前面に配置 */
  header > * {
    position: relative;
    z-index: 2;
  }

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px; /* 余白を追加 */
}


 /* nav ul: 縦並びの親要素 */
    nav ul{
        flex-direction: column; /* リンクを縦に並べる（これが重要） */
        padding: 0; /* paddingをリセット */
        margin: 0;
    }

    /* nav li: 縦並びになったリストアイテム */
    nav li {
        width: 100%; /* 幅を画面いっぱいに広げる */
        text-align: center; /* テキストを中央寄せ */
        box-sizing: border-box; /* パディングを含めて幅100%にする */
    }

    /* nav li a: クリック可能なエリアを広げる */
    nav li a{
        display: block; /* リンクをブロック要素にして li の幅いっぱいに広げる */
        padding: 1rem 0; /* 上下のパディングを維持し、左右は0にする */
        margin-bottom: 0; /* margin-bottomをリセット */
    }

.card-wrapper {
  display: block;
  margin-bottom: 24px;

}

.card {
  display: block;
  background-color: #e0e0e0;
  margin:auto;
}

.card-content {

  flex-direction: column;

}

.card-text {
  flex-grow: 2;
}

.card-gap{
  height:  50px;
}

img {
max-width: 100%;
height: auto;
}

   /* ... navの修正など ... */

    /* .category-links 全体の幅は設定不要（画面いっぱいを使うため） */
    .category-links {
        /* widthとheightの指定を削除 */
        gap: 15px; /* 縦の隙間を少し狭める */
        padding: 20px 0;
    }
    
  .category-item {
        /* スマホ画面の90%の幅に設定し、中央に配置 */
        width: 90%; 
        height: 50px;
        /* 中央寄せは親要素の justify-content: center; が有効なため、marginは不要です */
        display: flex;
    　　flex-wrap:wrap;
    }

 .site-header {
       height: 160px; /* 高さを少し低くしてコンテンツにスペースを空ける */
       padding: 10px;
    }
    
    .site-title {
        /* h1 もしくは .site-title のフォントサイズを調整 */
        font-size: 1.8rem; 
    }

    .site-description {
        /* 説明文のフォントサイズを小さく */
        font-size: 0.8rem;
    }


}