/* Eleventy 部落格專用 CSS (設計語言極致相容 Paris Portfolio 闇色主題) */

:root {
  --bg-primary: #0f1011;
  --bg-card: #18191c;
  --bg-card-hover: #222428;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --accent-color: #818cf8;
  --accent-hover: #6366f1;
  --border-color: #2e3035;
}

/* 部落格主容器 ( margin-top: 120px 留白避開主站 100px 固定雙層選單) */
.blog-container {
  max-width: 1140px;
  margin: 120px auto 60px auto;
  padding: 0 20px;
  box-sizing: border-box;
  width: 100%;
}

/* 頁面大標題 */
.blog-header {
  text-align: center;
  margin-bottom: 35px;
  padding: 10px 0;
  width: 100%;
}

.blog-header h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.75rem;
  letter-spacing: 3px;
  color: var(--text-main);
  margin-bottom: 8px;
  text-transform: uppercase;
}

.blog-header p {
  color: var(--text-muted);
  font-size: 1rem;
  font-family: 'Noto Sans TC', sans-serif;
  margin: 0;
}

/* 標籤/分類篩選列 (膠囊狀水平置中橫排) */
.filter-bar {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
  justify-content: center !important;
  align-items: center !important;
  margin-bottom: 40px !important;
  padding: 0 10px !important;
  width: 100% !important;
}

.filter-bar a.filter-btn,
.filter-btn {
  display: inline-block !important;
  width: auto !important;
  background-color: var(--bg-card) !important;
  color: var(--text-muted) !important;
  border: 1px solid var(--border-color) !important;
  padding: 6px 18px !important;
  border-radius: 20px !important;
  font-size: 0.875rem !important;
  font-family: 'Noto Sans TC', sans-serif !important;
  cursor: pointer !important;
  text-decoration: none !important;
  transition: all 0.25s ease !important;
  margin: 0 !important;
}

.filter-bar a.filter-btn:hover,
.filter-bar a.filter-btn.active {
  background-color: var(--accent-color) !important;
  color: #ffffff !important;
  border-color: var(--accent-color) !important;
  box-shadow: 0 4px 14px rgba(129, 140, 248, 0.4) !important;
}

/* 文章卡片網格 */
.article-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)) !important;
  gap: 30px !important;
  width: 100% !important;
}

/* 文章卡片單體 */
.article-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  display: flex !important;
  flex-direction: column !important;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  width: 100% !important;
}

.article-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  border-color: var(--accent-color);
}

/* 卡片封面圖 */
.card-cover {
  width: 100% !important;
  height: 200px !important;
  object-fit: cover !important;
  display: block !important;
  background-color: #1a1a1d;
  transition: transform 0.4s ease;
}

.article-card:hover .card-cover {
  transform: scale(1.04);
}

/* 卡片內容區 */
.card-body {
  padding: 24px;
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto;
  width: 100% !important;
}

.card-meta {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  width: 100% !important;
}

.card-meta span {
  width: auto !important;
  display: inline-block !important;
}

.badge-category {
  display: inline-block !important;
  width: auto !important;
  background-color: rgba(129, 140, 248, 0.15);
  color: var(--accent-color);
  padding: 2px 10px;
  border-radius: 12px;
  font-weight: 500;
  font-size: 0.75rem;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 12px 0;
  font-family: 'Noto Sans TC', sans-serif;
  width: 100% !important;
}

.card-title a {
  display: inline !important;
  width: auto !important;
  color: var(--text-main);
  text-decoration: none;
  transition: color 0.2s ease;
}

.card-title a:hover {
  color: var(--accent-color);
}

.card-excerpt {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 20px;
  flex: 1 1 auto;
  width: 100% !important;

  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
  margin-top: auto;
  width: 100% !important;
}

.card-footer span, .card-footer a {
  width: auto !important;
  display: inline-block !important;
}

/* ==========================================================================
   文章內頁 (Post Detail)
   ========================================================================== */
.post-detail {
  max-width: 860px;
  margin: 120px auto 80px auto;
  padding: 0 20px;
  box-sizing: border-box;
  width: 100%;
}

.post-header {
  text-align: center;
  margin-bottom: 35px;
  width: 100%;
}

.post-header h1 {
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-main);
  margin: 16px 0;
  font-family: 'Noto Sans TC', sans-serif;
  width: 100%;
}

.post-meta-info {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 12px !important;
  color: var(--text-muted);
  font-size: 0.875rem;
  width: 100% !important;
}

.post-meta-info span {
  width: auto !important;
  display: inline-block !important;
}

.post-cover-img {
  width: 100% !important;
  max-height: 480px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 40px;
  border: 1px solid var(--border-color);
  background-color: #1a1a1d;
}

/* 內文排版 */
.post-content {
  color: #d1d5db;
  font-size: 1.05rem;
  line-height: 1.85;
  font-family: 'Noto Sans TC', sans-serif;
  width: 100%;
}

