/* ==========================================================================
   RESET & VARIABEL TEMA (MENGADOPSI GAYA SVELTEPRESS / VITEPRESS)
   ========================================================================== */
   :root {
    --vp-c-brand: #fb7185; /* Warna utama Sveltepress (Rose 400) */
    --vp-c-brand-light: #fda4af;
    --vp-c-brand-dark: #f43f5e;
    --vp-c-text-1: #213547;
    --vp-c-text-2: #3c3c43b3;
    --vp-c-bg: #ffffff;
    --vp-c-bg-alt: #f6f6f7;
    --vp-c-divider: #e2e2e3;
    --vp-c-bg-nav: rgba(255, 255, 255, 0.85);
    --vp-code-bg: rgba(175, 184, 193, 0.2);
    --vp-code-text: #476582;
    --vp-font-family-base: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
    --vp-font-family-mono: "JetBrains Mono", "Fira Code", source-code-pro, Menlo, Monaco, Consolas, "Courier New", monospace;
}

html.dark {
    --vp-c-text-1: rgba(255, 255, 255, 0.87);
    --vp-c-text-2: rgba(235, 235, 245, 0.6);
    --vp-c-bg: #1e1e20;
    --vp-c-bg-alt: #161618;
    --vp-c-divider: #2e2e32;
    --vp-c-bg-nav: rgba(30, 30, 32, 0.85);
    --vp-code-bg: rgba(0, 0, 0, 0.4);
    --vp-code-text: #c9def1;
}

body {
    margin: 0;
    font-family: var(--vp-font-family-base);
    color: var(--vp-c-text-1);
    background-color: var(--vp-c-bg);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   LAYOUT UTAMA (NAVBAR, SIDEBAR & KONTEN)
   ========================================================================== */
.sabda-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 32px;
    height: 64px;
    border-bottom: 1px solid var(--vp-c-divider);
    background-color: var(--vp-c-bg-nav);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.sabda-navbar .logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.3rem;
    color: var(--vp-c-text-1);
    letter-spacing: -0.02em;
}

.sabda-navbar .logo-img {
    height: 28px;
    margin-right: 12px;
}

.sabda-navbar .nav-right {
    display: flex;
    gap: 24px;
}

.sabda-navbar .nav-link {
    text-decoration: none;
    color: var(--vp-c-text-1);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.sabda-navbar .nav-link:hover {
    color: var(--vp-c-brand);
}

.theme-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    margin-left: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--vp-c-text-1);
    transition: transform 0.2s ease;
}

.theme-toggle:hover {
    transform: scale(1.1);
}

.sabda-layout {
    display: flex;
    min-height: calc(100vh - 64px);
}

.sabda-sidebar {
    width: 280px;
    background-color: var(--vp-c-bg-alt);
    border-right: 1px solid var(--vp-c-divider);
    padding: 32px 24px;
    box-sizing: border-box;
    position: sticky;
    top: 64px; /* Turun seukuran navbar */
    height: calc(100vh - 64px);
    overflow-y: auto;
}

.sidebar-group {
    margin-bottom: 24px;
}

.sidebar-group-title {
    margin-top: 0;
    font-size: 1.1rem;
    font-weight: 600;
    padding-bottom: 8px;
    margin-bottom: 8px;
    color: var(--vp-c-text-1);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    list-style: none; /* Sembunyikan default arrow HTML */
    user-select: none;
}

/* Sembunyikan arrow bawaan Safari/Webkit */
.sidebar-group-title::-webkit-details-marker {
    display: none;
}

.sidebar-group-title .chevron {
    display: inline-block;
    width: 16px;
    height: 16px;
    position: relative;
    transition: transform 0.3s ease;
    transform: rotate(90deg);
}

.sidebar-group-title .chevron::before,
.sidebar-group-title .chevron::after {
    content: '';
    position: absolute;
    background-color: var(--vp-c-text-2);
    height: 2px;
    width: 8px;
    border-radius: 2px;
    top: 7px;
}

.sidebar-group-title .chevron::before {
    left: 2px;
    transform: rotate(45deg);
}

.sidebar-group-title .chevron::after {
    right: 2px;
    transform: rotate(-45deg);
}

/* Animasi chevron saat terbuka */
details[open] > .sidebar-group-title .chevron {
    transform: rotate(-90deg);
}

