/*
Theme Name: My Theme
Description: 一個現代化的WordPress主題
Version: 1.0
Author: Your Name
Author URI: https://yoursite.com
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: my-theme
*/

/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 防止所有元素導致水平溢出 */
html {
    overflow-x: hidden;
}

* {
    /* 確保所有元素不會超出容器 */
    max-width: 100%;
}

/* 針對可能導致溢出的元素進行特殊處理 */
img, video, iframe, embed, object {
    max-width: 100% !important;
    height: auto !important;
    box-sizing: border-box;
}

/* 防止滿版元素造成水平滾動 */
.home-hero,
.youtube-gallery {
    width: 100vw !important;
    position: relative !important;
    left: 50% !important;
    right: 50% !important;
    margin-left: -50vw !important;
    margin-right: -50vw !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
}

/* 確保容器不會超出視窗寬度 */
.home-hero__img,
.customer-testimonial__img {
    width: 100% !important;
    max-width: none !important;
    display: block !important;
    object-fit: cover !important;
}

/* 防止表格和程式碼區塊造成水平滾動 */
table {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: auto !important;
    word-wrap: break-word !important;
}

pre, code {
    max-width: 100% !important;
    overflow-x: auto !important;
    word-wrap: break-word !important;
    white-space: pre-wrap !important;
}

