/* LuperIQ CMS — Public Site Styles */

:root {
    --bg: #ffffff;
    --surface: #f8fafc;
    --border: #e2e8f0;
    --text: #1e293b;
    --text-muted: #64748b;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --mono: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', monospace;
    --max-width: 800px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 16px; -webkit-font-smoothing: antialiased; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.site-header {
    background: var(--header-bg, var(--bg));
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.site-header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-logo {
    font-size: 20px;
    font-weight: 700;
    color: var(--header-text, var(--text));
    text-decoration: none;
    letter-spacing: -0.02em;
}

.site-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 15px;
    margin-left: 24px;
}
.site-nav a:hover { color: var(--accent); }
.site-nav a.active { color: var(--text); font-weight: 500; }

/* Main */
.site-main {
    flex: 1;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 48px 24px;
    width: 100%;
}

/* Article */
.page-article h1 {
    font-size: 36px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 24px;
    color: var(--text);
}

.page-content {
    font-size: 17px;
    line-height: 1.8;
    color: #334155;
}

.page-content h2 {
    font-size: 24px;
    font-weight: 600;
    margin: 40px 0 16px;
    color: var(--text);
}

.page-content h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 32px 0 12px;
    color: var(--text);
}

.page-content p {
    margin-bottom: 16px;
}

.page-content a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}
.page-content a:hover {
    color: var(--accent-hover);
}

.page-content ul, .page-content ol {
    margin: 16px 0;
    padding-left: 24px;
}

.page-content li {
    margin-bottom: 8px;
}

.page-content blockquote {
    border-left: 3px solid var(--accent);
    padding: 12px 20px;
    margin: 24px 0;
    background: var(--surface);
    border-radius: 0 6px 6px 0;
    color: var(--text-muted);
    font-style: italic;
}

.page-content pre {
    background: var(--code-bg, #0f172a);
    color: var(--code-text, #e2e8f0);
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 24px 0;
    font-family: var(--mono);
    font-size: 14px;
    line-height: 1.6;
}

.page-content code {
    font-family: var(--mono);
    background: var(--surface);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

.page-content pre code {
    background: transparent;
    padding: 0;
}

.page-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 24px 0;
}

.page-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 40px 0;
}

.page-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
}

.page-content th, .page-content td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.page-content th {
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

/* Blog listing */
.blog-listing h1 {
    font-size: 36px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 32px;
    color: var(--text);
}

.blog-card {
    padding: 24px 0;
    border-bottom: 1px solid var(--border);
}

.blog-card:last-child { border-bottom: none; }

.blog-card h2 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 4px;
}

.blog-card h2 a {
    color: var(--text);
    text-decoration: none;
}
.blog-card h2 a:hover { color: var(--accent); }

.blog-date {
    font-size: 13px;
    color: var(--text-muted);
    display: block;
    margin-bottom: 8px;
}

.blog-excerpt {
    color: #475569;
    line-height: 1.6;
}

.blog-empty {
    color: var(--text-muted);
    padding: 40px 0;
    text-align: center;
}

.blog-post-date {
    font-size: 14px;
    color: var(--text-muted);
    display: block;
    margin-bottom: 32px;
}

.blog-post-nav {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.blog-post-nav a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}
.blog-post-nav a:hover { text-decoration: underline; }

/* 404 */
.error-page {
    text-align: center;
    padding: 80px 20px;
}

.error-page h1 {
    font-size: 72px;
    color: var(--border);
    margin-bottom: 8px;
}

.error-subtitle {
    font-size: 22px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.error-detail {
    color: var(--text-muted);
    font-size: 15px;
    margin-bottom: 24px;
}

.error-detail code {
    font-family: var(--mono);
    background: var(--surface);
    padding: 2px 8px;
    border-radius: 4px;
}

.btn-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}
.btn-link:hover { text-decoration: underline; }

/* Footer */
.site-footer {
    border-top: 1px solid var(--border);
    background: var(--footer-bg, var(--surface));
}

.site-footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 24px;
    text-align: center;
    color: var(--footer-text, var(--text-muted));
    font-size: 13px;
}

/* Products */
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; padding: 20px 0; }
.product-card { background: var(--luperiq-surface, #fff); border: 1px solid var(--luperiq-border, #e2e8f0); border-radius: 8px; padding: 20px; transition: box-shadow 0.2s; }
.product-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.product-card h2 { font-size: 1.1rem; margin: 12px 0 8px; }
.product-card h2 a { color: inherit; text-decoration: none; }
.product-card h2 a:hover { color: var(--luperiq-primary, #3b82f6); }
.product-card-image { width: 100%; height: 180px; object-fit: cover; border-radius: 6px; }
.product-card-desc { color: var(--luperiq-muted, #64748b); font-size: 0.9rem; margin: 8px 0; }
.product-card-price { font-size: 1.25rem; font-weight: 700; color: var(--luperiq-primary, #3b82f6); }
.product-cat-badge { display: inline-block; background: var(--luperiq-primary, #3b82f6); color: #fff; font-size: 0.75rem; padding: 2px 8px; border-radius: 12px; margin: 4px 4px 0 0; }
.product-single { max-width: 800px; margin: 0 auto; padding: 20px; }
.product-single-image { width: 100%; max-height: 400px; object-fit: cover; border-radius: 8px; margin-bottom: 20px; }
.product-single-price { font-size: 1.5rem; font-weight: 700; color: var(--luperiq-primary, #3b82f6); margin: 16px 0; }
.product-description { line-height: 1.7; }

/* Responsive */
@media (max-width: 640px) {
    .page-article h1 { font-size: 28px; }
    .page-content { font-size: 16px; }
    .site-main { padding: 32px 16px; }
    .site-header-inner { padding: 12px 16px; }
    .site-nav a { margin-left: 16px; font-size: 14px; }
}
