@import url("/static/css/common.css");

/* Main layout */
.wrapper {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Content area */
.content {
    flex: 7;
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Sidebar */
.sidebar {
    flex: 3;
    background: var(--color-secondary-1);
    border-radius: 1rem;
    padding: 1.5rem;
    height: fit-content;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Typography */
.content h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--color-bg-dark);
}

.post-date {
    color: #666;
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

/* Post content styling */
.post-content {
    line-height: 1.33;
}

.post-content h1, 
.post-content h2, 
.post-content h3 {
    margin: 1.5rem 0 1rem 0;
}

.post-content p {
    margin-bottom: 1.2rem;
}

.post-content img {
    max-width: 100%;
    border-radius: 0.5rem;
    margin: 1.5rem 0;
}

.post-content blockquote {
    border-left: 4px solid var(--color-primary);
    padding-left: 1rem;
    margin-left: 0;
    color: #444;
}

.post-content ul, 
.post-content ol {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Images */
.cover-image {
    width: 100%;
    max-height: 512px;
    object-fit: cover;
    border-radius: 1.5rem;
    margin-bottom: 1.5rem;
}

.post-thumbnail {
    width: 100%;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

/* Author box */
.author-info {
    background-color: var(--color-secondary-1);
    padding: 1.5rem;
    border-radius: 1rem;
    margin-bottom: 2rem;
}

.author-info * {
    font-size: 0.8rem;
    display: block;
}

.author-info h4 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.author-info h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.author-info img {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    float: left;
    margin-right: 1rem;
}

.author-info a {
    display: inline-block;
    color: var(--color-bg-dark);
    margin-top: 0.5rem;
    font-weight: bold;
}

.author-bio {
    font-size: 0.9rem;
    line-height: 1.5;
    overflow: hidden;
}

/* Tags */
.sidebar-heading {
    margin-bottom: 1rem;
    font-size: 1.2rem;
    color: var(--color-bg-dark); /* Match heading color with site theme */
}

.tag-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.tag-pill {
    background-color: var(--color-bg-dark); /* Changed to primary color to match site theme */
    padding: 0.3rem 0.8rem;
    border-radius: 2rem;
    font-size: 0.8rem;
    color: var(--color-font-light); /* Ensuring text is readable on primary background */
    cursor: pointer;
    transition: background-color 0.2s;
}

.tag-pill:hover {
    text-decoration: underline;
}

/* Share buttons */
.share-section {
    margin-bottom: 2rem;
    margin-top: 1.5rem;
    width: 100%;
}

.share-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
    justify-content: flex-start;
}

.share-button {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-bg-dark);
    cursor: pointer;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

.share-button i {
    color: white;
    font-size: 1rem;
}

.share-button i.fa {
    font-size: 1.2rem;
    color: var(--color-font-light);
}

/* Back button with icon */
.back-button {
    display: inline-block;
    margin-bottom: 2rem;
    color: var(--color-bg-dark);
    text-decoration: none;
    font-weight: 600;
}

.back-button i.fa {
    margin-right: 0.3rem;
}

.back-button:hover {
    text-decoration: underline;
}

/* Related posts */
.related-posts {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #ddd;
}

.related-posts h3 {
    margin-bottom: 1.5rem;
}

.related-post-card {
    flex: 1;
    min-width: 200px;
    background-color: transparent;
    border-radius: 1rem;
    overflow: hidden;
}

.related-post-card:hover h4 {
    text-decoration: underline;
}

.related-post-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.related-post-card h4 {
    padding: 1rem;
    font-size: 1rem;
}

.post-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* Similar Posts Styling */
.similar-posts {
    margin-top: 2rem;
    border-top: 1px solid var(--color-secondary-1);
    padding-top: 1rem;
}

.similar-posts-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.similar-post-item {
    display: flex;
    gap: 1rem;
    text-decoration: none;
    border-radius: 0.5rem;
    overflow: hidden;
}

.similar-post-item:hover h4 {
    text-decoration: underline;
}

.similar-post-thumbnail {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    overflow: hidden;
}

.similar-post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.similar-post-info {
    padding: 0.5rem 0.5rem 0.5rem 0;
    display: flex;
    flex-direction: column;
}

.similar-post-info h4 {
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
    color: var(--color-bg-dark); /* Match heading color with site theme */
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 2.4em;
}

.similar-post-info .post-date {
    font-size: 0.7rem;
    margin: 0;
    color: var(--color-bg-dark);
    opacity: 0.8;
    display: block;
    margin-top: 0.25rem;
}

/* Responsive design */
@media (max-width: 768px) {
    section {
        padding: 0 0.5rem;
    }

    .wrapper {
        flex-direction: column;
        padding: 0 0.5rem;
    }
    
    .content, .sidebar {
        flex: 1;
        width: 100%;
        box-sizing: border-box;
    }
    
    .content {
        padding: 1rem;
    }
    
    .sidebar {
        margin-top: 2rem;
        margin-bottom: 2rem;
        overflow-x: hidden;
        padding: 1.25rem;
    }
    
    .content h1 {
        font-size: 2rem;
    }
    
    /* Fix for buttons in sidebar */
    .share-buttons {
        width: 100%;
        gap: 0.5rem;
        justify-content: flex-start;
    }
    
    .share-button {
        width: 42px;
        height: 42px;
    }
    
    /* Ensure tag pills don't overflow */
    .tag-pills {
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* Ensure related posts display properly */
    .related-posts .hflex {
        flex-direction: column;
    }
    
    .related-post-card {
        margin-bottom: 1rem;
    }

    .similar-post-item {
        flex-direction: row;
    }
    
    .similar-post-thumbnail {
        flex: 0 0 80px;
        height: 80px;
        width: auto;
    }
}
