@charset "utf-8";

/*-------------------------------------
  全体構造と背景
-------------------------------------*/

/* スマホ版でのはみ出し防止（グローバル） */
html {
  overflow-x: hidden;
}

body.news-page {
  /* 全体の背景色（フッターとタイトルヘッダー部分の背景） */
  background: #42392d;
  /* 記事ページ準拠の本文フォントに統一 */
  font-family: "Zen Maru Gothic", serif;
  overflow-x: hidden; /* 横スクロール・はみ出しを防止 */
}

/* main タグ全体の設定 */
body.news-page main {
  background: transparent;
  color: white;
  font-family: "Zen Maru Gothic", serif;
  /* スクリーンショットに合わせて、上部のパディングは削除 */
  padding: 0 0 40px;
}

/* リンクホバー時の色 */
body.news-page a:hover {
  color: #4caf50;
}

/*-------------------------------------
  ページヘッダー (最上部の「最新情報」背景画像付き)
-------------------------------------*/
.title {
  /* 完成イメージの背景画像付きタイトル部分 */
  background-image: url(../img/title.jpg); /* ★画像のパスを調整してください */
  padding: 120px 0 80px 0;
  text-align: center;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.title h1 {
  font-weight: bold;
  letter-spacing: 10px;
  font-size: 2.5rem;
  font-family: "Zen Maru Gothic", serif; /* 見出しはZen Maru */
  color: white;
}

/* 共通見出しのフォントを統一 */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Zen Maru Gothic", serif;
}

/* 本文のベースサイズ＋行間 */
body.news-page {
  font-size: 16px;
  line-height: 1.8;
}

/* モバイルでの文字サイズ最適化 */
@media screen and (max-width: 750px) {
  body.news-page {
    font-size: 15px;
  }
  .title h1 {
    font-size: clamp(1.6rem, 6vw, 2.2rem);
  }
}

/*-------------------------------------
  パンくずリスト
-------------------------------------*/
.breadcrumb {
  width: 100%;
  padding: 0 40px; /* .news-listと同じ左右パディング */
}

.breadcrumb ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 0;
  margin: 10px 0 24px 0; /* .news-headerとの間を開ける */
  border-bottom: 1px solid #c5c5c5;
}

.breadcrumb li {
  font-size: 14px;
  color: #aaa;
}

.breadcrumb li a,
.breadcrumb li a:visited {
  text-decoration: none;
  color: #aaa;
}

.breadcrumb li a:hover {
  color: #4caf50;
}

.breadcrumb li::after {
  content: ">";
  margin: 0 6px;
  color: #aaa;
}

.breadcrumb li:last-child::after {
  content: "";
}

/*-------------------------------------
  コンテンツラッパーとレイアウト
-------------------------------------*/
.news-container-wrapper {
  width: min(1200px, 92vw);
  margin: 0 auto;
  padding: 32px 0 120px;
  display: flex;
  gap: 48px;
  align-items: flex-start;
}

/* ★★★ サイドバーを非表示にし、メインコンテンツを幅いっぱいに広げる ★★★ */
.news-main-content {
  flex: 1 1 100%; /* メインコンテンツが幅全体を占める */
  /* 完成イメージの濃い茶色の背景色 */
  background-color: #42392dfe;
  border-radius: 0; /* 角丸は不要に見えるため削除 */
  padding: 5px 48px 48px 60px;
  box-shadow: 0 12px 35px rgba(80, 64, 40, 0.08);
}

/* ★★★ サイドバーのHTML要素を非表示にする ★★★ */
.news-sidebar {
  display: none !important;
}

/*-------------------------------------
  記事一覧ヘッダー (濃い緑の帯部分)
-------------------------------------*/
.news-header {
  width: 90%;
  color: #fff;
  margin-left: 0;
  padding-top: 10px;
  padding-left: 40px;
  margin-bottom: 15px;
  display: inline-flex; /* テキストの高さに合わせる */
  align-items: center; /* 垂直方向の中央揃え */
}

.news-header::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 1.5em;
  background-color: #4caf50;
  margin-right: 20px;
  border-radius: 2px;
  right: 0;
}

.news-header p {
  font-size: 1rem;
  flex-shrink: 0; /* 縮小しない */
  margin-left: 20px; /* ブログとカテゴリの間にスペースを追加 */
}

