:root {
    --bg: #ffffff;
    --surface: #f8f9fa;
    --text: #1a1a2e;
    --text-secondary: #555770;
    --border: #e2e4e8;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --radius: 10px;
    --max-w: 860px;
    --nav-h: 56px;
}

[data-theme="dark"] {
    --bg: #0f172a;
    --surface: #1e293b;
    --text: #e2e8f0;
    --text-secondary: #94a3b8;
    --border: #334155;
    --accent: #60a5fa;
    --accent-hover: #93bbfd;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg); color: var(--text); line-height: 1.7; font-size: 16px;
    min-height: 100vh; display: flex; flex-direction: column; -webkit-text-size-adjust: 100%;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; height: auto; display: block; }
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 16px; width: 100%; }

/* NAV */
.site-nav { position: sticky; top: 0; z-index: 100; background: var(--surface); border-bottom: 1px solid var(--border); height: var(--nav-h); display: flex; align-items: center; }
.nav-inner { max-width: var(--max-w); margin: 0 auto; padding: 0 16px; width: 100%; display: flex; justify-content: space-between; align-items: center; }
.nav-brand { font-weight: 700; font-size: 1.1rem; color: var(--text); }
.nav-brand:hover { color: var(--accent); }
.nav-links { display: flex; gap: 16px; list-style: none; }
.nav-links a { color: var(--text-secondary); font-size: 0.9rem; font-weight: 500; }
.nav-links a:hover { color: var(--accent); }
.nav-actions { display: flex; gap: 10px; align-items: center; }
.theme-btn { background: none; border: none; cursor: pointer; padding: 6px; color: var(--text-secondary); display: flex; align-items: center; }
.theme-btn:hover { color: var(--accent); }
.theme-btn svg { width: 20px; height: 20px; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="light"] .icon-moon { display: block; }
[data-theme="light"] .icon-sun { display: none; }
html:not([data-theme]) .icon-moon { display: block; }
html:not([data-theme]) .icon-sun { display: none; }
.menu-toggle { display: none; background: none; border: none; cursor: pointer; color: var(--text); padding: 6px; }
.menu-toggle svg { width: 24px; height: 24px; }
.search-form { display: flex; }
.search-form input { border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 12px; font-size: 0.9rem; background: var(--bg); color: var(--text); width: 180px; }
.search-form input:focus { outline: 2px solid var(--accent); border-color: transparent; }

/* HERO */
.hero {
    text-align: center; padding: 48px 16px 36px;
    background: linear-gradient(135deg, var(--accent) 0%, #7c3aed 50%, #ec4899 100%);
    color: #fff;
}
.hero h1 { font-size: 2rem; margin-bottom: 8px; font-weight: 800; }
.hero p { max-width: 480px; margin: 0 auto 24px; opacity: 0.9; font-size: 1.05rem; }
.hero-search {
    display: flex; max-width: 440px; margin: 0 auto; background: rgba(255,255,255,0.15);
    border-radius: 50px; overflow: hidden; backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.25);
}
.hero-search input {
    flex: 1; border: none; background: transparent; padding: 12px 20px;
    font-size: 1rem; color: #fff; outline: none;
}
.hero-search input::placeholder { color: rgba(255,255,255,0.7); }
.hero-search button {
    border: none; background: rgba(255,255,255,0.25); color: #fff;
    padding: 12px 24px; font-size: 0.95rem; font-weight: 600; cursor: pointer;
    transition: background 0.2s;
}
.hero-search button:hover { background: rgba(255,255,255,0.4); }

/* SECTION HEADING */
.section-heading { display: flex; align-items: center; gap: 12px; margin: 32px 0 20px; }
.section-heading h2 { font-size: 1.2rem; font-weight: 700; white-space: nowrap; }
.section-line { flex: 1; height: 1px; background: var(--border); }

/* FEATURED CARD */
.featured-card {
    display: flex; gap: 0; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
    transition: transform 0.15s, box-shadow 0.15s; margin-bottom: 8px;
}
.featured-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.08); }
.featured-img { flex: 0 0 45%; overflow: hidden; }
.featured-img img { width: 100%; height: 100%; min-height: 240px; object-fit: cover; }
.featured-body { flex: 1; padding: 24px; display: flex; flex-direction: column; justify-content: center; }
.label-featured {
    display: inline-block; background: var(--accent); color: #fff; font-size: 0.7rem;
    font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
    padding: 3px 10px; border-radius: 4px; margin-bottom: 10px; width: fit-content;
}
.featured-body h2 { font-size: 1.3rem; line-height: 1.4; margin-bottom: 8px; }
.featured-body h2 a { color: var(--text); }
.featured-body h2 a:hover { color: var(--accent); }
.featured-body p { color: var(--text-secondary); font-size: 0.92rem; margin-bottom: 10px; line-height: 1.6; }

