/**
 * Single Post CSS - Kampung Inggris Plus
 * Primary: #2049D0 | Accent: #FFB900
 * 
 * @package KIP_Theme_TG
 */

/* ========================================
   RESET & BASE
   ======================================== */
*, ::after, ::before {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body.single-post-page {
    font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: #1f2937;
    background-color: #f9fafb;
    padding-top: 70px; /* For fixed header */
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
}

/* ========================================
   BREADCRUMB
   ======================================== */
.breadcrumb-nav {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 15px 20px;
}

.breadcrumb-container {
    max-width: 1200px;
    margin: 0 auto;
    font-size: 14px;
    color: #6b7280;
}

.breadcrumb-container a {
    color: #2049D0;
    transition: color 0.3s ease;
}

.breadcrumb-container a:hover {
    color: #1e3a8a;
    text-decoration: underline;
}

.breadcrumb-container .separator {
    margin: 0 10px;
    font-size: 10px;
    color: #9ca3af;
}

.breadcrumb-container .current {
    color: #374151;
    font-weight: 500;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: middle;
}

/* ========================================
   MAIN LAYOUT
   ======================================== */
.single-post-main {
    padding: 40px 20px 80px;
}

.single-post-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
    align-items: start;
}

/* ========================================
   POST ARTICLE
   ======================================== */
.post-article {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

/* Post Header */
.post-header {
    padding: 40px 40px 30px;
    border-bottom: 1px solid #f3f4f6;
}

.post-category a {
    display: inline-block;
    background: linear-gradient(135deg, #2049D0 0%, #3b82f6 100%);
    color: #fff;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 16px;
    transition: transform 0.3s ease;
}

.post-category a:hover {
    transform: translateY(-2px);
}

.post-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: #111827;
    line-height: 1.3;
    margin-bottom: 20px;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #6b7280;
}

.meta-item i {
    font-size: 13px;
    color: #2049D0;
}

.meta-item a {
    color: #2049D0;
}

.meta-item a:hover {
    text-decoration: underline;
}

/* ========================================
   TABLE OF CONTENTS
   ======================================== */
.toc-wrapper {
    margin: 0 40px 30px;
    background: linear-gradient(135deg, rgba(32, 73, 208, 0.05) 0%, rgba(32, 73, 208, 0.1) 100%);
    border: 1px solid rgba(32, 73, 208, 0.15);
    border-radius: 12px;
    overflow: hidden;
}

.toc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, #2049D0 0%, #1e3a8a 100%);
    color: #fff;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    transition: background 0.3s ease;
}

.toc-header:hover {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e3a8a 100%);
}

.toc-header i {
    margin-right: 8px;
}

.toc-toggle-icon {
    transition: transform 0.3s ease;
}

.toc-wrapper.collapsed .toc-toggle-icon {
    transform: rotate(-90deg);
}

.toc-content {
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.toc-wrapper.collapsed .toc-content {
    max-height: 0;
    padding: 0 20px;
    overflow: hidden;
}

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

.toc-content li {
    margin-bottom: 10px;
}

.toc-content a {
    display: block;
    padding: 8px 12px;
    color: #374151;
    font-size: 14px;
    border-radius: 6px;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.toc-content a:hover {
    background: #fff;
    color: #2049D0;
    border-left-color: #2049D0;
}

.toc-content .toc-h3 {
    padding-left: 24px;
    font-size: 13px;
}

/* ========================================
   POST CONTENT
   ======================================== */
.post-content {
    padding: 30px 40px 40px;
}

.post-content .featured-image-single {
    margin-bottom: 30px !important;
}

.post-content .featured-image-single img {
    border-radius: 12px !important;
}

.post-content h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #111827;
    margin: 40px 0 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e7eb;
}

.post-content h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1f2937;
    margin: 30px 0 15px;
}

.post-content h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #374151;
    margin: 25px 0 12px;
}

.post-content p {
    margin-bottom: 20px;
    color: #374151;
}

