/* ランキング一覧ページ専用スタイル */

/* ランキング一覧ページ専用スタイル */

/* 固定ヘッダー */
.ichiran-fixed-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  z-index: 1000;
  padding: 15px 20px;
}

.ichiran-fixed-header .header-content {
  max-width: 1400px;
  margin: 0 auto;
  text-align: center;
  position: relative;
}

.ichiran-fixed-header h1 {
  margin: 0;
  font-size: 1.8rem;
  color: #333;
}

/* ichiran用ハンバーガーボタン */
.ichiran-hamburger-btn {
  position: absolute;
  top: 50%;
  right: 20px;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  z-index: 1002;
}

.ichiran-hamburger-btn span {
  display: block;
  width: 28px;
  height: 3px;
  background: #333;
  border-radius: 2px;
  transition: all 0.3s;
}

.ichiran-hamburger-btn:hover span {
  background: #007bff;
}

/* ドロワーメニュー（ichiran用、共通スタイル流用） */
/* drawer-overlay, drawer-menu, drawer-header, drawer-menu-list は共通 */

/* ドロワーオーバーレイ */
.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  z-index: 1100;
}

.drawer-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* ドロワーメニュー */
.drawer-menu {
  position: fixed;
  top: 0;
  right: -320px;
  width: 320px;
  height: 100%;
  background: #fff;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.2);
  transition: right 0.3s;
  z-index: 1101;
  overflow-y: auto;
}

.drawer-menu.show {
  right: 0;
}

/* ドロワーヘッダー */
.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #ddd;
}

.drawer-header h2 {
  margin: 0;
  font-size: 1.5rem;
  color: #333;
}

.drawer-close {
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.drawer-close:hover {
  color: #333;
}

/* ドロワーメニューリスト */
.drawer-menu-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.drawer-menu-list li {
  border-bottom: 1px solid #eee;
}

.drawer-menu-list li:last-child {
  border-bottom: none;
}

.drawer-menu-list a,
.drawer-menu-list button {
  display: block;
  padding: 15px 20px;
  color: #333;
  text-decoration: none;
  font-size: 1rem;
  transition: background 0.2s;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  cursor: pointer;
}

.drawer-menu-list a:hover,
.drawer-menu-list button:hover {
  background: #f0f0f0;
}

/* 外部リンク */
.drawer-menu-list .external a::after {
  content: ' ↗';
  font-size: 0.8em;
  color: #999;
}

/* アクションボタン */
.drawer-menu-list .action button {
  font-weight: bold;
  color: #fff;
}

.drawer-menu-list .action button:hover {
  background: #e8f5fe;
}

/* Xポストボタン（Twitter風デザイン） */
.x-post-btn {
  display: flex !important;
  align-items: center;
  gap: 8px;
  background: #000 !important;
  color: #fff !important;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 20px !important;
}

.x-post-btn:hover {
  background: #333 !important;
}

.x-post-btn .x-icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* body scroll lock */
body.drawer-open {
  overflow: hidden;
}

/* コンテンツラッパー */
.ichiran-content-wrapper {
  padding-top: 70px; /* 固定ヘッダー分の余白 */
}

.ichiran-container {
  display: flex;
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  gap: 30px;
}

/* サイドバー（年リスト） */
.ichiran-sidebar {
  width: 200px;
  flex-shrink: 0;
}

.ichiran-sidebar h2 {
  font-size: 1.2rem;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid #333;
}

.year-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.year-list li {
  margin-bottom: 5px;
}

.year-list a {
  display: block;
  padding: 10px 15px;
  text-decoration: none;
  color: #333;
  border-radius: 4px;
  transition: background 0.2s;
}

.year-list a:hover {
  background: #f0f0f0;
}

.year-list a.active {
  background: #007bff;
  color: #fff;
  font-weight: bold;
}

/* メインコンテンツ */
.ichiran-main {
  flex: 1;
  min-width: 0;
}

/* SPブロック */
.sp-block {
  margin-bottom: 40px;
}

.sp-block h2 {
  font-size: 1.5rem;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #d63384;
  color: #d63384;
}

/* 週刊ブロック（月ごと） */
.month-block {
  margin-bottom: 40px;
}

.month-block h2 {
  font-size: 1.3rem;
  margin-bottom: 15px;
  padding-bottom: 8px;
  border-bottom: 2px solid #333;
}

/* カード一覧 */
.ranking-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

/* 1カード */
.ranking-card {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 15px;
  background: #fff;
  transition: box-shadow 0.2s;
}

.ranking-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* カードタイトル（クリッカブル） */
.ranking-card .card-title {
  display: block;
  font-size: 1.1rem;
  font-weight: bold;
  margin-bottom: 10px;
  color: #333;
  text-decoration: none;
  transition: color 0.2s;
}

.ranking-card .card-title:hover {
  color: #007bff;
  text-decoration: underline;
}

.ranking-card .card-title.sp {
  color: #d63384;
}

.ranking-card .card-title.sp:hover {
  color: #a02860;
}

/* 番号部分（#935、SP37など）の色 */
.ranking-card .card-title .ranking-number {
  color: #007bff;
}

/* サムネリンク（クリッカブル） */
.ranking-card .card-thumb-link {
  display: block;
  text-decoration: none;
  margin-bottom: 10px;
}

.ranking-card .card-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #f0f0f0;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  transition: opacity 0.2s;
}

