/* ===========================================
 * Components - 再利用可能なコンポーネント
 * ボタン、カード、ページネーション、フォーム等
 * =========================================== */

/* ===========================================
 * ボタン
 * =========================================== */
.back-link {
  display: inline-block;
  margin: 16px 0;
  padding: 8px 16px;
  background: #6c757d;
  color: #fff;
  text-decoration: none;
  border-radius: 4px;
  font-size: 14px;
}

.back-link:hover {
  background: #5a6268;
  text-decoration: none;
}

/* 前回・次回ボタン */
.nav-btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: #007bff;
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  transition: background 0.2s;
  min-width: 80px;
  flex-shrink: 0;
}

.nav-btn:hover {
  background: #0056b3;
  text-decoration: none;
}

.nav-btn-disabled {
  background: #ccc;
  color: #666;
  cursor: not-allowed;
  pointer-events: none;
}

.search-btn {
  padding: 8px 16px;
  background: #667eea;
  border: 1px solid #667eea;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  color: white;
  font-weight: 600;
  transition: all 0.2s;
}

.search-btn:hover {
  background: #5568d3;
}

.card-button {
  display: inline-block;
  background: #0066cc;
  color: white;
  padding: 10px 20px;
  border-radius: 5px;
  font-weight: 600;
  transition: all 0.2s;
}

.card-button:hover {
  background: #004499;
  text-decoration: none;
}

.card-button.sp {
  background: #d63384;
}

.card-button.sp:hover {
  background: #b02a6a;
}

.x-post-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #000;
  color: #fff;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  text-decoration: none;
}

.x-post-btn:hover {
  background: #333;
  text-decoration: none;
}

/* ===========================================
 * カードコンポーネント
 * =========================================== */
.ranking-cards-section {
  margin-bottom: 30px;
}

.ranking-cards-section h2 {
  font-size: 20px;
  margin: 0 0 20px 0;
  padding-bottom: 10px;
  border-bottom: 2px solid #667eea;
  color: #333;
}

.ranking-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.ranking-card {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s;
}

.ranking-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.card-thumbnail {
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: #f0f0f0;
}

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

.card-content {
  padding: 20px;
}

.card-content.full {
  padding: 30px;
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 8px 0;
  color: #0066cc;
}

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

.card-title.special {
  color: #667eea;
}

.card-subtitle {
  font-size: 14px;
  color: #666;
  margin: 0 0 15px 0;
}

/* ===========================================
 * ページネーション
 * =========================================== */
.pagination {
  background: #fff;
  border: 1px solid var(--border-color);
  border-top: none;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pagination a, 
.pagination span {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 13px;
  color: var(--text-color);
  text-decoration: none;
}

.pagination a:hover {
  background: #f0f0f0;
  text-decoration: none;
}

.pagination .current {
  background: #4a90d9;
  color: #fff;
  border-color: #4a90d9;
}

.pagination .disabled {
  color: #ccc;
  border-color: #eee;
  pointer-events: none;
}

.pagination .info {
  border: none;
  padding: 6px 0;
  color: var(--text-muted);
}

/* ===========================================
 * 検索・フィルター
 * =========================================== */
.search-section {
  background: #fff;
  border: 1px solid var(--border-color);
  border-top: none;
  padding: 12px 16px;
}

.search-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 200px;
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
}

.search-options {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  font-size: 13px;
}

.search-options label {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

/* セレクトボックス */
.selector-weekly select,
.selector-sp select {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

/* ===========================================
 * 年代ナビ・号数ナビ
 * =========================================== */

/* ランキング上部ナビゲーション（前回・サムネ・次回） */
.ranking-top-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.ranking-main-thumb {
  display: block;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 4px;
}

.ranking-main-thumb img {
  width: 128px;
  height: 72px;
  object-fit: cover;
  object-position: center;
  aspect-ratio: 16/9;
  display: block;
}

/* 年代ナビ */
.year-nav {
  background: #fff;
  border: 1px solid var(--border-color);
  border-top: none;
  padding: 12px 16px;
}

.year-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}

.year-row:last-child {
  margin-bottom: 0;
}

.year-row a, 
.year-row span {
  display: inline-block;
  padding: 6px 12px;
  background: #e8e8e8;
  border-radius: 4px;
  font-size: 13px;
  color: var(--text-color);
  text-decoration: none;
}

.year-row a:hover {
  background: #d0d0d0;
  text-decoration: none;
}

.year-row a.active, 
.year-row span.active {
  background: #666;
  color: #fff;
}

.num-popup {
  position: relative;
  display: inline-block;
}

.num-popup-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  padding: 12px;
  z-index: 100;
  min-width: 400px;
}

.num-popup:hover .num-popup-content {
  display: block;
}

.month-row {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
}

.month-row span {
  padding: 4px 8px;
  background: #888;
  color: #fff;
  border-radius: 4px;
  font-size: 12px;
}

