@font-face {
  font-family: 'LXG';

  /* 這裡的 url 請對應你 Step 1 放入的字體檔名 */
  src: url('/fonts/LXGWWenKaiTC-Medium.ttf') format('truetype');

  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'Swei';

  /* 注意：檔名後面一定要加上副檔名 (例如 .ttf 或 .otf) */
  src: url('/fonts/irohamaru-Regular.ttf') format('truetype');

  font-weight: normal;
  font-style: normal;
}

/* 2. 覆寫 mana 主題預設的字體變數 */
:root,
[data-theme="light"] {
  /* 文章內文、普通文字使用 Swei */
  --font-body: 'Swei', sans-serif !important;

  /* 網站的各個大標題 (h1, h2, h3，包含文章標題) 使用 Swei */
  --font-heading: 'Swei', sans-serif !important;

  /* 左上角的網站 Logo 名稱使用 LXG */
  --font-logo: 'LXG', sans-serif !important;
}

/* 強制讓上方的導覽列 (首頁、文章、關於我) 也使用 LXG 字體 */
.sticky-header,
.mobile-menu-content {
  font-family: 'LXG', sans-serif !important;
}

/* =========================================
   3. 下拉選單 (Dropdown Menu) 樣式
   ========================================= */

/* 電腦版導覽列：確保選單項目可以包含絕對定位的下拉選單 */
.header-menu .menu-item {
  position: relative;
}

/* 電腦版下拉選單 (預設隱藏) */
.header-menu .dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-primary, #fff);
  border: 1px solid var(--border-color, #eaeaea);
  border-radius: 0.375rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  min-width: 180px;
  padding: 0.5rem 0;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.2s ease;
  list-style: none;
  margin: 0;
}

