/* BlogCMS — Style bloga (publiczny frontend) */

/* === CSS Variables — zmien kolory per klient === */
:root {
    --primary: #4A90D9;
    --text: #1a1a1a;
    --text-light: #666;
    --border: #e5e5e5;
    --bg: #fff;
    --bg-alt: #f9fafb;
    --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Georgia, serif;
    --font-heading: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --max-width: 780px;
    --max-width-post: 720px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
}

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: var(--max-width-post); margin: 0 auto; padding: 0 20px; }

/* Header */
.blog-header {
    border-bottom: 1px solid var(--border);
    padding: 24px 0;
    margin-bottom: 40px;
}
.blog-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.blog-title { font-size: 20px; color: var(--text); text-decoration: none; }
.blog-title:hover { color: var(--primary); }
.home-link { color: var(--text-light); text-decoration: none; font-size: 14px; }
.home-link:hover { color: var(--primary); }

/* Search */
.search-form {
    margin-bottom: 32px;
}
.search-input {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 15px;
    font-family: var(--font-body);
}
.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74,144,217,0.1);
}
.search-info {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 20px;
}

/* Posts list */
.post-card {
    padding: 32px 0;
    border-bottom: 1px solid var(--border);
}
.post-card:first-child { padding-top: 0; }
.post-card:last-child { border-bottom: none; }

.post-card h2 { font-size: 24px; margin-bottom: 8px; font-family: var(--font-heading); }
.post-card h2 a { color: var(--text); text-decoration: none; }
.post-card h2 a:hover { color: var(--primary); }

.post-meta {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 12px;
}

.post-excerpt {
    color: #444;
    font-size: 16px;
}

.post-image {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 16px;
    object-fit: cover;
    max-height: 300px;
}

.read-more {
    display: inline-block;
    margin-top: 12px;
    color: var(--primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}
.read-more:hover { text-decoration: underline; }

/* Article */
.article-header { margin-bottom: 32px; }
.article-header h1 {
    font-size: 32px;
    line-height: 1.3;
    margin-bottom: 12px;
    font-family: var(--font-heading);
}
.article-meta { color: var(--text-light); font-size: 14px; }

.featured-image {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 32px;
    object-fit: cover;
    max-height: 400px;
}

/* Post content typography */
.post-content { font-size: 17px; }
.post-content h2 { font-size: 24px; margin: 32px 0 12px; font-family: var(--font-heading); }
.post-content h3 { font-size: 20px; margin: 28px 0 10px; font-family: var(--font-heading); }
.post-content p { margin-bottom: 16px; }
.post-content ul, .post-content ol { margin: 16px 0; padding-left: 24px; }
.post-content li { margin-bottom: 6px; }
.post-content blockquote {
    border-left: 3px solid var(--primary);
    padding: 12px 20px;
    margin: 20px 0;
    color: #555;
    background: #f8f9fa;
    border-radius: 0 6px 6px 0;
}
.post-content pre {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 16px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 16px 0;
    font-size: 14px;
    line-height: 1.5;
}
.post-content code {
    background: #f1f1f1;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
}
.post-content pre code { background: none; padding: 0; }
.post-content img { max-width: 100%; border-radius: 6px; }
.post-content a { color: var(--primary); }
.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}
.post-content th, .post-content td {
    padding: 10px;
    border: 1px solid var(--border);
    text-align: left;
}
.post-content th { background: #f8f9fa; }

/* Back link */
.back-to-blog {
    display: inline-block;
    margin-top: 40px;
    padding: 10px 20px;
    color: var(--primary);
    text-decoration: none;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
}
.back-to-blog:hover { background: #f8f9fa; }

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    padding: 40px 0;
}
.page-link {
    padding: 8px 14px;
    border-radius: 6px;
    text-decoration: none;
    color: var(--text);
    font-size: 14px;
}
.page-link:hover { background: var(--bg-alt); }
.page-link.active { background: var(--primary); color: #fff; }

/* Empty */
.empty { text-align: center; padding: 60px 20px; color: var(--text-light); }

/* 404 */
.not-found { text-align: center; padding: 60px 20px; }
.not-found h1 { font-size: 48px; color: var(--text-light); margin-bottom: 8px; }
.not-found p { color: var(--text-light); margin-bottom: 20px; }

/* Draft preview banner */
.preview-banner {
    background: #fefce8;
    color: #a16207;
    padding: 12px 20px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    border-bottom: 1px solid #fde68a;
}

/* Footer */
.blog-footer {
    border-top: 1px solid var(--border);
    padding: 20px 0;
    text-align: center;
    color: var(--text-light);
    font-size: 13px;
    margin-top: 60px;
}
.blog-footer a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
}
.blog-footer a:hover { color: var(--primary); }

/* Breadcrumb */
.breadcrumb {
    font-size: 13px;
    color: var(--text-light);
    margin: 24px 0 16px;
    line-height: 1.6;
}
.breadcrumb a {
    color: var(--text-light);
    text-decoration: none;
}
.breadcrumb a:hover { color: var(--primary); text-decoration: underline; }
.breadcrumb .sep { margin: 0 6px; opacity: 0.5; }
.breadcrumb [aria-current="page"] { color: var(--text); font-weight: 500; }

/* Category chips */
.category-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}
.category-chip {
    display: inline-block;
    padding: 4px 12px;
    background: #f1f5f9;
    color: #475569;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid transparent;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.category-chip:hover {
    background: #e2e8f0;
    color: #1e293b;
}
.category-chip.active {
    background: var(--primary, #2563eb);
    color: #fff;
}

/* Category navigation on blog index */
.category-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0 24px;
}
