/**
 * market-style-jp.css
 * Phase 3.8.1-JP — Japanese Localized UI Design System
 *
 * Design Philosophy:
 * - PR TIMES × Yahoo!ニュース × エルメス融合
 * - 情報密度優先（Density-first）
 * - 静かな信頼感（Quiet Trust）
 * - 日本語タイポグラフィ最適化
 */

/* ========================================
   日本的色階調（Japanese Color Palette）
   ======================================== */
:root {
  --jp-bg: #f7f7f7;          /* 白磁 */
  --jp-card: #ffffff;        /* 純白 */
  --jp-line: #e5e5e5;        /* 絹鼠 */
  --jp-text: #1a1a1a;        /* 墨黒 */
  --jp-muted: #6b6b6b;       /* 鈍色 */
  --jp-accent: #2b6cb0;      /* 群青 */
  --jp-accent-soft: #d0e0f7; /* 空色 */
  --jp-alert: #d32f2f;       /* 朱色 */
  --jp-warning: #f57c00;     /* 橙色 */
  --jp-info: #1976d2;        /* 藍色 */
}

/* ========================================
   グローバル設定（Global Styles）
   ======================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Noto Sans JP", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--jp-bg);
  color: var(--jp-text);
  font-size: 14px;
  line-height: 1.4;
  letter-spacing: -0.015em; /* 字詰め */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   ヘッダー（Header）
   ======================================== */
.jp-header {
  background: linear-gradient(to right, #e9eef2 0%, #f9fafa 100%);
  border-bottom: 1px solid var(--jp-line);
  position: sticky;
  top: 0;
  z-index: 100;
}

.jp-header-inner {
  max-width: 1125px !important;
  margin: 0 auto !important;
  padding: 16px 12px !important;  /* PRTIMES準拠 1125px幅 */
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}

@media (max-width: 768px) {
  .jp-header-inner {
    padding: 12px;
  }

  .jp-container {
    padding: 12px;
  }

  .jp-footer-inner {
    padding: 20px 12px;
  }
}

.jp-header h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--jp-text);
}

.jp-header-nav {
  display: flex;
  gap: 16px;
  font-size: 14px;
}

.jp-header-nav a {
  color: var(--jp-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.jp-header-nav a:hover {
  color: var(--jp-accent);
}

/* ========================================
   タブナビゲーション（Tab Navigation）
   ======================================== */
.tab-navigation {
  max-width: 1125px !important;
  margin: 0 auto !important;
  padding-left: 12px !important;
  padding-right: 12px !important;
}

.tab-content {
  max-width: 1125px !important;
  margin: 0 auto !important;
  padding-left: 12px !important;
  padding-right: 12px !important;
}

/* ========================================
   コンテナ（Container）
   ======================================== */
.jp-container {
  max-width: 1125px;
  margin: 0 auto;
  padding: 16px 12px;
}

/* ========================================
   サマリーカード（Summary Cards）
   ======================================== */
.jp-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.jp-summary-card {
  background: var(--jp-card);
  border: 1px solid var(--jp-line);
  border-radius: 6px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.jp-summary-label {
  font-size: 12px;
  color: var(--jp-muted);
  letter-spacing: -0.01em;
}

.jp-summary-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--jp-text);
  line-height: 1.2;
}

.jp-summary-card.alert .jp-summary-value {
  color: var(--jp-alert);
}

/* ========================================
   セクションヘッダー（Section Header）
   ======================================== */
.jp-section {
  margin-bottom: 24px;
}

.jp-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--jp-line);
}

.jp-section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--jp-text);
  letter-spacing: -0.02em;
}

.jp-section-action {
  font-size: 13px;
  color: var(--jp-accent);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.jp-section-action:hover {
  opacity: 0.7;
}

/* ========================================
   記事カード（Article Cards）
   ======================================== */

/* Override legacy news-list grid when using Japanese UI */
#news-list {
  display: block !important;
}

.jp-article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.jp-article-card {
  background: var(--jp-card);
  border: 1px solid var(--jp-line);
  border-radius: 6px;
  overflow: hidden;
  transition: border-color 0.2s ease;
  cursor: pointer;
  position: relative; /* Phase 4.1.0: EIDバッジ用 */
}

/* Phase 4.1.0: EIDバッジ */
.eid-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
  z-index: 10;
  transition: transform 0.2s ease;
}

