/* assets/css/style.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --bg-color: #ffffff;
    --bg-light: #f3f4f6;
    --border-color: #e5e7eb;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    
    /* Typography variables */
    --font-serif: 'Georgia', 'Times New Roman', Times, serif;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', monospace;
}

body {
    font-family: var(--font-sans);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================ */
/* NAVBAR STYLES */
/* ============================================ */
.navbar {
    background-color: var(--bg-color);
    box-shadow: var(--shadow);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
    color: var(--text-color);
}

.logo span {
    color: var(--primary-color);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-color);
    transition: color 0.3s;
}

.nav-menu a:hover {
    color: var(--primary-color);
}

.hamburger {
    display: none;
    cursor: pointer;
}

.hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    margin: 5px 0;
    transition: 0.3s;
}

/* ============================================ */
/* HERO SECTION */
/* ============================================ */
.hero {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 120px 0 80px;
    margin-top: 60px;
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

.search-form {
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    gap: 1rem;
}

.search-form input {
    flex: 1;
    padding: 0.8rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
}

.search-form button {
    padding: 0.8rem 1.5rem;
    background-color: white;
    color: var(--primary-color);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.2s;
}

.search-form button:hover {
    transform: translateY(-2px);
}

/* ============================================ */
/* ARTICLES GRID (Card) */
/* ============================================ */
.articles-section {
    padding: 60px 0;
}

.articles-section h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    text-align: center;
    font-weight: 700;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.article-card {
    background: var(--bg-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.article-image {
    width: 100%;
    height: 240px;
    object-fit: cover;
}

.article-content {
    padding: 1.5rem;
}

.article-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: var(--primary-color);
    color: white;
    border-radius: 20px;
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.article-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
    color: var(--text-color);
    font-weight: 600;
}

.article-excerpt {
    color: var(--text-light);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: var(--text-light);
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

.read-more {
    color: var(--primary-color);
    font-weight: 500;
}

/* ============================================ */
/* ARTICLE DETAIL PAGE - MAIN CONTENT STYLES */
/* ============================================ */
.article-detail {
    padding: 120px 0 60px;
}

/* Article Container - untuk readability */
.article-detail .container {
    max-width: 900px;
}

/* Article Header */
.article-header {
    margin-bottom: 2rem;
    text-align: center;
}

.article-header .article-category {
    display: inline-block;
    margin-bottom: 1rem;
}

.article-header h1 {
    font-size: 2.8rem;
    margin: 1rem 0;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #111827;
}

/* Featured Image */
.featured-image {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: 16px;
    margin-bottom: 2.5rem;
}

/* ============================================ */
/* ARTICLE BODY - TYPOGRAPHY */
/* ============================================ */
.article-body {
    font-family: var(--font-serif);
    font-size: 1.125rem;
    line-height: 1.8;
    color: #374151;
}

/* Paragraph styling */
.article-body p {
    margin-bottom: 1.75rem;
    font-size: 1.125rem;
    line-height: 1.8;
}

/* Heading styles dalam artikel */
.article-body h1 {
    font-family: var(--font-sans);
    font-size: 2.5rem;
    font-weight: 700;
    margin: 2.5rem 0 1rem;
    line-height: 1.3;
    color: #111827;
    letter-spacing: -0.02em;
}

.article-body h2 {
    font-family: var(--font-sans);
    font-size: 2rem;
    font-weight: 700;
    margin: 2.5rem 0 1rem;
    line-height: 1.3;
    color: #111827;
    letter-spacing: -0.01em;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.article-body h3 {
    font-family: var(--font-sans);
    font-size: 1.5rem;
    font-weight: 600;
    margin: 2rem 0 0.75rem;
    line-height: 1.4;
    color: #1f2937;
}

.article-body h4 {
    font-family: var(--font-sans);
    font-size: 1.25rem;
    font-weight: 600;
    margin: 1.5rem 0 0.5rem;
    line-height: 1.4;
    color: #374151;
}

.article-body h5, 
.article-body h6 {
    font-family: var(--font-sans);
    font-weight: 600;
    margin: 1.25rem 0 0.5rem;
    color: #4b5563;
}

/* List styling */
.article-body ul,
.article-body ol {
    margin: 1.25rem 0;
    padding-left: 2rem;
}

.article-body li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

.article-body ul li {
    list-style-type: disc;
}

.article-body ol li {
    list-style-type: decimal;
}

/* Blockquote styling */
.article-body blockquote {
    margin: 2rem 0;
    padding: 1rem 2rem;
    border-left: 4px solid var(--primary-color);
    background-color: #f8fafc;
    font-style: italic;
    color: #334155;
    border-radius: 0 12px 12px 0;
}

.article-body blockquote p {
    margin-bottom: 0;
}

/* Code styling */
.article-body code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    padding: 0.2rem 0.4rem;
    background-color: #f1f5f9;
    border-radius: 6px;
    color: #dc2626;
}

.article-body pre {
    margin: 1.5rem 0;
    padding: 1rem;
    background-color: #1e293b;
    border-radius: 12px;
    overflow-x: auto;
}

.article-body pre code {
    background-color: transparent;
    color: #e2e8f0;
    font-size: 0.875rem;
    padding: 0;
}

/* Image styling dalam artikel */
.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 2rem 0;
    box-shadow: var(--shadow);
}

.article-body figure {
    margin: 2rem 0;
}

.article-body figcaption {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-light);
    margin-top: 0.5rem;
}

/* Table styling */
.article-body table {
    width: 100%;
    margin: 1.5rem 0;
    border-collapse: collapse;
    overflow-x: auto;
    display: block;
}

.article-body th,
.article-body td {
    border: 1px solid var(--border-color);
    padding: 0.75rem;
    text-align: left;
}

.article-body th {
    background-color: var(--bg-light);
    font-weight: 600;
}

/* Horizontal rule */
.article-body hr {
    margin: 2rem 0;
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
}

/* Link styling dalam artikel */
.article-body a {
    color: var(--primary-color);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s;
}

.article-body a:hover {
    color: var(--secondary-color);
}

/* Strong and emphasis */
.article-body strong {
    font-weight: 700;
    color: #111827;
}

.article-body em {
    font-style: italic;
}

/* First paragraph drop cap (opsional) */
.article-body p:first-of-type:first-letter {
    font-size: 3.5rem;
    font-weight: 700;
    float: left;
    line-height: 1;
    margin-right: 0.5rem;
    color: var(--primary-color);
}

/* ============================================ */
/* ARTICLE TAGS */
/* ============================================ */
.article-tags {
    display: flex;
    gap: 0.75rem;
    margin: 3rem 0 2rem;
    flex-wrap: wrap;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.tag {
    display: inline-block;
    padding: 0.375rem 1rem;
    background-color: var(--bg-light);
    color: var(--text-color);
    border-radius: 30px;
    font-size: 0.875rem;
    text-decoration: none;
    font-family: var(--font-sans);
    transition: all 0.2s;
}

.tag:hover {
    background-color: var(--primary-color);
    color: white;
}

/* ============================================ */
/* RELATED ARTICLES */
/* ============================================ */
.related-articles {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 1px solid var(--border-color);
}

.related-articles h3 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    font-family: var(--font-sans);
}

.related-articles .articles-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* ============================================ */
/* CATEGORY PAGE */
/* ============================================ */
.category-section .category-header {
    text-align: center;
    margin-bottom: 3rem;
}

.category-section h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.categories-grid .category-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

/* ============================================ */
/* SEARCH PAGE */
/* ============================================ */
.search-section .search-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
}