/* 通用防水平滾動規則 */
.entry-content,
.widget-area,
.site-main {
    overflow-x: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* 防止長文字或連結造成水平溢出 */
p, div, span, a {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* 確保表單元素不會造成溢出 */
input, textarea, select, button {
    max-width: 100%;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #ffffff; /* 將整體頁面背景改為白色，移除 footer 上方灰塊 */
    /* 防止水平滾動 */
    overflow-x: hidden;
    /* 確保頁面寬度不會超出視窗 */
    max-width: 100vw;
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 */
.site-header {
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding: 1rem 0;
}

.site-title {
    font-size: 2rem;
    font-weight: bold;
    color: #333;
    text-decoration: none;
}

.site-description {
    color: #666;
    margin-top: 0.5rem;
}

/* 导航菜单 */
.main-navigation {
    margin-top: 1rem;
}

.main-navigation ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.main-navigation a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s ease;
    /* 增加点击区域 */
    padding: 8px 12px;
    display: inline-block;
    /* 确保链接可以正常点击 */
    position: relative;
    z-index: 10;
    /* 改善触摸响应 */
    -webkit-tap-highlight-color: rgba(0,0,0,0.1);
    touch-action: manipulation;
}

.main-navigation a:hover {
    color: #007cba;
}

/* 主要内容区域 */
.site-main {
    padding: 2rem 0;
}

/* 404 頁面滿版顯示 */
.site-main.c-404 {
    padding: 0;
    margin: 0;
}

/* 文章样式 */
.entry {
    background: #fff;
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.entry-title {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: #333;
}

.entry-title a {
    text-decoration: none;
    color: inherit;
}

.entry-meta {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.entry-content {
    line-height: 1.8;
}

.entry-content p {
    margin-bottom: 1rem;
}

/* 单篇文章页面样式 */
.single-entry {
    max-width: 100%;
}

.single-entry .entry-title {
    font-size: 2.2rem;
    margin-bottom: 1.5rem;
    color: #333;
    border-bottom: 3px solid #007cba;
    padding-bottom: 1rem;
}

.single-entry .entry-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 5px;
}

.single-entry .entry-meta span {
    display: inline-flex;
    align-items: center;
}

.single-entry .entry-thumbnail {
    margin-bottom: 2rem;
    text-align: center;
}

.single-entry .entry-thumbnail img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.single-entry .entry-content {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 2rem;
}

.single-entry .entry-content h2,
.single-entry .entry-content h3,
.single-entry .entry-content h4 {
    margin: 2rem 0 1rem 0;
    color: #333;
}

.single-entry .entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    margin: 1rem 0;
}

.single-entry .entry-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid #eee;
}

/* 文章导航样式 */
.post-navigation {
    margin: 2rem 0;
}

.post-navigation .nav-links {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.post-navigation .nav-previous,
.post-navigation .nav-next {
    flex: 1;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.post-navigation .nav-previous:hover,
.post-navigation .nav-next:hover {
    background: #e9ecef;
}

.post-navigation .nav-subtitle {
    display: block;
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.post-navigation .nav-title {
    font-weight: 600;
    color: #333;
}

/* 分类和标签样式 */
.cat-links a,
.tags-links a {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    margin: 0.2rem;
    background: #007cba;
    color: #fff;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.8rem;
    transition: background-color 0.3s ease;
}

.cat-links a:hover,
.tags-links a:hover {
    background: #005a87;
}

/* 找不到文章时的样式 */
.no-post {
    text-align: center;
    padding: 3rem 1rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.no-post h2 {
    color: #333;
    margin-bottom: 2rem;
}

.latest-posts {
    list-style: none;
    text-align: left;
    max-width: 500px;
    margin: 0 auto;
}

.latest-posts li {
    padding: 0.8rem 0;
    border-bottom: 1px solid #eee;
}

.latest-posts li:last-child {
    border-bottom: none;
}

.latest-posts a {
    color: #007cba;
    text-decoration: none;
    font-weight: 500;
}

.latest-posts a:hover {
    text-decoration: underline;
}

/* 侧边栏 */
.widget-area {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.widget {
    margin-bottom: 2rem;
}

.widget-title {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: #333;
    border-bottom: 2px solid #007cba;
    padding-bottom: 0.5rem;
}

/* ===== Footer 頁腳樣式 ===== */
.site-footer {
    background: #535353; /* 深灰背景對應截圖 */
    color: #fff;
    padding: 40px 0 0; /* 上方間距略小以貼近截圖 */
    margin-top: 40px;
    position: relative;
}

.site-footer__container {
    max-width: 1260px; /* 寬度貼近截圖 */
    margin: 0 auto;
    padding: 0 30px;
    display: grid;
    grid-template-columns: 240px 1fr 220px; /* 左 中 右 */
    align-items: center;
    gap: 28px;
}

/* 左側 Logo 區塊 */
.site-footer__left {
    display: flex;
    align-items: center;
}

.site-footer__center {
    display: flex;
    align-items: center;
}

.site-footer__logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.site-footer__logo-link {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
}

.site-footer__logo-link:hover {
    transform: scale(1.05);
    filter: brightness(1.2);
}

.site-footer__logo-img {
    width: 110px; /* 截圖尺寸更小 */
    height: 110px;
    object-fit: contain;
    filter: none;
}

.site-footer__logo-text {
    color: #fff;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 0.1em;
    margin-left: 16px;
}

/* 聯絡資訊 */
.site-footer__contact {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
/* 兩欄排版 */
.site-footer__contact--grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 40px;
}
.site-footer__contact-col { display: flex; flex-direction: column; gap: 10px; }

.site-footer__contact-item {
    display: flex;
    align-items: baseline; /* 讓字基線對齊，更貼近視覺需求 */
    gap: 0; /* 移除元素之間的間距，讓內容緊貼冒號後 */
    font-size: 16px;
    line-height: 1.6;
}

.site-footer__contact-label {
    color: #dcdcdc;
    font-weight: 500;
    min-width: 0; /* 取消固定寬度，讓數值緊跟冒號 */
    margin-right: 0; /* 取消可能的額外間距 */
    white-space: nowrap;
}

.site-footer__contact-value {
    color: #ffffff;
    font-weight: 500;
    letter-spacing: 0.02em;
    white-space: nowrap;
    margin-left: 0; /* 確保緊貼冒號 */
}

.site-footer__contact-link {
    color: inherit;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.site-footer__contact-link:hover {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* 微調右欄第一列（公司名稱）與左欄基線對齊 */
.site-footer__contact-col:nth-child(2) .site-footer__contact-item:first-child {
    margin-top: 10px;
}

/* 電腦端 LINE ID 向上移動 10px */
.site-footer__contact-col:first-child .site-footer__contact-item:nth-child(2) {
    transform: translateY(-8px) !important;
}

/* 右側社群圖標 */
.site-footer__right {
    display: flex;
    justify-content: flex-end;
}

.site-footer__social {
    display: flex;
    gap: 20px;
    align-items: center;
}

/* 電腦端社群圖標向上移動 35px */
@media (min-width: 769px) {
    .site-footer__social {
        transform: translateY(-35px) !important;
    }
}

.site-footer__social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px; /* 截圖中的小圓按鈕 */
    height: 36px;
    border-radius: 50%;
    background: #3f3f3f;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.site-footer__social-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(255,255,255,0.2) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.site-footer__social-link:hover::before {
    opacity: 1;
}

.site-footer__social-link:hover { background: #4a4a4a; transform: none; box-shadow: none; }

.site-footer__social-icon {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 圖示在圓形容器內滿版顯示 */
    display: block;
    filter: none;
    transition: none;
    position: relative;
    z-index: 1;
}

.site-footer__social-link:hover .site-footer__social-icon {
    transform: scale(1.1);
}

/* LINE 圖標放大 1.5 倍 */
.site-footer__social-link:first-child {
    transform: scale(1.5);
}

.site-footer__social-link:first-child .site-footer__social-icon {
    transform: scale(1);
}

/* 版權資訊 */
.site-footer__bottom {
    margin-top: 22px;
    padding: 16px 0 18px;
    border-top: 1px solid rgba(255,255,255,0.25); /* 截圖較細的分隔線 */
    text-align: center;
}

.site-footer__copyright {
    max-width: 1260px;
    margin: 0 auto;
    padding: 0 30px;
    font-size: 13px;
    color: #d9d9d9;
    line-height: 1.5;
    letter-spacing: 0.02em;
}

.site-footer__copyright-link {
    color: inherit;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
}

.site-footer__copyright-link:hover {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    /* 移動裝置額外防護 */
    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100vw !important;
    }
    
    .main-navigation ul {
        flex-direction: column;
        gap: 1rem;
    }
    
    .main-navigation a {
        /* 增加移动端点击区域 */
        padding: 12px 16px;
        /* 确保触摸响应 */
        min-height: 44px;
        display: flex;
        align-items: center;
        /* 防止触摸延迟 */
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }
    
    /* Footer 響應式設計 */
    .site-footer__container {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 22px;
        padding: 0 20px;
    }
    /* 調整區塊顯示順序：Logo → 社群 → 聯絡資訊 */
    .site-footer__left { order: 1; width: 100%; display: flex; justify-content: center; }
    .site-footer__right { order: 2; width: 100%; display: flex; justify-content: center; }
    .site-footer__center { order: 3; width: 100%; }
    
    .site-footer__left {
        align-items: center;
        gap: 25px;
    }
    
    .site-footer__contact { 
        margin-left: 0; 
        align-items: center; 
        display: flex;
        flex-direction: column;
        gap: 12px;
        text-align: center;
        width: 100%;
    }
    .site-footer__contact--grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
        align-items: center !important;
        text-align: center !important;
        width: 100% !important;
    }
    .site-footer__contact-col {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
        align-items: center !important;
        text-align: center !important;
        width: 100% !important;
    }
    .site-footer__contact-item { 
        flex-direction: row; 
        text-align: center; 
        gap: 8px; 
        justify-content: center; 
        align-items: center;
        white-space: nowrap; 
        width: 100%;
    }
    .site-footer__contact-label,
    .site-footer__contact-value,
    .site-footer__contact-link { 
        white-space: nowrap; 
        text-align: center;
    }
    
    .site-footer__contact-label {
        min-width: auto;
        font-size: 14px;
    }
    
    .site-footer__contact-value {
        font-size: 14px;
    }
    
    .site-footer__logo-img { width: 90px; height: 90px; }
    
    .site-footer__logo-link:hover {
        transform: scale(1.03);
    }
    
    .site-footer__logo-text { font-size: 22px; margin-left: 0; margin-top: 12px; }
    
    .site-footer__social { gap: 18px; }
    .site-footer__right { justify-content: center; }
    
    .site-footer__social-link {
        width: 56px;
        height: 56px;
    }
    
    /* 移動端 LINE 圖標尺寸優化（取消 transform，直接放大容器） */
    .site-footer__social-link:first-child {
        transform: none;
        width: 64px;
        height: 64px;
    }
    
    .site-footer__social-icon {
        width: 100%;
        height: 100%;
    }
    
    .site-footer__copyright {
        padding: 0 20px;
        font-size: 13px;
    }
    
    /* 確保所有容器在移動裝置上不會溢出 */
    .container,
    .intro-split__container,
    .about-extra__container,
    .youtube-gallery__container,
    .public-welfare__container,
    .location-transport__container,
    .faq-section__container {
        max-width: 100vw !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }
}

/* 手機版額外響應式設計 */
@media (max-width: 600px) {
    .site-footer {
        padding: 40px 0 0;
        margin-top: 60px;
    }
    
    .site-footer__container {
        padding: 0 16px;
        gap: 25px;
    }
    
    .site-footer__left { gap: 8px; }
    
    .site-footer__logo { flex-direction: column; gap: 8px; }
    
    .site-footer__logo-img { width: 78px; height: 78px; }
    
    .site-footer__logo-link:hover {
        transform: scale(1.02);
    }
    
    .site-footer__logo-text { font-size: 20px; }
    
    .site-footer__contact {
        gap: 10px;
    }
    
    .site-footer__contact-item {
        gap: 3px;
    }
    
    .site-footer__contact-label,
    .site-footer__contact-value {
        font-size: 13px;
    }
    
    .site-footer__social { gap: 16px; }
    
    .site-footer__social-link {
        width: 52px;
        height: 52px;
    }
    
    /* 小螢幕 LINE 圖標尺寸優化（取消 transform，直接放大容器） */
    .site-footer__social-link:first-child {
        transform: none;
        width: 60px;
        height: 60px;
    }
    
    .site-footer__social-icon {
        width: 100%;
        height: 100%;
    }
    
    .site-footer__bottom {
        margin-top: 35px;
        padding: 20px 0;
    }
    
    .site-footer__copyright {
        padding: 0 16px;
        font-size: 12px;
    }
} 

.single-breadcrumb-block {
  margin-top: 20px;
  margin-bottom: 1.5rem;
  padding-left: 50px;
  padding-right: 50px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  box-sizing: border-box;
  width: 100%;
  max-width: none;
}
.single-breadcrumb {
  font-size: 1.12rem;
  color: #222;
  margin-top: 2.5rem;
  margin-bottom: 0.2rem;
  letter-spacing: 0.02em;
  font-weight: 500;
}
.single-breadcrumb a {
  color: #222;
  text-decoration: none;
  transition: color 0.2s;
}
.single-breadcrumb a:hover {
  color: #b98c5e;
  text-decoration: underline;
}
.single-back-link {
  font-size: 1rem;
  color: #222;
  text-decoration: none;
  display: inline-block;
  margin-bottom: 0.5rem;
  margin-top: 0.2rem;
  font-weight: 500;
  transition: color 0.2s;
}
.single-back-link:hover {
  color: #b98c5e;
  text-decoration: underline;
}
.single-block-align {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 32px;
  box-sizing: border-box;
}
.single-block-align-20 {
  padding-left: 50px;
  padding-right: 50px;
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  margin: 0;
}
@media (max-width: 600px) {
  .single-breadcrumb-block,
  .single-block-align-20 {
    padding-left: 16px;
    padding-right: 16px;
  }
} 

/* WordPress 文章內容標準樣式 */
.entry-content {
  line-height: 1.8;
  font-size: 1.08rem;
  color: #222;
  word-break: break-word;
}
.entry-content h1, .entry-content h2, .entry-content h3, .entry-content h4, .entry-content h5, .entry-content h6 {
  font-weight: bold;
  margin: 2em 0 1em 0;
  line-height: 1.3;
}
.entry-content p {
  margin: 1.2em 0;
}
.entry-content ul, .entry-content ol {
  margin: 1.2em 0 1.2em 2em;
  padding: 0 0 0 1.2em;
}
.entry-content li {
  margin-bottom: 0.5em;
}
.entry-content img {
  display: block;
  margin: 1.2em auto;
  max-width: 100%;
  height: auto;
}
.entry-content a {
  color: #b98c5e;
  text-decoration: underline;
}
.entry-content a:hover {
  color: #8a6a3f;
} 

/* 位置圖標樣式 */
.location-icon {
  width: 15%;
  height: auto;
  display: inline-block;
  vertical-align: middle;
}

/* 位置信息容器樣式 */
.location-info {
  text-align: left;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: -50px;
}

/* === Mobile Typography 行動端排版優化 === */
html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

@media (max-width: 768px) {
    body {
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", Arial, sans-serif;
        font-size: 16px;
        line-height: 1.9;
        letter-spacing: 0.01em;
    }

    .container {
        padding: 0 16px;
    }

    .site-header {
        padding: 0.75rem 0;
    }

    .entry-title {
        font-size: 1.4rem;
        line-height: 1.35;
        margin-bottom: 0.8rem;
    }

    .single-entry .entry-title {
        font-size: 1.7rem;
        line-height: 1.3;
    }

    .entry-content {
        font-size: 1rem;
        line-height: 1.9;
    }

    .entry-content p {
        margin: 1em 0 1.1em;
    }

    .entry-content h1 { font-size: 1.75rem; }
    .entry-content h2 { font-size: 1.5rem; }
    .entry-content h3 { font-size: 1.25rem; }
    .entry-content h4 { font-size: 1.15rem; }

    .entry-content ul,
    .entry-content ol {
        margin: 1em 0 1.1em 1.4em;
        padding-left: 1em;
    }

    .post-navigation .nav-links {
        flex-direction: column;
    }

    /* Progressive enhancement：平衡換行，降低尷尬換行 */
    @supports (text-wrap: balance) {
        .entry-content h1,
        .entry-content h2,
        .entry-content h3,
        .entry-content h4 {
            text-wrap: balance;
        }
    }

    @supports (text-wrap: pretty) {
        .entry-content p {
            text-wrap: pretty;
        }
    }
}

@media (max-width: 600px) {
    body {
        font-size: 15.5px;
    }

    .entry-content {
        font-size: 0.98rem;
        line-height: 1.95;
    }

    .entry-content h1 { font-size: 1.6rem; }
    .entry-content h2 { font-size: 1.4rem; }
    .entry-content h3 { font-size: 1.2rem; }

    .single-breadcrumb-block,
    .single-block-align {
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* === CJK 斷行優化：避免怪異換行/斷詞，優先套用於內容區 === */
@media (max-width: 768px) {
    .entry-content,
    .entry-content p,
    .entry-content li,
    .entry-content a,
    .entry-content span {
        white-space: normal;
        word-break: normal;           /* 避免英文被硬切，維持語義斷行 */
        overflow-wrap: anywhere;      /* 長字/URL 需要時才斷行 */
        word-wrap: normal;            /* 舊屬性回退 */
        hyphens: manual;              /* 關閉自動斷字（英文不隨意加連字號） */
        -webkit-hyphens: manual;
        line-break: loose;            /* CJK 斷行更自然（Safari/Chromium 支援） */
        text-align: left;             /* 避免兩端對齊造成大空隙 */
        text-justify: auto;
    }
}