/**
 * Single Post CSS
 * @package Gia-Sat
 * @since 1.0.2
 * @author Aboyit
 * @license GPL-2.0+
 */

/* Post Featured Image */
.post-featured-image {
    width: 100%;
    max-width: 800px;
    margin: 20px auto 30px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.post-featured-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* Post Content Layout */
.post-content-layout {
    display: flex;
    gap: 30px;
    margin-top: 30px;
}

/* Table of Contents Sidebar */
.post-toc-sidebar {
    flex: 0 0 250px;
    max-width: 250px;
}

.toc-sticky {
    position: sticky;
    top: 20px;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.toc-sticky h3 {
    font-family: Roboto-Medium, sans-serif;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 15px 0;
    color: #212529;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--main-color, #D92228);
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-list li {
    margin-bottom: 8px;
}

.toc-list ul {
    list-style: none;
    padding-left: 15px;
    margin-top: 5px;
    margin-bottom: 5px;
}

.toc-list a {
    color: #666;
    text-decoration: none;
    font-family: Roboto-Regular, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    display: block;
    padding: 5px 0;
    transition: all 0.3s ease;
}

.toc-list a:hover {
    color: var(--main-color, #D92228);
    padding-left: 5px;
}

.toc-list a.active {
    color: var(--main-color, #D92228);
    font-weight: 600;
}

/* Post Content Area */
.post-content-area {
    flex: 1;
    min-width: 0;
}

.post-content-area .article {
    font-family: Roboto-Regular, sans-serif;
    font-size: 16px;
    line-height: 1.8;
    color: #333;
}

.post-content-area .article h2 {
    font-family: Roboto-Medium, sans-serif;
    font-size: 24px;
    font-weight: 600;
    color: #212529;
    margin-top: 30px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.post-content-area .article h3 {
    font-family: Roboto-Medium, sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: #212529;
    margin-top: 25px;
    margin-bottom: 12px;
}

.post-content-area .article h4 {
    font-family: Roboto-Medium, sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: #212529;
    margin-top: 20px;
    margin-bottom: 10px;
}

.post-content-area .article p {
    margin-bottom: 15px;
}

.post-content-area .article img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    margin: 20px 0;
}

.post-content-area .article ul,
.post-content-area .article ol {
    margin: 15px 0;
    padding-left: 30px;
}

.post-content-area .article li {
    margin-bottom: 8px;
}

/* Related Posts Section */
.related-posts {
    background: #f5f5f5;
    padding: 50px 0;
    margin-top: 50px;
}

.related-posts .title-main {
    text-align: center;
    margin-bottom: 40px;
}

.related-posts .title-main h2 {
    font-family: Anton-Regular, sans-serif;
    font-size: 28px;
    color: #212529;
    text-transform: uppercase;
    font-weight: 700;
    position: relative;
    display: inline-block;
    padding-bottom: 10px;
}

.related-posts .title-main h2:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: var(--main-color, #D92228);
}

.related-posts-list {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

.related-post-item {
    display: flex;
    flex-direction: column;
    width: calc(33.333% - 20px);
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.related-post-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.related-post-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
}

.related-post-image a {
    display: block;
    width: 100%;
    height: 100%;
}

.related-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.related-post-item:hover .related-post-image img {
    transform: scale(1.1);
}

.related-post-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.related-post-title {
    font-family: Roboto-Medium, sans-serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.5;
    margin-bottom: 10px;
}

.related-post-title a {
    color: #212529;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-post-title a:hover {
    color: var(--main-color, #D92228);
}

.related-post-date {
    font-family: Roboto-Regular, sans-serif;
    font-size: 13px;
    color: #999;
    margin-bottom: 10px;
}

.related-post-date i {
    margin-right: 5px;
}

.related-post-excerpt {
    font-family: Roboto-Regular, sans-serif;
    font-size: 14px;
    color: #636366;
    line-height: 1.6;
    margin-top: auto;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Responsive */
@media screen and (max-width: 991px) {
    .post-content-layout {
        flex-direction: column;
    }
    
    .post-toc-sidebar {
        flex: 1 1 auto;
        max-width: 100%;
        order: -1;
        margin-bottom: 30px;
    }
    
    .toc-sticky {
        position: static;
    }
    
    .related-post-item {
        width: calc(50% - 15px);
    }
    
    .related-posts .title-main h2 {
        font-size: 24px;
    }
}

@media screen and (max-width: 768px) {
    .post-featured-image {
        margin: 15px 0 20px;
    }
    
    .post-content-layout {
        gap: 20px;
        margin-top: 20px;
    }
    
    .toc-sticky {
        padding: 15px;
    }
    
    .toc-sticky h3 {
        font-size: 16px;
    }
    
    .toc-list a {
        font-size: 13px;
    }
    
    .related-posts {
        padding: 40px 0;
        margin-top: 40px;
    }
    
    .related-posts .title-main {
        margin-bottom: 30px;
    }
    
    .related-posts .title-main h2 {
        font-size: 22px;
    }
    
    .related-posts-list {
        gap: 20px;
    }
    
    .related-post-item {
        width: 100%;
    }
    
    .related-post-image {
        height: 180px;
    }
}

