/* ================================
   POST & PAGE CONTENT
   ================================ */

/* Post Page Layout */
.post-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 48px 24px 80px;
}

.post-article {
    width: 100%;
}

/* Post Header */
.post-header {
    max-width: 800px;
    margin: 0 auto 48px;
    text-align: center;
}

.post-tag-badge {
    display: inline-block;
    padding: 6px 16px;
    background: var(--color-primary);
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    text-decoration: none;
    margin-bottom: 20px;
    transition: all 0.2s ease;
}

.post-tag-badge:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.post-title {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 900;
    color: var(--text-primary);
    margin: 0 0 24px 0;
    line-height: 1.2;
    letter-spacing: -0.03em;
}

.post-feature-image {
    margin: 32px 0 0;
}

.post-feature-image img {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
}

.post-feature-image figcaption {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 12px;
}

/* Post Body - Two Column Layout */
.post-body {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 60px;
    max-width: 1200px;
    margin: 0 auto;
    align-items: start;
}

/* ================================
   TABLE OF CONTENTS SIDEBAR
   ================================ */
.toc-sidebar {
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    order: 2;
}

.toc-container {
    padding: 24px;
    background: var(--bg-light);
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--color-primary);
}

.toc-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin: 0 0 16px 0;
}

.toc-nav {
    font-size: 0.9rem;
}

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

.toc-item {
    margin: 0;
}

.toc-link {
    display: block;
    padding: 8px 0;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 2px solid transparent;
    padding-left: 12px;
    margin-left: -12px;
}

.toc-link:hover {
    color: var(--color-primary);
}

.toc-link.is-active {
    color: var(--color-primary);
    font-weight: 600;
    border-left-color: var(--color-primary);
}

/* H3 items indented */
.toc-h3 .toc-link {
    padding-left: 24px;
    font-size: 0.85rem;
}

/* ================================
   POST CONTENT AREA
   ================================ */
article header {
    margin-bottom: 48px;
    text-align: center;
}

.post-meta-single {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    color: var(--text-muted);
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.post-meta-single time,
.post-meta-single .reading-time {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-light);
    padding: 8px 16px;
    border-radius: var(--radius-md);
}

.post-meta-single svg {
    width: 18px;
    height: 18px;
    stroke: var(--text-muted);
}

.post-content {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.post-content h2,
.post-content h3,
.post-content h4 {
    color: var(--text-primary);
    font-weight: 800;
    margin: 48px 0 24px;
    letter-spacing: -0.02em;
    position: relative;
    padding-left: 20px;
}

.post-content h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.5em;
    width: 8px;
    height: 8px;
    background: var(--color-primary);
    border-radius: 50%;
}

.post-content h2 {
    font-size: 2rem;
}

.post-content h3 {
    font-size: 1.5rem;
}

.post-content p {
    margin-bottom: 28px;
}

.post-content a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
    padding-bottom: 2px;
}

.post-content a:hover {
    color: var(--color-primary-hover);
    border-bottom-color: var(--color-primary-hover);
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
    margin: 32px 0;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
}

.post-content img:hover {
    transform: scale(1.01);
    box-shadow: var(--shadow-xl);
}

.post-content blockquote {
    border-left: 4px solid var(--color-primary);
    padding: 24px 32px;
    margin: 32px 0;
    background: var(--bg-light);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-style: italic;
    position: relative;
}

.post-content blockquote::before {
    content: '"';
    position: absolute;
    top: -20px;
    left: 20px;
    font-size: 80px;
    color: var(--color-primary);
    opacity: 0.2;
    font-family: serif;
}

.post-content code {
    background: var(--bg-light);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.9em;
    color: var(--color-primary);
    font-family: "Courier New", Courier, monospace;
}

.post-content pre {
    background: var(--color-black);
    color: var(--color-white);
    padding: 24px;
    border-radius: var(--radius-lg);
    overflow-x: auto;
    margin: 32px 0;
    position: relative;
}

.post-content pre::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--color-primary);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

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

/* Tables - wrap in container for mobile overflow */
.post-content .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 32px 0;
}