.post-content p {
  margin-bottom: 1.5rem;
  width: 100%;
}

.post-content h2 {
  font-size: 1.6rem;
  color: var(--text-main);
  margin: 2.5rem 0 1rem 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
  width: 100%;
}

.post-content h3 {
  font-size: 1.3rem;
  color: var(--text-main);
  margin: 2rem 0 0.8rem 0;
  width: 100%;
}

.post-content blockquote {
  border-left: 4px solid var(--accent-color);
  background-color: rgba(255, 255, 255, 0.03);
  padding: 16px 24px;
  margin: 1.5rem 0;
  border-radius: 0 8px 8px 0;
  color: #e5e7eb;
  font-style: italic;
  width: 100%;
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 20px 0;
  display: block;
}

/* ==========================================================================
   文章內文圖片多欄並排 (Image Grids & Columns for 2, 3, 4 columns)
   ========================================================================== */
.post-content .grid-2,
.post-content .grid-3,
.post-content .grid-4,
.post-content .image-grid {
  display: grid !important;
  gap: 16px !important;
  margin: 24px 0 !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* 2 欄並排 */
.post-content .grid-2 {
  grid-template-columns: repeat(2, 1fr) !important;
}

/* 3 欄並排 */
.post-content .grid-3 {
  grid-template-columns: repeat(3, 1fr) !important;
}

/* 4 欄並排 */
.post-content .grid-4 {
  grid-template-columns: repeat(4, 1fr) !important;
}

/* 自動響應式網格 (依畫面尺寸自動填滿) */
.post-content .image-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
}

/* 並排圖片統一高度與滿寬裁剪 */
.post-content .grid-2 img,
.post-content .grid-3 img,
.post-content .grid-4 img,
.post-content .image-grid img {
  width: 100% !important;
  height: 240px !important;
  object-fit: cover !important;
  border-radius: 8px !important;
  margin: 0 !important;
}

/* 手機版自動切換為單欄 */
@media screen and (max-width: 640px) {
  .post-content .grid-2,
  .post-content .grid-3,
  .post-content .grid-4 {
    grid-template-columns: 1fr !important;
  }
  .post-content .grid-2 img,
  .post-content .grid-3 img,
  .post-content .grid-4 img {
    height: auto !important;
  }
}

/* ==========================================================================
   CTA 行動呼籲按鈕樣式 (Call To Action Buttons)
   ========================================================================== */

/* 按鈕容器與置中對齊 */
.post-content .cta-wrapper,
.post-content .wp-block-buttons,
.post-content .btn-container {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 16px !important;
  margin: 32px 0 !important;
  width: 100% !important;
  flex-wrap: wrap !important;
}

/* CTA 主要按鈕樣式 (.btn-cta, .cta-button, .wp-block-button__link) */
.post-content a.btn-cta,
.post-content a.cta-button,
.post-content .wp-block-button__link {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  width: auto !important;
  padding: 14px 32px !important;
  background: linear-gradient(135deg, #6366f1 0%, #818cf8 100%) !important;
  color: #ffffff !important;
  font-family: 'Noto Sans TC', sans-serif !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
  letter-spacing: 1px !important;
  text-decoration: none !important;
  border-radius: 30px !important;
  border: none !important;
  box-shadow: 0 4px 18px rgba(99, 102, 241, 0.4) !important;
  cursor: pointer !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  margin: 8px 0 !important;
}

.post-content a.btn-cta:hover,
.post-content a.cta-button:hover,
.post-content .wp-block-button__link:hover {
  transform: translateY(-3px) scale(1.02) !important;
  box-shadow: 0 8px 28px rgba(129, 140, 248, 0.6) !important;
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%) !important;
  color: #ffffff !important;
}

.post-content a.btn-cta:active,
.post-content a.cta-button:active,
.post-content .wp-block-button__link:active {
  transform: translateY(-1px) scale(0.99) !important;
}

/* 次要/邊框款 CTA 按鈕 (.btn-cta-outline) */
.post-content a.btn-cta-outline {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  width: auto !important;
  padding: 12px 30px !important;
  background: transparent !important;
  color: var(--text-main) !important;
  border: 2px solid var(--border-color) !important;
  font-family: 'Noto Sans TC', sans-serif !important;
  font-size: 1rem !important;
  font-weight: 500 !important;
  text-decoration: none !important;
  border-radius: 30px !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
}

.post-content a.btn-cta-outline:hover {
  border-color: var(--accent-color) !important;
  color: var(--accent-color) !important;
  background: rgba(129, 140, 248, 0.08) !important;
  transform: translateY(-2px) !important;
}

.post-tags {
  margin-top: 40px;
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  align-items: center !important;
  width: 100% !important;
}

.tag-badge {
  display: inline-block !important;
  width: auto !important;
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 0.8rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.tag-badge:hover {
  color: var(--accent-color);
  border-color: var(--accent-color);
}