.jp-article-card:hover .eid-badge {
  transform: scale(1.1);
}

/* Phase 4.1.0-beta: Human Echo吹き出し */
.human-echo-bubble {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 176px; /* 画像高さ分だけ下を空ける */
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.3s ease;
  pointer-events: none;
  z-index: 5;
  border-radius: 6px 6px 0 0;
}

.jp-article-card:hover .human-echo-bubble {
  opacity: 1;
  transform: translateY(0);
}

.human-echo-reader {
  font-size: 13px;
  line-height: 1.5;
  color: #374151;
  font-weight: 500;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  padding: 8px 12px;
  border-radius: 12px 12px 12px 2px;
  border-left: 3px solid var(--jp-accent);
}

.human-echo-lab {
  font-size: 12px;
  line-height: 1.5;
  color: #1f2937;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  padding: 8px 12px;
  border-radius: 12px 12px 2px 12px;
  border-left: 3px solid #f59e0b;
  font-weight: 500;
}

.jp-article-card:hover {
  border-color: var(--jp-accent);
}

.jp-article-image {
  width: 100%;
  height: 176px;
  object-fit: cover;
  transition: filter 0.2s ease;
}

.jp-article-card:hover .jp-article-image {
  filter: brightness(1.08);
}

.jp-article-content {
  padding: 12px;
}

.jp-article-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--jp-muted);
  letter-spacing: -0.01em;
}

.jp-article-source {
  display: inline-block;
  padding: 2px 8px;
  background: #f0f4f8;
  color: var(--jp-accent);
  border-radius: 3px;
  font-weight: 500;  /* 600 → 500: 控えめに */
  font-size: 11px;
}

.jp-article-time {
  color: var(--jp-muted);
}

/* Phase 4.1.0: 共鳴度スコア */
.resonance-score {
  display: inline-block;
  padding: 2px 6px;
  background: linear-gradient(135deg, #e0f2fe 0%, #dbeafe 100%);
  color: var(--jp-accent);
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  margin-left: 4px;
  letter-spacing: -0.01em;
}

.jp-article-title {
  font-size: 15px;
  font-weight: 500;  /* 600 → 500: より繊細な印象 */
  line-height: 1.45;
  color: var(--jp-text);
  letter-spacing: -0.015em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}

/* ========================================
   フィルターバー（Filter Bar）
   ======================================== */
.jp-filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.jp-filter-btn {
  padding: 6px 14px;
  font-size: 13px;
  color: var(--jp-muted);
  background: var(--jp-card);
  border: 1px solid var(--jp-line);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  letter-spacing: -0.01em;
}

.jp-filter-btn:hover {
  border-color: var(--jp-accent);
  color: var(--jp-accent);
}

.jp-filter-btn.active {
  background: var(--jp-accent);
  color: white;
  border-color: var(--jp-accent);
}

/* ========================================
   フッター（Footer）
   ======================================== */
.jp-footer {
  background: #fafafa;
  border-top: 1px solid var(--jp-line);
  margin-top: 40px;
}

.jp-footer-inner {
  max-width: 1125px;
  margin: 0 auto;
  padding: 24px 12px;
}

.jp-footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--jp-muted);
  line-height: 1.4;
}

.jp-footer-links {
  display: flex;
  gap: 12px;
}

.jp-footer-links a {
  color: var(--jp-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.jp-footer-links a:hover {
  color: var(--jp-accent);
}

/* ========================================
   レスポンシブ（Responsive）
   ======================================== */
@media (max-width: 768px) {
  .jp-article-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .jp-summary-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .jp-header h1 {
    font-size: 18px;
  }

  .jp-header-nav {
    gap: 12px;
    font-size: 13px;
  }

  .jp-article-title {
    font-size: 14px;
  }

  .jp-article-image {
    height: 140px;
  }

  body {
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .jp-article-grid {
    grid-template-columns: 1fr;
  }

  .jp-summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .jp-container {
    padding: 12px 8px;
  }

  .jp-article-content {
    padding: 10px;
  }
}

/* ========================================
   Loading State
   ======================================== */
.jp-loading {
  text-align: center;
  padding: 40px;
  color: var(--jp-muted);
  font-size: 14px;
}

/* ========================================
   Empty State
   ======================================== */
.jp-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--jp-muted);
  font-size: 14px;
}

.jp-empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.3;
}
