/* Public CSS - KnowledgeHub (Clean, Minimalist, High Readability & Súc Tích) */
:root {
    --bg-main: #ffffff;
    --bg-surface: #f9fafb;
    --bg-card: #ffffff;
    --text-main: #111827;
    --text-muted: #6b7280;
    --text-light: #9ca3af;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --border: #e5e7eb;
    --border-light: #f3f4f6;
    --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    --radius: 6px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
}

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-stack);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.75;
    font-size: 17px;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--primary); }

.container {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.site-header {
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}
.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -0.02em;
    color: var(--text-main);
}
.logo-icon { color: var(--primary); font-size: 20px; }

.main-nav {
    display: flex;
    align-items: center;
    gap: 24px;
}
.nav-link {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-muted);
}
.nav-link:hover, .nav-link.active {
    color: var(--text-main);
}

.search-trigger-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px 14px;
    font-size: 14px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
}
.search-trigger-btn:hover {
    border-color: #cbd5e1;
    color: var(--text-main);
    background: #ffffff;
}
.search-hint { font-size: 12px; color: var(--text-light); }

/* Hero Section */
.hero-section {
    padding: 48px 0 36px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 32px;
}
.hero-title {
    font-size: 32px;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.03em;
    color: var(--text-main);
    margin-bottom: 12px;
}
.hero-slogan {
    font-size: 17px;
    color: var(--text-muted);
    max-width: 640px;
    line-height: 1.6;
}

/* Sections & Article Lists */
.home-section {
    margin-bottom: 48px;
}
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 20px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}
.section-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.01em;
}
.view-all {
    font-size: 14px;
    font-weight: 500;
    color: var(--primary);
}

/* Article List (Clean Editorial Style, No bulky colored cards) */
.posts-list {
    display: flex;
    flex-direction: column;
}
.post-item {
    padding: 24px 0;
    border-bottom: 1px solid var(--border-light);
}
.post-item:first-child { padding-top: 8px; }
.post-item-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.post-tag {
    background: var(--bg-surface);
    color: #475569;
    border: 1px solid var(--border);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}
.post-item-title {
    font-size: 21px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}
.post-item-title a { color: var(--text-main); }
.post-item-title a:hover { color: var(--primary); }
.post-item-excerpt {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Categories Grid (Clean, Simple, 2 Columns) */
.categories-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}
.category-box {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: border-color 0.15s ease;
}
.category-box:hover {
    border-color: #94a3b8;
}
.category-box-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.category-box-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
}
.category-box-count {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-surface);
    padding: 2px 8px;
    border-radius: 12px;
}
.category-box-desc {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Single Post Layout */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    margin: 24px 0 16px 0;
}
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--text-main); }
.breadcrumbs .sep { color: var(--text-light); }
.breadcrumbs .current { color: var(--text-main); font-weight: 500; }

.post-header {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}
.post-badge {
    display: inline-block;
    background: #eff6ff;
    color: var(--primary);
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 4px;
    margin-bottom: 12px;
}
.post-title {
    font-size: 34px;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.03em;
    color: var(--text-main);
    margin-bottom: 16px;
}
.post-meta {
    font-size: 14px;
    color: var(--text-muted);
}

/* Table of Contents (TOC) - Minimalist Box */
.toc-box {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 22px;
    margin-bottom: 36px;
}
.toc-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-main);
    margin-bottom: 12px;
}
.toc-list {
    list-style: none;
    font-size: 15px;
}
.toc-list li {
    margin-bottom: 6px;
}
.toc-list a {
    color: var(--text-muted);
}
.toc-list a:hover {
    color: var(--primary);
}

/* Typography & Content Body */
.content-typography {
    font-size: 17px;
    line-height: 1.8;
    color: #1f2937;
}
.content-typography p { margin-bottom: 20px; }
.content-typography .lead {
    font-size: 19px;
    line-height: 1.7;
    color: #374151;
    margin-bottom: 24px;
}
.content-typography h2 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-main);
    margin: 40px 0 16px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}
