@import url("notosanstc.css");
@import url("notoseriftc.css");

@font-face {
  font-family: "TaiwanPearl-Regular";
  font-style: normal; /* Explicitly state the style */
  font-weight: 400; /* Explicitly state the weight (400 is normal/regular) */
  font-display: swap; /* Recommended: Shows fallback text immediately, swaps when loaded */
  src: url(https://cdn.jsdelivr.net/gh/max32002/TaiwanPearl@2.125/webfont/TaiwanPearl-Regular.woff2)
      format("woff2"),
    url(https://cdn.jsdelivr.net/gh/max32002/TaiwanPearl@2.125/webfont/TaiwanPearl-Regular.woff)
      format("woff");
}

@font-face {
  font-family: "HunInn";
  src: url(https://cdn.jsdelivr.net/gh/marsnow/open-huninn-font@1.1/font/jf-openhuninn.eot); /* IE9 Compat Modes */
  src: url(https://cdn.jsdelivr.net/gh/marsnow/open-huninn-font@1.1/font/jf-openhuninn.eot?#iefix)
      format("embedded-opentype"),
    /* IE6-IE8 */
      url(https://cdn.jsdelivr.net/gh/marsnow/open-huninn-font@1.1/font/jf-openhuninn.woff)
      format("woff"),
    /* Modern Browsers */
      url(https://cdn.jsdelivr.net/gh/marsnow/open-huninn-font@1.1/font/jf-openhuninn.ttf)
      format("truetype"),
    /* Safari, Android, iOS */
      url(https://cdn.jsdelivr.net/gh/marsnow/open-huninn-font@1.1/font/jf-openhuninn.svg#SealmemoryHeader)
      format("svg"); /* Legacy iOS */
}

@import url("widget.css");

/**
 * Macchiato 主題自訂樣式
 * 在這裡添加您的自訂樣式，避免修改 style.css
 */

/**
 * 目錄：
 * 1. 全局樣式
 * 2. 頁首樣式
 * 3. 導航樣式
 * 4. 內容樣式
 * 5. 側邊欄樣式
 * 6. 頁尾樣式
 * 7. 首頁樣式
 * 8. 文章和頁面樣式
 * 9. 評論樣式
 * 10. 響應式調整
 * 11. 輔助類別
 * 12. 整合樣式 (WooCommerce, Elementor)
 */

/* ========================================
   1. 全局樣式
   ======================================== */
body {
  font-family: var(--bs-body-font-family);
  color: var(--bs-body-color);
  line-height: var(--bs-body-line-height);
  overflow-x: hidden;
}

a {
  color: var(--bs-link-color);
  text-decoration: var(--bs-link-decoration);
  transition: all 0.3s ease;
}

a:hover {
  color: var(--bs-link-hover-color);
  text-decoration: var(--bs-link-hover-decoration);
}

h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
  margin-bottom: 1rem;
  font-weight: var(--bs-headings-font-weight);
  line-height: var(--bs-headings-line-height);
  color: var(--bs-headings-color);
}

/* 容器調整，確保內容區域有合適間距 */
.container,
.container-fluid {
  padding-right: calc(var(--bs-gutter-x) * 0.5);
  padding-left: calc(var(--bs-gutter-x) * 0.5);
  margin-right: auto;
  margin-left: auto;
}

#main {
  padding: 3em 0;
}

/* ========================================
   2. 頁首樣式
   ======================================== */
.site-header {
  background-color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 999;
}

.navbar-brand {
  padding: 0.5rem 0;
}

.custom-logo-link {
  display: inline-block;
}

.custom-logo {
  max-height: 60px;
  width: auto;
}

.site-title {
  font-size: 1.5rem;
  margin-bottom: 0;
}

.site-description {
  font-size: 0.875rem;
  margin-bottom: 0;
  color: rgba(0, 0, 0, 0.6);
}

/* ========================================
   3. 導航樣式
   ======================================== */
.navbar {
  padding: 0;
}

.navbar-nav .nav-link {
  padding: 1rem 0.75rem;
  font-weight: 500;
}

.navbar-nav .dropdown-menu {
  border-radius: 0.25rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.dropdown-item:active {
  background-color: var(--bs-primary);
}

/* 行動裝置導航 */
/**
 * Mobile Navigation Custom Styles
 */

/* Off-canvas menu styling */
.offcanvas {
  max-width: 80%;
}

/* Mobile menu items */
#mobileNavContent .navbar-nav .nav-item {
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

#mobileNavContent .navbar-nav .nav-link {
  padding: 0.5rem 1rem;
  font-size: 1rem;
}

/* Dropdown styling in mobile view */
#mobileNavContent .dropdown-menu {
  border: none;
  background-color: rgba(0, 0, 0, 0.05);
  padding-left: 1rem;
}

#mobileNavContent .dropdown-item {
  padding: 0.5rem 1rem;
}

/* Mobile toggle button */
.navbar-toggler {
  border: none;
  padding: 0.5rem;
}

.navbar-toggler:focus {
  box-shadow: none;
  outline: none;
}

/* Ensure the site title/logo is properly sized on mobile */
@media (max-width: 767px) {
  .site-title {
    font-size: 1.2rem;
    margin-bottom: 0;
  }

  .site-description {
    font-size: 0.8rem;
    margin-bottom: 0;
  }

  .custom-logo {
    max-height: 40px;
    width: auto;
  }
}

/* ========================================
   4. 內容樣式
   ======================================== */
.site-content {
  padding: 3rem 0;
  min-height: 500px; /* 確保短頁面有足夠高度 */
}

.entry-content {
  margin-bottom: 2rem;
}

.entry-content p,
.entry-content ul,
.entry-content ol {
  margin-bottom: 1.5rem;
}

.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6 {
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.entry-meta {
  font-size: 0.875rem;
  color: #6c757d;
  margin-bottom: 1rem;
}

.entry-meta a {
  color: inherit;
}

.entry-meta a:hover {
  color: var(--bs-primary);
}

.entry-footer {
  padding-top: 1rem;
  margin-top: 2rem;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  font-size: 0.875rem;
}

/* 分頁 */
.pagination {
  margin-top: 2rem;
}

.page-numbers {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  border: 1px solid #dee2e6;
  margin: 0 0.25rem;
  text-decoration: none;
  color: var(--bs-primary);
  border-radius: 0.25rem;
}

.page-numbers.current {
  background-color: var(--bs-primary);
  color: #fff;
  border-color: var(--bs-primary);
}

/* 麵包屑導航 */
.breadcrumb {
  margin-bottom: 2rem;
  background-color: rgba(0, 0, 0, 0.03);
  padding: 0.75rem 1rem;
  border-radius: 0.25rem;
  font-size: 0.875rem;
}

/* ========================================
   5. 側邊欄樣式
   ======================================== */
.widget-area {
  margin-top: 3rem;
}

@media (min-width: 992px) {
  .widget-area {
    margin-top: 0;
  }
}

.widget {
  margin-bottom: 2rem;
}

.widget ul {
  padding-left: 1.25rem;
}

.widget li {
  padding: 0.25rem 0;
}

/* 搜尋 widget */
.search-form {
  position: relative;
}

.search-form .form-control {
  padding-right: 3rem;
}

.search-form .btn {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
}

/* ========================================
   6. 頁尾樣式
   ======================================== */
.site-footer {
  background-color: #212529;
  color: rgba(255, 255, 255, 0.6);
  padding: 3rem 0 1.5rem;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.8);
}

.site-footer a:hover {
  color: #fff;
}

.site-footer .widget-title {
  color: #fff;
  margin-bottom: 1.5rem;
  font-size: 1.25rem;
}

.footer-widgets {
  margin-bottom: 2rem;
}

.site-info {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.5rem;
  font-size: 0.875rem;
}

/* ========================================
   7. 首頁樣式
   ======================================== */
/* 首頁橫幅區域 */
.home-banner {
  background-color: var(--bs-light);
  padding: 5rem 0;
  margin-bottom: 3rem;
  text-align: center;
}

.home-banner h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.home-banner p {
  font-size: 1.25rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 2rem;
}

/* 首頁特色區塊 */
.home-feature {
  padding: 3rem 0;
}

.home-feature .card {
  height: 100%;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.home-feature .card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.home-feature .card-img-top {
  height: 200px;
  object-fit: cover;
}

/* ========================================
   8. 文章和頁面樣式
   ======================================== */
/* 特色圖片 */
.post-thumbnail {
  margin-bottom: 1.5rem;
}

.post-thumbnail img {
  width: 100%;
  height: auto;
  border-radius: 0.25rem;
}

/* 文章列表 */
.post {
  margin-bottom: 3rem;
}

.post-card {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.post-card .card-body {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.post-card .entry-content {
  flex-grow: 1;
}

.post-card .card-img-top {
  height: 200px;
  object-fit: cover;
}

/* ========================================
   9. 評論樣式
   ======================================== */
.comments-area {
  margin-top: 3rem;
}

.comment-list {
  padding-left: 0;
  list-style: none;
}

.comment {
  margin-bottom: 2rem;
}

.comment-body {
  padding: 1rem;
  background-color: #f8f9fa;
  border-radius: 0.25rem;
}

.comment-meta {
  margin-bottom: 1rem;
}

.comment-author .avatar {
  margin-right: 0.5rem;
  border-radius: 50%;
}

.comment-metadata {
  font-size: 0.75rem;
  color: #6c757d;
}

.comment-form label {
  display: block;
  margin-bottom: 0.5rem;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  padding: 0.375rem 0.75rem;
  border: 1px solid #ced4da;
  border-radius: 0.25rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.comment-form input[type="text"]:focus,
.comment-form input[type="email"]:focus,
.comment-form input[type="url"]:focus,
.comment-form textarea:focus {
  border-color: var(--bs-primary);
  outline: 0;
  box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25);
}

/* ========================================
   10. 響應式調整
   ======================================== */
@media (max-width: 767.98px) {
  .site-content {
    padding: 2rem 0;
  }

  .home-banner {
    padding: 3rem 0;
  }

  .home-banner h1 {
    font-size: 2rem;
  }

  .home-banner p {
    font-size: 1rem;
  }

  .entry-title {
    font-size: 1.75rem;
  }
}

@media (max-width: 575.98px) {
  .home-banner {
    padding: 2rem 0;
  }

  .home-banner h1 {
    font-size: 1.75rem;
  }

  .post-card .card-img-top {
    height: 180px;
  }
}

/* ========================================
   11. 輔助類別
   ======================================== */
/* 螢幕閱讀器文字 */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute !important;
  width: 1px;
  word-wrap: normal !important;
}

/* 更多連結箭頭 */
.more-link {
  display: inline-block;
  margin-top: 1rem;
}

.more-link::after {
  content: " →";
  font-size: 80%;
}

/* 內容對齊 */
.text-center img,
.aligncenter {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.alignleft {
  float: left;
  margin: 0.5rem 1rem 0.5rem 0;
}

.alignright {
  float: right;
  margin: 0.5rem 0 0.5rem 1rem;
}

/* ========================================
   12. 整合樣式 (WooCommerce, Elementor)
   ======================================== */
/* Elementor 相容性 */
.elementor-page .site-content {
  padding: 0;
}

.elementor-page.has-sidebar .site-content {
  padding: 3rem 0;
}

/* WooCommerce 樣式覆蓋 (如果需要) */
.woocommerce .main a.button,
.woocommerce .main button.button {
  background-color: var(--bs-primary);
  color: #fff;
}

.woocommerce .main a.button:hover,
.woocommerce .main button.button:hover {
  background-color: var(--bs-primary-hover);
  color: #fff;
}

/* 開發模式指示器 */
.dev-mode::before {
  content: "開發模式";
  position: fixed;
  bottom: 0;
  right: 0;
  background-color: #dc3545;
  color: #fff;
  font-size: 11px;
  padding: 3px 6px;
  z-index: 9999;
  opacity: 0.7;
}