.post-content table {
    width: 100%;
    min-width: 500px;
    border-collapse: collapse;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.post-content th {
    background: var(--color-primary);
    color: var(--bg-body);
    padding: 16px;
    text-align: left;
    font-weight: 700;
}

.post-content td {
    padding: 16px;
    border-bottom: 1px solid var(--border-light);
}

.post-content tr:nth-child(even) {
    background: var(--bg-light);
}

.post-content tr:hover {
    background: var(--bg-light);
}

/* Lists */
.post-content ul,
.post-content ol {
    margin: 24px 0;
    padding-left: 24px;
}

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

.post-content li::marker {
    color: var(--color-primary);
}

/* Author Bio */
.author-bio {
    margin-top: 60px;
    padding: 40px;
    background: var(--bg-light);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    gap: 32px;
}

.author-bio img {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 4px solid var(--color-primary);
}

.author-bio-content h3 {
    margin: 0 0 12px 0;
    color: var(--text-primary);
    font-size: 1.5rem;
}

.author-bio-content p {
    margin: 0;
    color: var(--text-secondary);
}

/* Post Tags */
.post-tags-single {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 2px solid var(--border-light);
}

.post-tags-single h3 {
    margin: 0 0 20px 0;
    color: var(--text-primary);
    font-size: 1.25rem;
}

/* ================================
   RESPONSIVE TABLET FOR POST
   ================================ */
@media (max-width: 1023px) {
    .post-body {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .toc-sidebar {
        display: none;
    }

    .post-page {
        padding: 32px 24px 60px;
    }
}

/* ================================
   RESPONSIVE MOBILE FOR POST
   ================================ */
@media (max-width: 767px) {
    .post-page {
        padding: 24px 16px 48px;
    }

    .post-header {
        margin-bottom: 32px;
    }

    .post-title {
        font-size: 2rem;
    }

    .post-content {
        font-size: 1.05rem;
        line-height: 1.7;
    }

    .post-content h2 {
        font-size: 1.75rem;
    }

    .post-content h3 {
        font-size: 1.35rem;
    }

    .post-meta-single {
        flex-direction: column;
        gap: 12px;
    }

    .author-bio,
    .author-card-single {
        flex-direction: column;
        text-align: center;
        padding: 32px;
    }

    .post-footer {
        margin-top: 48px;
    }
}

/* ================================
   POST FOOTER / AUTHOR CARD
   ================================ */
.post-footer {
    max-width: 800px;
    margin: 60px auto 0;
    padding-top: 40px;
    border-top: 2px solid var(--border-light);
}

.author-card-single {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 32px;
    background: var(--bg-light);
    border-radius: var(--radius-xl);
}

.author-avatar-single {
    width: 100px;
    height: 100px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 4px solid var(--color-primary);
    flex-shrink: 0;
}

.author-avatar-single.author-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-body);
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--color-primary);
}

.author-info-single h3 {
    margin: 0 0 8px 0;
    font-size: 1.25rem;
}

.author-info-single h3 a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.author-info-single h3 a:hover {
    color: var(--color-primary);
}

.author-info-single p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ================================
   SHARE SECTION
   ================================ */
.post-share {
    max-width: 800px;
    margin: 48px auto 0;
    padding: 32px 0;
    border-top: 2px solid var(--border-light);
}

.post-share-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 20px 0;
    letter-spacing: -0.01em;
}

.post-share-title svg {
    color: var(--color-primary);
    flex-shrink: 0;
}

.share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    border: 2px solid var(--border-light);
    background: var(--bg-body);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: inherit;
    line-height: 1;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.share-btn svg {
    flex-shrink: 0;
}

/* X / Twitter */
.share-btn-x:hover {
    background: #000000;
    border-color: #000000;
    color: #ffffff;
}

/* Facebook */
.share-btn-facebook:hover {
    background: #1877F2;
    border-color: #1877F2;
    color: #ffffff;
}

/* LinkedIn */
.share-btn-linkedin:hover {
    background: #0A66C2;
    border-color: #0A66C2;
    color: #ffffff;
}

