/* =========================================================================
 * FONT IMPORTS
 * ========================================================================= */
@import url('https://fonts.googleapis.com/css2?family=Amiri:wght@400;700&family=Inter:wght@400;600;700&family=Noto+Sans+Arabic:wght@400;700&display=swap');

/* =========================================================================
 * GLOBAL VARIABLES & RESET 
 * ========================================================================= */
:root {
    --color-primary: #1565C0; /* Biru Tua */
    --color-accent: #FFC107; /* Kuning Emas */
    --color-text: #333;
    --color-text-light: #555;
    --color-bg: #f8f9fa; /* Abu-abu Sangat Terang */
    --color-light-gray: #eee;
    
    /* Font yang Lebih Terdefinisi */
    --font-heading: 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-arabic: 'Noto Sans Arabic', sans-serif;
    --font-amiri: 'Amiri', serif;

    --max-width: 1200px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    color: var(--color-text);
    background-color: var(--color-bg);
    line-height: 1.6;
    transition: all 0.3s;
}

/* RTL Support */
[dir="rtl"] {
    font-family: var(--font-arabic);
}


/* =========================================================================
 * LAYOUT & CONTAINER
 * ========================================================================= */
.container {
    max-width: 1100px; 
    margin: 20px auto;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 25px;
    padding: 0 15px;
}

@media (max-width: 850px) {
    .container {
        grid-template-columns: 1fr;
    }
}


/* =========================================================================
 * HEADER & NAVIGATION
 * ========================================================================= */
header {
    background: var(--color-primary); 
    color: white;
    padding: 2rem 1rem;
    text-align: center;
}

nav {
    background: white;
    padding: 10px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Styling umum untuk semua tombol navigasi dan bahasa */
button.nav-btn, button.lang-btn {
    background: var(--color-light-gray); 
    border: none;
    padding: 5px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    text-transform: uppercase;
    transition: background 0.2s, color 0.2s;
}

/* Status aktif untuk semua tombol navigasi dan bahasa */
button.nav-btn.active, button.lang-btn.active {
    background: var(--color-accent);
    color: white;
}

.hidden {
    display: none;
}


/* =========================================================================
 * POST LIST & CARDS (Mode HOME/CATEGORY)
 * ========================================================================= */
.post-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.post-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    gap: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: 0.2s;
}

.post-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.post-card img {
    width: 150px;
    height: 120px;
    object-fit: cover;
}

.post-info {
    padding: 10px;
    flex: 1;
}

.post-info h3 {
    margin: 0 0 10px;
    font-size: 1.1rem;
    color: var(--color-primary);
}

.post-info p {
    font-size: 0.9rem;
    color: var(--color-text-light); 
    
    /* LINE-CLAMP */
    overflow: hidden;
    text-overflow: ellipsis; 
    display: -webkit-box;
    -webkit-line-clamp: 2; 
    -webkit-box-orient: vertical;
    
    margin-top: 5px; 
}


/* =========================================================================
 * ARTICLE VIEW (Mode READ) - FINAL PROFESSIONAL DESIGN
 * ========================================================================= */

#content #app.article-view {
    display: block; 
    background: white; 
    padding: 40px 50px; 
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08); 
    line-height: 1.8; 
    width: 100%;
}

@media (max-width: 600px) {
    #content #app.article-view {
        padding: 20px;
        border-radius: 0;
    }
}

.btn-back {
    display: inline-block;
    margin-bottom: 25px;
    padding: 10px 18px;
    cursor: pointer;
    border: none;
    background: var(--color-light-gray);
    color: var(--color-text-light);
    border-radius: 6px;
    font-weight: 600;
    transition: background 0.2s;
}
.btn-back:hover {
    background: #ddd;
}

.article-meta {
    font-size: 0.9rem;
    color: var(--color-text-light);
    margin-bottom: 10px;
}

.article-title {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    margin-bottom: 20px;
    line-height: 1.2;
    color: var(--color-primary);
    border-bottom: 2px solid var(--color-light-gray);
    padding-bottom: 15px;
}

/* Gambar Artikel (Thumbnail) */
.article-title + img, .article-header img {
    width: 100%;
    max-height: 450px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* Header di dalam Konten (H2, H3, dll.) */
.article-content h3 {
    font-family: var(--font-heading);
    color: var(--color-primary);
    margin-top: 30px;
    margin-bottom: 10px; 
    font-size: 1.5rem;
    border-left: 4px solid var(--color-accent); 
    padding-left: 10px;
}

/* Paragraf dan List Container */
.article-content p, .article-content ul, .article-content ol {
    margin-bottom: 20px; 
    font-size: 1.1rem; 
}

/* Margin Kiri untuk Bullet/Numbered List (Sesuai Permintaan) */
.article-content ul, .article-content ol {
    margin-left: 20px; 
    padding-left: 0; /* Pastikan padding bawaan browser tidak menyebabkan indentasi ganda */
}

/* Spacing antar List Item */
.article-content li {
    margin-bottom: 5px; 
}


/* Kotak Kutipan Al-Qur'an (Amiri Font) */
.quran-verse {
    font-family: var(--font-amiri); 
    font-size: 2.0rem; 
    font-weight: 700;
    background: #e3f2fd; 
    padding: 30px;
    border-radius: 10px;
    border-left: 5px solid var(--color-primary);
    margin: 30px 0;
    text-align: right; 
    direction: rtl;
    line-height: 1.8;
}

.quran-verse + p {
    font-style: italic;
    font-size: 1rem;
    color: var(--color-text-light);
    margin-top: -15px; 
    margin-bottom: 30px;
    text-align: center; 
}


/* Kotak Kutipan Teks Biasa (Quote Box) */
.quote-box {
    margin: 30px 0;
    padding: 20px 25px;
    border-left: 5px solid var(--color-accent);
    background: #fffbe6; 
    color: var(--color-text);
    border-radius: 8px;
    font-style: italic;
}

.quote-box blockquote {
    margin: 0;
    padding: 0;
}

.article-footer-views {
    margin-top: 30px;
    padding-top: 15px;
    border-top: 1px solid var(--color-light-gray);
    font-size: 0.9rem;
    color: var(--color-text-light);
    text-align: right;
}


/* =========================================================================
 * SIDEBAR & ANIMATION
 * ========================================================================= */
.sidebar-box {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

#view-home, #view-read {
    animation: fadeIn 0.4s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}