/* 豊富なテンプレート一覧ページのスタイル */

/* ページ全体のレイアウト */
body {
  min-height: 100vh;
}

/* ページヘッダー */
.page-header {
  text-align: center;
  margin-bottom: 30px;
  padding: 40px 0 20px;
}

.page-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 15px;
  color: #fff;
}

/* メインコンテナ */
.templates-container {
  margin: 0 auto;
  padding: 40px 60px;
  background-color: #f5f5f5;
  border-radius: 20px;
  max-width: 896px;
  position: relative;
}

/* 説明ボックス */
.template-description-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  color: #000;
}
.template-description-box .description-text {
  flex: 1;
  font-size: 1.125rem;
}
.template-description-box .description-text strong {
  color: #2492cc;
}
.template-description-box .description-image {
  flex: none;
  width: 180px;
}

/* セクションタイトル */
.templates-list-archive {
  margin-bottom: 40px;
}

.templates-list-archive h2:first-of-type {
  font-size: 2rem;
  font-weight: 700;
  color: #333;
  margin: 0 0 30px 0;
  padding-left: 0;
  padding-bottom: 8px;
  display: flex;
  align-items: center;
  border-bottom-width: 2px;
  border-bottom-style: solid;
  border-image: linear-gradient(2.3deg, #2376D0, #25ACCA 43%, #20CD7A) 5;
  mask: linear-gradient(white, white)
}

.templates-list-archive h2:first-of-type::before {
  content: "";
  background-image: url(../img/Subtract.png);
  background-size: contain;
  display: inline-block;
  width: 20px;
  height: calc(47px / 2);
  margin-right: 8px;
  margin-top: 4px;
}

/* グリッドレイアウト */
.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

/* テンプレートアイテム */
.template-item {
  background-color: transparent;      /* 任意 */
  border-radius: 8px;
  overflow: hidden;                   /* 角丸を効かせる */
  border: 2px solid transparent;
  transition: background 0.3s ease, transform 0.3s ease;
  /* 二重背景：内側(白)、外側(透明) */
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(0deg, rgba(0,0,0,0), rgba(0,0,0,0)) border-box;
  padding: 8px;
  text-decoration: none;
}

/* ホバー時：外側をグラデーションに差し替え（中身はそのまま） */
.template-item:hover {
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(49.43deg, #2376D0 0.87%, #25ACCA 43.12%, #20CD7A 99.13%) border-box;
}

/* 画像エリア */
.template-image {
  width: 100%;
  overflow: hidden;
  background-color: #f5f5f5;
  position: relative;
}

.template-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.template-no-image {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e0e0e0, #f5f5f5);
  color: #999;
  font-size: 14px;
}

/* コンテンツエリア */
.template-content {
  padding: 12px;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.template-info {
  width: 100%;
}

.template-title {
  font-size: 13px;
  line-height: 1.4;
  color: #27292D;
  margin: 0;
  font-weight: 500;
}

/* カテゴリー表示（必要な場合） */
.template-category {
  display: none;
}

/* 矢印は不要なので非表示 */
.template-arrow {
  display: none;
}

/* ページネーション */
.navigation.pagination {
  margin-top: 40px;
  text-align: center;
}

.page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: 4px;
  background-color: #fff;
  color: #333;
  text-decoration: none;
  font-size: 0.875rem;
  margin: 0 4px;
  border: 1px solid #ddd;
  transition: all 0.3s ease;
}

.page-numbers.current {
  background-color: #4ade80;
  color: #fff;
  border-color: #4ade80;
}

.page-numbers:hover:not(.current) {
  background-color: #e8f5e9;
  border-color: #4ade80;
}

/* メッセージ */
.no-templates {
  color: #666;
  text-align: center;
  padding: 40px 20px;
  font-size: 1rem;
}

/* レスポンシブ対応 */
@media screen and (max-width: 1200px) {
  .templates-container {
    padding: 40px;
  }
  
  .template-description-box {
    right: 40px;
  }
  
  .templates-container::before {
    left: 40px;
    width: 120px;
    height: 120px;
  }
  
  .templates-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
  }
}

@media screen and (max-width: 768px) {
  .page-title {
    font-size: 1.5rem;
  }
  
  .templates-container {
    padding: 20px;
    border-radius: 15px;
  }
  
  /* スマホではキャラクターと説明ボックスを縦に配置 */
  .templates-container::before {
    position: relative;
    top: 0;
    left: 0;
    margin: 0 auto 20px;
    display: block;
    width: 100px;
    height: 100px;
  }
  
  .template-description-box {
    position: relative;
    top: auto;
    right: auto;
    max-width: 100%;
    margin: 0 0 30px 0;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .template-description-box .description-image {
    flex: none;
    width: 100%;
    text-align: center;
  }

  .templates-list-archive {
    margin-top: 20px;
  }

  .templates-list-archive h2:first-of-type::before {
    margin-top: 0;
  }
  
  .templates-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
  }
  
  .template-image {
    height: 120px;
  }
  
  .template-content {
    padding: 10px;
  }
  
  .template-title {
    font-size: 12px;
  }
  
  .templates-list-archive h2:first-of-type {
    font-size: 1rem;
  }
}

@media screen and (max-width: 480px) {
  .templates-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  
  .template-image {
    height: 100px;
  }
  
  .template-description-box h3 {
    font-size: 0.9rem;
  }
  
  .template-description-box p {
    font-size: 0.8rem;
  }
}

/* アニメーション */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.template-item {
  animation: fadeInUp 0.5s ease-out;
  animation-fill-mode: both;
}

.template-item:nth-child(1) { animation-delay: 0.05s; }
.template-item:nth-child(2) { animation-delay: 0.1s; }
.template-item:nth-child(3) { animation-delay: 0.15s; }
.template-item:nth-child(4) { animation-delay: 0.2s; }
.template-item:nth-child(5) { animation-delay: 0.25s; }
.template-item:nth-child(6) { animation-delay: 0.3s; }