/* POST GRID */
.post-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
.grid-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; transition: transform 0.15s, box-shadow 0.15s;
}
.grid-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,0.07); }
.grid-card-img { position: relative; display: block; overflow: hidden; }
.grid-card-img img { width: 100%; height: 160px; object-fit: cover; transition: transform 0.3s; }
.grid-card:hover .grid-card-img img { transform: scale(1.04); }
.tag {
    position: absolute; top: 8px; left: 8px;
    background: var(--accent); color: #fff; font-size: 0.7rem; font-weight: 600;
    padding: 2px 8px; border-radius: 4px; text-transform: capitalize;
}
.grid-card-body { padding: 14px; }
.grid-card-body h3 { font-size: 0.95rem; line-height: 1.4; margin-bottom: 6px; }
.grid-card-body h3 a { color: var(--text); }
.grid-card-body h3 a:hover { color: var(--accent); }
.grid-card-body p { color: var(--text-secondary); font-size: 0.85rem; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-card-meta { font-size: 0.78rem; color: var(--text-secondary); }

/* SINGLE POST */
.single-header { padding: 32px 0 20px; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.single-header h1 { font-size: 1.6rem; line-height: 1.4; margin-bottom: 10px; }
.single-meta { font-size: 0.85rem; color: var(--text-secondary); }
.single-featured { border-radius: var(--radius); overflow: hidden; margin-bottom: 24px; }
.single-featured img { width: 100%; max-height: 400px; object-fit: cover; }
.single-content { font-size: 1.05rem; line-height: 1.8; }
.single-content p { margin-bottom: 1.2em; }
.single-content h2, .single-content h3 { margin-top: 1.6em; margin-bottom: 0.6em; }
.single-content img { border-radius: 8px; margin: 16px 0; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin: 16px 0; }
.gallery-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; cursor: pointer; }
.gallery-grid img:hover { opacity: 0.9; }

.related-box { margin-top: 32px; padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.related-box h3 { font-size: 1rem; margin-bottom: 12px; }
.related-list { list-style: none; }
.related-list li { margin-bottom: 8px; }
.related-list a { color: var(--text); font-size: 0.92rem; }
.related-list a:hover { color: var(--accent); }

/* SEARCH */
.search-keyword { font-size: 1.3rem; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.search-items { list-style: none; }
.search-item { padding: 14px 0; border-bottom: 1px solid var(--border); }
.search-item h3 { font-size: 1rem; margin-bottom: 4px; }
.search-item p { color: var(--text-secondary); font-size: 0.9rem; }

/* PAGES */
.page-content { padding: 32px 0; }
.page-content h1 { font-size: 1.5rem; margin-bottom: 16px; }
.page-content p { margin-bottom: 1em; color: var(--text-secondary); }
.page-content h3 { margin-top: 1.4em; margin-bottom: 0.5em; }
.page-content a { color: var(--accent); }

/* BREADCRUMB */
.breadcrumb { font-size: 0.85rem; color: var(--text-secondary); margin-top: 20px; margin-bottom: 16px; }
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--accent); }

/* FOOTER */
.site-footer { margin-top: auto; padding: 24px 16px; text-align: center; font-size: 0.85rem; color: var(--text-secondary); border-top: 1px solid var(--border); background: var(--surface); }

/* LIGHTBOX */
.lightbox { display: none; position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,0.85); justify-content: center; align-items: center; }
.lightbox.active { display: flex; }
.lightbox img { max-width: 90vw; max-height: 85vh; border-radius: 8px; }
.lightbox-close { position: absolute; top: 16px; right: 20px; background: none; border: none; color: #fff; font-size: 2rem; cursor: pointer; }

/* BACK TO TOP */
.back-top { position: fixed; bottom: 24px; right: 24px; width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.3s; z-index: 90; border: none; cursor: pointer; font-size: 1.2rem; }
.back-top.show { opacity: 1; pointer-events: auto; }

/* PAGINATION */
.pagination { display: flex; justify-content: center; margin: 32px 0; }
.pagination nav { display: flex; gap: 4px; }
.pagination nav a, .pagination nav span {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 40px; height: 40px; padding: 0 12px;
    border: 1px solid var(--border); border-radius: var(--radius);
    font-size: 0.9rem; color: var(--text); background: var(--surface);
    transition: all 0.15s;
}
.pagination nav a:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.pagination nav span.active { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
.pagination nav .disabled { opacity: 0.4; pointer-events: none; }

/* POST CARD (search, related) */
.post-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; transition: transform 0.15s, box-shadow 0.15s; }
.post-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.06); }
.post-card-thumb { border-radius: 8px; overflow: hidden; margin-bottom: 12px; }
.post-card-thumb img { width: 100%; height: 200px; object-fit: cover; }
.post-card h2 { font-size: 1.2rem; line-height: 1.4; margin-bottom: 8px; }
.post-card h2 a { color: var(--text); }
.post-card h2 a:hover { color: var(--accent); }
.post-card-excerpt { color: var(--text-secondary); font-size: 0.92rem; margin-bottom: 10px; }

