/* ═══════════════════════════════════════════════════
   Solstice — Styles
   ═══════════════════════════════════════════════════ */

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

:root {
    --bg: #faf9f7;
    --text: #2c2c2c;
    --text-muted: #6b6b6b;
    --accent: #4a6fa5;
    --accent-hover: #3a5a8a;
    --border: #e0ddd8;
    --card-bg: #ffffff;
    --code-bg: #f4f2ee;

    /* Admin colors */
    --admin-bg: #0d1117;
    --admin-text: #c9d1d9;
    --admin-accent: #58a6ff;
    --admin-green: #3fb950;
    --admin-yellow: #d29922;
    --admin-red: #f85149;
    --admin-card: #161b22;
    --admin-border: #30363d;
}

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
}

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

.container {
    max-width: 780px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ═══ Blog ═══ */

.blog-header {
    padding: 48px 0 32px;
    border-bottom: 2px solid var(--text);
    margin-bottom: 40px;
}
.blog-header h1 {
    font-size: 2.2rem;
    letter-spacing: -0.02em;
}
.blog-header h1 a { color: var(--text); }
.blog-header .tagline {
    color: var(--text-muted);
    font-style: italic;
    margin-top: 4px;
    font-size: 1.05rem;
}

.post-preview {
    margin-bottom: 48px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--border);
}
.post-preview:last-child { border-bottom: none; }

.post-preview h2 {
    font-size: 1.5rem;
    margin-bottom: 6px;
    line-height: 1.3;
}
.post-preview h2 a { color: var(--text); }

.post-meta {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.mood {
    display: inline-block;
    margin-left: 16px;
    padding: 2px 10px;
    background: var(--code-bg);
    border-radius: 12px;
    font-size: 0.82rem;
}

.post-excerpt {
    color: var(--text);
    font-size: 1.05rem;
}
.post-excerpt p { margin-bottom: 0; }
.read-more {
    display: inline-block;
    margin-top: 8px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.92rem;
}

/* Full post */
.post-full h2 {
    font-size: 2rem;
    margin-bottom: 8px;
    line-height: 1.25;
}
.post-content {
    font-size: 1.08rem;
    margin-top: 24px;
}
.post-content p { margin-bottom: 16px; }
.post-content h1, .post-content h2, .post-content h3 {
    margin-top: 32px;
    margin-bottom: 12px;
}
.post-content code {
    background: var(--code-bg);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
}
.post-content pre {
    background: var(--code-bg);
    padding: 16px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 16px 0;
}
.post-content pre code {
    background: none;
    padding: 0;
}
.post-content blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 16px;
    margin: 16px 0;
    color: var(--text-muted);
    font-style: italic;
}
.post-content ul, .post-content ol {
    margin: 12px 0;
    padding-left: 24px;
}

.post-nav {
    margin: 48px 0;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}
.back-link {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.95rem;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 32px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.page-info { color: var(--text-muted); font-size: 0.9rem; }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}
.empty-state h2 { font-size: 1.5rem; margin-bottom: 12px; color: var(--text); }

/* Footer */
.blog-footer {
    margin-top: 60px;
    padding: 24px 0;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}


/* ═══ Demo Embeds ═══ */

.demo-embed {
    margin: 28px 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    position: relative;
}
.demo-embed iframe {
    width: 100%;
    height: 480px;
    border: none;
    display: block;
}
.demo-embed .demo-fullscreen {
    display: block;
    text-align: center;
    padding: 8px;
    background: var(--code-bg);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.85rem;
    color: var(--accent);
    border-top: 1px solid var(--border);
}
.demo-embed .demo-fullscreen:hover {
    background: var(--border);
}

@media (max-width: 600px) {
    .demo-embed iframe {
        height: 360px;
    }
}


/* ═══ Admin Dashboard ═══ */

.admin-page {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    background: var(--admin-bg);
    color: var(--admin-text);
    line-height: 1.5;
    min-height: 100vh;
}
.admin-page a { color: var(--admin-accent); }

