/* ===================================
   Single Post Layout
   =================================== */

.single-container {
    margin-top: 30px;
}

.single-layout {
    display: grid;
    grid-template-columns: 70% 30%;
    gap: 40px;
}

.single-main {
    padding-right: 20px;
}

/* ===================================
   Single Content - Prevent Overflow
   =================================== */
.single-content img,
.single-content iframe,
.single-content video,
.single-content embed,
.single-content object {
    max-width: 100% !important;
    height: auto !important;
}

.single-content .wp-block-embed,
.single-content .wp-block-image {
    max-width: 100%;
}

/* ===================================
   Breadcrumb
   =================================== */

.breadcrumb {
    font-size: 14px;
    color: var(--light-text);
    margin-bottom: 15px;
    padding: 10px 0;
}

.breadcrumb a {
    color: var(--light-text);
}

.breadcrumb a:hover {
    color: var(--primary-color);
}

.breadcrumb .separator {
    margin: 0 8px;
}

.breadcrumb .current {
    color: var(--text-color);
}

/* ===================================
   Post Category Badge
   =================================== */

.post-category-badge {
    margin-bottom: 15px;
}

.post-category-badge a {
    display: inline-block;
    background-color: var(--primary-color);
    color: #ffffff;
    padding: 5px 15px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.post-category-badge a:hover {
    background-color: var(--hover-color);
}

/* ===================================
   Single Post Title
   =================================== */

.single-title {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
    color: var(--text-color);
    letter-spacing: -2px;
}

/* ===================================
   Featured Image
   =================================== */

.single-featured-image {
    margin: 25px 0;
}

.single-featured-image img {
    width: 100%;
    height: auto;
    border-radius: 5px;
}

/* ===================================
   Share Buttons
   =================================== */

.share-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 25px 0;
    padding: 15px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.share-label {
    font-weight: 600;
    margin-right: 10px;
    color: var(--text-color);
}

.share-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    transition: all 0.3s ease;
}

.share-btn:hover {
    transform: translateY(-3px);
}

.share-btn.facebook {
    background-color: #3b5998;
}

.share-btn.twitter {
    background-color: #1da1f2;
}

.share-btn.reddit {
    background-color: #ff4500;
}

.share-btn.linkedin {
    background-color: #0077b5;
}

.share-btn.telegram {
    background-color: #0088cc;
}

.share-btn.whatsapp {
    background-color: #25d366;
}

.share-btn.copy-link {
    background-color: #6c757d;
}

/* ===================================
   Post Content
   =================================== */

.single-content {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-color);
    margin: 30px 0;
}

.single-content p {
    margin-bottom: 1.5rem;
}

.single-content h2,
.single-content h3,
.single-content h4 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.single-content img {
    margin: 2rem auto;
    border-radius: 5px;
}

.single-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 20px;
    margin: 2rem 0;
    font-style: italic;
    color: var(--light-text);
}

.single-content a {
    color: var(--primary-color);
    text-decoration: underline;
}

.single-content a:hover {
    color: var(--hover-color);
}

/* ===================================
   Post Tags
   =================================== */

.post-tags {
    margin: 30px 0;
    padding: 20px 0;
    border-top: 1px solid var(--border-color);
}

.tags-label {
    font-weight: 600;
    margin-right: 10px;
    color: var(--text-color);
}

.tag-link {
    display: inline-block;
    background-color: #f5f5f5;
    padding: 5px 12px;
    margin: 5px;
    border-radius: 3px;
    font-size: 14px;
    color: var(--text-color);
}

.tag-link:hover {
    background-color: var(--primary-color);
    color: #ffffff;
}

/* ===================================
   Author Bio
   =================================== */

.author-bio {
    display: flex;
    gap: 20px;
    background-color: #f9f9f9;
    padding: 30px;
    border-radius: 5px;
    margin: 40px 0;
}

.author-avatar img {
    border-radius: 50%;
    width: 80px;
    height: 80px;
}

.author-info {
    flex: 1;
}

.author-name {
    font-size: 1.25rem;
    margin-bottom: 10px;
}

.author-name a {
    color: var(--text-color);
}