.post-content a {
    color: #2049D0;
    font-weight: 500;
    text-decoration: underline;
    text-decoration-color: rgba(32, 73, 208, 0.3);
    text-underline-offset: 3px;
    transition: all 0.3s ease;
}

.post-content a:hover {
    color: #1e3a8a;
    text-decoration-color: #1e3a8a;
}

.post-content ul,
.post-content ol {
    margin: 0 0 20px 25px;
    color: #374151;
}

.post-content ul li {
    list-style-type: disc;
}

.post-content ol li {
    list-style-type: decimal;
}

.post-content li {
    margin-bottom: 10px;
}

.post-content blockquote {
    margin: 30px 0;
    padding: 20px 25px;
    background: linear-gradient(135deg, rgba(32, 73, 208, 0.05) 0%, rgba(32, 73, 208, 0.1) 100%);
    border-left: 4px solid #2049D0;
    border-radius: 0 12px 12px 0;
    font-style: italic;
    color: #374151;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
    font-size: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    overflow: hidden;
}

.post-content table thead {
    background: linear-gradient(135deg, #2049D0 0%, #3b82f6 100%);
    color: #fff;
}

.post-content table th,
.post-content table td {
    padding: 14px 18px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.post-content table tbody tr:nth-child(even) {
    background: #f9fafb;
}

.post-content table tbody tr:hover {
    background: rgba(32, 73, 208, 0.05);
}

.post-content img {
    border-radius: 12px;
    margin: 20px 0;
}

.post-content figure {
    margin: 30px 0;
}

.post-content figcaption {
    text-align: center;
    font-size: 14px;
    color: #6b7280;
    margin-top: 10px;
}

.post-content pre {
    background: #1f2937;
    color: #f9fafb;
    padding: 20px;
    border-radius: 12px;
    overflow-x: auto;
    margin: 25px 0;
    font-size: 14px;
}

.post-content code {
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 14px;
    color: #dc2626;
}

.post-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.post-content .cta-button-container {
    margin: 40px 0 !important;
    border-radius: 16px !important;
}

/* ========================================
   POST TAGS
   ======================================== */
.post-tags {
    padding: 0 40px 30px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.tags-label {
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
}

.tags-label i {
    margin-right: 6px;
    color: #2049D0;
}

.post-tags a {
    display: inline-block;
    background: #f3f4f6;
    padding: 6px 14px;
    border-radius: 20px;
    color: #374151;
    font-size: 13px;
    transition: all 0.3s ease;
}

.post-tags a:hover {
    background: #2049D0;
    color: #fff;
}

/* ========================================
   AUTHOR BOX
   ======================================== */
.author-box {
    margin: 0 40px 40px;
    padding: 30px;
    background: linear-gradient(135deg, rgba(32, 73, 208, 0.05) 0%, #fff 100%);
    border: 1px solid rgba(32, 73, 208, 0.15);
    border-radius: 16px;
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.author-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #2049D0;
}

.author-info {
    flex: 1;
}

.author-label {
    font-size: 12px;
    font-weight: 600;
    color: #2049D0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.author-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: #111827;
    margin: 6px 0 10px;
}

.author-bio {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.6;
}

/* ========================================
   RELATED POSTS
   ======================================== */
.related-posts {
    padding: 40px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

.related-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 25px;
}

.related-title i {
    color: #2049D0;
    margin-right: 10px;
}

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

.related-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.related-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.related-thumbnail {
    aspect-ratio: 16/10;
    overflow: hidden;
}

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

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

.related-info {
    padding: 16px;
}

.related-card-title {
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-date {
    font-size: 13px;
    color: #6b7280;
}

/* ========================================
   SIDEBAR
   ======================================== */
.post-sidebar {
    position: relative;
}

.sidebar-sticky {
    position: sticky;
    top: 100px;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.sidebar-widget {
    background: #fff;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.widget-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e5e7eb;
}

.widget-title i {
    color: #2049D0;
    margin-right: 8px;
}

/* Recent Posts */
.recent-posts-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.recent-post-item {
    display: flex;
    gap: 12px;
    padding: 10px;
    border-radius: 10px;
    transition: background 0.3s ease;
}

.recent-post-item:hover {
    background: #f3f4f6;
}

.recent-post-thumb {
    width: 70px;
    height: 50px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
}

.recent-post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recent-post-info {
    flex: 1;
    min-width: 0;
}

.recent-post-title {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.4;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.recent-post-date {
    font-size: 12px;
    color: #6b7280;
}

/* Sidebar CTA */
.sidebar-cta {
    background: linear-gradient(135deg, #2049D0 0%, #1e3a8a 100%);
    text-align: center;
    color: #fff;
}

.sidebar-cta .cta-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
}

.sidebar-cta .cta-icon i {
    font-size: 24px;
}

.sidebar-cta .cta-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.sidebar-cta .cta-text {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 20px;
    line-height: 1.5;
}

.sidebar-cta .cta-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #FFB900;
    color: #1e293b !important;
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.sidebar-cta .cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 185, 0, 0.4);
    background: #e6a800;
}

/* ========================================
   RESPONSIVE - TABLET
   ======================================== */
@media (max-width: 1024px) {
    .single-post-container {
        grid-template-columns: 1fr 280px;
        gap: 30px;
    }
    
    .post-header {
        padding: 30px 30px 25px;
    }
    
    .post-title {
        font-size: 1.9rem;
    }
    
    .toc-wrapper {
        margin: 0 30px 25px;
    }
    
    .post-content {
        padding: 25px 30px 35px;
    }
    
    .post-tags {
        padding: 0 30px 25px;
    }
    
    .author-box {
        margin: 0 30px 35px;
        padding: 25px;
    }
    
    .related-posts {
        padding: 30px;
    }
    
    .related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========================================
   RESPONSIVE - MOBILE
   ======================================== */
@media (max-width: 768px) {
    body.single-post-page {
        padding-top: 62px;
    }
    
    .single-post-main {
        padding: 20px 15px 60px;
    }
    
    .single-post-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .post-sidebar {
        order: 2;
    }
    
    .sidebar-sticky {
        position: relative;
        top: 0;
    }
    
    .post-article {
        border-radius: 12px;
    }
    
    .post-header {
        padding: 25px 20px 20px;
    }
    
    .post-title {
        font-size: 1.5rem;
    }
    
    .post-meta {
        gap: 12px;
    }
    
    .meta-item {
        font-size: 13px;
    }
    
    .toc-wrapper {
        margin: 0 20px 20px;
    }
    
    .post-content {
        padding: 20px;
    }
    
    .post-content h2 {
        font-size: 1.4rem;
        margin: 30px 0 15px;
    }
    
    .post-content h3 {
        font-size: 1.2rem;
    }
    
    .post-content table {
        font-size: 13px;
    }
    
    .post-content table th,
    .post-content table td {
        padding: 10px 12px;
    }
    
    .post-tags {
        padding: 0 20px 20px;
    }
    
    .author-box {
        margin: 0 20px 30px;
        padding: 20px;
        flex-direction: column;
        text-align: center;
        align-items: center;
    }
    
    .author-avatar {
        margin-bottom: 15px;
    }
    
    .author-avatar img {
        width: 70px;
        height: 70px;
    }
    
    .related-posts {
        padding: 25px 20px;
    }
    
    .related-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .related-card {
        display: flex;
        gap: 15px;
    }
    
    .related-thumbnail {
        width: 100px;
        height: 70px;
        flex-shrink: 0;
        aspect-ratio: auto;
    }
    
    .related-info {
        padding: 10px 10px 10px 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    
    .breadcrumb-container .current {
        max-width: 150px;
    }
}

@media (max-width: 480px) {
    .post-title {
        font-size: 1.3rem;
    }
    
    .post-meta {
        flex-direction: column;
        gap: 8px;
    }
    
    .sidebar-widget {
        padding: 20px;
    }
}
