/* Blog Frontend Styles */

:root {
    --blog-primary: #2563EB;
    --blog-primary-dark: #1E40AF;
    --blog-text: #1F2937;
    --blog-text-light: #6B7280;
    --blog-bg: #FFFFFF;
    --blog-bg-light: #F9FAFB;
    --blog-border: #E5E7EB;
    --blog-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --blog-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --blog-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --blog-radius: 8px;
    --blog-spacing: 1rem;
}

/* Header */
.blog-header {
    background: var(--blog-bg);
    border-bottom: 1px solid var(--blog-border);
    padding: var(--blog-spacing) 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--blog-shadow);
}

.blog-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.blog-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--blog-primary);
    text-decoration: none;
}

.blog-menu {
    display: flex;
    gap: 2rem;
}

.blog-menu a {
    color: var(--blog-text);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.blog-menu a:hover {
    color: var(--blog-primary);
}

/* Main Layout */
.blog-main {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

.blog-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
}

.blog-content {
    min-width: 0;
}

/* Post Card */
.post-card {
    background: var(--blog-bg);
    border: 1px solid var(--blog-border);
    border-radius: var(--blog-radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--blog-shadow);
    transition: box-shadow 0.2s;
}

.post-card:hover {
    box-shadow: var(--blog-shadow-md);
}

.post-image {
    margin-bottom: 1rem;
    border-radius: var(--blog-radius);
    overflow: hidden;
}

.post-image img {
    width: 100%;
    height: auto;
    display: block;
}

.post-title {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.post-title a {
    color: var(--blog-text);
    text-decoration: none;
    transition: color 0.2s;
}

.post-title a:hover {
    color: var(--blog-primary);
}

.post-meta {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--blog-text-light);
    flex-wrap: wrap;
}

.post-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.post-meta svg {
    width: 16px;
    height: 16px;
}

.post-excerpt {
    color: var(--blog-text-light);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.post-taxonomy {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.post-categories,
.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.category-tag {
    background: var(--blog-primary);
    color: white !important;
    padding: 0.375rem 0.875rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    display: inline-block;
    border: 1px solid var(--blog-primary);
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.2);
}

.category-tag:hover {
    background: var(--blog-primary-dark);
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

.tag-link {
    color: var(--blog-primary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.tag-link:hover {
    color: var(--blog-primary-dark);
    text-decoration: underline;
}

.post-footer {
    margin-top: 1rem;
}

.read-more {
    color: var(--blog-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.read-more:hover {
    color: var(--blog-primary-dark);
}

/* Single Post */
.single-post {
    background: var(--blog-bg);
    border: 1px solid var(--blog-border);
    border-radius: var(--blog-radius);
    padding: 2rem;
    margin-bottom: 2rem;
}

.post-header {
    margin-bottom: 3rem;
    text-align: center;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--blog-border);
}

/* Remove top category badge, display in meta row instead */
.post-category-badge {
    display: none;
}

.post-header .post-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    color: var(--blog-text);
    letter-spacing: -0.02em;
}

.post-header .post-meta {
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 0.9375rem;
    gap: 2rem;
    flex-wrap: wrap;
}

.post-category-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.category-link-inline {
    display: inline-block;
    color: var(--blog-primary);
    text-decoration: none;
    font-size: 0.9375rem;
    padding: 0.25rem 0.75rem;
    background: var(--blog-bg-light);
    border-radius: 15px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    font-weight: 500;
}

.category-link-inline:hover {
    background: var(--blog-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
    border-color: var(--blog-primary);
}

.post-header .post-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--blog-bg-light);
    border-radius: 20px;
    transition: all 0.3s ease;
}

.post-header .post-meta span:hover {
    background: var(--blog-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.2);
}

.post-header .post-meta svg {
    width: 18px;
    height: 18px;
}

/* Tags Section Styles */
.post-tags-section {
    margin: 3rem 0;
    padding: 0;
}

.post-tags-container {
    background: var(--blog-bg-light);
    border: 1px solid var(--blog-border);
    border-radius: var(--blog-radius);
    padding: 1.5rem;
    box-shadow: var(--blog-shadow);
}

.post-tags-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--blog-text);
    margin: 0 0 1rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--blog-border);
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.tag-link {
    display: inline-block;
    color: var(--blog-primary);
    text-decoration: none;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid var(--blog-primary);
    border-radius: 20px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.tag-link:hover {
    background: var(--blog-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
    border-color: var(--blog-primary);
}

.post-featured-image {
    margin-bottom: 2rem;
    border-radius: var(--blog-radius);
    overflow: hidden;
}

.post-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

.post-content {
    line-height: 1.8;
    color: var(--blog-text);
    margin-bottom: 2rem;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
    margin-top: 1.5em;
    margin-bottom: 0.75em;
    font-weight: 600;
    line-height: 1.3;
    color: var(--blog-text);
}

.post-content h1 {
    font-size: 2rem;
}

.post-content h2 {
    font-size: 1.75rem;
}

.post-content h3 {
    font-size: 1.5rem;
}

.post-content h4 {
    font-size: 1.25rem;
}

.post-content h5 {
    font-size: 1.125rem;
}

.post-content h6 {
    font-size: 1rem;
}

.post-content p {
    margin-bottom: 1rem;
}

.post-content ul,
.post-content ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.post-content li {
    margin-bottom: 0.5rem;
}

.post-content ul {
    list-style-type: disc;
}

.post-content ol {
    list-style-type: decimal;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    border: 1px solid var(--blog-border);
}

.post-content th,
.post-content td {
    padding: 0.75rem;
    text-align: left;
    border: 1px solid var(--blog-border);
}

.post-content th {
    background-color: var(--blog-bg-light);
    font-weight: 600;
}

.post-content tr:nth-child(even) {
    background-color: var(--blog-bg-light);
}

.post-content strong {
    font-weight: 600;
}

.post-content em {
    font-style: italic;
}

.post-content a {
    color: var(--blog-primary);
    text-decoration: underline;
}

.post-content a:hover {
    color: var(--blog-primary-dark);
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--blog-radius);
    margin: 1rem 0;
}

.post-content blockquote {
    border-left: 4px solid var(--blog-primary);
    padding-left: 1rem;
    margin: 1.5rem 0;
    color: var(--blog-text-light);
    font-style: italic;
}

.post-content code {
    background-color: var(--blog-bg-light);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.post-content pre {
    background-color: var(--blog-bg-light);
    padding: 1rem;
    border-radius: var(--blog-radius);
    overflow-x: auto;
    margin: 1.5rem 0;
}

.post-content pre code {
    background-color: transparent;
    padding: 0;
}

.post-content hr {
    border: none;
    border-top: 1px solid var(--blog-border);
    margin: 2rem 0;
}

.post-share {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--blog-border);
}

.post-share a {
    color: var(--blog-primary);
    text-decoration: none;
    transition: color 0.2s;
}

.post-share a:hover {
    color: var(--blog-primary-dark);
}

/* Sidebar */
.blog-sidebar {
    position: sticky;
    top: 80px;
    height: fit-content;
}

.sidebar-widget {
    background: var(--blog-bg);
    border: 1px solid var(--blog-border);
    border-radius: var(--blog-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--blog-shadow);
}

.widget-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--blog-text);
}

.search-form {
    display: flex;
    gap: 0.5rem;
}

.search-form input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--blog-border);
    border-radius: var(--blog-radius);
    font-size: 0.875rem;
}

