/* =====================================================
   LAYAR KATEKESE KATOLIK
   File: assets/css/detail.css
   Fungsi: Styling halaman detail artikel
   ===================================================== */

/* ============================================
   1. READING PROGRESS BAR
   ============================================ */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, var(--secondary), var(--primary));
    z-index: 9999;
    transition: width 0.1s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ============================================
   2. ARTICLE HEADER
   ============================================ */
.article-header {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: white;
    padding: 4rem 0 3rem;
    position: relative;
    overflow: hidden;
}

.article-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23C9A84C' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.article-header-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.article-category-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--secondary);
    color: var(--text-dark);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.article-category-link:hover {
    background: var(--secondary-light);
    transform: translateY(-2px);
    color: var(--text-dark);
}

.article-title-detail {
    font-family: var(--font-heading);
    font-size: 2.8rem;
    color: white;
    margin-bottom: 1.5rem;
    line-height: 1.3;
    letter-spacing: 0.5px;
}

.article-meta-detail {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 1.5rem;
}

.article-meta-detail span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.article-meta-detail i {
    color: var(--secondary);
}

.article-excerpt-detail {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.7;
    font-style: italic;
    font-family: var(--font-primary);
    border-left: 3px solid var(--secondary);
    padding-left: 1.5rem;
    margin-top: 1.5rem;
}

/* ============================================
   3. FEATURED IMAGE
   ============================================ */
.article-featured-image {
    max-width: 1000px;
    margin: -2rem auto 0;
    position: relative;
    z-index: 3;
    padding: 0 1.5rem;
}

.article-featured-image img {
    width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    display: block;
}

/* ============================================
   4. ARTICLE LAYOUT
   ============================================ */
.article-detail-layout {
    max-width: 1280px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2.5rem;
}

.article-content-wrapper {
    min-width: 0;
}

/* ============================================
   5. ARTICLE CONTENT
   ============================================ */
/* ============================================
   ARTICLE CONTENT - JUSTIFIED TEXT
   ============================================ */
.article-content {
    text-align: justify;
    text-justify: inter-word;
    word-spacing: 0.05em;
    letter-spacing: 0.01em;
    line-height: 1.8;
    hyphens: auto;
    -webkit-hyphens: auto;
    -moz-hyphens: auto;
    -ms-hyphens: auto;
    hyphenate-limit-chars: 6 3 2;
}

/* Paragraf dalam artikel */
.article-content p {
    text-align: justify;
    text-justify: inter-word;
    margin-bottom: 1.2rem;
    line-height: 1.8;
    hyphens: auto;
    -webkit-hyphens: auto;
    -moz-hyphens: auto;
}

/* Baris terakhir paragraf tetap rata kiri */
.article-content p:last-child {
    text-align-last: left;
}

/* Heading tetap rata kiri */
.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
    text-align: left;
    text-align-last: left;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

/* List (bullet/number) tetap rata kiri */
.article-content ul,
.article-content ol {
    text-align: left;
    padding-left: 2rem;
}

