
/*
Theme Name: Echo TW
Theme URI: https://example.com/echo-tw
Author: You
Author URI: https://example.com
Description: A minimal, blank WordPress starter theme with echo-prefixed classes and IDs.
Version: 1.0.0
Requires at least: 5.8
Tested up to: 6.6
Requires PHP: 7.4
Text Domain: echo-tw
*/
:root {
  --echo-spacing: 1rem;
}

.echo-body { margin: 0; }
.echo-container { max-width: 1200px; margin: 0 auto; padding: var(--echo-spacing); }
.echo-main { min-height: 60vh; }
.echo-header, .echo-footer { padding: var(--echo-spacing); }

/* ==========================================================================
   MOBILE NAVIGATION STYLES (GLOBAL)
   ========================================================================== */

/* Mobile Menu Toggle */
.echo-mobile-menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 8px;
    z-index: 1002;
    position: relative;
}

.echo-mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: white;
    margin: 3px 0;
    transition: all 0.3s ease;
    transform-origin: center;
}

/* 非首頁的mobile toggle應該是黑色 */
body:not(.home) .echo-mobile-menu-toggle span {
    background-color: #333;
}

/* 首頁scrolled狀態下的mobile toggle也應該是黑色 */
body.home #echo-header.echo-state-scrolled .echo-mobile-menu-toggle span {
    background-color: #333;
}

/* Mobile menu toggle animation */
.echo-mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.echo-mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.echo-mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Mobile flyout menu */
.echo-mobile-flyout {
    position: fixed;
    top: 0;
    right: -80%;
    width: 80%;
    max-width: 400px;
    height: 100vh;
    background-color: white;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    z-index: 1001;
    transition: right 0.3s ease;
    overflow-y: auto;
}

.echo-mobile-flyout.active {
    right: 0;
}

.echo-mobile-flyout-content {
    padding: 80px 30px 30px;
}

.echo-mobile-flyout .echo-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.echo-mobile-flyout .echo-menu a {
    color: #333;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 400;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
    transition: color 0.3s ease;
}

.echo-mobile-flyout .echo-menu a:hover {
    color: #821415;
}

/* Mobile overlay */
.echo-mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(0,0,0,0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.echo-mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Media Queries for Mobile Menu */
@media (max-width: 768px) {
    #echo-nav {
        display: none !important;
    }
    
    .echo-mobile-menu-toggle {
        display: flex !important;
    }
}

/* ==========================================================================
   PAGE TITLE BAR STYLES (ARCHIVE/CATEGORY PAGES)
   ========================================================================== */

.echo-page-title-bar {
    background-color: #E9E4DE;
    min-height: 30vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 0;
    position: relative;
}

.echo-page-title-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.echo-category-description {
    color: #821415;
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0 0 15px 0;
    line-height: 1.4;
}

.echo-page-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: bold;
    color: #000;
    margin: 0 0 25px 0;
    line-height: 1.2;
}

.echo-breadcrumb {
    margin-top: 20px;
}

/* RankMath 麵包屑樣式優化 */
.echo-breadcrumb .rank-math-breadcrumb {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.9rem;
}

.echo-breadcrumb .rank-math-breadcrumb a {
    color: #666;
    text-decoration: none;
    transition: color 0.3s ease;
}

.echo-breadcrumb .rank-math-breadcrumb a:hover {
    color: #821415;
    text-decoration: underline;
}

.echo-breadcrumb .rank-math-breadcrumb span {
    color: #999;
}

.echo-breadcrumb .rank-math-breadcrumb .separator {
    color: #ccc;
    margin: 0 5px;
}

/* Archive 內容區域 */
.echo-blog-archive {
    padding: 60px 0;
    min-height: 40vh;
}

.echo-archive-layout {
    display: grid;
    grid-template-columns: 25% 75%;
    gap: 40px;
    align-items: start;
}

/* ==========================================================================
   SIDEBAR STYLES
   ========================================================================== */

.echo-archive-sidebar {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.echo-sidebar-widget {
    background: #fff;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid #f0f0f0;
}

.echo-widget-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #821415;
    position: relative;
}

.echo-widget-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 30px;
    height: 2px;
    background-color: #821415;
}

/* 搜尋表單 */
.echo-search-input-group {
    display: flex;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    overflow: hidden;
    transition: border-color 0.3s ease;
}

.echo-search-input-group:focus-within {
    border-color: #821415;
}

