/* ====== Google Fonts: Space Grotesk ====== */
@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap");

/* ====== Logo 樣式：tim Insight ====== */
.main-title {
  font-family: "Space Grotesk", "Noto Sans TC", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.main-title a .tim {
  color: #222;
  font-weight: 500;  /* 較輕的字重 */
}

.main-title a .insight {
  background: linear-gradient(135deg, #B4A7D6 0%, #667eea 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  font-weight: 700;  /* 較重的字重 */
}

.main-title a:hover .insight::after {
  width: 100%;
}

.main-title a .insight::after {
  content: "";
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 2px;
  background: #667eea;
  transition: width 0.3s ease;
}

/*
Theme Name: GeneratePress Child
Theme URI: https://blog.rajatim.com
Description: Child theme for GeneratePress - Morandi Purple Edition
Author: rajatim
Template: generatepress
Version: 3.1.0 - Morandi Purple + Playfair Display
*/

/* ========================================
   blog.rajatim.com - 莫蘭迪紫優雅版
   配色：莫蘭迪紫 + Playfair Display 標題 + Inter/Noto Sans TC 內文
   版本：v3.1 - Elegant Typography
   日期：2025-10-20
   ======================================== */

/* ====== Google Fonts - Playfair Display + Inter + Noto Sans TC ====== */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700;800&family=Noto+Sans+TC:wght@400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');

/* ====== 莫蘭迪紫色系變數 ====== */
:root {
  /* 主色 - 莫蘭迪紫 */
  --primary: #B4A7D6;
  --primary-hover: #9A8CBE;
  --primary-light: #F0EDF7;
  --primary-dark: #8577A8;
  --accent: #CCC0E3;
  
  /* 文字色 */
  --text-primary: #2D2D2D;
  --text-secondary: #5A5A5A;
  --text-tertiary: #8A8A8A;
  
  /* 背景色 */
  --bg-primary: #FFFFFF;
  --bg-secondary: #FAFAFA;
  --bg-tertiary: #F5F5F5;
  
  /* 邊框和陰影 */
  --border: #E8E8E8;
  --border-light: #F0F0F0;
  --shadow-sm: 0 2px 8px rgba(180, 167, 214, 0.12);
  --shadow-md: 0 8px 24px rgba(180, 167, 214, 0.18);
  --shadow-lg: 0 12px 32px rgba(180, 167, 214, 0.22);
  
  /* 間距 */
  --radius: 12px;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
}

/* ====== 全局字體優化 ====== */
body {
  font-family: 'Noto Sans TC', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ====== 標題層級優化 ====== */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Playfair Display', 'Noto Sans TC', Georgia, 'Times New Roman', serif;
  color: var(--text-primary);
  line-height: 1.3;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

h1 {
  font-size: 2.5rem;
  font-weight: 700;  /* Playfair Display */
  margin-bottom: 1.5rem;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-top: 2.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 3px solid var(--primary);
  position: relative;
}

h2::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 80px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-secondary);
}

h4 {
  font-size: 1.25rem;
  font-weight: 600;
}

h5, h6 {
  font-size: 1.125rem;
  font-weight: 600;
}

/* ====== 文章卡片優化（含優雅 hover）====== */
article, .post, .type-post {
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
  background: var(--bg-primary);
  box-shadow: var(--shadow-sm);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

/* 頂部裝飾線 */
article::before, .post::before, .type-post::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: 0;
  transition: opacity 0.4s ease;
}

article:hover, .post:hover, .type-post:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

article:hover::before, .post:hover::before, .type-post:hover::before {
  opacity: 1;
}

/* ====== 文章標題優化 ====== */
.entry-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: var(--space-md);
  line-height: 1.4;
}

.entry-title a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.entry-title a:hover {
  color: var(--primary-hover);
}

/* ====== 元資訊美化 ====== */
.entry-meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-size: 0.875rem;
  color: var(--text-tertiary);
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}

.entry-meta a {
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color 0.2s;
}

.entry-meta a:hover {
  color: var(--primary-hover);
}

/* ====== 標籤視覺增強 ====== */
/* 分類標籤 - 莫蘭迪紫漸變 */
.cat-links a {
  display: inline-block;
  padding: 6px 16px;
  margin: 2px 4px 2px 0;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 8px rgba(180, 167, 214, 0.3);
  transition: all 0.3s ease;
}

.cat-links a:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(180, 167, 214, 0.4);
}

/* 一般標籤 - 淡雅設計 */
.post-tags a,
.entry-tags a,
.tags-links a {
  display: inline-block;
  padding: 5px 14px;
  margin: 2px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 16px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s ease;
}

.post-tags a:hover,
.entry-tags a:hover,
.tags-links a:hover {
  background: var(--primary-light);
  color: var(--primary-hover);
  border-color: var(--primary);
  transform: translateY(-1px);
}