.news-header a {
  color: #4caf50; /* 濃い緑の背景に合わせて白に変更 */
  text-decoration: underline;
}

.category-filter {
  /* 右側に「カテゴリー: すべて」を寄せる */
  margin-left: auto;
  align-self: center; /* 垂直方向の中央揃え */
  flex-shrink: 0;
}

.category-select {
  border: 1px solid rgba(255, 255, 255, 0.4); /* 白い枠線に変更 */
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.85rem;
  background: transparent; /* 背景なし */
  color: white;
  appearance: none;
}

/* ラベルと三角形アイコンの分離 */
.category-label {
  margin-right: 8px;
}
.category-select-wrapper {
  position: relative;
  display: inline-block;
}
.category-select-wrapper::after {
  content: "\25BE"; /* ▼ */
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: white;
  pointer-events: none;
}
.category-select {
  padding-right: 36px; /* 逆三角のスペースを確保 */
}

/*-------------------------------------
  記事リスト (news-list)
-------------------------------------*/

.news-item-link {
  text-decoration: none;
  color: inherit;
}

.news-item-link:hover .news-item {
  background: rgba(255, 255, 255, 0.05); /* ホバーで少し明るく */
}

.news-list {
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 0 40px; /* 左右にパディングを追加して内側に寄せる */
}

.news-item {
  padding: 20px 0;
  border-top: rgba(196, 196, 196, 0.5) solid 1px;
  display: flex;
  gap: 24px; /* 画像とテキストの間隔を広げる */
}

.news-item-link:last-child .news-item {
  border-bottom: rgba(196, 196, 196, 0.5) solid 1px;
}

.news-item .news-img img {
  width: 300px;
  height: 200px;
  object-fit: cover;
}

.news-item h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
  line-height: 1.5;
  color: white;
}

/* メタ情報（日付、タグ） */
.news-date {
  font-weight: 700;
  color: #d4d4d4;
  font-size: 0.9rem;
}

.news-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.news-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.news-tag {
  display: inline-block;
  padding: 4px 12px;
  font-size: 0.85rem;
  font-weight: 500;
  color: white;
  white-space: nowrap;
}

/* 抜粋 */
.news-comment {
  margin-top: 10px;
  line-height: 1.7;
  font-size: 1rem;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

/*-------------------------------------
  ページネーション (Paging)
-------------------------------------*/
.pagination-links {
  text-align: center;
  margin-top: 40px;
  padding: 30px 40px 10px;
}

/* リスト形式のページネーション */
.pagination-links ul {
  list-style: none;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0;
  margin: 0;
}

.pagination-links li {
  display: inline-block;
}

.pagination-links .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  padding: 8px 14px;
  border: none; /* 外枠を削除 */
  border-radius: 6px;
  color: white;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.25s ease;
  background: transparent;
}

/* 現在のページ */
.pagination-links .page-numbers.current {
  background: #4caf50;
  color: white;
  font-weight: 700;
}

/* ホバー時（現在ページ以外） */
.pagination-links .page-numbers:not(.current):hover {
  background: transparent;
  color: #4caf50;
}

/* 前へ・次へボタン */
.pagination-links .pagination-prev,
.pagination-links .pagination-next {
  font-size: 0.9rem;
  white-space: nowrap;
}

/* ドット（...） */
.pagination-links .page-numbers.dots {
  border: none;
  background: none;
  min-width: auto;
  padding: 8px 4px;
  color: rgba(255, 255, 255, 0.6);
}

/* モバイル対応 */
@media screen and (max-width: 940px) {
  .pagination-links {
    padding: 20px 16px 10px;
  }

  .pagination-links ul {
    gap: 6px;
  }

  .pagination-links .page-numbers {
    min-width: 38px;
    height: 38px;
    padding: 6px 10px;
    font-size: 0.85rem;
  }

  .pagination-links .pagination-prev,
  .pagination-links .pagination-next {
    font-size: 0.8rem;
  }
}

/* (タグスタイルは前回のものをそのまま使用) */

