@charset "utf-8";

/**
 * アーカイブページレイアウト
 * 加工実績・新着情報ページの横幅統一とレイアウト調整
 */

/* ==========================================================================
   アーカイブページ共通レイアウト
   ========================================================================== */

/* アーカイブコンテンツエリア - 全幅レイアウト */
.archive-content {
  margin-bottom: 60px;
}

/* 記事一覧エリア - 全幅表示 */
.archive-posts-area {
  width: 100%;
  max-width: 100%;
}

/* メインコンテンツエリア */
.archive-content > div:first-child {
  min-width: 0; /* grid overflowを防ぐ */
}

/* ==========================================================================
   フィルター・ソートエリア
   ========================================================================== */

/* フィルターバー */
.archive-filters-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 30px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  gap: 20px;
}

/* フィルターコンテナ（旧） */
.archive-filters {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* フィルタータブ */
.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.filter-tab {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #495057;
  cursor: pointer;
  transition: all 0.3s ease;
}

.filter-tab:hover {
  background: #e9ecef;
  border-color: #dee2e6;
}

.filter-tab.active {
  background: var(--col_primary, #e11f1f);
  border-color: var(--col_primary, #e11f1f);
  color: white;
}

/* カテゴリー数の表示 */
.category-count {
  font-size: 0.75rem;
  opacity: 0.8;
  margin-left: 4px;
}

/* ソートセレクト */
.archive-sort select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  background: white;
  font-size: 0.875rem;
  color: #495057;
}

/* サイドバー */
.archive-sidebar {
  margin-top: 0;
}

/* サイドバーウィジェット */
.sidebar-widget {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.sidebar-widget:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.sidebar-widget:last-child {
  margin-bottom: 0;
}

.widget-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--col_primary);
  color: #2c3e50;
}

/* ==========================================================================
   フィルターとソート
   ========================================================================== */

.archive-filters {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin: 40px 0;
  padding: 24px;
  background: #f8f9fa;
  border-radius: 12px;
  gap: 20px;
}

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  flex: 1;
}

.filter-tab {
  padding: 8px 20px;
  background: #fff;
  border: 2px solid #e0e0e0;
  border-radius: 24px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #6c757d;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.filter-tab:hover {
  border-color: var(--col_primary);
  color: var(--col_primary);
}

.filter-tab.active {
  background: var(--col_primary);
  border-color: var(--col_primary);
  color: #fff;
}

.archive-sort {
  flex-shrink: 0;
}

.sort-select {
  padding: 8px 16px;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  background: #fff;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.sort-select:focus {
  outline: none;
  border-color: var(--col_primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--col_primary) 10%, transparent);
}

/* ==========================================================================
   統計エリア
   ========================================================================== */

.archive-stats {
  margin: 30px 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding: 24px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 12px;
}

