@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Source+Serif+4:wght@400;600&display=swap');

/* ==========================
   RESET
========================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ==========================
   BODY
========================== */
body {
    font-family: 'Inter', sans-serif;
    background: #fafafa;
    color: #242424;
}

/* ==========================
   HEADER
========================== */
header {
    height: 60px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid #eee;
    background: #fff;
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-title {
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.3px;
    text-decoration: none;
    color: #242424;
}

.header-title:hover {
    color: #000;
}

/* toggle button */
.menu-toggle {
    display: none;
    font-size: 20px;
    background: none;
    border: none;
    cursor: pointer;
}

/* ==========================
   LAYOUT
========================== */
.container {
    display: flex;
    min-height: calc(100vh - 60px);
}

/* ==========================
   SIDEBAR
========================== */
.sidebar {
    width: 200px;
    padding: 25px 15px;
    background: #fff;
    border-right: 1px solid #eee;
}

.sidebar ul {
    list-style: none;
}

.menu-title {
    margin-top: 20px;
    font-size: 13px;
    font-weight: 600;
    color: #000;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.submenu {
    margin-top: 8px;
    margin-left: 10px;
}

.submenu a {
    text-decoration: none;
    color: #6b6b6b;
    font-size: 14px;
    transition: 0.2s;
}

.submenu a:hover {
    color: #000;
}

.submenu a.active {
    color: #000;
    font-weight: 600;
}

/* ==========================
   MAIN CONTENT
========================== */
main.content {
    flex: 1;
    padding: 40px 20px;
}

.content-body {
    max-width: 720px;
    margin: 0 auto;
    width: 100%;
}

/* ==========================
   TYPOGRAPHY
========================== */
h2 {
    font-family: 'Source Serif 4', serif;
    font-size: 34px;
    line-height: 1.3;
}

p {
    font-family: 'Source Serif 4', serif;
    font-size: 18px;
    line-height: 1.8;
    color: #242424;
}

/* spacing antar elemen */
.content-body > * + * {
    margin-top: 14px;
}

/* ==========================
   CODE BLOCK
========================== */
pre {
    background: #f6f8fa;
    padding: 15px;
    border-radius: 6px;
    overflow-x: auto;
}

code {
    font-family: monospace;
    font-size: 14px;
}

.preview h1, .preview h2, .preview h3,
.preview h4, .preview h5, .preview h6 {
    all: revert;
}

.preview {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    margin: 16px 0;
}

.preview::before {
    content: '● ● ●';
    display: block;
    background: #e8e8e8;
    padding: 8px 14px;
    font-size: 12px;
    letter-spacing: 4px;
    color: #aaa;
    border-bottom: 1px solid #ddd;
}

.preview-content {
    padding: 16px 20px;
    background: #fff;
}

.line-numbers .line-numbers-rows {
    border-right: 1px solid #ddd;
}

/* copy button */
.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 12px;
    padding: 4px 8px;
    cursor: pointer;
    border: none;
    background: #eee;
    border-radius: 4px;
}

.copy-btn:hover {
    background: #ddd;
}

/* ==========================
   BREADCRUMB
========================== */
.breadcrumb {
    font-size: 14px;
    color: #888;
}

.breadcrumb a {
    color: #666;
    text-decoration: none;
}

.breadcrumb a:hover {
    color: #000;
    text-decoration: underline;
}

/* ==========================
   NAV LESSON
========================== */
.nav-lesson {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.nav-lesson a {
    text-decoration: none;
    color: #333;
    font-size: 14px;
}

.nav-lesson a:hover {
    text-decoration: underline;
}

/* ==========================
   FOOTER
========================== */
footer {
    text-align: center;
    padding: 20px;
    font-size: 14px;
    color: #999;
    border-top: 1px solid #eee;
    background: #fff;
}

/* ==========================
   MOBILE
========================== */
@media (max-width: 768px) {

    /* header */
    .header-title {
        font-size: 20px;
    }

    .menu-toggle {
        display: block;
    }

    /* layout */
    .container {
        flex-direction: column;
    }

    /* sidebar */
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #eee;

        display: none; /* siap toggle */
    }

    .sidebar.active {
        display: block;
    }

    /* content */
    main.content {
        padding: 20px 15px;
    }

    h2 {
        font-size: 24px;
    }

    p {
        font-size: 16px;
    }

    /* nav lesson */
    .nav-lesson {
        flex-direction: column;
        gap: 10px;
    }
}
