/*
Theme Name: WorldLens Japan
Theme URI: 
Author: Takuji
Author URI: 
Description: 海外メディア・ジャパン・ウォッチ 統合企画書に基づく、多角的視点から海外ニュースを比較できるWordPressテーマ。
Version: 2.0.0
License: GNU General Public License v2 or later
Text Domain: worldlens-japan
*/

:root {
  /* モダンで洗練されたカラーパレット (Tailwind Slate/Blue/Amber) */
  --primary-color: #0f172a;
  --primary-hover: #1e293b;
  --secondary-color: #3b82f6;
  --secondary-hover: #2563eb;
  --accent-color: #f59e0b;

  --bg-base: #f8fafc;
  --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  --surface-color: rgba(255, 255, 255, 0.85);
  /* グラスモーフィズム用 */

  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  --border-color: rgba(226, 232, 240, 0.6);
  --border-glass: rgba(255, 255, 255, 0.5);

  /* 報道スタンスの色分け (明るい背景用) */
  --stance-positive-bg: rgba(220, 252, 231, 0.9);
  --stance-positive-text: #166534;
  --stance-neutral-bg: rgba(241, 245, 249, 0.9);
  --stance-neutral-text: #475569;
  --stance-critical-bg: rgba(254, 226, 226, 0.9);
  --stance-critical-text: #991b1b;

  /* タイポグラフィ */
  --font-family-base: 'Inter', 'Noto Sans JP', sans-serif;
  --font-family-heading: 'Outfit', 'Noto Sans JP', sans-serif;

  /* 影（Depth）設計 */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-glass: 0 8px 32px 0 rgba(31, 38, 135, 0.05);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family-base);
  color: var(--text-primary);
  /* SVGによる立体的で有機的な背景パターンを追加 */
  background-color: var(--bg-base);
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%2364748b' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
}

/* ページ全体に敷く有機的なグラデーションオーブ(立体感・ガラス質感用) */
body::before {
  content: '';
  position: fixed;
  top: -20%;
  left: -10%;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, rgba(255, 255, 255, 0) 70%);
  border-radius: 50%;
  z-index: -1;
  pointer-events: none;
}

body::after {
  content: '';
  position: fixed;
  bottom: -20%;
  right: -10%;
  width: 60vw;
  height: 60vw;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.05) 0%, rgba(255, 255, 255, 0) 70%);
  border-radius: 50%;
  z-index: -1;
  pointer-events: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-family-heading);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.5em;
  color: var(--primary-color);
  letter-spacing: -0.02em;
}

a {
  color: var(--secondary-color);
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

a:hover {
  color: var(--secondary-hover);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ------------------------------------
 * Header (グラスモーフィズム適用)
 * ------------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
}

.site-header.scrolled {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-sm);
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
}

.site-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.05em;
  margin: 0;
}

.site-title a {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.main-navigation ul {
  display: flex;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.main-navigation a {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.95rem;
  position: relative;
}

/* アニメーション付きの手描き風アンダーライン */
.main-navigation a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 0;
  background-color: var(--secondary-color);
  transition: width 0.3s ease;
  border-radius: 2px;
}

.main-navigation a:hover::after {
  width: 100%;
}

.main-navigation a:hover {
  color: var(--primary-color);
}

/* ------------------------------------
 * Badges (立体感とグラス)
 * ------------------------------------ */
.badge {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: var(--shadow-sm);
  letter-spacing: 0.02em;
}

.stance-positive {
  background-color: var(--stance-positive-bg);
  color: var(--stance-positive-text);
  border: 1px solid rgba(22, 101, 52, 0.1);
  backdrop-filter: blur(4px);
}

.stance-neutral {
  background-color: var(--stance-neutral-bg);
  color: var(--stance-neutral-text);
  border: 1px solid rgba(71, 85, 105, 0.1);
  backdrop-filter: blur(4px);
}

.stance-critical {
  background-color: var(--stance-critical-bg);
  color: var(--stance-critical-text);
  border: 1px solid rgba(153, 27, 27, 0.1);
  backdrop-filter: blur(4px);
}

/* ------------------------------------
 * Article Card (グラスモーフィズム & 3D Hover)
 * ------------------------------------ */
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2.5rem;
}

.article-card {
  background: var(--surface-color);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  box-shadow: var(--shadow-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  /* 少しバウンドさせる */
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}

.article-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 16px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
  /* ハイライト */
  pointer-events: none;
  z-index: 10;
}

.article-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-xl), 0 0 0 1px rgba(255, 255, 255, 1) inset;
  /* 外側と内側の影を強調 */
}

.card-image-wrap {
  position: relative;
  overflow: hidden;
}

.card-image-wrap::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(to top, rgba(255, 255, 255, 0.95), transparent);
  /* 画像下部の馴染ませ */
}

.card-image {
  height: 220px;
  object-fit: cover;
  width: 100%;
  transition: transform 0.6s ease;
}

.article-card:hover .card-image {
  transform: scale(1.05);
  /* 画像ズーム効果 */
}

.card-body {
  padding: 1.5rem 1.8rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 2;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.card-title {
  font-size: 1.3rem;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.card-title a {
  color: var(--primary-color);
  background: linear-gradient(to right, var(--text-primary) 0%, var(--text-primary) 100%);
  background-size: 0px 2px;
  background-position: 0 95%;
  background-repeat: no-repeat;
  transition: background-size 0.3s ease, color 0.3s ease;
}

.article-card:hover .card-title a {
  background-size: 100% 2px;
}

.card-excerpt {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  flex: 1;
  line-height: 1.7;
}

/* ------------------------------------
 * Tabs UI (JSと連携)
 * ------------------------------------ */
.region-tabs-wrapper {
  position: relative;
  margin-bottom: 3rem;
  border-bottom: 2px solid var(--border-color);
}

.region-tabs {
  display: flex;
  gap: 2rem;
  overflow-x: auto;
  white-space: nowrap;
  padding-bottom: 1rem;
  scrollbar-width: none;
  /* Firefox */
}

.region-tabs::-webkit-scrollbar {
  display: none;
  /* Chrome */
}

.region-tab-link {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-secondary);
  position: relative;
  padding: 0.5rem 0;
  cursor: pointer;
  transition: color 0.3s ease;
}

.region-tab-link:hover,
.region-tab-link.active {
  color: var(--primary-color);
}

.region-tab-link::after {
  content: '';
  position: absolute;
  bottom: -18px;
  /* 親のborder-bottomの上に配置 */
  left: 0;
  width: 0%;
  height: 3px;
  background-color: var(--secondary-color);
  border-radius: 3px 3px 0 0;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.region-tab-link.active::after {
  width: 100%;
}

/* ------------------------------------
 * Typography & Utilities
 * ------------------------------------ */
.mb-2 {
  margin-bottom: 0.5rem;
}

.mb-4 {
  margin-bottom: 1rem;
}

.mb-8 {
  margin-bottom: 2rem;
}

.mt-auto {
  margin-top: auto;
}

.mt-8 {
  margin-top: 2rem;
}

.text-muted {
  color: var(--text-muted);
}

/* Footer */
.site-footer {
  background: var(--primary-color);
  color: #fff;
  padding: 4rem 0;
  margin-top: 6rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.site-footer a {
  color: var(--text-muted);
}

.site-footer a:hover {
  color: #fff;
}

@media (max-width: 768px) {
  .site-header .container {
    height: 60px;
  }

  .main-navigation {
    display: none;
    /* スマホ用メニューは本来ハンバーガー化するがMVPなので非表示か簡素化 */
  }
}