/* Blog List Styles */
.blog-header {
    text-align: center;
    margin: 2rem 0 3rem 0;
}

.blog-header h1 {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.blog-header p {
    color: #666;
    font-size: 1.1rem;
}

.search-form {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.search-form input[type="text"] {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid #ddd;
    border-radius: 25px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

.search-form input[type="text"]:focus {
    border-color: var(--primary-color);
}

.search-form button {
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
}

.search-form button:hover {
    background: var(--secondary-color);
}

.categories-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 2rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 12px;
}

.filter-label {
    font-weight: 600;
    color: var(--secondary-color);
    margin-right: 0.5rem;
}

.category-btn {
    padding: 0.5rem 1rem;
    background: white;
    color: #555;
    border: 2px solid #ddd;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.category-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.category-btn.active {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

.category-filter {
    text-align: center;
    margin: 2rem 0;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.blog-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

.blog-card-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.blog-card:hover .blog-card-image img {
    transform: scale(1.05);
}

.blog-card-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.blog-card h2 {
    font-size: 1.5rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.blog-card h2 a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.3s;
}

.blog-card h2 a:hover {
    color: var(--primary-color);
}

.blog-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.blog-meta span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.blog-excerpt {
    color: #555;
    margin-bottom: 1rem;
    flex: 1;
    line-height: 1.7;
}

.blog-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.blog-category {
    background: var(--accent-color);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    text-decoration: none;
    transition: background 0.3s;
}

.blog-category:hover {
    background: var(--primary-color);
}

.blog-views {
    color: #999;
    font-size: 0.9rem;
}

.no-posts {
    text-align: center;
    padding: 4rem 2rem;
    color: #666;
}

.no-posts h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

/* Blog Post Styles */
.post-container {
    max-width: 800px;
    margin: 0 auto;
}

.post-header {
    text-align: center;
    margin: 2rem 0 3rem 0;
    padding: 2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.post-header h1 {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
    line-height: 1.3;
}

.post-meta {
    display: flex;
    justify-content: center;
    gap: 2rem;
    color: #666;
    font-size: 0.95rem;
    flex-wrap: wrap;
}

.post-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.post-category {
    background: var(--accent-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    text-decoration: none;
    display: inline-block;
    margin: 1rem 0;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.tag {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background: #f0f0f0;
    color: #666;
    border-radius: 15px;
    font-size: 0.85rem;
    border: 1px solid #ddd;
}

.post-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    line-height: 1.6;
    font-size: 1.1rem;
}

.post-content p {
    white-space: pre-wrap;
    margin-bottom: 1.2rem;
}

/* Force list styles - must come early */
.post-content ul {
    list-style: disc outside !important;
    padding-left: 2.5rem !important;
    margin: 1rem 0 !important;
    display: block !important;
}

.post-content ul li {
    display: list-item !important;
    list-style: disc outside !important;
    margin-bottom: 0.5rem !important;
    margin-left: 0 !important;
}

.post-content ul li::before {
    display: none !important;
}

.post-content ol {
    list-style: decimal outside !important;
    padding-left: 2.5rem !important;
    margin: 1rem 0 !important;
    display: block !important;
}

.post-content ol li {
    display: list-item !important;
    list-style: decimal outside !important;
    margin-bottom: 0.5rem !important;
    margin-left: 0 !important;
}

.post-content ol li::before {
    display: none !important;
}

/* Handle legacy <bc> tags as list items - must target the actual element */
bc {
    display: list-item !important;
    list-style-type: disc !important;
    list-style-position: outside !important;
    margin-left: 2rem !important;
    margin-bottom: 0.5rem !important;
}

.post-content bc {
    display: list-item !important;
    list-style-type: disc !important;
    list-style-position: outside !important;
    margin-left: 2rem !important;
    margin-bottom: 0.5rem !important;
}

.post-content p bc {
    display: list-item !important;
    list-style-type: disc !important;
    list-style-position: outside !important;
    margin-left: 2rem !important;
    margin-bottom: 0.5rem !important;
}

.post-content h2 {
    color: var(--secondary-color);
    margin: 2rem 0 1rem 0;
    font-size: 1.8rem;
}

.post-content h3 {
    color: var(--primary-color);
    margin: 1.5rem 0 0.8rem 0;
    font-size: 1.4rem;
}

.post-content blockquote {
    border-left: 4px solid var(--accent-color);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    color: #555;
    font-style: italic;
}

.post-content code {
    background: #f4f4f4;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

.post-content pre {
    background: #2d2d2d;
    color: #f8f8f8;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.post-content pre code {
    background: none;
    color: inherit;
    padding: 0;
}

.post-actions {
    display: flex;
    justify-content: space-between;
    margin: 2rem 0;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Comments Section */
.comments-section {
    margin-top: 3rem;
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.comments-section h3 {
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

.comment {
    padding: 1rem;
    border-left: 3px solid var(--accent-color);
    background: #f9f9f9;
    margin-bottom: 1rem;
    border-radius: 4px;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #666;
}

.comment-author {
    font-weight: 600;
    color: var(--secondary-color);
}

.comment-content {
    color: #333;
    line-height: 1.6;
}

.comment-form {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
}

.comment-form h4 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #555;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Inline styles replacements for blog post */
.no-comments {
    color: #666;
    font-style: italic;
}

.comment-note {
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
    margin-top: 1rem;
}

/* Responsive Styles for Blog */
@media (max-width: 768px) {
    .blog-grid {
        grid-template-columns: 1fr;
    }

    .blog-header h1 {
        font-size: 2rem;
    }

    .post-header h1 {
        font-size: 1.8rem;
    }

    .post-content {
        padding: 1.5rem;
        font-size: 1rem;
    }

    .comments-section {
        padding: 1.5rem;
    }
}

/* Kavivanar Font - For poems only */
@font-face {
    font-family: 'Kavivanar';
    src: url('/static/fonts/Kavivanar-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Poem Block Styling - using blockquote */
.post-content blockquote {
    font-family: 'Kavivanar', 'TAU Marutham', 'Noto Sans Tamil', serif;
    font-size: 1.2rem;
    line-height: 2;
    padding: 2rem;
    margin: 2rem 0;
    background: linear-gradient(135deg, #fef9f3 0%, #fef5eb 100%);
    border-left: 4px solid var(--accent-color);
    border-radius: 8px;
    color: #2c1810;
    white-space: pre-wrap;
}

.post-content blockquote p {
    margin: 0.5rem 0;
    white-space: pre-wrap;
}

/* Poem Inline Styling - using |text| */
.post-content .poem-inline {
    font-family: 'Kavivanar', 'TAU Marutham', 'Noto Sans Tamil', serif;
    font-size: 1.1rem;
    color: #2c1810;
    display: block;
    line-height: 1.3;
    padding: 0.1rem 0;
    white-space: pre-wrap;
}

/* Optional: Keep .poem class for manual use */
.poem {
    font-family: 'Kavivanar', 'TAU Marutham', 'Noto Sans Tamil', serif;
    font-size: 1.2rem;
    line-height: 2;
    padding: 2rem;
    margin: 2rem 0;
    background: linear-gradient(135deg, #fef9f3 0%, #fef5eb 100%);
    border-left: 4px solid var(--accent-color);
    border-radius: 8px;
    white-space: pre-line;
    color: #2c1810;
}
