/* LONTAR Theme: Flavor — Theme blog bersih dan minimal */

/* === Variabel dari theme settings === */
:root {
    --primary: var(--primary-color, #2563eb);
    --primary-hover: color-mix(in srgb, var(--primary) 85%, black);
    --text: #1f2937;
    --text-light: #6b7280;
    --bg: #ffffff;
    --bg-alt: #f9fafb;
    --border: #e5e7eb;
    --radius: 0.5rem;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --max-width: 1200px;
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* === Reset === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg-alt);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-hover);
}

/* === Header === */
.site-header {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 4rem;
}

.site-branding {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.site-logo {
    height: 2rem;
    width: auto;
}

.site-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
}

.site-title:hover {
    color: var(--primary);
}

.site-tagline {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* Navigation */
.main-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-item {
    position: relative;
}

.nav-item > a {
    display: block;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
    border-radius: var(--radius);
    transition: background 0.2s, color 0.2s;
}

.nav-item > a:hover,
.nav-item > a.active {
    color: var(--primary);
    background: var(--bg-alt);
}

/* Dropdown */
.nav-item .dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    min-width: 180px;
    padding: 0.25rem 0;
    z-index: 200;
}

.nav-item:hover .dropdown {
    display: block;
}

.dropdown a {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: var(--text);
}

.dropdown a:hover,
.dropdown a.active {
    background: var(--bg-alt);
    color: var(--primary);
}

/* Mobile nav toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text);
    border-radius: 1px;
    transition: transform 0.2s;
}

/* === Layout === */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem 1.5rem;
    display: flex;
    gap: 2.5rem;
    flex: 1;
}

.content {
    flex: 1;
    min-width: 0;
}

.container.no-sidebar {
    max-width: 800px;
}

.container.no-sidebar .content {
    flex: 1;
}

/* === Sidebar === */
.sidebar {
    width: 280px;
    flex-shrink: 0;
}

.widget {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.widget-title {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary);
}

.widget ul {
    list-style: none;
}

.widget li {
    padding: 0.375rem 0;
    border-bottom: 1px solid var(--border);
}

.widget li:last-child {
    border-bottom: none;
}

.widget li a {
    display: flex;
    justify-content: space-between;
    color: var(--text);
    font-size: 0.875rem;
}

.widget li a span {
    color: var(--text-light);
    font-size: 0.75rem;
}

.widget li a:hover {
    color: var(--primary);
}

/* Tag cloud */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.tag {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 9999px;
    font-size: 0.75rem;
    color: var(--text-light);
    transition: all 0.2s;
}

.tag:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* === Post Card === */
.posts-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.post-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.post-card:hover {
    box-shadow: var(--shadow);
}

.post-card-image img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
}

.posts-list:not(.posts-grid) .post-card {
    display: flex;
}

.posts-list:not(.posts-grid) .post-card-image {
    width: 280px;
    flex-shrink: 0;
}

.posts-list:not(.posts-grid) .post-card-image img {
    height: 100%;
    aspect-ratio: auto;
}

.post-card-body {
    padding: 1.25rem;
    flex: 1;
}

.post-card-title {
    font-size: 1.125rem;
    line-height: 1.4;
    margin-bottom: 0.375rem;
}

.post-card-title a {
    color: var(--text);
}

.post-card-title a:hover {
    color: var(--primary);
}

.post-meta {
    font-size: 0.8125rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
}

.meta-sep {
    margin: 0 0.125rem;
}

.post-category {
    color: var(--primary);
    font-weight: 500;
}

