/* ==========================================================================
   SINGLE POST PAGE STYLES - RiseCreatives Theme
   ========================================================================== */

/* Article Container */
.rise-theme-article-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ========================================
   1. ARTICLE HEADER SECTION
   ======================================== */

.rise-theme-article-header {
    background-color: #E9F4F2;
    padding: 40px 0 60px;
    border-bottom: 1px solid #e0e0e0;
}

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

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

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

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

.rise-theme-meta-icon {
    color: #3F776F;
    flex-shrink: 0;
}

.rise-theme-meta-item a {
    color: #3F776F;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.rise-theme-meta-item a:hover {
    color: #2D5A5A;
    text-decoration: underline;
}

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

/* ========================================
   2. ARTICLE CONTENT SECTION
   ======================================== */

.rise-theme-article-section {
    padding: 60px 0;
}

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

/* ========================================
   3. TABLE OF CONTENTS SIDEBAR
   ======================================== */

.rise-theme-article-sidebar {
    position: sticky;
    top: 100px;
}

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

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

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

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

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

.rise-theme-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;
}

.rise-theme-toc-link:hover,
.rise-theme-toc-link.active {
    background-color: rgba(63, 119, 111, 0.1);
    color: #3F776F;
    border-left-color: #3F776F;
    text-decoration: none;
}

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

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

/* ========================================
   4. ARTICLE MAIN CONTENT
   ======================================== */

.rise-theme-article-main {
    max-width: none;
    overflow: hidden;
}

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

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

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

.rise-theme-article-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.rise-theme-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;
}

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

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

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

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

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

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

.rise-theme-article-content img {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 8px;
    margin: 20px 0;
    display: block;
}

/* WordPress圖片容器處理 */
.rise-theme-article-content .wp-block-image,
.rise-theme-article-content figure,
.rise-theme-article-content .wp-caption {
    max-width: 100% !important;
    height: auto !important;
}

.rise-theme-article-content .wp-block-image img,
.rise-theme-article-content figure img,
.rise-theme-article-content .wp-caption img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
}

.rise-theme-article-content a {
    color: #3F776F;
    text-decoration: underline;
    font-weight: 500;
    transition: color 0.3s ease;
}

.rise-theme-article-content a:hover {
    color: #2D5A5A;
}

/* ========================================
   5. ARTICLE TAGS
   ======================================== */

.rise-theme-article-tags {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid #e0e0e0;
}

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

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

.rise-theme-article-tag {
    display: inline-block;
    padding: 6px 12px;
    background-color: rgba(63, 119, 111, 0.1);
    color: #3F776F;
    text-decoration: none;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.rise-theme-article-tag:hover {
    background-color: #3F776F;
    color: white;
    text-decoration: none;
}

/* ========================================
   6. RELATED ARTICLES SECTION
   ======================================== */

.rise-theme-related-articles {
    background-color: #f8f9fa;
    padding: 80px 0;
    margin-top: 60px;
}

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

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

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

/* 確保桌機版是3欄 */
@media (min-width: 993px) {
    .rise-theme-related-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

.rise-theme-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;
}

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

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

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

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

.rise-theme-related-placeholder {
    background: linear-gradient(135deg, #3F776F, #2D5A5A);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.rise-theme-related-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(63, 119, 111, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.rise-theme-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;
}

.rise-theme-related-link:hover {
    background-color: white;
    color: #3F776F;
    text-decoration: none;
}

.rise-theme-related-content {
    padding: 20px;
}

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

.rise-theme-related-date {
    color: #3F776F;
    font-size: 0.85rem;
    font-weight: 500;
}

.rise-theme-related-post-title {
    margin: 0 0 12px 0;
}

.rise-theme-related-post-title a {
    color: #333;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.rise-theme-related-post-title a:hover {
    color: #3F776F;
}

.rise-theme-related-excerpt {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ========================================
   7. RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 1200px) {
    .rise-theme-article-layout {
        grid-template-columns: 30% 70%;
        gap: 30px;
    }
    
    .rise-theme-article-title {
        font-size: 2rem;
    }
}

@media (max-width: 992px) {
    .rise-theme-related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .rise-theme-article-container {
        padding: 0 1rem;
    }
    
    .rise-theme-article-header {
        padding: 30px 0 40px;
    }
    
    .rise-theme-article-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .rise-theme-article-sidebar {
        position: static;
        order: 1;
    }
    
    .rise-theme-article-main {
        order: 2;
    }
    
    .rise-theme-toc-widget {
        margin-top: 0;
        margin-bottom: 30px;
    }
        margin-top: 30px;
    }
    
    .rise-theme-article-title {
        font-size: 1.8rem;
    }
    
    .rise-theme-article-meta {
        gap: 15px;
    }
    
    .rise-theme-article-content {
        font-size: 1rem;
    }
    
    .rise-theme-article-content h2 {
        font-size: 1.5rem;
    }
    
    .rise-theme-article-content h3 {
        font-size: 1.3rem;
    }
    
    .rise-theme-related-articles {
        padding: 60px 0;
    }
    
    .rise-theme-related-title {
        font-size: 1.8rem;
        margin-bottom: 30px;
    }
    
    .rise-theme-related-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .rise-theme-article-header {
        padding: 20px 0 30px;
    }
    
    .rise-theme-article-title {
        font-size: 1.5rem;
        margin: 15px 0 20px;
    }
    
    .rise-theme-article-excerpt {
        font-size: 1rem;
    }
    
    .rise-theme-toc-widget {
        padding: 20px;
    }
    
    .rise-theme-related-title {
        font-size: 1.5rem;
    }
}