.echo-search-input {
    flex: 1;
    padding: 12px 15px;
    border: none;
    outline: none;
    font-size: 0.9rem;
}

.echo-search-btn {
    padding: 12px 15px;
    background-color: #821415;
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.echo-search-btn:hover {
    background-color: #a01617;
}

/* 分類列表 */
.echo-categories-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.echo-categories-list li {
    margin: 0 0 8px 0;
}

.echo-categories-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    color: #666;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
}

.echo-categories-list a:hover,
.echo-categories-list .current-cat a {
    background-color: #821415;
    color: white;
}

.echo-categories-list .post-count {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* 標籤列表 */
.echo-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.echo-tags-list a {
    display: inline-block;
    padding: 6px 12px;
    background-color: #f8f9fa;
    color: #666;
    text-decoration: none;
    border-radius: 15px;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    border: 1px solid #e0e0e0;
}

.echo-tags-list a:hover {
    background-color: #821415;
    color: white;
    border-color: #821415;
}

.echo-tags-list .no-tags {
    color: #999;
    font-style: italic;
}

/* ==========================================================================
   POSTS GRID STYLES
   ========================================================================== */

.echo-archive-main {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.echo-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.echo-post-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
}

.echo-post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.echo-post-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.echo-post-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.echo-post-card:hover .echo-post-img {
    transform: scale(1.05);
}

.echo-post-placeholder {
    background: linear-gradient(135deg, #821415, #a01617);
    display: flex;
    align-items: center;
    justify-content: center;
}

.echo-placeholder-content {
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
}

.echo-post-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(130, 20, 21, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.echo-post-card:hover .echo-post-overlay {
    opacity: 1;
}

.echo-read-more {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 10px 20px;
    border: 2px solid white;
    border-radius: 25px;
    transition: all 0.3s ease;
}

.echo-read-more:hover {
    background-color: white;
    color: #821415;
}

.echo-post-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.echo-post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 0.8rem;
}

.echo-post-date {
    color: #821415;
    font-weight: 500;
}

.echo-post-category {
    background-color: #f8f9fa;
    color: #666;
    padding: 4px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
}

.echo-post-title {
    margin: 0 0 12px 0;
    font-size: 1.1rem;
    line-height: 1.4;
}

.echo-post-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.echo-post-title a:hover {
    color: #821415;
}

.echo-post-excerpt {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 15px;
    flex: 1;
}

.echo-post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: auto;
}

.echo-tag {
    background-color: rgba(130, 20, 21, 0.1);
    color: #821415;
    padding: 4px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* ==========================================================================
   PAGINATION STYLES
   ========================================================================== */

.echo-pagination {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.echo-pagination-nav {
    display: flex;
    justify-content: center;
}

.echo-pagination-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 5px;
}

.echo-pagination-list li {
    margin: 0;
}

.echo-pagination-list a,
.echo-pagination-list span {
    display: block;
    padding: 10px 15px;
    color: #666;
    text-decoration: none;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.echo-pagination-list a:hover {
    background-color: #821415;
    color: white;
    border-color: #821415;
}

.echo-pagination-list .current {
    background-color: #821415;
    color: white;
    border-color: #821415;
}

.echo-no-posts {
    text-align: center;
    padding: 60px 20px;
    background-color: #f8f9fa;
    border-radius: 10px;
    border: 2px dashed #ddd;
}

.echo-no-posts h2 {
    color: #333;
    margin-bottom: 10px;
}

.echo-no-posts p {
    color: #666;
    margin: 0;
}

/* 搜尋結果特殊樣式 */
.echo-search-count {
    font-size: 1rem;
    color: #666;
    margin: 10px 0 0 0;
    font-style: italic;
}

.echo-post-excerpt mark {
    background-color: #ffeb3b;
    color: #333;
    padding: 2px 4px;
    border-radius: 3px;
}

/* 響應式設計 */
@media (max-width: 1024px) {
    .echo-posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .echo-archive-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .echo-archive-sidebar {
        order: 2;
    }
    
    .echo-archive-main {
        order: 1;
    }
    
    .echo-posts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .echo-sidebar-widget {
        padding: 20px;
    }
    
    .echo-post-content {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .echo-blog-archive {
        padding: 40px 0;
    }
    
    .echo-sidebar-widget {
        padding: 15px;
    }
    
    .echo-post-image {
        height: 180px;
    }
    
    .echo-post-content {
        padding: 12px;
    }
    
    .echo-pagination-list a,
    .echo-pagination-list span {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
}

/* 響應式設計 */
@media (max-width: 768px) {
    .echo-page-title-bar {
        min-height: 35vh;
        padding: 40px 0;
    }
    
    .echo-page-title-content {
        padding: 0 20px;
    }
    
    .echo-category-description {
        font-size: 1rem;
        margin-bottom: 12px;
    }
    
    .echo-page-title {
        margin-bottom: 20px;
    }
    
    .echo-breadcrumb .rank-math-breadcrumb {
        font-size: 0.85rem;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .echo-page-title-bar {
        min-height: 40vh;
        padding: 30px 0;
    }
    
    .echo-category-description {
        font-size: 0.95rem;
    }
    
    .echo-breadcrumb .rank-math-breadcrumb {
        font-size: 0.8rem;
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }
    
    .echo-breadcrumb .rank-math-breadcrumb .separator {
        display: none;
    }
}

/* ==========================================================================
   TO TOP BUTTON (GLOBAL)
   ========================================================================== */

.echo-to-top {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #821415, #a01617);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 4px 15px rgba(130, 20, 21, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.echo-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.echo-to-top:hover {
    background: linear-gradient(135deg, #a01617, #821415);
    transform: translateX(-50%) translateY(-5px);
    box-shadow: 0 8px 25px rgba(130, 20, 21, 0.4);
}

.echo-to-top:active {
    transform: translateX(-50%) translateY(-2px) scale(0.95);
}

.echo-to-top-icon {
    transition: transform 0.3s ease;
}

.echo-to-top:hover .echo-to-top-icon {
    transform: translateY(-2px);
}

/* To Top button animation */
@keyframes echoPulse {
    0% {
        box-shadow: 0 4px 15px rgba(130, 20, 21, 0.3);
    }
    50% {
        box-shadow: 0 4px 15px rgba(130, 20, 21, 0.6), 0 0 0 10px rgba(130, 20, 21, 0.1);
    }
    100% {
        box-shadow: 0 4px 15px rgba(130, 20, 21, 0.3);
    }
}

.echo-to-top.pulse {
    animation: echoPulse 2s ease-in-out infinite;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .echo-to-top {
        width: 45px;
        height: 45px;
        bottom: 20px;
        /* 調整位置避免與LINE按鈕重疊 */
        right: 20px;
        left: auto;
        transform: translateX(0) translateY(100px);
    }
    
    .echo-to-top.show {
        transform: translateX(0) translateY(0);
    }
    
    .echo-to-top:hover {
        transform: translateX(0) translateY(-5px);
    }
    
    .echo-to-top:active {
        transform: translateX(0) translateY(-2px) scale(0.95);
    }
    
    .echo-to-top-icon {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 480px) {
    .echo-to-top {
        width: 40px;
        height: 40px;
        bottom: 15px;
        right: 15px;
    }
    
    .echo-to-top-icon {
        width: 16px;
        height: 16px;
    }
}

/* ==========================================================================
   SINGLE ARTICLE PAGE STYLES
   ========================================================================== */

/* Article Header Section */
.echo-article-header {
    background-color: #E9E4DE;
    padding: 40px 0 60px;
    border-bottom: 1px solid #e0e0e0;
}

.echo-article-header-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.echo-article-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    color: #333;
    margin: 20px 0 30px;
    line-height: 1.3;
}

.echo-article-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.echo-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: #666;
}

.echo-meta-icon {
    color: #821415;
    flex-shrink: 0;
}

.echo-meta-item a {
    color: #821415;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.echo-meta-item a:hover {
    color: #a01617;
    text-decoration: underline;
}

.echo-article-excerpt {
    font-size: 1.1rem;
    color: #555;
    line-height: 1.6;
    font-style: italic;
    max-width: 600px;
    margin: 0 auto;
}

/* Article Content Section */
.echo-article-section {
    padding: 60px 0;
}

.echo-article-layout {
    display: grid;
    grid-template-columns: 25% 75%;
    gap: 40px;
    align-items: start;
}

/* Table of Contents Sidebar */
.echo-article-sidebar {
    position: sticky;
    top: 100px;
}

.echo-toc-widget {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid #f0f0f0;
}

.echo-toc-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #821415;
    position: relative;
}

.echo-toc-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 30px;
    height: 2px;
    background-color: #821415;
}

.echo-toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.echo-toc-item {
    margin: 0 0 8px 0;
}

.echo-toc-link {
    display: block;
    padding: 8px 12px;
    color: #666;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
    line-height: 1.4;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.echo-toc-link:hover,
.echo-toc-link.active {
    background-color: rgba(130, 20, 21, 0.1);
    color: #821415;
    border-left-color: #821415;
    text-decoration: none;
}

.echo-toc-loading {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 20px 0;
}

.echo-toc-empty {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 20px 0;
    font-size: 0.9rem;
}

/* Article Main Content */
.echo-article-main {
    max-width: none;
}

.echo-featured-image {
    margin-bottom: 40px;
    text-align: center;
}

.echo-featured-img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.echo-image-caption {
    margin-top: 10px;
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
}

.echo-article-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
}

.echo-article-content h2 {
    font-size: 1.8rem;
    font-weight: 600;
    color: #333;
    margin: 40px 0 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    scroll-margin-top: 100px; /* For smooth scrolling with fixed header */
}

.echo-article-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin: 30px 0 15px;
}

.echo-article-content h4 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
    margin: 25px 0 12px;
}

.echo-article-content p {
    margin-bottom: 20px;
}

.echo-article-content ul,
.echo-article-content ol {
    margin: 20px 0;
    padding-left: 30px;
}

.echo-article-content li {
    margin-bottom: 8px;
}

.echo-article-content blockquote {
    background-color: #f8f9fa;
    border-left: 4px solid #821415;
    padding: 20px 25px;
    margin: 30px 0;
    font-style: italic;
    border-radius: 0 8px 8px 0;
}

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

.echo-article-content a {
    color: #821415;
    text-decoration: underline;
    font-weight: 500;
    transition: color 0.3s ease;
}

.echo-article-content a:hover {
    color: #a01617;
}

/* Article Tags */
.echo-article-tags {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid #e0e0e0;
}

.echo-article-tags h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

.echo-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.echo-article-tag {
    display: inline-block;
    padding: 6px 12px;
    background-color: rgba(130, 20, 21, 0.1);
    color: #821415;
    text-decoration: none;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.echo-article-tag:hover {
    background-color: #821415;
    color: white;
    text-decoration: none;
}

/* Related Articles Section */
.echo-related-articles {
    background-color: #f8f9fa;
    padding: 80px 0;
    margin-top: 60px;
}

.echo-related-title {
    font-size: 2.2rem;
    font-weight: 600;
    color: #333;
    text-align: center;
    margin-bottom: 50px;
    position: relative;
    display: inline-block;
    width: 100%;
}

.echo-related-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: #821415;
}

.echo-related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.echo-related-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 1px solid #f0f0f0;
}

.echo-related-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.echo-related-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.echo-related-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.echo-related-card:hover .echo-related-img {
    transform: scale(1.05);
}

.echo-related-placeholder {
    background: linear-gradient(135deg, #821415, #a01617);
    display: flex;
    align-items: center;
    justify-content: center;
}

.echo-related-placeholder .echo-placeholder-content {
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
}

.echo-related-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(130, 20, 21, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.echo-related-card:hover .echo-related-overlay {
    opacity: 1;
}

.echo-related-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border: 2px solid white;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.echo-related-link:hover {
    background-color: white;
    color: #821415;
    text-decoration: none;
}

.echo-related-content {
    padding: 20px;
}

.echo-related-meta {
    margin-bottom: 10px;
}

.echo-related-date {
    font-size: 0.85rem;
    color: #821415;
    font-weight: 500;
}

.echo-related-post-title {
    margin: 0 0 12px 0;
    font-size: 1.1rem;
    line-height: 1.4;
}

.echo-related-post-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.echo-related-post-title a:hover {
    color: #821415;
}

.echo-related-excerpt {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* 響應式設計 */
@media (max-width: 1024px) {
    .echo-related-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
}

@media (max-width: 768px) {
    .echo-article-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .echo-article-sidebar {
        order: 1; /* 目錄在前 */
        position: static;
    }
    
    .echo-article-main {
        order: 2; /* 內容在後 */
    }
    
    .echo-article-header {
        padding: 30px 0 40px;
    }
    
    .echo-article-section {
        padding: 40px 0;
    }
    
    .echo-article-meta {
        gap: 20px;
    }
    
    .echo-related-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .echo-related-articles {
        padding: 60px 0;
    }
}

@media (max-width: 480px) {
    .echo-article-header {
        padding: 20px 0 30px;
    }
    
    .echo-article-section {
        padding: 30px 0;
    }
    
    .echo-article-meta {
        flex-direction: column;
        gap: 10px;
    }
    
    .echo-toc-widget {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .echo-toc-title {
        font-size: 1.1rem;
        text-align: center;
        margin-bottom: 15px;
    }
    
    .echo-toc-list {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .echo-toc-link {
        text-align: center;
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .echo-related-articles {
        padding: 40px 0;
    }
    
    .echo-related-title {
        font-size: 1.8rem;
        margin-bottom: 30px;
    }
}

/* ==========================================================================
   FOOTER STYLES
   ========================================================================== */

.echo-footer {
    background-color: #E9E4DE;
    padding: 0;
}

.echo-footer-main {
    padding: 60px 0 40px;
}

.echo-footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    align-items: start;
}

.echo-footer-column {
    display: flex;
    flex-direction: column;
}

/* 第一欄：Logo和聯絡資訊 */
.echo-footer-contact {
    gap: 20px;
}

.echo-footer-logo-img {
    max-height: 35px;
    width: auto;
    object-fit: contain;
}

.echo-footer-contact-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.echo-footer-email a {
    color: #821415;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.echo-footer-email a:hover {
    color: #333;
    text-decoration: underline;
}

.echo-footer-address {
    color: #666;
    line-height: 1.6;
    margin: 0;
}

.echo-footer-email {
    margin: 0;
}

/* 第二欄：關於愛客選單 */
.echo-footer-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 20px 0;
}

.echo-footer-nav {
    margin: 0;
}

.echo-footer-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.echo-footer-menu li {
    margin: 0;
}

.echo-footer-menu a {
    color: #666;
    text-decoration: none;
    font-size: 0.95rem;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.echo-footer-menu a:hover {
    color: #821415;
    text-decoration: underline;
}

/* 第三欄：電子報訂閱 */
.echo-newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.echo-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.echo-form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #333;
    margin: 0;
}

.echo-form-group input {
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.9rem;
    background-color: #fff;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.echo-form-group input:focus {
    outline: none;
    border-color: #821415;
    box-shadow: 0 0 0 2px rgba(130, 20, 21, 0.1);
}

.echo-newsletter-submit {
    padding: 12px 20px;
    background-color: #821415;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.echo-newsletter-submit:hover {
    background-color: #a01617;
    transform: translateY(-1px);
}

.echo-newsletter-note {
    margin: 10px 0 0 0;
    font-size: 0.8rem;
    color: #888;
    font-style: italic;
}

/* 第四欄：熱門標籤 */
.echo-tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-start;
}

.echo-tags-cloud a,
.echo-tags-cloud .tag-cloud-link {
    display: inline-block;
    padding: 6px 12px;
    background-color: #fff;
    color: #666;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.85rem;
    border: 1px solid #ddd;
    transition: all 0.3s ease;
    line-height: 1.2;
}

.echo-tags-cloud a:hover,
.echo-tags-cloud .tag-cloud-link:hover {
    background-color: #821415;
    color: #fff;
    border-color: #821415;
    transform: translateY(-1px);
    text-decoration: none;
}

/* Copyright 區域 */
.echo-footer-bottom {
    background-color: #E9E4DE;
    padding: 20px 0;
    border-top: 1px solid rgba(130, 20, 21, 0.2);
}

.echo-copyright {
    text-align: center;
}

.echo-copyright p {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
    line-height: 1.4;
}

.echo-copyright a {
    color: #821415;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.echo-copyright a:hover {
    color: #333;
    text-decoration: underline;
}

/* 響應式設計 */
@media (max-width: 1024px) {
    .echo-footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
    
    .echo-footer-main {
        padding: 50px 0 30px;
    }
}

@media (max-width: 768px) {
    .echo-footer-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .echo-footer-main {
        padding: 40px 0 30px;
    }
    
    .echo-footer-contact {
        text-align: center;
    }
    
    .echo-footer-title {
        text-align: center;
        margin-bottom: 15px;
    }
    
    .echo-footer-menu {
        align-items: center;
        text-align: center;
    }
    
    .echo-tags-cloud {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .echo-footer-main {
        padding: 30px 0 20px;
    }
    
    .echo-container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .echo-footer-logo-img {
        max-height: 30px;
    }
    
    .echo-footer-title {
        font-size: 1.1rem;
    }
    
    .echo-newsletter-submit {
        padding: 10px 18px;
        font-size: 0.85rem;
    }
}