.stat-item {
  text-align: center;
  padding: 16px 12px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.stat-number {
  display: block;
  font-family: var(--font_MavenPro);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--col_primary);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-number small {
  font-size: 0.8em;
  color: #6c757d;
}

.stat-label {
  font-size: 0.75rem;
  color: #6c757d;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ==========================================================================
   結果表示エリア
   ========================================================================== */

.archive-results {
  margin: 20px 0;
  padding: 12px 20px;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid var(--col_primary);
}

.results-count {
  margin: 0;
  font-size: 0.875rem;
  color: #495057;
}

.results-count .count {
  font-weight: 700;
  color: var(--col_primary);
}

/* ==========================================================================
   投稿なしメッセージ
   ========================================================================== */

.no-posts-message {
  text-align: center;
  padding: 80px 40px;
  background: #f8f9fa;
  border-radius: 12px;
  margin: 40px 0;
}

.no-posts-icon {
  margin-bottom: 24px;
  color: #6c757d;
}

.no-posts-message h3 {
  font-size: 1.5rem;
  color: #495057;
  margin: 0 0 16px 0;
}

.no-posts-message p {
  color: #6c757d;
  margin-bottom: 32px;
  line-height: 1.6;
}

/* ==========================================================================
   カテゴリーリスト（サイドバー）
   ========================================================================== */

.category-list,
.archive-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.category-item,
.archive-item {
  border-bottom: 1px solid #f0f0f0;
}

.category-item:last-child,
.archive-item:last-child {
  border-bottom: none;
}

.category-link,
.archive-item a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  color: #495057;
  text-decoration: none;
  transition: color 0.3s ease;
}

.category-link:hover,
.archive-item a:hover {
  color: var(--col_primary);
}

.category-name {
  flex: 1;
  font-weight: 500;
}

.category-count {
  background: #e9ecef;
  color: #6c757d;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 12px;
  min-width: 24px;
  text-align: center;
}

/* ==========================================================================
   テクニカルタグ
   ========================================================================== */

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tech-tag {
  display: inline-block;
  padding: 6px 12px;
  background: #e9ecef;
  color: #495057;
  font-size: 0.75rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 16px;
  transition: all 0.3s ease;
}

.tech-tag:hover {
  background: var(--col_primary);
  color: #fff;
}

/* ==========================================================================
   タグクラウド
   ========================================================================== */

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-link {
  display: inline-block;
  padding: 6px 12px;
  background: #f8f9fa;
  color: #6c757d;
  font-size: 0.75rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 16px;
  border: 1px solid #e9ecef;
  transition: all 0.3s ease;
}

.tag-link:hover {
  background: var(--col_primary);
  color: #fff;
  border-color: var(--col_primary);
}

/* ==========================================================================
   マテリアルプログレスバー（加工実績ページ専用）
   ========================================================================== */

.material-list {
  margin: 0;
  padding: 0;
}

.material-item {
  margin-bottom: 16px;
}

.material-item:last-child {
  margin-bottom: 0;
}

.material-name {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: #495057;
  font-size: 0.875rem;
}

.material-bar {
  height: 8px;
  background: #e9ecef;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.material-progress {
  height: 100%;
  background: linear-gradient(90deg, var(--col_primary) 0%, color-mix(in srgb, var(--col_primary) 80%, #ff4757) 100%);
  border-radius: 4px;
  transition: width 1s ease-in-out;
  width: 0%;
}

/* ==========================================================================
   お問い合わせCTA（アーカイブページ専用調整）
   ========================================================================== */

/* アーカイブページでのCTA横幅調整 */
.archive-work .contact-cta,
.archive-news .contact-cta,
.archive .contact-cta {
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}

/* ==========================================================================
   フォールバックロゴのスタイル
   ========================================================================== */

/* ==========================================================================
   カードコンポーネント - 固定サイズレイアウト
   ========================================================================== */

/* カードグリッド - 固定幅カードレイアウト */
.archive-grid,
.news-grid,
.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 40px;
  max-width: 100%;
}

/* 個別カード - 固定幅設定 */
.card--work,
.card--news {
  width: 100%;
  max-width: 380px;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  justify-self: start; /* グリッド内で左揃え */
}

/* カードボディの均等化 */
.card--work .card-body,
.card--news .card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px;
}

.card--work .card-title,
.card--news .card-title {
  margin-bottom: auto;
}

/* 関連記事エリア - コンパクトカード */
.related-posts,
.popular-posts {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card--compact {
  max-width: 100%;
  min-height: auto;
  height: auto;
}

/* アイキャッチ画像がない場合のロゴ表示スタイル */
.card--fallback-logo .card-image {
  object-fit: contain;
  padding: 20px;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
}

/* ロゴの最大サイズ制限 */
.card--fallback-logo .card-image-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 8px;
}

/* ロゴ画像のサイズ調整 */
.card--fallback-logo .card-image {
  max-width: 120px;
  max-height: 80px;
  width: auto;
  height: auto;
  opacity: 0.8;
}

/* ==========================================================================
   カテゴリー投稿一覧（シングルページサイドバー）
   ========================================================================== */

.category-posts-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.category-post-item {
  border-bottom: 1px solid #f0f0f0;
  padding-bottom: 16px;
}

.category-post-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.category-post-link {
  display: flex;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
}

.category-post-link:hover {
  color: var(--col_primary);
}

.category-post-thumbnail {
  flex-shrink: 0;
  width: 80px;
  height: 60px;
  border-radius: 6px;
  overflow: hidden;
  background: #f8f9fa;
}

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

.category-post-link:hover .category-post-image {
  transform: scale(1.05);
}

.category-post-content {
  flex: 1;
  min-width: 0;
}

.category-post-title {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 6px 0;
  color: #2c3e50;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.category-post-date {
  font-size: 0.75rem;
  color: #6c757d;
  font-weight: 500;
}

.no-posts {
  text-align: center;
  color: #6c757d;
  font-size: 0.875rem;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 6px;
  margin: 0;
}

.view-all-link {
  margin-top: 20px;
  text-align: center;
}

.btn--small {
  padding: 8px 16px;
  font-size: 0.875rem;
  border-radius: 6px;
}

/* ==========================================================================
   レスポンシブ対応
   ========================================================================== */

/* タブレット (768px - 1439px) */
@media (min-width: 768px) and (max-width: 1439px) {
  .archive-posts-area {
    width: 100%;
  }
  
  .archive-filters-bar {
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
  }
  
  .filter-tabs {
    justify-content: center;
  }
  
  .archive-sort {
    max-width: 200px;
    align-self: center;
  }
  
  /* カードグリッドのタブレット対応 */
  .archive-grid,
  .news-grid,
  .work-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 32px;
  }
  
  .card--work,
  .card--news {
    max-width: 340px;
    min-height: 380px;
  }
  
  .archive-filters {
    flex-direction: column;
    gap: 16px;
  }
  
  .filter-tabs {
    justify-content: center;
  }
}

/* モバイル (767px以下) */
@media (max-width: 767px) {
  .archive-posts-area {
    width: 100%;
  }
  
  .archive-filters-bar {
    flex-direction: column;
    gap: 16px;
    padding: 16px;
  }
  
  .filter-tabs {
    flex-direction: column;
    gap: 8px;
  }
  
  .filter-tab {
    text-align: center;
    justify-content: center;
  }
  
  .archive-sort {
    width: 100%;
  }
  
  .sidebar-widget {
    padding: 20px;
  }
  
  /* カードグリッドのモバイル対応 */
  .archive-grid,
  .news-grid,
  .work-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  
  .card--work,
  .card--news {
    max-width: 100%;
    min-height: 350px;
  }
  
  .stat-number {
    font-size: 1.5rem;
  }
  
  .archive-filters {
    flex-direction: column;
    gap: 16px;
    padding: 20px;
  }
  
  .filter-tabs {
    justify-content: center;
  }
  
  .filter-tab {
    padding: 6px 16px;
    font-size: 0.8rem;
  }
}

/* スモールモバイル (480px以下) */
@media (max-width: 480px) {
  .sidebar-widget {
    padding: 16px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 16px;
  }
  
  .archive-filters {
    padding: 16px;
  }
  
  .filter-tab {
    padding: 6px 12px;
    font-size: 0.75rem;
  }
  
  /* カテゴリー投稿一覧のモバイル対応 */
  .category-post-thumbnail {
    width: 70px;
    height: 50px;
  }
  
  .category-post-title {
    font-size: 0.8rem;
  }
  
  .category-post-date {
    font-size: 0.7rem;
  }
}
