/* Detail Post CSS - MILLANA */
/* Styling untuk halaman detail post seperti referensi belibis */

/* Main Article Container */
.main-article {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

/* Article Categories */
.article-categories {
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.category-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    padding: 8px 16px;
    background: rgba(245, 166, 35, 0.1);
    border-radius: 20px;
    transition: all 0.3s ease;
}

.category-tag:hover {
    background: rgba(245, 166, 35, 0.2);
    transform: translateY(-2px);
}

.category-tag i {
    font-size: 12px;
}

/* Article Title */
.article-title {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
    margin-bottom: 25px;
    word-wrap: break-word;
}

/* Article Meta */
.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.author-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.author-avatar {
    width: 40px !important;
    height: 40px !important;
    background: var(--bg-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    overflow: hidden;
    flex-shrink: 0;
}

.author-avatar .author-photo {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    border-radius: 50%;
    max-width: 40px !important;
    max-height: 40px !important;
}

/* Additional protection against CSS conflicts */
.author-info-section .author-avatar {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
}

.author-info-section .author-avatar .author-photo {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    max-width: 40px !important;
    max-height: 40px !important;
}

.author-label {
    font-weight: 600;
    color: #333;
    font-size: 16px;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.author-details {
    display: flex;
    align-items: center;
    gap: 8px;
}

.author-name {
    font-weight: 600;
    color: var(--text-primary);
}

.author-description {
    margin-top: 16px;
    color: #333;
    font-size: 14px;
    line-height: 1.6;
    font-style: normal;
}

.verified-badge {
    color: #28a745;
    font-size: 16px;
}

.publish-date {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Engagement Metrics */
.engagement-metrics {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    padding: 15px;
    background: var(--bg-light);
    border-radius: 8px;
}

.metric-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 14px;
}

.metric-item i {
    font-size: 16px;
}

.metric-item span {
    font-weight: 600;
    color: var(--text-primary);
}

/* Featured Image */
.featured-image-container {
    margin-bottom: 0;
    text-align: center;
    position: relative;
}

.featured-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.featured-image:hover {
    transform: scale(1.02);
}

.featured-image.external-image {
    border: 2px solid #007bff;
}

.featured-image.local-image {
    border: 2px solid #28a745;
}

.featured-image.default-image {
    border: 2px solid #6c757d;
    opacity: 0.8;
}

/* Image Caption Styling */
.image-caption {
    margin-top: 12px;
    text-align: center;
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 6px;
    border-left: 3px solid #f5a623;
}

.caption-text {
    color: #666;
    font-style: italic;
    margin: 0;
    line-height: 1.4;
    font-size: 13px;
}





/* Responsive image */
@media (max-width: 768px) {
    .featured-image-container {
        margin: 1rem 0;
    }
    
    .sidebar-section {
        margin-bottom: 1.5rem;
    }
    
    .popular-post-item,
    .reader-choice-item {
        padding: 12px 15px;
    }
    
    .post-title a,
    .choice-title a {
        -webkit-line-clamp: 3;
        line-clamp: 3;
    }
}

@media (max-width: 576px) {
    .sidebar-section {
        margin-bottom: 1rem;
    }
    
    .sidebar-title {
        padding: 12px 15px;
        font-size: 1rem;
    }
    
    .popular-post-item,
    .reader-choice-item {
        padding: 10px 15px;
    }
    
    .post-number {
        width: 25px;
        height: 25px;
        font-size: 0.8rem;
    }
    
    .choice-image {
        width: 50px;
        height: 50px;
    }
}

/* Social Share Buttons */
.social-share-buttons {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    margin-bottom: 20px;
    justify-content: flex-end;
    padding-top: 0;
}

.share-btn {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.share-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.25);
    color: #ffffff;
}

.share-btn.facebook {
    background: #1877f2;
}

.share-btn.twitter {
    background: #000000;
}

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

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

/* Article Content */
.article-content {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-primary);
    margin-bottom: 30px;
}

.article-content h3 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 30px 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

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

.article-content strong {
    font-weight: 700;
    color: var(--text-primary);
}

/* Related Post Widgets */
.related-post-widget {
    margin: 40px 0;
    padding: 25px;
    background: var(--bg-light);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.widget-header h4 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    text-align: center;
}

.related-post-item {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.post-image {
    flex-shrink: 0;
    width: 120px;
    height: 80px;
    overflow: hidden;
    border-radius: 6px;
}

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

.post-content {
    flex: 1;
}

.post-category {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.post-time {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.post-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
    margin: 0;
}

.post-title a {
    color: inherit;
    text-decoration: none;
}

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

/* Content Ad Banner */
.content-ad-banner {
    margin: 30px 0;
    text-align: center;
}

/* Content Ad Container */
.content-ad-container {
    margin: 30px 0;
    text-align: center;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.content-ad-container .ad-banner-content {
    display: inline-block;
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    max-width: 100%;
    width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    box-sizing: border-box;
}

/* Mobile responsive untuk content ads */
@media (max-width: 768px) {
    .content-ad-container {
        margin: 20px 0;
        padding: 0 10px;
        width: 100%;
        box-sizing: border-box;
    }
    
    .content-ad-container .ad-banner-content {
        width: 100% !important;
        max-width: 100% !important;
        padding: 12px;
        box-sizing: border-box;
    }
}

@media (max-width: 576px) {
    .content-ad-container {
        margin: 15px 0;
        padding: 0 5px;
    }
    
    .content-ad-container .ad-banner-content {
        padding: 10px;
    }
}

@media (max-width: 400px) {
    .content-ad-container {
        margin: 10px 0;
        padding: 0 3px;
    }
    
    .content-ad-container .ad-banner-content {
        padding: 8px;
    }
}

.ad-content {
    background: var(--bg-secondary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 18px;
    margin: 0 auto;
}

/* Scroll Indicator */
.scroll-indicator {
    background: var(--primary-color);
    color: #ffffff;
    text-align: center;
    padding: 15px;
    border-radius: 8px;
    margin: 30px 0;
}

.scroll-text {
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 1px;
}

/* Reporter Info */
.reporter-info {
    margin: 30px 0;
}

.divider-line {
    height: 1px;
    background: #e9ecef;
    margin: 20px 0;
}

.reporter-text {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0;
    text-align: center;
}

/* Tags Section */
.tags-section {
    margin: 30px 0;
}

.tags-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    text-align: center;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.tag-item {
    display: inline-block;
    padding: 8px 16px;
    background: transparent;
    border: 2px solid #f5a623;
    border-radius: 20px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    text-transform: capitalize;
    transition: all 0.3s ease;
}

.tag-item:hover {
    background: #f5a623;
    color: #ffffff;
    border-color: #f5a623;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(245, 166, 35, 0.3);
}

/* Sidebar Styling */
.sidebar-section {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    overflow: hidden;
}

.sidebar-title {
    background: var(--nav-bg);
    color: white;
    padding: 15px 20px;
    margin: 0;
    font-size: 1.1rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Popular Posts List */
.popular-posts-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.popular-post-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s ease;
}

.popular-post-item:last-child {
    border-bottom: none;
}

.popular-post-item:hover {
    background-color: var(--bg-secondary);
}

.post-number {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    background: var(--nav-bg);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
}

.post-content {
    flex: 1;
}

.post-category {
    font-size: 10px;
    font-weight: 600;
    margin-bottom: 4px;
    text-transform: uppercase;
    color: #f5a623;
}

.post-title {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.3;
    margin: 0;
}

.post-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.post-title a:hover {
    color: var(--nav-bg);
}

/* Reader's Choice */
.readers-choice-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.reader-choice-item {
    display: flex;
    gap: 12px;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s ease;
}

.reader-choice-item:last-child {
    border-bottom: none;
}

.reader-choice-item:hover {
    background-color: var(--bg-secondary);
}

.choice-image {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-secondary);
}

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

.choice-content {
    flex: 1;
}

.choice-title {
    font-size: 12px;
    font-weight: 500;
    line-height: 1.3;
    margin: 0 0 6px 0;
}

.choice-title a {
    color: #000000;
    text-decoration: none;
    transition: color 0.2s ease;
}

.choice-title a:hover {
    color: #333333;
}

.choice-time {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Sidebar Ad */
.sidebar-ad-container {
    margin-bottom: 25px;
    text-align: center;
}

.ad-banner-sidebar {
    background: var(--bg-secondary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 16px;
    margin: 0 auto;
}

/* Responsive Design */
@media (max-width: 991.98px) {
    .main-article {
        padding: 20px;
    }
    
    .article-title {
        font-size: 28px;
    }
    
    .article-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .engagement-metrics {
        flex-wrap: wrap;
    }
    
    .sidebar-section {
        margin-bottom: 1.5rem;
    }
    
    .social-share-buttons {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .related-post-item {
        flex-direction: column;
        text-align: center;
    }
    
    .post-image {
        width: 100%;
        height: 200px;
    }
}

@media (max-width: 767.98px) {
    .main-article {
        padding: 15px;
    }
    
    .article-title {
        font-size: 24px;
    }
    
    .engagement-metrics {
        justify-content: center;
    }
    
    .share-btn {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
    
    .tags-container {
        justify-content: flex-start;
    }
    
}

@media (max-width: 575.98px) {
    .container {
        padding: 0 10px;
    }
    
    .main-article {
        padding: 15px 10px;
    }
    
    .article-title {
        font-size: 22px;
    }
    
    .engagement-metrics {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .metric-item {
        gap: 5px;
    }
    
    .social-share-buttons {
        justify-content: center;
    }
    
    .related-post-widget {
        padding: 20px 15px;
    }
    
    .tags-container {
        justify-content: center;
    }
}


/* Related Posts Section */
.related-posts-section {
    margin-top: 40px;
}

.related-posts-title {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--text-primary);
    margin: 20px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.related-post-item {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.related-post-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

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

.related-post-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
}

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

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

.related-post-content {
    padding: 20px;
}

.related-post-category {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--nav-bg);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.related-post-time {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.related-post-title {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.related-post-title:hover {
    color: var(--nav-bg);
}

.related-post-excerpt {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-top: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Responsive Design for Related Posts */
@media (max-width: 768px) {
    .related-posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .related-post-image {
        height: 180px;
    }
    
    .related-post-content {
        padding: 15px;
    }
    
    .related-post-title {
        font-size: 1rem;
    }
    
    .related-post-excerpt {
        font-size: 0.85rem;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }
}

@media (max-width: 576px) {
    .related-posts-section {
        margin-top: 30px;
    }
    
    .related-posts-title {
        font-size: 1.1rem;
        margin: 15px 0;
    }
    
    .related-post-image {
        height: 160px;
    }
    
    .related-post-content {
        padding: 12px;
    }
    
    .related-post-category {
        font-size: 0.75rem;
    }
    
    .related-post-time {
        font-size: 0.8rem;
    }
    
    .related-post-title {
        font-size: 0.95rem;
    }
    
    .related-post-excerpt {
        font-size: 0.8rem;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }
}


/* ===== RESPONSIVE IMAGES FIX ===== */
/* Gambar dalam konten artikel */
.article-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
    margin: 20px auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.article-content img:hover {
    transform: scale(1.02);
}

/* Gambar dalam figure */
.article-content figure {
    margin: 20px 0;
    text-align: center;
}

.article-content figure img {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.article-content figure figcaption {
    font-size: 14px;
    color: #666;
    font-style: italic;
    margin-top: 10px;
    padding: 0 15px;
}

/* Responsive untuk mobile */
@media (max-width: 768px) {
    .article-content img {
        margin: 15px auto;
        border-radius: 6px;
    }
    
    .article-content figure {
        margin: 15px 0;
    }
    
    .article-content figure img {
        border-radius: 6px;
    }
}

@media (max-width: 576px) {
    .article-content img {
        margin: 10px auto;
        border-radius: 4px;
    }
    
    .article-content figure {
        margin: 10px 0;
    }
    
    .article-content figure img {
        border-radius: 4px;
    }
    
    .article-content figure figcaption {
        font-size: 13px;
        padding: 0 10px;
    }
}

/* Fix spacing for detail-post page */
body.detail-post-page .container.my-2 {
    margin-top: 10px !important;
}

body.detail-post-page .sticky-header-container {
    margin-bottom: 0 !important;
}

/* Fix image caption overlap issue */
.featured-image-container {
    overflow: visible !important;
}

.featured-image:hover {
    transform: scale(1.01) !important;
}

.image-caption {
    position: relative !important;
    z-index: 10 !important;
    margin-top: 15px !important;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(5px) !important;
    border: 1px solid rgba(245, 166, 35, 0.2) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
}

/* Post Navigation Styles - Using specific class to avoid conflict with main nav */
.post-navigation-section {
    margin: 40px 0;
    padding: 20px 0;
}

.post-navigation-title {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.post-navigation {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    width: 100%;
    max-width: 100%;
}

.post-nav-item {
    flex: 1;
    min-width: 300px;
    max-width: 100%;
    overflow: hidden;
}

.post-nav-link {
    display: flex;
    align-items: center;
    padding: 20px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    width: 100%;
    min-height: 80px;
    overflow: hidden;
}

.post-nav-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-color: var(--primary-color, #f5a623);
    color: #333;
}

.post-nav-prev .post-nav-link {
    flex-direction: row;
}

.post-nav-next .post-nav-link {
    flex-direction: row-reverse;
}

.post-nav-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color, #f5a623);
    color: white;
    border-radius: 50%;
    font-size: 16px;
    margin: 0 15px;
    flex-shrink: 0;
}

.post-nav-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.post-nav-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.post-nav-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

.post-nav-date {
    font-size: 12px;
    color: #999;
}

/* Responsive for post navigation */
@media (max-width: 768px) {
    .post-navigation {
        flex-direction: column;
    }
    
    .post-nav-item {
        min-width: auto;
    }
    
    .post-nav-link {
        padding: 15px;
    }
    
    .post-nav-icon {
        width: 35px;
        height: 35px;
        font-size: 14px;
        margin: 0 10px;
    }
    
    .post-nav-title {
        font-size: 14px;
    }
}
