/* Blog Public CSS */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --text: #1e293b;
    --text-light: #64748b;
    --bg: #f8fafc;
    --white: #ffffff;
    --border: #e2e8f0;
    --max-width: 1200px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
}

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

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

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

/* Header */
.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
}

.site-branding {
    flex-shrink: 0;
}

.site-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.site-logo img {
    max-height: 50px;
    width: auto;
}

.site-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
}

.site-logo:hover .site-title {
    color: var(--primary);
}

.site-tagline {
    font-size: 14px;
    color: var(--text-light);
    margin-top: 2px;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-menu a {
    color: var(--text);
    font-weight: 500;
}

.nav-menu a:hover {
    color: var(--primary);
}

.header-search {
    display: flex;
    gap: 5px;
}

.header-search input {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 5px;
    width: 150px;
}

.header-search button {
    padding: 8px 15px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.header-search button:hover {
    background: var(--primary-dark);
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 2px;
    background: var(--text);
    transition: all 0.3s;
}

/* Main Content */
.site-main {
    padding: 40px 0;
    min-height: calc(100vh - 200px);
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
}

/* Post Cards */
.posts-list {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.post-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

.post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.post-thumbnail {
    display: block;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.post-card:hover .post-thumbnail img {
    transform: scale(1.05);
}

.post-content {
    padding: 25px;
}

.post-category {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 10px;
}

.post-title {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 12px;
}

.post-title a {
    color: var(--text);
}

.post-title a:hover {
    color: var(--primary);
}

.post-excerpt {
    color: var(--text-light);
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.post-meta span + span::before {
    content: "•";
    margin: 0 8px;
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.widget {
    background: var(--white);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.widget-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary);
}

.category-list {
    list-style: none;
}

.category-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.category-list li:last-child {
    border-bottom: none;
}

.category-list a {
    display: flex;
    justify-content: space-between;
    color: var(--text);
}

.category-list a:hover {
    color: var(--primary);
}

.category-list span {
    color: var(--text-light);
    font-size: 14px;
}

.popular-posts {
    list-style: none;
}

.popular-posts li {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.popular-posts li:last-child {
    border-bottom: none;
}

.popular-posts a {
    display: block;
    color: var(--text);
    font-weight: 500;
    margin-bottom: 5px;
}

.popular-posts a:hover {
    color: var(--primary);
}

.popular-posts .views {
    font-size: 12px;
    color: var(--text-light);
}

/* Single Post */
.single-post {
    max-width: 800px;
    margin: 0 auto;
}

.post-header {
    text-align: center;
    margin-bottom: 30px;
}

.post-header .post-title {
    font-size: 36px;
    margin-bottom: 20px;
}

.post-featured-image {
    margin-bottom: 30px;
    border-radius: 12px;
    overflow: hidden;
}

.post-featured-image img {
    width: 100%;
    display: block;
}

.post-body {
    background: var(--white);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.post-body h2,
.post-body h3,
.post-body h4 {
    margin: 30px 0 15px;
}

.post-body p {
    margin-bottom: 20px;
}

.post-body img {
    border-radius: 8px;
    margin: 20px 0;
}

.post-body ul,
.post-body ol {
    margin: 20px 0;
    padding-left: 30px;
}

.post-body blockquote {
    border-left: 4px solid var(--primary);
    padding: 20px;
    margin: 20px 0;
    background: var(--bg);
    border-radius: 0 8px 8px 0;
    font-style: italic;
}

.post-body pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 20px 0;
}

.post-body code {
    background: var(--bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Consolas', monospace;
}

.post-body pre code {
    background: none;
    padding: 0;
}

/* Related Posts */
.related-posts {
    margin-top: 50px;
}

.related-posts h3 {
    font-size: 24px;
    margin-bottom: 25px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.related-card {
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.related-card img {
    width: 100%;
    aspect-ratio: 16/10;
    object-fit: cover;
}

.related-card h4 {
    padding: 15px;
    font-size: 16px;
}

.related-card h4 a {
    color: var(--text);
}

.related-card h4 a:hover {
    color: var(--primary);
}

/* Category Page */
.page-header {
    text-align: center;
    padding: 40px 0;
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 36px;
    margin-bottom: 10px;
}

.page-header p {
    color: var(--text-light);
    font-size: 18px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.pagination ul {
    display: flex;
    list-style: none;
    gap: 8px;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 15px;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-weight: 500;
}

.pagination a:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

.pagination .current {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

/* Footer */
.site-footer {
    background: var(--text);
    color: var(--white);
    padding: 50px 0 20px;
    margin-top: 50px;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    margin-bottom: 30px;
}

.footer-info h4,
.footer-links h4 {
    font-size: 18px;
    margin-bottom: 15px;
}

.footer-info p {
    color: #94a3b8;
}

.social-links {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #334155;
    color: #fff;
    border-radius: 50%;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s;
}

.social-link:hover {
    transform: translateY(-2px);
}

.social-facebook:hover { background: #1877f2; }
.social-twitter:hover { background: #1da1f2; }
.social-instagram:hover { background: #e4405f; }
.social-youtube:hover { background: #ff0000; }
.social-tiktok:hover { background: #000; }
.social-linkedin:hover { background: #0077b5; }
.social-github:hover { background: #333; }

.footer-links ul {
    list-style: none;
}

.footer-links a {
    color: #94a3b8;
    display: block;
    padding: 5px 0;
}

.footer-links a:hover {
    color: var(--white);
}

.footer-bottom {
    padding-top: 20px;
    border-top: 1px solid #334155;
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
}

/* No posts */
.no-posts {
    text-align: center;
    padding: 60px 20px;
    background: var(--white);
    border-radius: 12px;
}

.no-posts h2 {
    margin-bottom: 10px;
}

.no-posts p {
    color: var(--text-light);
}

/* Responsive */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header-inner {
        flex-wrap: wrap;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .nav-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        padding: 20px 0;
        gap: 15px;
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .sidebar {
        grid-template-columns: 1fr;
    }
    
    .post-header .post-title {
        font-size: 28px;
    }
    
    .post-body {
        padding: 25px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .page-header h1 {
        font-size: 28px;
    }
}

/* Print styles */
@media print {
    .site-header,
    .site-footer,
    .sidebar,
    .pagination {
        display: none;
    }
    
    .main-content {
        display: block;
    }
    
    .post-body {
        box-shadow: none;
        padding: 0;
    }
}