.sidebar-group-items {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sabda-sidebar li {
    margin-bottom: 4px;
}

.sabda-sidebar a {
    text-decoration: none;
    color: var(--vp-c-text-2);
    display: block;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.25s ease;
}

.sidebar-group-items li a.active,
.sabda-sidebar a:hover {
    color: var(--vp-c-brand);
    background-color: rgba(251, 113, 133, 0.08);
}

.sabda-content {
    flex: 1;
    padding: 48px 64px;
    box-sizing: border-box;
    max-width: 860px;
    margin: 0 auto;
}

/* ==========================================================================
   HERO HOMEPAGE STYLING (GAYA SVELTEPRESS HOME)
   ========================================================================== */
.sabda-layout.is-home .sabda-content {
    max-width: 1100px;
    text-align: center;
    padding-top: 100px;
}

.sabda-layout.is-home .sabda-markdown h1 {
    font-size: 4rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    background: -webkit-linear-gradient(315deg, #f43f5e 25%, #fb7185);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 24px;
    border: none;
}

.sabda-layout.is-home .sabda-markdown p {
    font-size: 1.4rem;
    color: var(--vp-c-text-2);
    max-width: 700px;
    margin: 0 auto 32px auto;
    line-height: 1.5;
}

.sabda-layout.is-home .sabda-markdown a {
    display: inline-block;
    background-color: var(--vp-c-brand);
    color: white !important;
    padding: 12px 28px;
    border-radius: 24px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s;
    margin-top: 16px;
}

.sabda-layout.is-home .sabda-markdown a:hover {
    background-color: var(--vp-c-brand-dark);
}

/* --- Features Grid --- */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 64px;
    text-align: left;
}

.feature-card {
    background-color: var(--vp-c-bg-alt);
    padding: 24px;
    border-radius: 12px;
    border: 1px solid var(--vp-c-divider);
    transition: border-color 0.2s;
}

.feature-card:hover {
    border-color: var(--vp-c-brand);
}

.feature-card h3 {
    margin-top: 0;
    font-size: 1.25rem;
    margin-bottom: 12px;
    color: var(--vp-c-brand);
}

.feature-card p {
    font-size: 1rem;
    color: var(--vp-c-text-2);
    margin-bottom: 0;
}

/* ==========================================================================
   TYPOGRAPHY (GAYA MARKDOWN SVELTEPRESS)
   ========================================================================== */
.sabda-markdown {
    word-wrap: break-word;
}

.sabda-markdown h1, 
.sabda-markdown h2, 
.sabda-markdown h3, 
.sabda-markdown h4 {
    font-weight: 600;
    line-height: 1.25;
    margin-top: 24px;
    margin-bottom: 16px;
    color: var(--vp-c-text-1);
}

.sabda-markdown h1 {
    font-size: 2.2rem;
    letter-spacing: -0.02em;
    margin-bottom: 32px;
}

.sabda-markdown h2 {
    font-size: 1.65rem;
    margin-top: 48px;
    border-bottom: 1px solid var(--vp-c-divider);
    padding-bottom: 12px;
}

.sabda-markdown h3 { font-size: 1.35rem; margin-top: 32px; }
.sabda-markdown p { margin-top: 0; margin-bottom: 16px; }

.sabda-markdown a {
    color: var(--vp-c-brand);
    text-decoration: none;
    font-weight: 500;
}

.sabda-markdown a:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* List */
.sabda-markdown ul, .sabda-markdown ol {
    padding-left: 1.25rem;
    margin-top: 0;
    margin-bottom: 16px;
}

.sabda-markdown li { margin-bottom: 8px; }

/* Inline Code */
.sabda-markdown code {
    font-family: var(--vp-font-family-mono);
    font-size: 0.85em;
    background-color: var(--vp-code-bg);
    padding: 3px 6px;
    border-radius: 4px;
    color: var(--vp-code-text);
}

/* Sembunyikan garis <hr> pertama hasil dari frontmatter Bun markdown loader */
.sabda-markdown hr:first-of-type {
    display: none;
}

.sabda-markdown hr {
    height: 1px;
    border: none;
    background-color: var(--vp-c-divider);
    margin: 32px 0;
}

/* Blockquote */
.sabda-markdown blockquote {
    margin: 16px 0;
    padding: 0 16px;
    border-left: 4px solid var(--vp-c-brand);
    color: var(--vp-c-text-2);
    background-color: rgba(251, 113, 133, 0.08);
    padding-top: 8px;
    padding-bottom: 8px;
    border-radius: 0 8px 8px 0;
}

.sabda-markdown blockquote p:last-child { margin-bottom: 0; }

/* Tabel */
.sabda-markdown table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
    display: block;
    overflow-x: auto;
}

.sabda-markdown th, .sabda-markdown td {
    border: 1px solid var(--vp-c-divider);
    padding: 8px 16px;
    text-align: left;
}

.sabda-markdown th {
    background-color: var(--vp-c-bg-alt);
    font-weight: 600;
}

/* ==========================================================================
   SYNTAX HIGHLIGHTING (GAYA PEWARNAAN KODE SABDA)
   ========================================================================== */
code[class*="language-"],
pre[class*="language-"] {
    display: block;
    white-space: pre;
    background-color: #282c34;
    color: #abb2bf;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: var(--vp-font-family-mono);
    margin: 16px 0;
    font-size: 0.9em;
}

/* Gaya khusus untuk code inline agar tidak pecah baris */
:not(pre) > code[class*="language-"],
p code, li code, h1 code, h2 code, h3 code, h4 code, h5 code, h6 code {
    display: inline;
    white-space: normal;
    padding: 2px 5px;
    margin: 0;
    background-color: var(--vp-code-bg);
    color: var(--vp-code-text);
}

/* Kata Kunci (Purple) */
.token.keyword, .k {
    color: #c678dd;
    font-weight: bold;
}

/* Operator & Simbol (Yellow/Orange) */
.token.operator,
.token.punctuation, .o {
    color: #d19a66;
}

/* Identitas/Variabel (Blue/Cyan) */
.token.variable,
.token.function, .i {
    color: #61afef;
}

/* Teks/String (Green) */
.token.string, .s {
    color: #98c379;
}

/* Komentar (Gray) */
.token.comment, .c {
    color: #5c6370;
    font-style: italic;
}

/* Angka/Number */
.token.number,
.token.boolean {
    color: #d19a66;
}

/* Akhiran 'nya' & Awalan 'ber' */
.token.akhiran,
.token.awalan {
    color: #c678dd;
    font-weight: bold;
}
