﻿/* ============================================
   Kita Belajar - Main Stylesheet
   Pure static HTML/CSS site for AdSense
   ============================================ */

/* --- CSS Variables --- */
:root {
    --primary: #1a73e8;
    --primary-dark: #1557b0;
    --success: #34a853;
    --accent: #fbbc04;
    --text: #202124;
    --text-secondary: #5f6368;
    --bg: #ffffff;
    --bg-light: #f8f9fa;
    --border: #e8eaed;
    --radius: 12px;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.12);
    --max-width: 1200px;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); text-decoration: underline; }

/* --- Container --- */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Header / Navigation --- */
.site-header {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}
.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}
.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}
.logo:hover { text-decoration: none; color: var(--primary-dark); }
.logo-icon {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--success));
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1.2rem; font-weight: 700;
}

.main-nav { display: flex; gap: 28px; align-items: center; }
.main-nav a {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text);
    padding: 8px 4px;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}
.main-nav a:hover, .main-nav a.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    text-decoration: none;
}

/* Mobile menu toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 8px;
}
.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
}

/* --- Hero Section --- */
.hero {
    background: #0f172a url('../images/hero-bg.jpg') center center / cover no-repeat;
    padding: 70px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(15,23,42,0.72) 0%, rgba(30,27,75,0.55) 60%, rgba(13,148,136,0.35) 100%);
    z-index: 0;
}
.hero > * {
    position: relative;
    z-index: 1;
}
.hero h1 {
    font-size: 2.75rem;
    margin-bottom: 16px;
    color: #fff;
    font-weight: 800;
    text-shadow: 0 2px 20px rgba(0,0,0,0.35);
}
.hero .subtitle {
    font-size: 1.15rem;
    color: rgba(255,255,255,0.85);
    max-width: 620px;
    margin: 0 auto 32px;
    text-shadow: 0 1px 8px rgba(0,0,0,0.3);
}
.hero-cta {
    display: inline-block;
    background: linear-gradient(135deg, #14b8a6, #06b6d4);
    color: #fff;
    padding: 16px 36px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1.05rem;
    transition: all 0.25s;
    box-shadow: 0 4px 24px rgba(20,184,166,0.35);
}
.hero-cta:hover {
    background: linear-gradient(135deg, #0d9488, #0891b2);
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(20,184,166,0.5);
}

/* --- Section Titles --- */
.section { padding: 20px 0; }
.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.section-title::after {
    content: '';
    flex: 1;
    height: 2px;
    background: var(--border);
    max-width: 200px;
}

/* --- Article Cards Grid --- */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}
.article-card {
    background: var(--bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
}
.article-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary);
}
.article-card .card-image {
    aspect-ratio: 16/9;
    display: block;
    overflow: hidden;
    border-radius: var(--radius) var(--radius) 0 0;
}
.article-card .card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}
.article-card:hover .card-image img {
    transform: scale(1.03);
}
.article-card .card-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.card-category {
    display: inline-block;
    background: #e8f0fe;
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    align-self: flex-start;
}
.article-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.4;
    color: var(--text);
}
.article-card h3 a { color: var(--text); }
.article-card h3 a:hover { color: var(--primary); text-decoration: none; }
.article-card .card-excerpt {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}
.article-card .card-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    gap: 12px;
    align-items: center;
}

/* --- Category Sections --- */
.category-section { margin-bottom: 8px; }
.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.category-header h2 {
    font-size: 1.35rem;
    font-weight: 700;
}
.category-header a.view-all {
    font-size: 0.85rem;
    font-weight: 500;
}
.category-mini-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

/* --- Article Detail Page --- */
.article-detail { max-width: 780px; margin: 0 auto; padding: 40px 20px; }
.breadcrumb {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { margin: 0 6px; }

.article-detail h1 {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 16px;
}
.article-meta {
    display: flex;
    gap: 16px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}
.article-cover {
    aspect-ratio: 16/6;
    border-radius: var(--radius);
    margin-bottom: 32px;
    overflow: hidden;
    background: #e8eaed;
}
.article-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.article-body h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 36px 0 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--bg-light);
}
.article-body h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 24px 0 12px;
}
.article-body p {
    font-size: 1.05rem;
    line-height: 1.75;
    margin-bottom: 16px;
    color: #333;
}
.article-body ul, .article-body ol {
    margin: 16px 0;
    padding-left: 24px;
}
.article-body li {
    margin-bottom: 8px;
    line-height: 1.7;
}
.article-body blockquote {
    border-left: 4px solid var(--primary);
    background: var(--bg-light);
    padding: 16px 20px;
    margin: 20px 0;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: var(--text-secondary);
}
.article-body strong { font-weight: 700; color: var(--text); }
.article-body code {
    background: var(--bg-light);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Consolas', monospace;
    font-size: 0.9rem;
}