/* WhatsApp */
.share-btn-whatsapp:hover {
    background: #25D366;
    border-color: #25D366;
    color: #ffffff;
}

/* Email */
.share-btn-email:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #ffffff;
}

/* Copy Link */
.share-btn-copy:hover {
    background: var(--text-primary);
    border-color: var(--text-primary);
    color: var(--bg-body);
}

.share-btn-copy.is-copied {
    background: #16a34a;
    border-color: #16a34a;
    color: #ffffff;
}

/* Share Responsive - Tablet */
@media (max-width: 1023px) {
    .post-share {
        margin-top: 40px;
        padding: 28px 0;
    }
}

/* Share Responsive - Mobile */
@media (max-width: 767px) {
    .post-share {
        margin-top: 32px;
        padding: 24px 0;
    }

    .share-buttons {
        gap: 8px;
    }

    .share-btn {
        padding: 10px 14px;
        font-size: 0.82rem;
    }

    .share-btn span {
        display: none;
    }

    .share-btn {
        padding: 12px;
    }
}

/* ================================
   COMMENTS SECTION
   ================================ */
.article-comments {
    max-width: 800px;
    margin: 60px auto 0;
    padding-top: 40px;
    border-top: 2px solid var(--border-light);
}

.comments-header {
    margin-bottom: 32px;
}

.comments-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.02em;
}

.comments-title svg {
    color: var(--color-primary);
    flex-shrink: 0;
}

/* Ghost native comments container */
.comments-container {
    margin-top: 8px;
}

/* CTA for non-members */
.comments-cta {
    text-align: center;
    padding: 48px 32px;
    background: var(--bg-light);
    border-radius: var(--radius-xl);
    border: 2px dashed var(--border-light);
    transition: var(--transition);
}

.comments-cta:hover {
    border-color: var(--color-primary);
    background: linear-gradient(135deg, var(--bg-light), rgba(var(--color-primary-rgb, 99, 102, 241), 0.04));
}

.comments-cta-icon {
    margin-bottom: 20px;
    color: var(--color-primary);
    opacity: 0.7;
}

.comments-cta-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 12px 0;
    letter-spacing: -0.02em;
}

.comments-cta-text {
    color: var(--text-secondary);
    font-size: 1rem;
    margin: 0 0 24px 0;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.comments-cta-btn {
    display: inline-block;
    padding: 14px 32px;
    background: var(--color-primary);
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all 0.25s ease;
    box-shadow: 0 4px 14px rgba(var(--color-primary-rgb, 99, 102, 241), 0.3);
}

.comments-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(var(--color-primary-rgb, 99, 102, 241), 0.45);
}

.comments-cta-btn:active {
    transform: translateY(0);
}

/* ================================
   POST PAGE RESPONSIVE - TABLET
   ================================ */
@media (max-width: 1024px) {
    .post-page {
        padding: 24px 16px 60px;
    }
}

/* ================================
   POST PAGE RESPONSIVE - MOBILE
   ================================ */
@media (max-width: 767px) {
    .post-page {
        padding: 16px 12px 48px;
    }

    .post-article .post-title {
        font-size: 1.8rem;
    }

    .post-article .post-excerpt {
        font-size: 1rem;
    }
}

/* ================================
   COMMENTS RESPONSIVE - TABLET
   ================================ */
@media (max-width: 1023px) {
    .article-comments {
        margin-top: 48px;
        padding-top: 32px;
    }
}

/* ================================
   COMMENTS RESPONSIVE - MOBILE
   ================================ */
@media (max-width: 767px) {
    .article-comments {
        margin-top: 40px;
        padding-top: 24px;
    }

    .comments-title {
        font-size: 1.25rem;
    }

    .comments-cta {
        padding: 36px 20px;
    }

    .comments-cta-title {
        font-size: 1.15rem;
    }

    .comments-cta-text {
        font-size: 0.95rem;
    }

    .comments-cta-btn {
        padding: 12px 28px;
        font-size: 0.95rem;
    }
}