/* notebook.css - 手帳モチーフ専用スタイル */
@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@500;700&family=Zen+Maru+Gothic:wght@400;500;700&display=swap');

:root {
  --bg-color: #fdf2f8; /* 背景色（薄いピンク・机の色） */
  --paper-color: #ffffff; /* 紙の色 */
  --text-main: #374151; /* メイン文字色（濃いグレー、目に優しい） */
  --text-muted: #9ca3af; /* 薄い文字色 */
  --brand: #f472b6; /* 手帳のテーマカラー（ピンク） */
  --brand-light: #fbcfe8;
  --accent: #be185d; /* 濃いピンク枠・文字 */
  --rule-line: #e2e8f0; /* ノートの罫線色 */
}

/* 全体リセット */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-color);
  background-image: 
    linear-gradient(transparent 95%, rgba(244, 114, 182, 0.05) 5%),
    linear-gradient(90deg, transparent 95%, rgba(244, 114, 182, 0.05) 5%);
  background-size: 20px 20px;
  color: var(--text-main);
  font-family: "Quicksand", "Zen Maru Gothic", "Hiragino Maru Gothic ProN", sans-serif;
  line-height: 1.6;
}

/* 非表示ユーティリティ */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0;
}

/* ヘッダー：手帳の表紙・リボン風 */
.site-header {
  background: var(--paper-color);
  border-bottom: 4px solid var(--brand);
  box-shadow: 0 4px 12px rgba(244, 114, 182, 0.15);
  padding: 16px 20px;
  text-align: center;
  position: relative;
  z-index: 10;
}
.site-header a { text-decoration: none; display: inline-block; }
.site-title {
  margin: 0;
  color: var(--accent);
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: 0.05em;
}
.site-subtitle {
  margin: 4px 0 0 0;
  color: var(--brand);
  font-size: 0.85rem;
  font-family: "Quicksand", sans-serif;
  font-weight: 700;
  letter-spacing: 0.1em;
}

/* ページレイアウト（2カラム枠） */
.layout-shell {
  max-width: 1100px; /* ノート800px + サイドバー300px */
  margin: 24px auto;
  padding: 0 16px;
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

/* メインコンテナ：ノート本体 */
.main-content {
  flex: 1;
  min-width: 0;
  padding: 16px 24px;
  background: var(--paper-color);
  border-radius: 8px 16px 16px 8px; /* 右側がページのめくり風 */
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
  position: relative;
}
/* 左のバインダー穴 (PC向け) */
@media (min-width: 768px) {
  .main-content::before {
    content: "";
    position: absolute;
    top: 24px; bottom: 24px; left: 16px;
    width: 14px;
    background-image: radial-gradient(circle, var(--bg-color) 40%, transparent 45%);
    background-size: 14px 36px;
    background-repeat: repeat-y;
  }
  .main-content { padding-left: 56px; }
}

/* 冒頭紹介テキスト */
.site-intro {
  margin-bottom: 32px;
  text-align: center;
}
.site-intro h2 {
  font-size: 1.35rem;
  color: var(--accent);
  margin: 0 0 12px 0;
}
.site-intro p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* パネル（各ブロック） */
.panel {
  margin-bottom: 24px;
}
.panel h2 {
  font-size: 1.25rem;
  color: var(--brand);
  border-bottom: 2px dashed var(--brand-light);
  padding-bottom: 8px;
  margin: 0 0 16px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel h2::before {
  content: "★";
  color: #fca5a5;
  font-size: 1.15rem;
}

/* 月別ジャンプ (インデックスシール風) */
.month-toc {
  display: grid;
  grid-template-columns: repeat(6, 1fr); /* PCは6列に均等割り付け */
  gap: 12px;
  padding: 0;
}
.toc-btn {
  display: block; /* aタグをブロックにして広げる */
  padding: 8px 0;
  text-align: center;
  background: var(--paper-color);
  border: 2px solid var(--brand-light);
  color: var(--accent);
  border-radius: 24px; /* 左右対称の完全な角丸（カプセル風）に変更 */
  font-weight: 800;
  font-size: 1rem;
  text-decoration: none;
  box-shadow: 2px 2px 0 var(--brand-light);
  transition: all 0.2s ease;
}
.toc-btn:hover, .toc-btn:focus {
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 var(--brand);
  border-color: var(--brand);
  background: var(--paper-color);
}

/* 絞り込みセレクト */
.filter-controls {
  display: flex;
  gap: 16px;
}
.filter-controls select,
.filter-controls option {
  padding: 10px 16px;
  border-radius: 8px;
  border: 2px solid var(--brand-light);
  background: var(--bg-color);
  color: var(--text-main);
  font-size: 1rem;
  font-family: "Quicksand", "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "UD Digi Kyokasho NP-R", "UD デジタル 教科書体 NP-R", sans-serif;
  font-weight: bold;
  cursor: pointer;
  outline: none;
  flex: 1;
  transition: border-color 0.2s;
}
.filter-controls select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(244, 114, 182, 0.2);
}

/* リスト部分：罫線ノート風 */
.month-section {
  margin-bottom: 24px;
}
.month-heading {
  font-size: 1.3rem;
  color: var(--text-main);
  background: linear-gradient(transparent 60%, rgba(244, 114, 182, 0.3) 60%);
  display: inline-block;
  padding: 0 6px;
  margin: 0 0 8px 0;
  font-weight: 900;
}
.char-table {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--rule-line);
}
.char-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap; /* スマホでバッジが折り返せるようにする */
  padding: 4px 8px; /* 上下の余白を極限まで削る */
  border-bottom: 1px dashed var(--rule-line);
  gap: 4px 12px;
  line-height: 1.3; /* 行間もギリギリまで詰める */
  transition: background 0.2s ease;
}
.char-row:hover {
  background: rgba(252, 231, 243, 0.4); /* ほんのり色付く */
}
.char-date {
  font-weight: 900;
  font-size: 1rem;
  color: var(--accent);
  width: 48px;
  flex-shrink: 0;
  font-family: "Quicksand", sans-serif;
}
.char-name {
  font-size: 1rem;
  font-weight: 700;
  flex: 1 1 auto;
}
/* バッジ領域をCSS Grid化して文字数によらず縦位置を固定 */
.char-meta {
  display: grid;
  grid-template-columns: 130px 220px; /* 一番長いサンダーボルトエンターテイメントが入るよう事務所側を拡張 */
  gap: 8px;
  justify-content: flex-end; /* PCでは右寄せ */
}
.badge {
  padding: 2px 4px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--paper-color);
  white-space: nowrap;
  
  /* セル幅ピッタリにして文字を中央寄せに統一 */
  width: 100%;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}