/* 支援深色模式 */
[data-theme="dark"] .header-menu .dropdown-menu {
  background-color: var(--bg-secondary, #1e293b);
  border-color: var(--border-color, #334155);
}

/* 滑鼠移入時顯示下拉選單 */
.header-menu .menu-item.has-dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* 下拉選單項目 */
.dropdown-menu .dropdown-item {
  width: 100%;
}

.dropdown-menu .menu-link {
  display: block;
  padding: 0.5rem 1rem;
  font-weight: normal;
  border-radius: 0;
}

.dropdown-arrow {
  font-size: 0.8em;
  margin-left: 4px;
  opacity: 0.7;
}

/* =========================================
   手機版 (側邊欄) 下拉選單樣式
   ========================================= */
.mobile-menu-nav .dropdown-menu {
  display: flex;
  flex-direction: column;
  list-style: none;
  padding: 0 0 0 1rem;
  /* 縮排 */
  margin: 0.25rem 0 0 1rem;
  border-left: 2px solid var(--border-color, #eaeaea);
}

.mobile-menu-nav .dropdown-item .menu-link {
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
  opacity: 0.9;
}

/* =========================================
   4. 首頁「最近發布」標題專屬樣式
   ========================================= */
.posts-title {
  /* 在這邊換成你想要的字體名稱，如果沒有指定，會使用你上方設定的 LXG 字體 */
  font-family: 'Swei', 'Arial', sans-serif !important;
  /* 也可以在這裡調整大小或顏色 */
  /* color: #FF5722; */
}

/* =========================================
   5. 首頁滿版輪播圖 (Hero Slider) 樣式
   ========================================= */
.hero-slider-section {
  width: 100%;
  position: relative;
  /* background-color: var(--bg-primary); */
  overflow: hidden;
  padding: 40px 0;
  /* Add padding to look better */
}

.hero-swiper {
  width: 100%;
  height: 60vh;
  min-height: 400px;
}

.hero-swiper .swiper-wrapper {
  display: flex;
  height: 100%;
}

.hero-swiper .swiper-slide {
  width: 75%;
  /* Active slide width */
  max-width: 1000px;
  height: 100%;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.hero-swiper .slide-link,
.hero-swiper .slide-bg {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  display: block;
}

/* Make adjacent slides slightly smaller and transparent */
.hero-swiper .swiper-slide:not(.swiper-slide-active) {
  opacity: 0.6;
  transform: scale(0.85);
}

/* Customize Navigation Buttons */
.hero-swiper .swiper-button-prev,
.hero-swiper .swiper-button-next {
  color: #fff;
  background: rgba(0, 0, 0, 0.4);
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.hero-swiper .swiper-button-prev:after,
.hero-swiper .swiper-button-next:after {
  font-size: 18px;
  font-weight: bold;
}

.hero-swiper .swiper-button-prev:hover,
.hero-swiper .swiper-button-next:hover {
  background: rgba(0, 0, 0, 0.8);
}

/* Customize Pagination */
.hero-swiper .swiper-pagination-bullet {
  background: rgba(150, 150, 150, 0.7);
  opacity: 1;
}

.hero-swiper .swiper-pagination-bullet-active {
  background: var(--accent-primary, #CB1B45);
  transform: scale(1.2);
}

@media (max-width: 768px) {
  .hero-swiper .swiper-slide {
    width: 85%;
  }
}

/* =========================================
   6. 文章頁面：頂部封面圖片限制高度
   ========================================= */
.post-image-single img {
  width: 100%;
  /* 寬度一樣維持滿版 */
  max-height: 400px;
  object-fit: cover;
  /* 👉 圖片如果比例不對，會自動裁切邊緣而不會被壓扁變形 */
  border-radius: 8px;
  /* (選擇性) 如果你想讓圖片有圓角，可以保留這行 */
}

/* =========================================
   7. 文章卡片：限制首頁內文/副標題顯示兩行
   ========================================= */
.post-description {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  /* 限制顯示兩行 */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  /* 超過的部分顯示 ... */
}

/* =========================================
   8. 橫式文章卡片 (Horizontal Post Card)
   ========================================= */
.post-card {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  /* 恢復為 center，不強制拉長 */
  gap: 20px;
  background-color: var(--bg-primary);
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  margin-bottom: 24px;
}

/* 圖片區塊 (控制左側格子的長寬比例與大小) */
.post-card .post-image {
  flex: 0 0 35%;
  /* 👉 這是格子的寬度 (目前佔據卡片的 35%) */
  max-width: 200px;
  aspect-ratio: 1 / 1;
  /* 恢復上一版的比例設定 (可以改成 16 / 10) */
  margin: 0 !important;
}

.post-card .post-image img {
  width: 100%;
  height: 100%;
  /* 讓圖片完美填滿這個格子的高度 */
  object-fit: cover;
  /* 讓圖片填滿格子且不會被壓扁變形 */
  border-radius: 0;
}

/* 內容區塊 */
.post-card .post-content {
  flex: 1;
  padding: 20px 20px 20px 0;
  display: flex;
  flex-direction: column;
}

.post-card .post-title {
  margin-top: 0;
}

/* 確保內文限制兩行 */
.post-card .post-description {
  margin-bottom: auto;
  /* 讓下方的 footer 被推到最底 */
}

/* 底部排列：Tag 和 閱讀更多 */
.post-card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  border-top: 1px solid var(--border-color, #eee);
  padding-top: 12px;
}

/* 原本的 post-tags-inline 可能有自己的 margin，消除它 */
.post-card-bottom .post-tags {
  margin-bottom: 0 !important;
  margin-top: 0 !important;
}

.post-read-more {
  color: var(--primary-color, #FF5722);
  font-weight: bold;
  text-decoration: none;
  font-size: 0.9em;
  white-space: nowrap;
}

.post-read-more:hover {
  text-decoration: underline;
}

/* 手機版自動切換為直式排版 */
@media (max-width: 768px) {
  .post-card {
    flex-direction: column !important;
  }

  .post-card .post-image {
    flex: 1 1 auto;
    max-width: 100%;
  }

  .post-card .post-content {
    padding: 20px;
  }
}

/* =========================================
   9. 內文 (Markdown 插入) 圖片樣式
   ========================================= */
.post-content-main img {
  max-width: 100%;
  /* 最大不會超過文章寬度 */
  max-height: 500px;
  /* 限制最高高度，避免圖片太大佔滿螢幕 */
  width: auto;
  /* 保持圖片比例 */
  border-radius: 8px;
  /* 給圖片加一點圓角 */
  display: block;
  margin: 20px auto;
  /* 讓圖片上下有間距，並且置中對齊 */
}

/* =========================================
   10. 客製化配色 (淡天藍、櫻花粉、珊瑚粉、薰衣草紫、玫瑰棕)
   ========================================= */

/* 覆寫網站的全局變數 (針對亮色模式) */
:root,
[data-theme="light"] {
  /* 主要背景：白色 */
  --bg-deep: #FFFFFF !important;
  --bg-primary: #FFFFFF !important;

  /* 卡片與區塊背景：白色 */
  --bg-secondary: #FFFFFF !important;
  --glass-surface: rgba(255, 255, 255, 0.8) !important;

  /* 主題強調色：胭脂紅/深紅 (#CB1B45) - 用於主要連結與按鈕 */
  --accent-primary: #CB1B45 !important;
  --accent-light-purple: #CB1B45 !important;
  --accent-hover: #CB1B45 !important;

  /* 次要強調色：卡其/米黃 (#DAC9A6) - 用於 Tag 與底色 */
  --accent-mid-purple: #DAC9A6 !important;
  --tag-bg: #DAC9A6 !important;

  /* 點綴色：深林綠 (#096148) - 用於特定深色強調 */
  --accent-secondary: #096148 !important;
  --border-color: #DAC9A6 !important;
  /* 邊框用卡其色 */
}

/* 1. 讓整體背景變成「白色」，並移除預設的漸層 */
[data-theme="light"] body,
body {
  background-image: none !important;
  background-color: #FFFFFF !important;
}

/* 2. 讓上方的導覽列變成「白色」 */
.sticky-header {
  background-color: rgba(255, 255, 255, 0.95) !important;
  border-bottom: 2px solid #DAC9A6 !important;
  /* 加上卡其色的底線 */
}

/* 3. 首頁的文章卡片背景變成「白色」 */
.post-card {
  background-color: #FFFFFF !important;
  border: 1px solid #DAC9A6 !important;
  /* 卡其色邊框 */
}

/* 4. Tag 標籤的顏色分配 */
.post-tag,
.tag-chip,
.tag-chip-large {
  background-color: #DAC9A6 !important;
  /* 卡其色背景 */
  color: #333 !important;
  /* 深色字體方便閱讀 */
}

.post-tag:hover,
.tag-chip:hover,
.tag-chip-large:hover,
.tag-item:hover .tag-chip-large {
  background-color: #CB1B45 !important;
  /* 滑鼠碰到變成胭脂紅 */
  color: #fff !important;
}

.tag-chip-active {
  background-color: #CB1B45 !important;
  color: #fff !important;
}

/* 5. 所有的文章標題連結與「閱讀更多」的顏色分配 */
a:hover,
.post-title a:hover {
  color: #CB1B45 !important;
  /* 標題跟連結變成胭脂紅 */
}

.post-read-more {
  color: #096148 !important;
  /* 閱讀更多平常是深林綠 */
}

.post-read-more:hover {
  color: #CB1B45 !important;
  /* 閱讀更多碰到變胭脂紅 */
}

/* 5.1 相關文章 (Related Posts) 標題配色 */
.related-post-link strong {
  color: #333 !important;
  /* 平常為深色字體 */
}

.related-post-link:hover strong {
  color: #CB1B45 !important;
  /* 滑鼠碰到變胭脂紅 */
}

.related-post-item {
  border-color: #DAC9A6 !important;
  /* 卡其色邊框 */
  background-color: #FFFFFF !important;
  /* 白色背景 */
}

/* 6. 文章閱讀頁面的背景卡片 */
.single-post {
  background-color: #FFFFFF !important;
  /* 白色 */
  border-radius: 12px;
  padding: 30px;
}

/* =========================================
   11. Table of Contents (TOC) 文章目錄配色
   ========================================= */
/* 目錄整個大區塊的背景與邊框 */
.post-toc {
  background-color: #FFFFFF !important;
  background-image: none !important;
  border: 1px solid #DAC9A6 !important;
  /* 卡其色邊框 */
}

/* 隱藏原本主題用來做半透明玻璃特效的遮罩 */
.post-toc::before {
  display: none !important;
}

/* 確保目錄內的元素在最上層 */
.post-toc>* {
  position: relative;
  z-index: 2;
}

/* 目錄裡的文字連結 */
.toc-nav a {
  color: #666 !important;
  /* 預設灰字 */
}

/* 滑鼠碰到目錄文字時 */
.toc-nav a:hover {
  color: #CB1B45 !important;
  /* 胭脂紅字體 */
  background-color: rgba(218, 201, 166, 0.3) !important;
  /* 卡其色半透明底色 */
}

/* 當前閱讀到的進度 (Active) */
.toc-nav a.active {
  color: #096148 !important;
  /* 深林綠字體，強調目前位置 */
  border-left-color: #096148 !important;
  /* 深林綠長條指示線 */
  background-color: rgba(218, 201, 166, 0.3) !important;
  /* 卡其色半透明底色 */
  font-weight: bold;
}

/* 手機版展開目錄的按鈕 */
.toc-toggle:hover {
  background-color: rgba(218, 201, 166, 0.3) !important;
}

.toc-burger-icon {
  color: #CB1B45 !important;
}

/* =========================================
   12. 麵包屑導覽 (Breadcrumb) 顏色設定
   ========================================= */
/* 只有麵包屑的超連結 (Home, Posts) 顯示綠色 */
.breadcrumb-nav a {
  color: #2E8B57 !important;
  /* 綠色 (SeaGreen) */
  transition: color 0.3s ease;
}

/* 當滑鼠移過 (Hover) 或是點選時變成紅色 */
.breadcrumb-nav a:hover,
.breadcrumb-nav a:active {
  color: #DC143C !important;
  /* 紅色 (Crimson) */
}

/* =========================================
   13. 列表頁面標題 (List Header) 樣式設定
   ========================================= */
/* 讓它與 Logo 的字體與實心顏色一樣，移除原本的空心框線特效 */
.list-title-line2 {
  font-family: var(--font-logo) !important;
  font-weight: 300 !important;
  /* 改為較輕的字重，避免筆畫糊在一起 */
  color: var(--text-primary) !important;
  font-size: 1rem !important;
  /* 依照需求調整為 1rem 大小 */
  -webkit-text-stroke: 0 !important;
  letter-spacing: normal !important;
}