.num-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.num-grid a {
  display: block;
  padding: 6px;
  text-align: center;
  background: #666;
  color: #fff;
  border-radius: 4px;
  font-size: 12px;
  text-decoration: none;
}

.num-grid a:hover {
  background: #444;
}

.num-grid a.current {
  background: #4a90d9;
}

/* ===========================================
 * インフォメーション
 * =========================================== */
.info-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.info-item {
  background: white;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 15px;
  box-shadow: var(--shadow);
  transition: all 0.3s;
}

.info-item:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.info-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.info-title {
  font-size: 16px;
  font-weight: 700;
  color: #333;
  margin: 0;
}

.info-category {
  display: inline-block;
  background: #667eea;
  color: white;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 12px;
}

.info-date {
  font-size: 13px;
  color: #999;
  white-space: nowrap;
}

.info-summary {
  font-size: 14px;
  color: #666;
  margin: 0;
  line-height: 1.6;
}

.info-more {
  margin-top: 15px;
  text-align: right;
}

.more-link {
  color: #667eea;
  font-weight: 600;
  font-size: 14px;
}

.more-link:hover {
  text-decoration: none;
  opacity: 0.8;
}

/* ===========================================
 * サイドバーオーバーレイ
 * =========================================== */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.3s;
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

/* ===========================================
 * サイドバーモバイルヘッダー
 * =========================================== */
.sidebar-mobile-header {
  display: none;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: #667eea;
  color: white;
  position: sticky;
  top: 0;
  z-index: 10;
}

.sidebar-mobile-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.sidebar-close-btn {
  background: transparent;
  border: none;
  color: white;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
}

.sidebar-close-btn:hover {
  opacity: 0.8;
}

.sidebar-close-btn:active {
  transform: scale(0.9);
}

/* ===========================================
 * インフォメーション
 * =========================================== */

/* インフォメーション一覧ページ */
.info-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 16px;
}

.info-page > h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 32px;
  color: #333;
  border-bottom: 3px solid #007bff;
  padding-bottom: 12px;
}

.info-list-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* 一覧記事カード */
.info-list-item {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 20px;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.info-list-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: #007bff;
}

.info-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.info-item-title {
  font-size: 20px;
  font-weight: 600;
  margin: 0;
  flex: 1;
  min-width: 200px;
}

.info-item-title a {
  color: #007bff;
  text-decoration: none;
  transition: color 0.2s;
}

.info-item-title a:hover {
  color: #0056b3;
  text-decoration: underline;
}

.info-item-date {
  color: #666;
  font-size: 14px;
  white-space: nowrap;
}

.info-item-summary {
  color: #555;
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
}

/* NEWバッジ */
.new-badge {
  display: inline-block;
  background: #dc3545;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 3px;
  margin-left: 8px;
  vertical-align: middle;
}

/* インフォメーション詳細ページ */
.info-detail-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 16px;
}

.info-detail {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 32px;
  margin-bottom: 24px;
}

.info-detail-header {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid #f0f0f0;
}

.info-detail-title {
  font-size: 26px;
  font-weight: 700;
  color: #333;
  margin: 0 0 12px 0;
  line-height: 1.4;
}

.info-detail-date {
  color: #666;
  font-size: 14px;
}

.info-detail-content {
  font-size: 15px;
  line-height: 1.8;
  color: #333;
}

.info-detail-content h2 {
  font-size: 22px;
  font-weight: 600;
  margin: 32px 0 16px 0;
  color: #333;
  border-left: 4px solid #007bff;
  padding-left: 12px;
}

.info-detail-content h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 24px 0 12px 0;
  color: #333;
}

.info-detail-content p {
  margin: 0 0 16px 0;
}

.info-detail-content ul,
.info-detail-content ol {
  margin: 0 0 16px 0;
  padding-left: 24px;
}

.info-detail-content li {
  margin-bottom: 8px;
}

.info-detail-content a {
  color: #007bff;
  text-decoration: underline;
}

.info-detail-content a:hover {
  color: #0056b3;
}

.info-detail-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.info-detail-actions .action-link {
  display: inline-block;
  padding: 10px 20px;
  background: #6c757d;
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s;
}

.info-detail-actions .action-link:hover {
  background: #5a6268;
  text-decoration: none;
}

/* インフォメーションアクション（一覧ページの戻るリンク） */
.info-actions {
  margin-top: 32px;
}

/* データなしメッセージ */
.no-data {
  text-align: center;
  color: #999;
  font-size: 16px;
  padding: 60px 20px;
  background: #f8f9fa;
  border-radius: 8px;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .info-page,
  .info-detail-page {
    padding: 16px 12px;
  }

  .info-page > h1 {
    font-size: 24px;
  }

  .info-list-item {
    padding: 16px;
  }

  .info-item-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .info-item-title {
    font-size: 18px;
  }

  .info-detail {
    padding: 20px;
  }

  .info-detail-title {
    font-size: 22px;
  }

  .info-detail-actions {
    flex-direction: column;
  }

  .info-detail-actions .action-link {
    text-align: center;
  }
}