.article-content li {
    text-align: left;
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

/* Blockquote rata kiri dengan styling */
.article-content blockquote {
    text-align: left;
    border-left: 4px solid var(--primary, #8B0000);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background: var(--bg-cream, #FAF8F5);
    font-style: italic;
    color: var(--text-body, #4A4A4A);
    border-radius: 0 8px 8px 0;
}

/* Tabel rata kiri */
.article-content table {
    text-align: left;
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.article-content table td,
.article-content table th {
    text-align: left;
    padding: 10px;
    border: 1px solid var(--border, #E8E0D4);
}

/* Gambar tetap center */
.article-content img {
    display: block;
    margin: 1.5rem auto;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* Link dalam artikel */
.article-content a {
    color: var(--primary, #8B0000);
    text-decoration: underline;
    text-decoration-color: rgba(139, 0, 0, 0.3);
    text-underline-offset: 3px;
    transition: all 0.3s ease;
}

.article-content a:hover {
    text-decoration-color: var(--primary, #8B0000);
}

/* Code block rata kiri */
.article-content pre,
.article-content code {
    text-align: left;
    direction: ltr;
}

/* Drop cap untuk paragraf pertama (opsional, seperti majalah) */
.article-content > p:first-of-type::first-letter {
    font-size: 3.5rem;
    font-weight: 700;
    float: left;
    line-height: 1;
    margin-right: 8px;
    margin-top: 4px;
    color: var(--primary, #8B0000);
    font-family: var(--font-heading, 'Cinzel', serif);
}

/* ============================================
   RESPONSIVE - Sesuaikan untuk mobile
   ============================================ */
@media (max-width: 768px) {
    .article-content {
        text-align: justify;
        font-size: 1rem;
        line-height: 1.7;
        word-spacing: 0.03em;
    }
    
    /* Di mobile, drop cap lebih kecil */
    .article-content > p:first-of-type::first-letter {
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    .article-content {
        font-size: 0.95rem;
        line-height: 1.7;
    }
    
    /* Drop cap di-disable di mobile kecil untuk menghindari layout rusak */
    .article-content > p:first-of-type::first-letter {
        font-size: 2rem;
        margin-right: 5px;
    }
}

/* ============================================
   PRINT STYLES - Untuk cetak
   ============================================ */
@media print {
    .article-content {
        text-align: justify;
        font-size: 11pt;
        line-height: 1.6;
        hyphens: auto;
    }
    
    .article-content p {
        orphans: 3;
        widows: 3;
    }
}

/* ============================================
   6. TAGS
   ============================================ */
.article-tags {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-light);
}

.article-tags-title {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--bg-cream);
    color: var(--primary);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    text-decoration: none;
    transition: var(--transition);
    border: 1px solid var(--border-light);
}

.tag-item:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ============================================
   7. SHARE BUTTONS
   ============================================ */
.share-buttons {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--bg-cream);
    border-radius: var(--radius-lg);
}

.share-title {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.share-list {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: white;
}

.share-btn.facebook { background: #1877F2; }
.share-btn.twitter { background: #1DA1F2; }
.share-btn.whatsapp { background: #25D366; }
.share-btn.telegram { background: #0088CC; }
.share-btn.copy-link { background: var(--text-dark); }

/* ============================================
   8. AUTHOR BOX
   ============================================ */
.author-box {
    margin-top: 2.5rem;
    padding: 2rem;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.author-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    flex-shrink: 0;
}

.author-info h4 {
    font-family: var(--font-primary);
    color: var(--text-dark);
    margin-bottom: 0.3rem;
    font-size: 1.2rem;
}

.author-role {
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    display: block;
}

.author-bio {
    color: var(--text-body);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ============================================
   9. RELATED ARTICLES
   ============================================ */
.related-articles {
    margin-top: 3rem;
    padding-top: 3rem;
    border-top: 2px solid var(--border-light);
}

.related-title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    text-align: center;
    position: relative;
    padding-bottom: 1rem;
}

.related-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--secondary);
    border-radius: 2px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.related-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
    display: block;
    border: 1px solid var(--border-light);
}

.related-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--secondary);
    color: inherit;
}

.related-image {
    height: 160px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    position: relative;
}

.related-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.related-card:hover .related-image img {
    transform: scale(1.08);
}

.related-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2.5rem;
}

.related-body {
    padding: 1rem 1.2rem;
}

.related-card-title {
    font-family: var(--font-primary);
    font-size: 1rem;
    color: var(--text-dark);
    margin: 0 0 0.5rem 0;
    line-height: 1.4;
    font-weight: 700;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-card:hover .related-card-title {
    color: var(--primary);
}

.related-meta {
    display: flex;
    gap: 10px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.related-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ============================================
   10. NAVIGATION POST
   ============================================ */
.post-navigation {
    margin-top: 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.post-nav-item {
    padding: 1.2rem 1.5rem;
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.post-nav-item:hover {
    border-color: var(--primary);
    background: var(--bg-cream);
    color: inherit;
}

.post-nav-item.next {
    flex-direction: row-reverse;
    text-align: right;
}

.post-nav-icon {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.post-nav-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 3px;
}

.post-nav-title {
    font-family: var(--font-primary);
    font-size: 0.95rem;
    color: var(--text-dark);
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================
   11. RESPONSIVE DETAIL
   ============================================ */
@media (max-width: 992px) {
    .article-detail-layout {
        grid-template-columns: 1fr;
    }
    
    .article-title-detail {
        font-size: 2.2rem;
    }
    
    .related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .article-header {
        padding: 3rem 0 2rem;
    }
    
    .article-title-detail {
        font-size: 1.8rem;
    }
    
    .article-content {
        padding: 1.5rem;
        font-size: 1rem;
    }
    
    .article-content h2 {
        font-size: 1.5rem;
    }
    
    .article-content h3 {
        font-size: 1.3rem;
    }
    
    .author-box {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }
    
    .related-grid {
        grid-template-columns: 1fr;
    }
    
    .post-navigation {
        grid-template-columns: 1fr;
    }
    
    .post-nav-item.next {
        flex-direction: row;
        text-align: left;
    }
    
    .share-btn {
        padding: 8px 14px;
        font-size: 0.85rem;
    }
    
    .article-meta-detail {
        font-size: 0.85rem;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .article-title-detail {
        font-size: 1.5rem;
    }
    
    .article-content {
        padding: 1.2rem;
    }
    
    .article-content blockquote {
        padding: 1rem 1.2rem;
    }
    
    .share-list {
        flex-direction: column;
    }
    
    .share-btn {
        justify-content: center;
    }
}

/* ============================================
   12. PRINT STYLES
   ============================================ */
@media print {
    .reading-progress,
    .main-navbar,
    .top-bar,
    .main-footer,
    .scroll-to-top,
    .share-buttons,
    .sidebar-wrapper,
    .post-navigation,
    .breadcrumb-wrapper {
        display: none !important;
    }
    
    .article-detail-layout {
        grid-template-columns: 1fr;
    }
    
    .article-content {
        box-shadow: none;
        border: none;
        padding: 0;
    }
    
    body {
        background: white;
        color: black;
    }
}