:root {
  --main-color: #4ea86e;      /* メインの緑 */
  --main-background-color: #fff; /* メインの背景色 */
  --header-font-color: #fff;
  --main-font-color: #333;
  --main-visited-color: #999;
  --grid-color: #f0f0f0;      /* 方眼の線の色 */
  --header-height-pc: 70px;   /* ヘッダーの高さ（PC） */
  --header-height-sp: 50px;   /* ヘッダーの高さ（スマホ） */
}

.dark-theme {
  --main-color: #1c7c4f;      /* メインの緑 */
  --main-background-color: #333;
  --grid-color: #3a3a3a;      /* 方眼の線の色 */
  --main-font-color: #eee;
  --main-visited-color: #aaa;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 94vh;
  min-height: 94dvh;
  margin: 0;
  font-family: "Zen Kaku Gothic New", sans-serif;
  font-weight: 400;
  color: var(--main-font-color);
  font-style: normal;
  font-size: 16px;
}

/* 方眼紙風の背景をつける */
.box {
  background-color: var(--main-background-color);
  background-image: 
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: 24px 24px;
  padding: 20px;
}

/* メイン */
main {
  flex: 1;
  padding-top: var(--header-height-pc); /* ヘッダーの高さ分だけメインの開始位置を下げる */
}

#main-inner {
  max-width: 960px;
  margin: 0 auto;
}

/* ページタイトル */
h1 {
  font-size: 1.8rem;
  letter-spacing: 0.3rem;  /* 文字間を広げる */
}

/* 検索結果一覧・ニュース一覧 */
h2 {
  font-size: 1.3rem;
  line-height: 1.5;
  font-weight: normal;
  margin-top: 2px;
  margin-bottom: 2px;
}

/* 記事本文 */
.article-text {
  display: flex;
  flex-direction: column; /* 中身を縦に積む */
  align-items: flex-start; /* 左寄せを確実にする */
  gap: 8px;               /* 各行の基本的な間隔 */
  line-height: 1.6;
}

/* 記事内の小見出し */
.mini-title {
  display: block;
  font-weight: bold;
  font-size: 1.2rem;
  margin-top: 16px; /* ブロックごとの上の余白 */
}

/* 最初の mini-title だけ上の余白を消す */
.mini-title:first-child {
  margin-top: 0;
}

/* 記事内の段落 */
.blk {
  display: block;
  margin-bottom: 5px;
}

/* 記事一覧（newsなど） */
.article-list {
  display: flex;
  flex-direction: column;
  margin-top: 40px;
}

/* 記事一覧内の各記事 */
.article-item {
  border-bottom: 1px solid #888;
}

.jnk {
  padding: 10px 0;
}

.article-item a,
.spanlink a,
.scrolling-message a,
.haruka-repo a,
.atogaki a {
  display: flex;
  flex-direction: column;
  padding: 10px 0;
  color: var(--main-font-color);
  text-decoration: none;
  transition: background 0.3s;
}

.article-item a:visited,
.spanlink a:visited,
.scrolling-message a:visited,
.haruka-repo a:visited,
.atogaki a:visited {
  color: var(--main-visited-color);
}

.spanlink {
  display: inline-block;
}

.spanlink a,
.scrolling-message a,
.haruka-repo a,
.atogaki a {
  display: inline-block;
  text-decoration: underline;
  padding: 0;
}

/* ホバー時に少し明るくする */
.article-item a:hover {
  opacity: 0.3;
}

/* 日付 */
.article-date {
  margin: 0;
  color: #777;
  font-size: 0.9rem;
}

/* PDF風 */
.white-pdf {
  background-color: #fff;
  margin-top: 50px;
  padding: 50px;
  border: 2px solid #555;
  border-top: 40px solid #555;
  color: #333;
  font-family: 'Zen Old Mincho', serif;box-shadow: 0 10px 25px rgba(0,0,0,0.7); /* 紙の浮き上がり感 */
  aspect-ratio: 1 / 1.414; /* A4の縦横比 */
}

/* フライヤー */
.flier-paper {
  background-image: linear-gradient(rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.4)), 
                    url('/image/flier.png');
  background-size: cover;
  background-position: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  padding: 0;
  font-family: "Zen Kaku Gothic New", sans-serif;
}

.flier-paper h2 {
  width: 100%;
  background-color: var(--main-color);
  color: var(--header-font-color);
  padding: 50px;
  margin: 0 !important; /* h2タグの余白をリセット */
  text-align: center;
  font-size: 2.2rem;
}

.flier-main {
  flex: 1; /* 残りのスペースをすべて埋める */
  padding: 30px 60px;
  font-size: 1.2rem;
  line-height: 2.2;
  text-align: center;
  align-items: center;
  justify-content: center;
}

.flier-main .blk {
  margin-bottom: 2.5rem; 
  background: rgba(255, 255, 255, 0.5);
  padding: 10px 20px;
  border-radius: 8px;
  line-height: 2.0;
}

.flier-footer {
  background-color: var(--main-color);
  color: var(--header-font-color);
  width: 100%;
  padding: 50px 20px;
  margin: 0 !important; /* pタグの余白をリセット */
  font-size: 1.1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

/* 順位表　横スクロール用コンテナ */
.table-container {
  width: 100%;
  overflow-x: auto;
  margin: 50px 0;
}

/* 順位表 */
.rank-table {
  width: 100%;
  min-width: 500px; /* ある程度の幅を確保 */
  border-collapse: collapse; /* 枠線を一本にまとめる */
}

.rank-table th, 
.rank-table td {
  border: 1px solid var(--header-font-color); /* 枠線の色 */
  padding: 12px 10px;
  text-align: center;
}

/* インタビュー記事内の質問文 */
.question {
  font-weight: bold;
}

/* フッター */
#footer {
  display: flex;
  flex-direction: column;
  margin: 50px auto 0;
  align-items: center;
  font-size: 0.8rem;
  line-height: 2;
  text-align: center;
}

/* レスポンシブ対応 */
@media (max-width: 800px) {
  main {
  padding-top: var(--header-height-sp); /* ヘッダーの高さ分だけメインの開始位置を下げる */
  }

  .article-list {
    margin-top: 20px;
  }

  .white-pdf {
    margin: 20px auto;    /* 画面の中央に配置 */
    overflow-x: auto;
    white-space: nowrap;
    aspect-ratio: auto; /* スマホでは内容に合わせて伸ばす */
    -webkit-overflow-scrolling: touch; /* スムーズなスクロール */
  }

  .flier-paper {
    overflow-x: auto;      /* 内部を横スクロール可能に */
    display: block;        /* flexを解除して左見切れを防止 */
    aspect-ratio: auto;    /* 高さはコンテンツに合わせる */
    text-align: left;      /* 基準を左にする */
  }

  .white-pdf h2,
  .white-pdf p,
  .white-pdf li {
    width: 220%;
    box-sizing: border-box;
    white-space: normal;
  }

  .white-pdf h2 {
    font-size: 1.2rem
  }

  .white-pdf p,
  .white-pdf li {
    font-size: 0.9rem;
  }
}