.search-form button {
    padding: 0.5rem 1rem;
    background: var(--blog-primary);
    color: white;
    border: none;
    border-radius: var(--blog-radius);
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.search-form button:hover {
    background: var(--blog-primary-dark);
}

.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-list li {
    margin-bottom: 0.5rem;
}

.category-list a {
    color: var(--blog-text);
    text-decoration: none;
    display: flex;
    justify-content: space-between;
    transition: color 0.2s;
}

.category-list a:hover {
    color: var(--blog-primary);
}

.category-list .count {
    color: var(--blog-text-light);
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-item {
    background: var(--blog-bg-light);
    color: var(--blog-text);
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.875rem;
    transition: background 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.tag-item:hover {
    background: var(--blog-border);
}

.tag-item.active {
    background: var(--blog-primary);
    color: white;
}

.tag-item .count {
    font-size: 0.75rem;
    opacity: 0.7;
}

.popular-posts,
.recent-comments {
    list-style: none;
    padding: 0;
    margin: 0;
}

.popular-posts li,
.recent-comments li {
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--blog-border);
}

.popular-posts li:last-child,
.recent-comments li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.popular-posts a,
.recent-comments a {
    color: var(--blog-text);
    text-decoration: none;
    display: block;
    margin-bottom: 0.25rem;
    transition: color 0.2s;
}

.popular-posts a:hover,
.recent-comments a:hover {
    color: var(--blog-primary);
}

.popular-posts .views,
.recent-comments .views {
    font-size: 0.75rem;
    color: var(--blog-text-light);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.page-link {
    padding: 0.5rem 1rem;
    border: 1px solid var(--blog-border);
    border-radius: var(--blog-radius);
    text-decoration: none;
    color: var(--blog-primary);
    background: var(--blog-bg);
    font-weight: 500;
    transition: all 0.2s;
}

.page-link:hover {
    background: var(--blog-primary);
    color: white;
    border-color: var(--blog-primary);
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.page-link.active {
    background: var(--blog-primary);
    color: white;
    border-color: var(--blog-primary);
    font-weight: 600;
}

/* Breadcrumb Navigation */
.breadcrumb {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
}

.breadcrumb a {
    color: var(--blog-primary);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: var(--blog-primary-dark);
    text-decoration: underline;
}

.breadcrumb span {
    color: var(--blog-text-light);
}

/* Comments */
.comments-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--blog-border);
}

.comment-item {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--blog-bg-light);
    border-radius: var(--blog-radius);
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.comment-author {
    font-weight: 600;
    color: var(--blog-text);
}

.comment-date {
    color: var(--blog-text-light);
    font-size: 0.875rem;
}

.comment-content {
    color: var(--blog-text);
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.comment-actions {
    margin-top: 0.5rem;
}

.reply-btn {
    background: none;
    border: none;
    color: var(--blog-primary);
    cursor: pointer;
    font-size: 0.875rem;
    padding: 0;
    text-decoration: underline;
}

.reply-btn:hover {
    color: var(--blog-primary-dark);
}

.comment-form-container {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--blog-bg-light);
    border-radius: var(--blog-radius);
}

.comment-form .form-group {
    margin-bottom: 1rem;
}

.comment-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--blog-text);
}