.search-results h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

/* ============================================ */
/* ERROR SECTION */
/* ============================================ */
.error-section {
    min-height: 60vh;
    display: flex;
    align-items: center;
}

.error-section h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* ============================================ */
/* FOOTER */
/* ============================================ */
footer {
    background-color: var(--bg-light);
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
    font-weight: 600;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    text-decoration: none;
    color: var(--text-light);
    transition: color 0.3s;
}

.footer-section a:hover {
    color: var(--primary-color);
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: var(--border-color);
    border-radius: 8px;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-light);
}

/* ============================================ */
/* LOADING STATE */
/* ============================================ */
.loading {
    text-align: center;
    padding: 4rem;
    font-size: 1.2rem;
    color: var(--text-light);
}

/* ============================================ */
/* RESPONSIVE DESIGN */
/* ============================================ */
@media (max-width: 768px) {
    .hamburger {
        display: block;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: var(--bg-color);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: var(--shadow);
        padding: 2rem 0;
        gap: 1rem;
    }

    .nav-menu.active {
        left: 0;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .articles-grid {
        grid-template-columns: 1fr;
    }

    /* Article responsive */
    .article-header h1 {
        font-size: 1.8rem;
    }
    
    .article-body {
        font-size: 1rem;
    }
    
    .article-body p {
        font-size: 1rem;
    }
    
    .article-body h1 {
        font-size: 1.8rem;
    }
    
    .article-body h2 {
        font-size: 1.5rem;
    }
    
    .article-body h3 {
        font-size: 1.25rem;
    }
    
    .search-form {
        flex-direction: column;
    }
    
    .article-body p:first-of-type:first-letter {
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }
    
    .article-header h1 {
        font-size: 1.5rem;
    }
    
    .article-body blockquote {
        padding: 0.75rem 1.25rem;
    }
    
    .related-articles .articles-grid {
        grid-template-columns: 1fr;
    }
}

/* Print styles untuk artikel */
@media print {
    .navbar,
    footer,
    .search-form,
    .related-articles,
    .article-tags,
    .hero {
        display: none;
    }
    
    .article-detail {
        padding: 20px 0;
    }
    
    .article-body {
        font-size: 12pt;
        line-height: 1.5;
        color: black;
    }
    
    .article-body a {
        color: black;
        text-decoration: none;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
}

/* Recent Articles Widget */
.recent-articles-list,
.popular-articles-list {
    list-style: none;
    padding: 0;
}

.recent-articles-list li,
.popular-articles-list li {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.recent-articles-list li:last-child,
.popular-articles-list li:last-child {
    border-bottom: none;
}

.recent-article-link,
.popular-article-link {
    text-decoration: none;
    display: block;
    transition: all 0.3s;
}

.recent-article-link:hover,
.popular-article-link:hover {
    transform: translateX(5px);
}

.recent-article-title,
.popular-article-title {
    display: block;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}

.recent-article-date {
    display: block;
    font-size: 0.75rem;
    color: var(--text-light);
}

.popular-article-category {
    display: inline-block;
    font-size: 0.7rem;
    color: var(--primary-color);
    background: var(--bg-light);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

/* Load More Button */
.load-more-container {
    text-align: center;
    margin-top: 3rem;
}

.load-more-btn {
    padding: 0.8rem 2rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
}

.load-more-btn:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

/* Artikel Grid dengan dynamic load */
.articles-grid.dynamic-load .article-card {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}