/* TRENDING LIST */
.trending-list { display: flex; flex-direction: column; gap: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 24px; }
.trending-item { display: flex; align-items: center; gap: 14px; padding: 10px 14px; text-decoration: none; color: var(--text); transition: background 0.15s; }
.trending-item:hover { background: var(--border); }
.trending-thumb { flex: 0 0 60px; width: 60px; height: 60px; border-radius: 8px; overflow: hidden; }
.trending-thumb img { width: 100%; height: 100%; object-fit: cover; }
.trending-body { flex: 1; min-width: 0; }
.trending-body h3 { font-size: 0.9rem; font-weight: 600; line-height: 1.3; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }



/* ARCHIVE LIST */
.archive-list { list-style: none; margin: 16px 0; }
.archive-list-item { display: flex; align-items: baseline; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.archive-list-date { flex: 0 0 60px; font-size: 0.82rem; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.archive-list-item a { font-size: 0.95rem; color: var(--text); }
.archive-list-item a:hover { color: var(--accent); }
/* SHARE BAR */
.share-bar { display: flex; align-items: center; gap: 12px; padding: 20px 0; margin: 24px 0 0; border-top: 1px solid var(--border); flex-wrap: wrap; }
.share-label { font-size: 0.9rem; font-weight: 600; color: var(--text-secondary); white-space: nowrap; }
.share-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.share-btn {
    display: inline-block; padding: 6px 14px; border-radius: 6px; font-size: 0.8rem;
    font-weight: 600; text-decoration: none; color: #fff; transition: opacity 0.2s;
}
.share-btn:hover { opacity: 0.85; color: #fff; }
.share-facebook { background: #1565c0; }
.share-twitter { background: #000; }
.share-whatsapp { background: #075E54; }
.share-telegram { background: #005f8a; }
.share-email { background: #4b5563; }
/* ARCHIVE */
.archive-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin: 16px 0; }
.archive-card {
    display: block; padding: 20px; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); text-align: center; text-decoration: none; color: var(--text);
    transition: transform 0.15s, box-shadow 0.15s;
}
.archive-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.06); color: var(--text); }
.archive-card-month { font-size: 1.1rem; font-weight: 700; color: var(--accent); margin-bottom: 2px; }
.archive-card-year { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 8px; }
.archive-card-count { font-size: 0.8rem; color: var(--text-secondary); background: var(--bg); padding: 3px 10px; border-radius: 20px; display: inline-block; }

/* RESPONSIVE */
@media (max-width: 768px) {
    .featured-card { flex-direction: column; }
    .featured-img { flex: none; }
    .featured-img img { min-height: 200px; }
    .post-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .nav-links { display: none; }
    .nav-links.open { display: flex; flex-direction: column; position: absolute; top: var(--nav-h); left: 0; right: 0; background: var(--surface); border-bottom: 1px solid var(--border); padding: 12px 16px; gap: 12px; z-index: 99; }
    .menu-toggle { display: block; }
    .search-form { display: none; }
    .hero { padding: 28px 16px 24px; }
    .hero h1 { font-size: 1.4rem; }
    .hero p { font-size: 0.95rem; margin-bottom: 16px; }
    .hero-search { flex-direction: column; border-radius: var(--radius); }
    .hero-search input { text-align: center; padding: 12px 16px; }
    .hero-search button { padding: 12px; }
    .post-grid { grid-template-columns: 1fr; gap: 12px; }
    .post-card-thumb img { height: 160px; }
    .featured-card { gap: 0; }
    .featured-body { padding: 16px; }
    .featured-body h2 { font-size: 1.1rem; }
    .section-heading { margin: 24px 0 16px; }
    .section-heading h2 { font-size: 1.05rem; }
    .archive-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .archive-card { padding: 14px; }
    .archive-card-month { font-size: 0.95rem; }
    .trending-thumb { flex: 0 0 50px; width: 50px; height: 50px; }
    .trending-body h3 { font-size: 0.82rem; }
    .share-bar { flex-direction: column; align-items: flex-start; gap: 8px; }
    .share-buttons { gap: 6px; }
    .share-btn { padding: 5px 10px; font-size: 0.75rem; }
    .single-content { font-size: 0.95rem; }
    .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
    .container { padding: 0 12px; }
}

/* ADMIN */
.admin-form { max-width: 640px; margin: 20px auto; }
.admin-form label { display: block; margin-bottom: 4px; font-weight: 600; font-size: 0.9rem; }
.admin-form input, .admin-form textarea, .admin-form select { width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); color: var(--text); margin-bottom: 16px; font-size: 0.95rem; }
.admin-form textarea { min-height: 150px; resize: vertical; }
.admin-form button { padding: 10px 24px; background: var(--accent); color: #fff; border: none; border-radius: var(--radius); cursor: pointer; font-size: 0.95rem; font-weight: 600; }
.admin-form button:hover { background: var(--accent-hover); }
.alert-success { padding: 12px; background: #d1fae5; color: #065f46; border-radius: var(--radius); margin: 12px 0; }
