@charset "utf-8";

/* ===== ベース設定 ===== */
html {
  font-size: 100%;
}

body {
  font-family: 'Noto Sans JP', 'Meiryo', 'メイリオ', sans-serif;
  width: 100%;
  background-color: #f4f9f4;
  color: #2e4d3c;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ===== ヘッダー ===== */
header {
  background-color: #a3c9a8;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

header h1 img {
  padding: 5px 0px 5px 0px;
  display: block;
  margin: auto;
}

/* ===== フッター ===== */
footer {
  background-color: #c1d0c7;
  text-align: center;
  padding: 5px 0px 70px 0px;
  color: #2e4d3c;
}

footer small {
  color: #555;
}

/* ===== 下部ナビ（スマホ表示用） ===== */
#bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-around;
  align-items: center;
  background-color: #6da06d;
  border-top: 1px solid #c1d0c7;
  padding: 15px 0;
  z-index: 1000;
}

#bottom-nav button,
#bottom-nav a {
  background: none;
  border: none;
  font-size: 1rem;
  color: #fff;
  text-decoration: none;
}

/* ===== ドロワー（共通） ===== */
.drawer {
  position: fixed;
  top: 0;
  width: 300px;
  height: 100%;
  background: white;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
  padding: 20px;
  overflow-y: auto;
  z-index: 1001;
  transition: transform 0.3s ease;
}

/* 左（メニュー）ドロワー */
.drawer.left {
  left: 0;
  transform: translateX(-100%);
}

/* 右（サイドバー）ドロワー */
.drawer.right {
  right: 0;
  transform: translateX(100%);
}

/* 表示時クラス */
.drawer.open.left {
  transform: translateX(0%);
}
.drawer.open.right {
  transform: translateX(0%);
}

/* ===== オーバーレイ ===== */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.4);
  z-index: 999;
}
.overlay.hidden {
  display: none;
}

/* ===== プロフィール／お問い合わせ/サイトポリシー ===== */
.profile-box {
  margin-top: 20px;
  text-align: center;
}
.profile-img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
}
.profile-text {
  font-size: 0.9rem;
  color: #2e4d3c;
  margin-top: 10px;
}

.contact-wrapper {
  margin-top: 30px;
  text-align: center;
}

.contact-link {
  display: inline-block;
  background-color: #a3c9a8;
  color: white;
  padding: 10px;
  border-radius: 6px;
  text-decoration: none;
  transition: background-color 0.3s ease;
  margin: 20px 0px;
}
.contact-link:hover {
  background-color: #6da06d;
}

/* ===== サイドバー記事表示（人気・新着） ===== */
#sidebar-drawer h4 {
  font-size: 2em;
  color: #2e4d3c;
  border-bottom: 5px solid #4CAF50;
  margin-top: 50px; 
}

#sidebar-drawer h4:first-of-type {
  margin-top: 0;
}

/* リストの上下余白と整列調整 */
#popular-list li,
#random-list li,
#latest-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #e0eee0;
  padding: 10px 0px 10px 10px;
}

/* サムネイル */
.thumb-img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

/* タイトル＋日付ブロック */
.text-block {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* タイトル */
.sidebar-title {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.3;
  color: #2e4d3c;
  margin-bottom: 4px;
}

/* 日付 */
.sidebar-date {
  font-size: 0.7rem;
  color: #888;
}

/* アーカイブとカテゴリ */
/* === セクション共通（見出し）=== */
.archive-wrapper, .category-wrapper {
  padding: 30px 0px;
}

.archive-wrapper h4,
.category-wrapper h4 {
  font-size: 1.1rem;
  font-weight: bold;
  margin-bottom: 12px;
  color: #2c3e50;
  border-bottom: 2px solid #4CAF50;
  padding-bottom: 4px;
}

.archive-wrapper a .count,
.category-wrapper a .count {
  display: block;
  font-size: 0.9em;
  color: #666;
  margin-top: 2px;
  line-height: 1.2;
  text-align: right;
}

.category-wrapper a .count {
  display: block;
  font-size: 0.9em;
  color: #666;
  margin-top: 2px;
}
.category-wrapper button#sort-toggle {
  font-size: 0.9em;
  padding: 4px 8px;
  cursor: pointer;
}

/* === リストスタイル === */
.month-archive,
.category-auto {
  list-style: none;
  padding-left: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* === 各リンク（カード風）=== */
.month-archive li a,
.category-auto li a {
  display: block;
  background-color: #f8f8f8;
  color: #333;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 0.95rem;
  text-decoration: none;
  box-shadow: 1px 1px 3px rgba(0,0,0,0.05);
  transition: all 0.2s ease-in-out;
}

.month-archive li a::before {
  content: "🕒 ";
  margin-right: 6px;
}

.category-auto li a::before {
  content: "🏷️ ";
  margin-right: 6px;
}

/* === ホバー効果 === */
.month-archive li a:hover,
.category-auto li a:hover {
  background-color: #e0f7e9;
  color: #1b5e20;
  transform: translateX(4px);
}

/* PHP */
.page-title {
  text-align: center;
  margin: 0 auto 10px;
  padding: 30px 0px;
  font-size: 1.5em;
  line-height: 1.4;
}

/* メニュー開閉のアニメーション追加 */
.drawer {
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.drawer.left {
  transform: translateX(-100%);
}
.drawer.left.open {
  transform: translateX(0);
}
.drawer.right {
  transform: translateX(100%);
}
.drawer.right.open {
  transform: translateX(0);
}

.overlay {
  transition: opacity 0.3s ease;
  opacity: 0;
  pointer-events: none;
}
.overlay:not(.hidden) {
  opacity: 1;
  pointer-events: auto;
}

/* スクロールのカクつきを防ぐために改善 */
.related-list li {
  opacity: 0;
  transition: opacity 0.4s ease;
  min-height: 200px; /* 高さ確保（仮） */
}

html.lock-scroll,
body.lock-scroll {
  overflow: hidden !important;
  height: 100%;
  position: relative; /* iOS対応のため必要な場合あり */
}

.related-list li.loaded {
  opacity: 1;
}

/* ===== PC表示時レイアウト調整 ===== */
@media screen and (min-width: 1200px) {
  .drawer.left,
  .drawer.right {
    transform: translateX(0%) !important;
  }

  .overlay {
    display: none !important;
  }

  #bottom-nav {
    display: none;
  }
}