.content-typography h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-main);
    margin: 32px 0 12px 0;
}
.content-typography ul, .content-typography ol {
    margin: 0 0 20px 24px;
}
.content-typography li { margin-bottom: 8px; }
.content-typography code {
    background: #f1f5f9;
    color: #0f172a;
    font-family: var(--font-mono);
    font-size: 0.9em;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Callout Boxes (Subtle, Clean Pastel, No Harsh Bright Colors) */
.callout {
    border-radius: var(--radius);
    padding: 16px 20px;
    margin: 24px 0;
    border-left: 4px solid;
    font-size: 15px;
    line-height: 1.65;
}
.callout-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    margin-bottom: 6px;
}
.callout-body { color: #334155; }

/* Tip: Subtle Soft Blue */
.callout-tip {
    background: #f0f7ff;
    border-color: #2563eb;
    color: #1e40af;
}
.callout-tip .callout-body { color: #1e3a8a; }

/* Note: Subtle Soft Slate */
.callout-note {
    background: #f8fafc;
    border-color: #64748b;
    color: #334155;
}

/* Important: Subtle Soft Violet */
.callout-important {
    background: #faf5ff;
    border-color: #7c3aed;
    color: #5b21b6;
}

/* Warning: Subtle Soft Amber */
.callout-warning {
    background: #fffbeb;
    border-color: #d97706;
    color: #92400e;
}
.callout-warning .callout-body { color: #78350f; }

/* Example: Subtle Soft Teal */
.callout-example {
    background: #f0fdfa;
    border-color: #0d9488;
    color: #115e59;
}

/* Summary: Subtle Soft Emerald */
.callout-summary {
    background: #f0fdf4;
    border-color: #16a34a;
    color: #166534;
}

/* Quote: Soft Gray */
.callout-quote {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #475569;
    font-style: italic;
}

/* Definition: Soft Indigo */
.callout-definition {
    background: #eef2ff;
    border-color: #4f46e5;
    color: #3730a3;
}

/* Code Blocks */
.code-block {
    position: relative;
    background: #0f172a;
    color: #f8fafc;
    border-radius: var(--radius);
    padding: 16px 20px;
    margin: 24px 0;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.6;
}
.code-block code {
    background: transparent;
    color: inherit;
    padding: 0;
}
.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #334155;
    color: #cbd5e1;
    border: none;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s ease;
}
.copy-btn:hover {
    background: #475569;
    color: #ffffff;
}

/* Floating Action Buttons (Discreet, Clean, Rounded) */
.floating-actions {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 40;
}
.fab-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    color: #4b5563;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: all 0.15s ease;
}
.fab-btn:hover {
    transform: translateY(-2px);
    color: var(--text-main);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}
.fab-facebook:hover { color: #1877f2; border-color: #1877f2; }
.fab-telegram:hover { color: #229ed9; border-color: #229ed9; }
.fab-top { color: #6b7280; }

/* Search Modal */
.search-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 100;
    display: flex;
    justify-content: center;
    padding-top: 100px;
}
.search-modal-backdrop {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(2px);
}
.search-modal-content {
    position: relative;
    background: #ffffff;
    width: 100%;
    max-width: 580px;
    border-radius: var(--radius);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border);
    overflow: hidden;
    margin: 0 16px;
    height: fit-content;
}
.search-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
}
.search-modal-header input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    color: var(--text-main);
}
.search-modal-close {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    color: var(--text-muted);
    cursor: pointer;
}
.search-modal-body {
    max-height: 360px;
    overflow-y: auto;
    padding: 12px 18px;
}
.search-state-msg {
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    padding: 24px 0;
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 36px 0;
    margin-top: 64px;
    font-size: 14px;
    color: var(--text-muted);
}
.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}
.footer-links a { color: var(--text-muted); }
.footer-links a:hover { color: var(--text-main); }

@media (max-width: 640px) {
    .header-inner { height: 56px; }
    .hero-title { font-size: 26px; }
    .post-title { font-size: 26px; }
    .footer-content { flex-direction: column; text-align: center; }
}
