:root {
    --primary: #0071e3;
    --bg: #f5f5f7;
    --text: #1d1d1f;
    --sub: #86868b;
    --sidebar-w: 260px;
    --card-bg: #ffffff;
    --border: #d2d2d7;
    --hover-bg: #f5f5f7;
    --shadow: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] {
    --primary: #0a84ff;
    --bg: #000000;
    --text: #f5f5f7;
    --sub: #98989d;
    --card-bg: #1c1c1e;
    --border: #38383a;
    --hover-bg: #2c2c2e;
    --shadow: rgba(0, 0, 0, 0.3);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, sans-serif;
    background-color: var(--bg);
    display: flex;
    flex-direction: row;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.sidebar {
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--card-bg);
    position: fixed;
    left: 0;
    top: 0;
    border-right: 1px solid var(--border);
    padding: 40px 20px;
    z-index: 1000;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.sidebar-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-wrapper {
    position: relative;
    margin-bottom: 20px;
}

.status-dot {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 12px;
    height: 12px;
    background: #34c759;
    border: 2px solid var(--card-bg);
    border-radius: 50%;
    transition: border-color 0.3s ease;
}

.site-title {
    color: var(--text);
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.site-description {
    color: var(--sub);
    font-size: 0.9rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    margin-bottom: 5px;
    transition: all 0.3s ease;
}

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

.cydia-icon {
    width: 18px;
    height: 18px;
    border-radius: 4px;
}

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--hover-bg);
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text);
    transition: all 0.3s ease;
    margin-bottom: 15px;
}

.theme-toggle:hover {
    background: var(--border);
    transform: rotate(20deg);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    transition: border-color 0.3s ease;
}

.social-links {
    display: flex;
    gap: 20px;
    font-size: 1.2rem;
}

.social-links a {
    color: var(--sub);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

/* CONTENT AREA */
.content {
    margin-left: var(--sidebar-w);
    padding: 40px;
    width: 100%;
}

.category-nav {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
    overflow-x: auto;
    white-space: nowrap;
    transition: border-color 0.3s ease;
}

.cat-link {
    text-decoration: none;
    color: var(--sub);
    font-weight: 600;
    position: relative;
    padding-bottom: 10px;
    transition: color 0.3s ease;
}

.cat-link.active {
    color: var(--primary);
}

.cat-link.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary);
}

.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
}

.post-card {
    background: var(--card-bg);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 4px 15px var(--shadow);
    transition: all 0.3s ease;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px var(--shadow);
}

.post-thumb {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.post-thumb-container {
    position: relative;
}

.category-tag {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--primary);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.post-info {
    padding: 20px;
}

.post-title {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--text);
    transition: color 0.3s ease;
}

.post-title-link {
    text-decoration: none;
}

.post-excerpt {
    color: var(--sub);
    font-size: 0.9rem;
    margin-bottom: 15px;
    line-height: 1.5;
}

.post-meta {
    color: var(--sub);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 5px;
}


@media (max-width: 768px) {
    body {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 20px;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .sidebar-top {
        display: flex;
        align-items: center;
        gap: 15px;
        justify-content: space-between;
    }

    .sidebar-top-left {
        display: flex;
        align-items: center;
        gap: 15px;
    }

    .avatar {
        width: 50px;
        height: 50px;
    }

    .site-description {
        margin-bottom: 0;
    }

    .theme-toggle {
        margin-bottom: 0;
    }

    .sidebar-nav {
        display: flex;
        overflow-x: auto;
        gap: 10px;
        padding: 15px 0 5px;
        scrollbar-width: none;

    }

    .sidebar-nav::-webkit-scrollbar {
        display: none;
    }

    .nav-item {
        padding: 8px 15px;
        background: var(--hover-bg);
        white-space: nowrap;
    }

    .nav-item span {
        font-size: 0.9rem;
    }

    .sidebar-footer {
        display: none;
    }


    .content {
        margin-left: 0;
        padding: 20px;
    }

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


    .category-nav {
        font-size: 0.9rem;
    }
}

/* Post Content Styles */
.post-content {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 18px;
    box-shadow: 0 4px 15px var(--shadow);
    max-width: 900px;
    margin: 0 auto;
    color: var(--text);
}

.post-content h1 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: var(--text);
}

.post-content h2 {
    font-size: 1.5rem;
    margin-top: 30px;
    margin-bottom: 15px;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    padding-bottom: 5px;
}

.post-content p {
    line-height: 1.7;
    margin-bottom: 15px;
    color: var(--text);
}

.post-content ul,
.post-content ol {
    margin-left: 25px;
    margin-bottom: 15px;
    color: var(--text);
}

.post-content li {
    margin-bottom: 5px;
}

.post-content a {
    color: var(--primary);
    text-decoration: none;
}

.post-content a:hover {
    text-decoration: underline;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
    display: block;
    box-shadow: 0 4px 10px var(--shadow);
}

.post-content pre {
    background: var(--hover-bg);
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.post-content code {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.9em;
    color: var(--text);
}

.post-content .cli {
    background-color: var(--hover-bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.9em;
    color: var(--primary);
}

.post-content .separator {
    width: 100%;
    height: 1px;
    background: var(--border);
    margin: 20px 0;
}

.post-content .center-text {
    text-align: center;
}

[data-theme="dark"] .post-content pre {
    background: #111;
}

.callout {
    background: var(--hover-bg);
    border-left: 4px solid var(--primary);
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 4px;
}

.callout h2 {
    margin-top: 0;
    font-size: 1.2rem;
    padding-bottom: 0;
    border-bottom: none;
}

/* Repo Button Styles */
.repo-btn-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 30px;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.repo-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 25px;
    background: var(--card-bg);
    color: var(--text);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    box-shadow: 0 2px 10px var(--shadow);
    transition: all 0.3s ease;
    border: 1px solid var(--border);
}

.repo-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--shadow);
    border-color: var(--primary);
    color: var(--primary);
}