.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--blog-border);
    border-radius: var(--blog-radius);
    font-size: 0.875rem;
    font-family: inherit;
}

.comment-form textarea {
    resize: vertical;
}

.btn-submit {
    background: var(--blog-primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--blog-radius);
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-submit:hover {
    background: var(--blog-primary-dark);
}

.comment-message {
    padding: 1rem;
    border-radius: var(--blog-radius);
    margin-bottom: 1rem;
}

.comment-message.success {
    background: #D1FAE5;
    color: #065F46;
}

.comment-message.error {
    background: #FEE2E2;
    color: #991B1B;
}

/* Related Posts */
.related-posts {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--blog-border);
}

.related-posts h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.related-post-card {
    padding: 1rem;
    background: var(--blog-bg-light);
    border-radius: var(--blog-radius);
    border: 1px solid var(--blog-border);
}

.related-post-card h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.related-post-card a {
    color: var(--blog-text);
    text-decoration: none;
    transition: color 0.2s;
}

.related-post-card a:hover {
    color: var(--blog-primary);
}

.related-post-meta {
    font-size: 0.875rem;
    color: var(--blog-text-light);
}

/* Footer */
.blog-footer {
    background: var(--blog-bg);
    border-top: 1px solid var(--blog-border);
    padding: 2rem 0;
    text-align: center;
    color: var(--blog-text-light);
    margin-top: 3rem;
}

/* No Posts */
.no-posts {
    text-align: center;
    padding: 3rem;
    color: var(--blog-text-light);
}

/* Category/Tag Header */
.category-header,
.tag-header,
.search-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--blog-border);
}

.category-header h1,
.tag-header h1,
.search-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.category-description,
.tag-description {
    color: var(--blog-text-light);
    margin-bottom: 0.5rem;
}

.category-count,
.tag-count,
.search-count {
    color: var(--blog-text-light);
    font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 768px) {
    .blog-layout {
        grid-template-columns: 1fr;
    }
    
    .blog-sidebar {
        position: static;
    }
    
    .blog-menu {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .post-meta {
        font-size: 0.75rem;
    }
    
    .related-posts-grid {
        grid-template-columns: 1fr;
    }
    
    .comment-item {
        margin-left: 0 !important;
    }
}

/* Search Highlight */
mark {
    background: #FEF3C7;
    padding: 0.125rem 0.25rem;
    border-radius: 3px;
}