.author-name a:hover {
    color: var(--primary-color);
}

.author-description {
    font-size: 15px;
    line-height: 1.6;
    color: var(--light-text);
}

/* ===================================
   Related Posts
   =================================== */

.related-posts {
    margin: 50px 0;
}

.related-posts h3 {
    font-size: 1.75rem;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--primary-color);
}

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

.related-post-item {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.related-post-item:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.related-post-thumb {
    display: block;
    overflow: hidden;
    position: relative;
}

.related-post-thumb img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
    display: block;
}

.related-post-item:hover .related-post-thumb img {
    transform: scale(1.05);
}

.related-post-thumb img,
    .related-post-placeholder {
        height: 180px;
    }

/* Placeholder for posts without featured image */
.related-post-placeholder {
    width: 100%;
    height: 200px;
    background-color: #e8f5e9;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.related-post-placeholder svg {
    width: 60px;
    height: 60px;
    color: #c8e6c9;
    opacity: 0.8;
}

.related-post-item:hover .related-post-placeholder {
    background-color: #dcedc8;
}

.related-post-title {
    padding: 15px;
    font-size: 1rem;
    line-height: 1.4;
}

.related-post-title a {
    color: var(--text-color);
}

.related-post-title a:hover {
    color: var(--primary-color);
}

.related-post-date {
    padding: 0 15px 15px;
    font-size: 13px;
    color: var(--light-text);
}

/* ===================================
   Sidebar
   =================================== */

.single-sidebar {
    position: sticky;
    top: 20px;
    height: fit-content;
}

.sidebar-widget-area {
    background-color: #f9f9f9;
    border-radius: 5px;
    overflow: hidden;
}

.widget {
    padding: 25px;
    border-bottom: 1px solid var(--border-color);
}

.widget:last-child {
    border-bottom: none;
}

.widget-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-color);
}

.sidebar-post-item {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-post-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.sidebar-post-thumb {
    flex-shrink: 0;
}

.sidebar-post-thumb img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 3px;
}

.sidebar-post-content {
    flex: 1;
}

.sidebar-post-title {
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 8px;
}

.sidebar-post-title a {
    color: var(--text-color);
}

.sidebar-post-title a:hover {
    color: var(--primary-color);
}

.sidebar-post-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 12px;
    color: var(--light-text);
}

.sidebar-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    font-size: 13px;
}

.sidebar-pagination-text {
    display: flex;
    gap: 15px;
    cursor: pointer;
}

.sidebar-pagination-prev:hover,
.sidebar-pagination-next:hover {
    color: var(--primary-color);
}

/* ===================================
   Comments
   =================================== */

.comments-area {
    margin-top: 50px;
    padding-top: 50px;
    border-top: 2px solid var(--border-color);
}

.comments-title {
    font-size: 1.75rem;
    margin-bottom: 30px;
}

.comment-list {
    list-style: none;
    margin: 0;
}

.comment {
    margin-bottom: 30px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 5px;
}

.comment-author img {
    border-radius: 50%;
}


/* ===================================
   Content Overflow Prevention
   =================================== */
.single-content img,
.single-content iframe,
.single-content video,
.single-content embed,
.single-content object,
.page-entry-content img,
.page-entry-content iframe,
.page-entry-content video,
.page-entry-content embed,
.page-entry-content object {
    max-width: 100% !important;
    height: auto !important;
}

.single-content .wp-block-embed,
.single-content .wp-block-image,
.page-entry-content .wp-block-embed,
.page-entry-content .wp-block-image {
    max-width: 100%;
}


/* ===================================
   Responsive Design
   =================================== */

@media (max-width: 1024px) {
    .single-layout {
        grid-template-columns: 65% 35%;
        gap: 30px;
    }
    
    .single-title {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .single-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .single-main {
        padding-right: 0;
    }
    
    .single-sidebar {
        position: static;
    }
    
    .single-title {
        font-size: 1.75rem;
    }
    
    .single-content {
        font-size: 1rem;
    }
    
    .related-posts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .share-buttons {
        flex-wrap: wrap;
    }
    
    .author-bio {
        flex-direction: column;
        text-align: center;
    }
}