/* Author box */
.author-box {
    background: var(--bg-light);
    border-radius: var(--radius);
    padding: 24px;
    margin: 40px 0;
    display: flex;
    gap: 16px;
    align-items: center;
}
.author-avatar {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--success));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
    flex-shrink: 0;
}
.author-info h4 { margin-bottom: 4px; }
.author-info p { font-size: 0.88rem; color: var(--text-secondary); margin: 0; }

/* Related articles */
.related-articles h3 {
    font-size: 1.3rem;
    margin-bottom: 20px;
}
.related-list {
    display: grid;
    gap: 16px;
}
.related-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all 0.2s;
}
.related-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
    text-decoration: none;
}
.related-thumb {
    width: 100px; height: 60px;
    border-radius: 6px;
    background: linear-gradient(135deg, #1e3a8a, #0d9488);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}
.related-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.related-thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.25), transparent 55%);
}
.related-info { flex: 1; min-width: 0; }
.related-info h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text);
    line-height: 1.3;
}
.related-info:hover h4 { color: var(--primary); }
.related-info .cat {
    font-size: 0.72rem;
    color: var(--text-secondary);
}

/* --- Static Pages (About, Contact, Privacy, Terms) --- */
.static-page { max-width: 760px; margin: 0 auto; padding: 60px 20px; }
.static-page h1 { font-size: 2rem; margin-bottom: 24px; }
.static-page h2 { font-size: 1.35rem; margin: 32px 0 16px; }
.static-page p, .static-page li { margin-bottom: 14px; line-height: 1.75; }
.static-page ul { padding-left: 24px; margin-bottom: 20px; }

/* Contact form */
.contact-form {
    background: var(--bg-light);
    padding: 32px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.form-group { margin-bottom: 20px; }
.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 0.92rem;
}
.form-group input, .form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}
.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}
.form-group textarea { min-height: 140px; resize: vertical; }
.btn-submit {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-submit:hover { background: var(--primary-dark); }

/* --- Footer --- */
.site-footer {
    background: #202124;
    color: #e8eaed;
    padding: 40px 0 20px;
    margin-top: 40px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}
.footer-brand .logo { color: #fff; margin-bottom: 12px; }
.footer-brand p {
    color: #9aa0a6;
    font-size: 0.9rem;
    max-width: 300px;
}
.footer-col h4 {
    font-size: 0.95rem;
    margin-bottom: 16px;
    color: #fff;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 10px; }
.footer-col a {
    color: #9aa0a6;
    font-size: 0.88rem;
    transition: color 0.2s;
}
.footer-col a:hover { color: #fff; text-decoration: none; }

.footer-bottom {
    border-top: 1px solid #3c4043;
    padding-top: 20px;
    text-align: center;
    font-size: 0.82rem;
    color: #9aa0a6;
}

/* --- Back to top button --- */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    box-shadow: var(--shadow-hover);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 999;
    font-size: 1.2rem;
}
.back-to-top.show {
    opacity: 1;
    visibility: visible;
}
.back-to-top:hover { background: var(--primary-dark); }

/* --- Newsletter --- */
.newsletter {
    background: linear-gradient(135deg, #e8f0fe, #e6f4ea);
    padding: 60px 0;
    text-align: center;
    margin-top: 40px;
}
.newsletter h2 { font-size: 1.6rem; margin-bottom: 12px; }
.newsletter p { color: var(--text-secondary); margin-bottom: 24px; }
.newsletter-form {
    max-width: 440px;
    margin: 0 auto;
    display: flex;
    gap: 8px;
}
.newsletter-form input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
}
.newsletter-form button {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .menu-toggle { display: flex; }
    .main-nav {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--bg);
        flex-direction: column;
        padding: 20px;
        gap: 8px;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s;
    }
    .main-nav.open {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    .main-nav a { padding: 12px; border-bottom: 1px solid var(--bg-light); }

    .hero { padding: 50px 0; }
    .hero h1 { font-size: 1.8rem; }
    .section { padding: 40px 0; }
    .section-title { font-size: 1.4rem; }

    .article-detail h1 { font-size: 1.6rem; }
    .article-cover { aspect-ratio: 16/7; }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 28px;
        text-align: left;
    }
    .site-footer { padding: 40px 0 20px; }

    .back-to-top { bottom: 20px; right: 20px; width: 42px; height: 42px; }
}

@media (max-width: 480px) {
    .articles-grid { grid-template-columns: 1fr; }
    .hero h1 { font-size: 1.5rem; }
    .related-item { flex-direction: column; }
    .related-thumb { width: 100%; height: 80px; }
}

/* --- Utility --- */
.text-center { text-align: center; }
.text-muted { color: var(--text-secondary); }
.tag {
    display: inline-block;
    padding: 4px 10px;
    background: var(--bg-light);
    border-radius: 16px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 2px 4px 2px 0;
}

/* Fade-in animation */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}