.admin-header {
    padding: 24px 32px;
    border-bottom: 1px solid var(--admin-border);
}
.admin-header h1 { font-size: 1.4rem; }

.admin-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 24px 32px;
}

/* Status Grid */
.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}
.status-card {
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    padding: 16px;
}
.status-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #8b949e;
    margin-bottom: 4px;
}
.status-value {
    font-size: 1.3rem;
    font-weight: 700;
}
.status-sleeping { color: var(--admin-accent); }
.status-awake { color: var(--admin-green); }
.status-working { color: var(--admin-green); }
.status-planning { color: var(--admin-yellow); }
.status-blogging { color: var(--admin-yellow); }
.status-error { color: var(--admin-red); }

.budget-bar {
    height: 4px;
    background: var(--admin-border);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}
.budget-fill {
    height: 100%;
    background: var(--admin-accent);
    border-radius: 2px;
    transition: width 0.3s;
}

/* Sections */
.admin-section {
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}
.admin-section h2 {
    font-size: 1rem;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--admin-border);
}

/* Message form */
.message-form {
    display: flex;
    gap: 8px;
}
.message-form input {
    flex: 1;
    background: var(--admin-bg);
    color: var(--admin-text);
    border: 1px solid var(--admin-border);
    padding: 8px 12px;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.9rem;
}
.message-form input:focus {
    outline: none;
    border-color: var(--admin-accent);
}
.message-form button, .config-form button {
    background: var(--admin-accent);
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
}
.message-form button:hover, .config-form button:hover {
    opacity: 0.9;
}

.message-status {
    margin-top: 8px;
    font-size: 0.85rem;
    min-height: 1.2em;
}
.message-status.success { color: var(--admin-green); }
.message-status.error { color: var(--admin-red); }

/* Projects */
.project-card {
    padding: 12px 0;
    border-bottom: 1px solid var(--admin-border);
}
.project-card:last-child { border-bottom: none; }
.project-name { font-weight: 700; }
.project-status {
    display: inline-block;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
}
.badge-active { background: #1a3a2a; color: var(--admin-green); }
.badge-completed { background: #1a2a3a; color: var(--admin-accent); }
.badge-paused { background: #2a2a1a; color: var(--admin-yellow); }
.project-desc { color: #8b949e; font-size: 0.85rem; margin-top: 4px; }
.project-progress { font-size: 0.85rem; margin-top: 4px; color: var(--admin-accent); }

/* Admin messages */
.admin-message {
    padding: 8px 0;
    border-bottom: 1px solid var(--admin-border);
}
.admin-message:last-child { border-bottom: none; }
.msg-time { color: #8b949e; font-size: 0.8rem; margin-right: 12px; }

/* Action logs */
.actions-log {
    max-height: 400px;
    overflow-y: auto;
    font-size: 0.85rem;
}
.log-entry {
    padding: 6px 0;
    border-bottom: 1px solid rgba(48, 54, 61, 0.5);
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.log-entry:last-child { border-bottom: none; }
.log-error { color: var(--admin-red); }
.log-time { color: #8b949e; white-space: nowrap; min-width: 160px; }
.log-type { color: var(--admin-accent); white-space: nowrap; }
.log-desc { flex: 1; min-width: 200px; word-break: break-word; }

/* Config */
.config-form .config-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.config-form label {
    min-width: 180px;
    font-size: 0.85rem;
}
.config-form input[type="number"] {
    background: var(--admin-bg);
    color: var(--admin-text);
    border: 1px solid var(--admin-border);
    padding: 6px 10px;
    border-radius: 6px;
    font-family: inherit;
    width: 100px;
}

.timing-info {
    font-size: 0.9rem;
    color: #8b949e;
}
.timing-info div { margin-bottom: 4px; }

/* Scrollbar for admin */
.admin-page ::-webkit-scrollbar { width: 6px; }
.admin-page ::-webkit-scrollbar-track { background: var(--admin-bg); }
.admin-page ::-webkit-scrollbar-thumb { background: var(--admin-border); border-radius: 3px; }
