/* Import PT Serif Font */
@import url('https://fonts.googleapis.com/css2?family=PT+Serif:ital,wght@0,400;0,700;1,400;1,700&display=swap');

/* CSS Variables */
:root {
    --primary-accent: #b91c1c;
    --primary-dark: #991b1b;
    --text-dark: #333333;
    --text-muted: #666666;
    --text-dimmer: #888888;
    --text-dimmed: #999999;
    --border-soft: #e2e8f0;
    --bg-light: #f8fafc;
    --pure-white: #ffffff;
    --shadow: 0 1px 3px rgba(0,0,0,0.05);
    --transition: all 0.3s ease;
}

/* Apply PT Serif to entire site */
* {
    font-family: 'PT Serif', serif;
}

/* Body styling */
body {
    background-color: var(--pure-white);
    color: var(--text-dark);
    line-height: 1.4;
    font-size: 13px;
    font-weight: 400;
}

/* Single Post Container - FIX FOR HEADER OVERLAP */
.single-post-container {
    margin-top: 140px !important;
    padding: 0 20px;
    min-height: 100vh;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 12px;
}

/* Article Layout */
.article-container {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.article-main {
    flex: 2.5;
}

.article-sidebar {
    flex: 1;
}

/* Article Header */
.article-header {
    margin-bottom: 20px;
}

.article-category {
    color: var(--primary-accent);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.article-title {
    font-size: 28px;
    line-height: 1.3;
    margin-bottom: 12px;
    font-weight: 700;
    color: var(--text-dark);
}

/* Article Meta Container with Share Button */
.article-meta-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    gap: 15px;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-dimmer);
    font-size: 12px;
    flex: 1;
    margin-top: 2px;
}

.article-author, .article-date {
    line-height: 1.3;
}

/* Share Button in Right Corner - Perfectly Aligned */
.share-any-platform-btn.top-share-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--primary-accent);
    color: white;
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 11px;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(185, 28, 28, 0.3);
    white-space: nowrap;
    flex-shrink: 0;
    height: 24px;
    line-height: 1;
    margin-top: -6px;
}

.share-any-platform-btn.top-share-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(185, 28, 28, 0.4);
}

.share-any-platform-btn.top-share-btn i {
    font-size: 10px;
}

.article-hero-img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 16px;
}

.article-caption {
    color: var(--text-dimmed);
    font-size: 11px;
    text-align: center;
    margin-bottom: 20px;
}

/* Article Content */
.article-content {
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-dark);
    text-align: justify;
    hyphens: auto;
}

.article-content p {
    margin-bottom: 20px;
}

.article-content h2 {
    font-size: 22px;
    margin: 30px 0 15px;
    color: var(--text-dark);
    font-weight: 600;
    text-align: left;
}

.article-content h3 {
    font-size: 18px;
    margin: 25px 0 12px;
    color: var(--text-dark);
    font-weight: 600;
    text-align: left;
}

.article-content blockquote {
    border-left: 3px solid var(--primary-accent);
    padding-left: 15px;
    margin: 20px 0;
    font-style: italic;
    color: var(--text-muted);
    text-align: left;
}

.article-content img {
    max-width: 100%;
    height: auto;
    margin: 20px 0;
    border-radius: 10px;
}

.article-content ul, .article-content ol {
    margin: 15px 0 15px 20px;
    text-align: left;
}

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

/* Article Footer */
.article-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-soft);
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.tag {
    background: var(--bg-light);
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 11px;
    text-decoration: none;
    transition: all 0.2s;
}

.tag:hover {
    background: var(--primary-accent);
    color: var(--pure-white);
}

.article-share {
    display: flex;
    align-items: center;
    gap: 12px;
}

.share-text {
    font-size: 12px;
    color: var(--text-dimmer);
}

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

.share-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 14px;
    border: 1px solid var(--border-soft);
    cursor: pointer;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.share-btn.facebook:hover {
    background: #1877f2;
    color: white;
    border-color: #1877f2;
}

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

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

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

.share-btn.instagram:hover {
    background: #e4405f;
    color: white;
    border-color: #e4405f;
}

.share-btn.general-share:hover {
    background: var(--primary-accent);
    color: white;
    border-color: var(--primary-accent);
}