/* ====== Reading Time 淺色系強制覆蓋 ====== */
.rt-reading-time,
.span-reading-time.rt-reading-time,
span.span-reading-time.rt-reading-time {
  display: inline-flex !important;
  align-items: center !important;
  font-size: 14px !important;
  color: #5A5A5A !important;  /* 深灰色文字 */
  margin: 0 0 24px 0 !important;
  padding: 12px 18px !important;
  background: linear-gradient(135deg, #F0EDF7 0%, #FAFAFA 100%) !important;  /* 淡紫漸變 */
  border-radius: 10px !important;
  border-left: 4px solid #B4A7D6 !important;  /* 莫蘭迪紫左邊框 */
  box-shadow: 0 2px 8px rgba(180, 167, 214, 0.12) !important;
  transition: all 0.3s ease !important;
  border-right: none !important;
  border-top: none !important;
  border-bottom: none !important;
}

.rt-reading-time:hover,
.span-reading-time.rt-reading-time:hover,
span.span-reading-time.rt-reading-time:hover {
  box-shadow: 0 8px 24px rgba(180, 167, 214, 0.18) !important;
  transform: translateY(-2px) !important;
  background: linear-gradient(135deg, #F0EDF7 0%, #FFFFFF 100%) !important;
}

.rt-label.rt-prefix {
  font-weight: 500 !important;
  margin-right: 4px !important;
  color: #5A5A5A !important;
}

.rt-time {
  font-weight: 700 !important;
  color: #9A8CBE !important;  /* 莫蘭迪紫 */
  font-size: 16px !important;
}

.rt-label.rt-postfix {
  margin-left: 4px !important;
  font-weight: 500 !important;
  color: #5A5A5A !important;
}
  font-weight: 500;
  color: var(--text-secondary);
}

/* ====== 按鈕優化 ====== */
.button,
.wp-block-button__link,
input[type="submit"],
button {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: white;
  border: none;
  border-radius: 8px;
  padding: var(--space-sm) var(--space-lg);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  box-shadow: var(--shadow-sm);
}

.button:hover,
.wp-block-button__link:hover,
input[type="submit"]:hover,
button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ====== 側邊欄 Widget 優化 ====== */
.widget {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
  box-shadow: var(--shadow-sm);
}

.widget-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--primary);
  position: relative;
}

.widget-title::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 50px;
  height: 2px;
  background: var(--accent);
}

/* ====== 導航 hover 效果 ====== */
.main-navigation a {
  transition: all 0.2s ease;
}

.main-navigation a:hover {
  color: var(--primary-hover);
}

/* ====== 搜尋框美化 ====== */
input[type="search"],
input[type="text"],
input[type="email"] {
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  transition: all 0.2s;
}

input[type="search"]:focus,
input[type="text"]:focus,
input[type="email"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* ====== 程式碼區塊美化 ====== */
pre {
  background: #282c34;
  color: #abb2bf;
  border: none;
  border-radius: var(--radius);
  padding: var(--space-lg);
  overflow-x: auto;
  margin: var(--space-lg) 0;
  box-shadow: var(--shadow-sm);
}

code {
  background: var(--bg-tertiary);
  color: #c7254e;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: 'Fira Code', 'Monaco', 'Courier New', monospace;
}

pre code {
  background: none;
  color: inherit;
  padding: 0;
}

/* ====== 引用區塊美化 ====== */
blockquote {
  margin: var(--space-lg) 0;
  padding: var(--space-md) var(--space-lg);
  border-left: 4px solid var(--primary);
  background: linear-gradient(90deg, var(--primary-light), var(--bg-primary));
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--text-secondary);
}

/* ====== 圖片優化 ====== */
img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
}

/* ====== 表格美化 ====== */
table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-lg) 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

th {
  background: linear-gradient(135deg, var(--primary-light), var(--bg-secondary));
  padding: var(--space-sm) var(--space-md);
  text-align: left;
  font-weight: 600;
  color: var(--primary-hover);
  border-bottom: 2px solid var(--primary);
}

td {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border-light);
}

tr:hover {
  background: var(--primary-light);
}

/* ====== 連結樣式 ====== */
a {
  color: var(--primary-hover);
  font-family: 'Noto Sans TC', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  transition: all 0.2s ease;
}

a:hover {
  color: var(--primary-dark);
}

/* ====== 載入動畫 ====== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

article, .post {
  animation: fadeInUp 0.6s ease-out;
}

/* ====== 響應式設計 ====== */
@media (max-width: 768px) {
  :root {
    --space-lg: 16px;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  article, .post {
    padding: var(--space-md);
  }
  
  .rt-reading-time {
    font-size: 13px;
    padding: 10px 14px;
  }
  
  .rt-time {
    font-size: 14px;
  }
}

/* ====== 無障礙優化 ====== */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ====== 效能優化 ====== */
* {
  box-sizing: border-box;
}

a, button, input {
  -webkit-tap-highlight-color: transparent;
}

/* ====== 暗色模式支援 ====== */
@media (prefers-color-scheme: dark) {
  .rt-reading-time {
    background: linear-gradient(135deg, #2D2D2D 0%, #1A1A1A 100%);
    color: #D1D5DB;
    box-shadow: 0 1px 3px rgba(180, 167, 214, 0.3);
  }
  
  .rt-reading-time:hover {
    box-shadow: 0 4px 6px rgba(180, 167, 214, 0.4);
  }
  
  .rt-time {
    color: var(--accent);
  }
}

/* ====== 導航 Active 狀態指示器 ====== */
/* 當前頁面 - 底線指示器 */
.main-navigation .main-nav ul li.current-menu-item > a,
.main-navigation .main-nav ul li.current-menu-parent > a,
.main-navigation .main-nav ul li.current-menu-ancestor > a,
.main-navigation .main-nav ul li.current_page_item > a {
  color: var(--primary) !important;
  position: relative;
}

.main-navigation .main-nav ul li.current-menu-item > a::after,
.main-navigation .main-nav ul li.current-menu-parent > a::after,
.main-navigation .main-nav ul li.current-menu-ancestor > a::after,
.main-navigation .main-nav ul li.current_page_item > a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 2px;
}

/* Hover 狀態保持底線 */
.main-navigation .main-nav ul li.current-menu-item > a:hover::after,
.main-navigation .main-nav ul li.current_page_item > a:hover::after {
  width: 32px;
}

/* 分類頁面的父選單高亮 */
.main-navigation .main-nav ul li.current-menu-parent > a {
  font-weight: 600;
}