.post-excerpt {
    font-size: 0.9375rem;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.read-more {
    font-size: 0.875rem;
    font-weight: 500;
}

/* === Single Post/Page === */
.single-post,
.single-page,
.single-content {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
}

.post-header {
    margin-bottom: 1.5rem;
}

.post-header h1,
.single-page h1 {
    font-size: 2rem;
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

.featured-image {
    width: 100%;
    border-radius: var(--radius);
    margin: 1.5rem 0;
}

/* Prose content */
.prose {
    line-height: 1.8;
}

.prose p {
    margin-bottom: 1.25rem;
}

.prose h2 {
    font-size: 1.5rem;
    margin: 2rem 0 0.75rem;
}

.prose h3 {
    font-size: 1.25rem;
    margin: 1.5rem 0 0.5rem;
}

.prose ul, .prose ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.prose li {
    margin-bottom: 0.375rem;
}

.prose blockquote {
    border-left: 3px solid var(--primary);
    padding: 0.75rem 1rem;
    margin: 1.5rem 0;
    background: var(--bg-alt);
    color: var(--text-light);
    font-style: italic;
}

.prose pre {
    background: #1f2937;
    color: #e5e7eb;
    padding: 1rem;
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 1.5rem 0;
    font-size: 0.875rem;
}

.prose code {
    background: var(--bg-alt);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.875em;
}

.prose pre code {
    background: none;
    padding: 0;
}

.prose img {
    border-radius: var(--radius);
    margin: 1rem 0;
}

.prose iframe {
    max-width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius);
    margin: 1.5rem 0;
    border: none;
}

.prose video {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    margin: 1.5rem 0;
}

.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.prose th, .prose td {
    border: 1px solid var(--border);
    padding: 0.5rem 0.75rem;
    text-align: left;
}

.prose th {
    background: var(--bg-alt);
    font-weight: 600;
}

/* Post tags */
.post-tags {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

/* Custom fields */
.custom-fields {
    margin: 1.5rem 0;
}

.custom-fields .field {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9375rem;
}

.custom-fields .field:last-child {
    border-bottom: none;
}

.field-image {
    margin-top: 0.5rem;
    max-width: 400px;
    border-radius: var(--radius);
}

.color-swatch {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border-radius: 0.25rem;
    border: 1px solid var(--border);
    vertical-align: middle;
    margin-right: 0.25rem;
}

/* === Archive === */
.archive-header {
    margin-bottom: 1.5rem;
}

.archive-header h1 {
    font-size: 1.75rem;
}

.archive-description {
    color: var(--text-light);
    margin-top: 0.25rem;
}

.section-title {
    font-size: 1.25rem;
    margin-bottom: 1.25rem;
    color: var(--text);
}

/* === Pagination === */
.pagination-wrapper {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
}

.pagination-wrapper nav {
    display: flex;
    gap: 0.25rem;
}

.pagination-wrapper a,
.pagination-wrapper span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 0.5rem;
    font-size: 0.875rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    transition: all 0.2s;
}

.pagination-wrapper a:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.pagination-wrapper span[aria-current="page"] {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* === 404 === */
.error-page {
    text-align: center;
    padding: 4rem 1rem;
}

.error-code {
    font-size: 8rem;
    font-weight: 800;
    color: var(--border);
    line-height: 1;
}

.error-page h1 {
    font-size: 1.5rem;
    margin: 0.5rem 0;
}

.error-page p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius);
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-hover);
    color: #fff;
}

/* === Empty state === */
.empty-message {
    color: var(--text-light);
    padding: 2rem 0;
    text-align: center;
}

.empty-state {
    text-align: center;
    padding: 3rem 0;
    color: var(--text-light);
}

/* === Footer === */
.site-footer {
    background: var(--bg);
    border-top: 1px solid var(--border);
    margin-top: auto;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem 1.5rem;
    text-align: center;
}

.footer-nav {
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-nav a {
    color: var(--text);
    font-size: 0.875rem;
}

.footer-nav a:hover {
    color: var(--primary);
}

.footer-text {
    font-size: 0.8125rem;
    color: var(--text-light);
}

/* === Responsive === */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
        padding: 1.25rem 1rem;
    }

    .sidebar {
        width: 100%;
    }

    .nav-toggle {
        display: flex;
    }

    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 0.5rem;
        box-shadow: var(--shadow);
    }

    .main-nav.open {
        display: flex;
    }

    .nav-item .dropdown {
        position: static;
        border: none;
        box-shadow: none;
        padding-left: 1rem;
    }

    .nav-item:hover .dropdown {
        display: block;
    }

    .posts-list:not(.posts-grid) .post-card {
        flex-direction: column;
    }

    .posts-list:not(.posts-grid) .post-card-image {
        width: 100%;
    }

    .posts-grid {
        grid-template-columns: 1fr;
    }

    .single-post,
    .single-page,
    .single-content {
        padding: 1.25rem;
    }

    .post-header h1,
    .single-page h1 {
        font-size: 1.5rem;
    }
}