.share-btn.copy-link:hover {
    background: var(--primary-accent);
    color: white;
    border-color: var(--primary-accent);
}

/* Related Articles */
.related-articles {
    margin-top: 40px;
}

.section-title {
    font-size: 18px;
    margin-bottom: 16px;
    color: var(--text-dark);
    font-weight: 600;
    border-bottom: 1px solid var(--border-soft);
    padding-bottom: 8px;
}

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

.related-card {
    background: var(--pure-white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-soft);
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.related-card:hover {
    transform: translateY(-2px);
}

.related-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px 8px 0 0;
    flex-shrink: 0;
}

.related-card-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.related-card-title {
    font-size: 15px;
    color: var(--text-dark);
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 10px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-clamp: 2;
    max-height: 2.6em;
    flex-shrink: 0;
}

.related-card-excerpt {
    font-size: 13px;
    line-height: 1.4;
    color: var(--text-muted);
    margin-bottom: 12px;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-clamp: 3;
    max-height: 4.2em;
}

.related-card-meta {
    margin-top: auto;
    flex-shrink: 0;
}

.related-card-date {
    font-size: 11px;
    color: var(--text-dimmer);
    font-weight: 400;
}

/* Text-only related articles */
.related-card.text-only-article {
    min-height: 200px;
}

.related-card.text-only-article .related-card-content {
    padding: 20px;
    justify-content: flex-start;
}

.related-card.text-only-article .related-card-title {
    font-size: 16px;
    margin-bottom: 12px;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

.related-card.text-only-article .related-card-excerpt {
    font-size: 14px;
    line-height: 1.5;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    max-height: 6em;
}

/* Sidebar */
.sidebar-section {
    background: var(--pure-white);
    border-radius: 8px;
    padding: 14px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-soft);
    margin-bottom: 20px;
}

.sidebar-section h4 {
    font-size: 12px;
    margin-bottom: 12px;
    color: var(--text-dark);
    border-bottom: 1px solid var(--border-soft);
    padding-bottom: 6px;
    font-weight: 500;
}

/* YouTube Widget */
.youtube-widget {
    margin-bottom: 30px;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border: 1px solid #e2e8f0;
}

.youtube-header {
    background: #dc2626;
    color: white;
    padding: 12px 15px;
    text-align: center;
}

.youtube-header h4 {
    margin: 0;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
}

.youtube-header i {
    font-size: 18px;
}

.youtube-content {
    padding: 0;
}

.latest-video {
    background: #000;
}

.latest-video iframe {
    width: 100%;
    height: 200px;
    display: block;
    border: none;
}

.youtube-info {
    padding: 15px;
}

.channel-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.channel-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #dc2626;
    display: flex;
    align-items: center;
    justify-content: center;
}

.channel-logo i {
    color: white;
    font-size: 16px;
}

.channel-name {
    font-weight: 600;
    font-size: 14px;
    color: #000000;
}

.channel-desc {
    font-size: 12px;
    color: #64748b;
}

.youtube-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.youtube-subscribe {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #dc2626;
    color: white;
    padding: 8px 12px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.youtube-subscribe:hover {
    background: #b91c1c;
    text-decoration: none;
    color: white;
}

.youtube-view-all {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #f8fafc;
    color: #000000;
    padding: 8px 12px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.youtube-view-all:hover {
    background: #e2e8f0;
    text-decoration: none;
    color: #000000;
}

/* Latest News Sidebar */
.news-list {
    display: flex;
    flex-direction: column;
}

.news-card {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    background: transparent;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--bg-light);
}

.news-card:last-child {
    border-bottom: none;
}

.news-card:hover {
    transform: translateY(-1px);
}

.news-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.news-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 4px;
    line-height: 1.2;
}

.category {
    color: var(--primary-accent);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.time {
    color: var(--text-dimmer);
    font-size: 10px;
    font-weight: 400;
}

.dot {
    color: var(--text-dimmed);
    font-size: 8px;
}

.news-title {
    font-size: 11px;
    line-height: 1.3;
    color: var(--text-muted);
    font-weight: 400;
    margin: 0;
    transition: color 0.2s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-clamp: 2;
    max-height: 2.8em;
}

.news-card:hover .news-title {
    color: var(--primary-accent);
}

.thumbnail {
    flex-shrink: 0;
    border-radius: 3px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease;
    width: 60px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
}

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

.news-card:hover .thumbnail {
    transform: scale(1.02);
}

/* Ad Unit */
.ad-unit {
    background: var(--pure-white);
    border-radius: 8px;
    padding: 14px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-soft);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    opacity: 0.3;
}