.badge-group { background: #f472b6; grid-column: 1; }
.badge-agency { background: #38bdf8; grid-column: 2; }

/* 広告エリア（右サイドバー） */
.right-ad {
  width: 300px;
  flex-shrink: 0;
  padding: 24px;
  background: var(--paper-color);
  border-radius: 12px;
  border: 1px dashed var(--brand-light);
  text-align: center;
  position: sticky;
  top: 24px;
}
.ad-disclosure {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}
.ad-slot { margin-bottom: 24px; }
.ad-buy-links {
  display: flex; gap: 8px; justify-content: center; margin-top: 12px;
}
.ad-buy-link {
  padding: 8px 16px;
  background: var(--paper-color);
  border: 1px solid var(--brand);
  color: var(--brand);
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: bold;
}
.ad-buy-link:hover {
  background: var(--brand);
  color: var(--paper-color);
}

/* フッター */
.site-footer {
  text-align: center;
  padding: 32px 20px;
  margin-top: 60px;
  background: var(--paper-color);
  border-top: 4px solid var(--brand);
  box-shadow: 0 -4px 12px rgba(244, 114, 182, 0.05);
}
.footer-nav {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.footer-nav a {
  color: var(--accent);
  text-decoration: none;
  font-weight: bold;
  font-size: 0.95rem;
}
.footer-nav a:hover { text-decoration: underline; }
.copyright {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
}

/* 画像レスポンシブとA8特有のテキストリンク・トラッキング画像対策 */
.ad-image-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.ad-image-slot a {
  font-size: 0.85rem;
  line-height: 1.4;
  word-break: word-break;
  text-align: center;
}
.ad-image-slot img, .ad-code-area img {
  max-width: 100% !important;
  height: auto !important;
}
/* トラッキングピクセルの非表示化（レイアウト崩れ防止） */
.ad-image-slot img[width="1"][height="1"],
.ad-code-area img[width="1"][height="1"] {
  display: none !important;
}

/* レイアウトが崩れるサイズの時（縦積み） */
@media (max-width: 850px) {
  .layout-shell {
    flex-direction: column;
    padding: 0 12px;
  }
  .main-content {
    margin: 16px 0;
    padding: 20px 16px;
    border-radius: 8px;
  }
  .right-ad {
    width: 100%;
    margin-top: 24px;
    position: static;
  }
}

/* モバイル表示最適化 */
@media (max-width: 600px) {
  .site-header { padding: 12px 16px; }
  .site-title { font-size: 1.5rem; }
  .filter-controls { flex-direction: column; gap: 12px; }
  
  .month-toc {
    grid-template-columns: repeat(4, 1fr); /* スマホは4列に均等割り付け */
    gap: 8px;
  }
  .toc-btn { padding: 6px 0; font-size: 0.9rem; }
  
  .char-row {
    padding: 6px 4px; /* スマホでも横並びを基本にし、上下余白を減らす */
  }
  .char-meta { 
    justify-content: flex-start; /* スマホでは左寄せ */
    grid-template-columns: 105px 190px; /* サンダーボルトエンターテイメント用に拡張 */
    gap: 4px;
    margin-left: 48px; /* 少し左寄りに余裕を持たせる */
    width: auto;
    margin-top: 0;
    margin-bottom: 4px;
  }
  .badge {
    font-size: 0.68rem; /* 長い事務所名が収まるよう全体的に少しだけ小さく */
    letter-spacing: -0.05em; /* 文字間を詰める */
  }
  
  /* PC用広告隠し */
  .ad-creative-pc { display: none; }
  .ad-creative-sp { display: block; }
}
@media (min-width: 601px) {
  .ad-creative-sp { display: none; }
}