.ranking-card .card-thumb-link:hover .card-thumb {
  opacity: 0.85;
}

.ranking-card .card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ranking-card .card-thumb .loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #999;
  font-size: 0.9rem;
}

/* カードリンク */
.ranking-card .card-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ranking-card .card-links a {
  display: block;
  padding: 8px 12px;
  text-align: center;
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.9rem;
  transition: background 0.2s;
}

.ranking-card .card-links .link-ranking {
  background: #007bff;
  color: #fff;
}

.ranking-card .card-links .link-ranking:hover {
  background: #0056b3;
}

.ranking-card .card-links .link-dic {
  background: #dc3545;
  color: #fff;
}

.ranking-card .card-links .link-dic:hover {
  background: #bd2130;
}

/* スマホ対応 */
.mobile-year-toggle {
  display: none;
  padding: 12px 20px;
  background: #007bff;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  margin-bottom: 20px;
  width: 100%;
  position: relative;
  z-index: 999;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 998; /* サイドバー(1001)より下 */
  pointer-events: auto;
}

.sidebar-overlay.show {
  pointer-events: auto; /* クリックを受け付ける */
}

@media (max-width: 768px) {
  .ichiran-fixed-header {
    padding: 10px 15px;
  }
  
  .ichiran-fixed-header h1 {
    font-size: 1.3rem;
  }
  
  .ichiran-hamburger-btn {
    right: 10px;
  }
  
  .drawer-menu {
    width: 280px;
    right: -280px;
  }
  
  .ichiran-content-wrapper {
    padding-top: 60px; /* スマホ用:固定ヘッダー分の余白 */
  }
  
  .ichiran-container {
    flex-direction: column;
    padding: 15px;
  }
  
  .mobile-year-toggle {
    display: block;
  }
  
  .ichiran-sidebar {
    position: fixed;
    top: 0;
    left: -250px;
    width: 250px;
    height: 100%;
    background: #fff;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    z-index: 1001; /* オーバーレイ(998)より上 */
    padding: 20px;
    overflow-y: auto;
    transition: left 0.3s;
  }
  
  .ichiran-sidebar.open {
    left: 0;
  }
  
  /* サイドバー内のリンクがクリックできることを確実にする */
  .ichiran-sidebar a {
    pointer-events: auto;
    cursor: pointer;
    position: relative;
    z-index: 1;
    -webkit-tap-highlight-color: rgba(0,0,0,0.1);
    touch-action: manipulation;
  }
  
  /* スマホ版の年リストのリンク */
  .ichiran-sidebar .year-list a {
    display: block;
    padding: 15px 20px; /* タップ領域を大きく */
    min-height: 48px; /* アクセシビリティ推奨の最小タップサイズ */
    font-size: 1.1rem;
  }
  
  /* タップ時の視覚的フィードバック */
  .ichiran-sidebar .year-list a:active {
    background: #e0e0e0;
    transform: scale(0.98);
  }
  
  .sidebar-overlay.show {
    display: block;
  }
  
  /* スマホ版では大百科ボタンを非表示 */
  .ranking-card .card-links .link-dic {
    display: none !important;
  }
  
  .ranking-cards {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
  }
}

/* トップに戻るボタン */
.scroll-top-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: #007bff;
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s, background 0.2s;
  z-index: 1000;
}

.scroll-top-btn.show {
  opacity: 1;
  visibility: visible;
}

.scroll-top-btn:hover {
  background: #0056b3;
}

.scroll-top-btn:active {
  transform: scale(0.95);
}

@media (max-width: 768px) {
  .scroll-top-btn {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    font-size: 1rem;
  }
}