.ad-placeholder {
    width: 140px;
    height: 110px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed var(--border-soft);
    color: var(--text-dimmer);
    font-size: 11px;
    font-weight: 400;
    border-radius: 6px;
}

/* Footer */
.site-footer {
    margin-top: 20px;
    padding: 16px 0;
    border-top: 1px solid var(--primary-accent);
    text-align: center;
    color: var(--text-dimmer);
    font-size: 11px;
    font-weight: 400;
}

/* No Related Posts */
.no-related-posts {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-size: 16px;
    grid-column: 1 / -1;
    background: var(--bg-light);
    border-radius: 12px;
    border: 1px dashed var(--border-soft);
}

/* Share Modal */
.share-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.share-modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.share-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-soft);
}

.share-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--text-dark);
}

.share-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-dimmer);
    transition: color 0.3s ease;
}

.share-modal-close:hover {
    color: var(--primary-accent);
}

.share-modal-body {
    padding: 20px;
}

.share-platforms {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.share-platform-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-light);
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    color: var(--text-dark);
    text-decoration: none;
}

.share-platform-btn:hover {
    background: var(--primary-accent);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(185, 28, 28, 0.2);
    text-decoration: none;
}

.share-platform-btn i {
    width: 16px;
    text-align: center;
}

/* ================= RESPONSIVE DESIGN ================= */
@media (max-width: 900px) {
    .article-container {
        flex-direction: column;
    }
    
    .related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .single-post-container {
        margin-top: 120px !important;
        padding: 0 15px;
    }
    
    body {
        font-size: 12px;
    }
    
    .article-title {
        font-size: 22px;
    }
    
    .article-hero-img {
        height: 250px;
    }
    
    .article-content {
        font-size: 15px;
    }
    
    .article-meta-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .share-any-platform-btn.top-share-btn {
        align-self: flex-start;
        margin-top: 0;
    }
    
    .related-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .related-card {
        max-width: 100%;
    }
    
    .related-card img {
        height: 180px;
    }
    
    .related-card.text-only-article .related-card-content {
        padding: 25px;
    }
    
    .news-card {
        flex-direction: column;
        gap: 6px;
        padding: 8px 0;
    }

    .thumbnail {
        width: 100% !important;
        height: 80px !important;
        margin-top: 0;
    }
    
    .share-platforms {
        grid-template-columns: 1fr;
    }
    
    .article-share {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .share-buttons {
        gap: 6px;
    }
    
    .share-btn {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .single-post-container {
        margin-top: 100px !important;
        padding: 0 10px;
    }
    
    .article-title {
        font-size: 20px;
    }
    
    .article-hero-img {
        height: 200px;
    }
    
    .related-card img {
        height: 160px;
    }
    
    .related-card-content {
        padding: 14px;
    }
    
    .related-card-title {
        font-size: 14px;
    }
    
    .related-card-excerpt {
        font-size: 12px;
    }
    
    .related-card.text-only-article .related-card-content {
        padding: 20px;
    }
    
    .related-card.text-only-article .related-card-title {
        font-size: 15px;
    }
    
    .related-card.text-only-article .related-card-excerpt {
        font-size: 13px;
    }
    
    .share-any-platform-btn.top-share-btn {
        padding: 4px 8px;
        font-size: 10px;
        gap: 4px;
    }
    
    .share-any-platform-btn.top-share-btn i {
        font-size: 9px;
    }
}

@media (max-width: 360px) {
    .single-post-container {
        margin-top: 90px !important;
        padding: 0 8px;
    }
    
    .related-card img {
        height: 140px;
    }
    
    .related-card.text-only-article .related-card-content {
        padding: 16px;
    }
}

/* Touch device improvements */
@media (hover: none) and (pointer: coarse) {
    .news-card:hover,
    .related-card:hover,
    .tag:hover,
    .share-btn:hover {
        transform: none;
    }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .news-card,
    .related-card,
    .tag,
    .share-btn,
    .thumbnail {
        transition: none;
    }
}