/*=====================================
  モバイル対応 (画面幅 940px以下)
=====================================*/
@media screen and (max-width: 940px) {
  /* スマホ版でのはみ出し防止（html/bodyのみに適用） */
  html,
  body,
  body.news-page {
    overflow-x: hidden;
    max-width: 100vw;
  }

  /* タイトルセクションのパディング調整 */
  .title {
    padding: 100px 0 30px 0;
  }

  /* ページ全体のパディングを調整 */
  body.news-page main {
    padding: 20px 0;
  }

  /* コンテナ幅 */
  .news-container-wrapper {
    padding: 16px 0 60px; /* 上下のパディングを小さく */
  }

  /* メインコンテンツのパディングを減らす */
  .news-main-content {
    padding: 20px 16px;
    flex: 1 1 100%; /* 幅いっぱいを再度確認 */
  }

  /* 記事一覧ヘッダー (濃い緑の帯) のパディング調整 */
  .news-header {
    /* news-main-content の新しいパディングに合わせて調整 */
    margin: -20px -16px 20px;
    padding: 10px 16px;
    flex-direction: column; /* 縦積みにしてタイトルとテキストを整列 */
    align-items: flex-start;
    gap: 10px;
    position: relative; /* h1::before の基準 */
  }

  /* モバイル時はコンテナの ::before を無効化し、h1 に付与して横に表示 */
  .news-header::before {
    display: none;
  }

  .news-header h1 {
    position: relative;
    padding-left: 20px; /* 緑線ぶんの余白 */
  }

  .news-header h1::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 1.5em;
    background-color: #4caf50;
    border-radius: 2px;
  }

  .news-header h1 {
    font-size: 1.5rem; /* タイトルを小さく */
  }

  .news-header p {
    font-size: 0.9rem;
    margin-left: 0;
  }

  .category-filter {
    /* モバイルでは左寄せにする */
    margin-left: 0;
    align-self: flex-start;
    width: 100%; /* 全幅に広げ、選択しやすいように */
  }

  .category-label {
    font-size: 0.9rem;
  }
  .category-select {
    font-size: 0.95rem;
  }
  .category-select-wrapper::after {
    right: 10px;
  }

  /*-------------------------------------
    記事リストのレイアウト変更
  -------------------------------------*/
  .breadcrumb {
    padding: 0; /* スマホでは.news-listと同じくパディングなし */
  }

  .news-list {
    padding: 0; /* 左右のインデントを解除 */
  }

  /* スマホでもPCと同じ横並びレイアウトを維持 */
  .news-item {
    flex-direction: row; /* 横並びを維持 */
    gap: 12px;
    padding: 16px 0;
  }

  .news-item .news-img {
    flex-shrink: 0; /* 画像が縮まないように */
    width: 120px; /* スマホでは少し小さめに */
  }

  .news-item .news-img img {
    width: 100%;
    height: 80px; /* 縦横比を維持しつつコンパクトに */
    object-fit: cover;
  }

  .news-item h3 {
    font-size: 1rem; /* タイトルを少し小さく */
    line-height: 1.4;
  }

  /* スマホでもタグは日付の横に表示 */
  .news-meta {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }

  .news-date {
    font-size: 0.75rem; /* 日付を小さく */
  }

  .news-tag {
    font-size: 0.7rem; /* タグを小さく */
    padding: 3px 8px;
  }

  .news-comment {
    font-size: 0.85rem; /* 抜粋を小さく */
    line-height: 1.5;
    -webkit-line-clamp: 2; /* スマホでは2行に抑える */
    line-clamp: 2;
  }
}

/* ニュース一覧の行全体をリンク化（タイトルのリンクを広げる） */
.news-item {
  position: relative; /* 子リンクの基準点 */
}

/* タイトル内のリンクをカード全体に広げる */
.news-item h3 a::after {
  content: "";
  position: absolute;
  inset: 0; /* 親要素(.news-item)の全域 */
  width: 100%;
  height: 100%;
  z-index: 1; /* ベースのリンク */
}

.news-item h3 a {
  color: white;
  text-decoration: none;
}
.news-item h3 a:hover {
  text-decoration: underline;
}

/* ニュース一覧の抜粋内リンク（サイドバーや記事内と同じデザインに） */
.news-comment a {
  color: #7ced80;
  text-decoration: under;
  position: relative; /* カード全体のリンクより上に配置 */
  z-index: 10; /* 確実にクリックできるようにする */
  pointer-events: auto; /* クリックイベントを有効化（念の為） */
}

.news-comment a:hover {
  color: #4caf50;
}
