/* Blog Specific Styles */

/* Reader Recommendations Section */
.reader-recommendations-section {
    padding: 3rem 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    margin: 2rem 0;
}

.reader-recommendations-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: #333;
    text-align: center;
}

.reader-recommendations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
}

.recommendation-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border-left: 4px solid #667eea;
}

.recommendation-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.rec-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
}

.rec-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.rec-title a:hover {
    color: #667eea;
}

.rec-reason {
    color: #666;
    font-size: 0.9rem;
    margin: 0;
    font-style: italic;
}

/* Search Box */
.search-container {
    max-width: 600px;
    margin: 0 auto 3rem;
    text-align: center;
}

.search-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.search-input {
    flex: 1;
    padding: 0.75rem 1.25rem;
    border: 2px solid #e0e0e0;
    border-radius: 30px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--purple-light);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-button {
    padding: 0 1.25rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 30px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.clear-search {
    padding: 0.75rem 1.25rem;
    background: #f0f0f0;
    color: #666;
    text-decoration: none;
    border-radius: 30px;
    transition: all 0.3s ease;
}

.clear-search:hover {
    background: #e0e0e0;
    color: #333;
}

.search-results-count {
    color: #666;
    font-style: italic;
}

/* Category Filter */
.search-filter-container {
    margin-bottom: 3rem;
}

.category-filter {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.category-link {
    padding: 0.5rem 1.25rem;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    color: var(--text-dark);
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
}

.category-link:hover {
    border-color: var(--purple-light);
    color: var(--purple-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.category-link.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

/* Blog header with gradient */
.page-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 5rem 0;
    position: relative;
    overflow: hidden;
}

/* Crumpled paper texture overlay */
.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='200' height='200' xmlns='http://www.w3.org/2000/svg'%3E%3Cg opacity='0.15'%3E%3Cpath d='M20 0 L40 200' stroke='rgba(255,255,255,0.3)' stroke-width='1'/%3E%3Cpath d='M60 0 L80 200' stroke='rgba(0,0,0,0.2)' stroke-width='1'/%3E%3Cpath d='M0 50 L200 70' stroke='rgba(255,255,255,0.3)' stroke-width='1'/%3E%3Cpath d='M0 120 L200 100' stroke='rgba(0,0,0,0.2)' stroke-width='1'/%3E%3Cpath d='M100 0 Q120 100 140 200' stroke='rgba(255,255,255,0.2)' stroke-width='1' fill='none'/%3E%3Cpath d='M160 0 Q140 100 180 200' stroke='rgba(0,0,0,0.15)' stroke-width='1' fill='none'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 400px 400px;
    opacity: 0.7;
}

.page-header .container {
    position: relative;
    z-index: 1;
}

.page-header h1 {
    color: white;
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.page-header p {
    color: rgba(255,255,255,0.9);
    font-size: 1.25rem;
}

.blog-main {
    padding: 4rem 0;
    background: var(--bg-light);
    position: relative;
}

/* Subtle crumpled paper background */
.blog-main::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='200' height='200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='paper2'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.02' numOctaves='4' result='noise' seed='5'/%3E%3CfeDiffuseLighting in='noise' lighting-color='white' surfaceScale='0.5'%3E%3CfeDistantLight azimuth='100' elevation='60'/%3E%3C/feDiffuseLighting%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23paper2)' opacity='0.03'/%3E%3C/svg%3E");
    background-size: 400px 400px;
    pointer-events: none;
}

.blog-main .container {
    position: relative;
    z-index: 1;
}

/* Pinned Post Styles */
.blog-post.pinned {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 3rem;
    overflow: hidden;
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    position: relative;
    border: 2px solid var(--gradient-1);
}

.pinned-label {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--gradient-1);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    z-index: 10;
}

/* Blog Grid */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

/* Blog Post Card */
.blog-post {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

.blog-post:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

/* Post Image */
.post-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: var(--gradient-2);
}

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

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

/* Featured Image in Blog Post */
.featured-image {
    margin-bottom: 2rem;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.featured-image img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: cover;
    display: block;
}

/* Post Content */
.post-content {
    padding: 1.5rem;
}

.post-title {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

/* Post Meta */
.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.post-date {
    color: #666;
}

.post-tags {
    display: flex;
    gap: 0.5rem;
}

.tag {
    background: rgba(102, 126, 234, 0.1);
    color: var(--purple-dark);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.75rem;
    transition: all 0.3s ease;
}

.tag:hover {
    background: var(--gradient-1);
    color: white;
}

/* Post Excerpt */
.post-excerpt {
    color: var(--text-dark);
    line-height: 1.6;
}

.post-excerpt p {
    margin-bottom: 1rem;
}

.read-more {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: transform 0.3s ease;
    display: inline-block;
}

.read-more:hover {
    transform: translateX(5px);
}

/* Post Footer Meta */
.post-footer-meta {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.post-category {
    font-size: 0.875rem;
}

.category-link-inline {
    color: var(--purple-dark);
    text-decoration: none;
    padding: 0.25rem 0.75rem;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 15px;
    transition: all 0.3s ease;
}

.category-link-inline:hover {
    background: rgba(102, 126, 234, 0.2);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 4rem;
}

.page-link {
    padding: 0.5rem 1rem;
    background: white;
    color: var(--text-dark);
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s ease;
    border: 1px solid #e0e0e0;
}

.page-link:hover,
.page-link.active {
    background: var(--gradient-1);
    color: white;
    border-color: transparent;
}

/* Blog Post Full Page Styles */
.blog-post-full {
    background: white;
}

.post-body {
    padding: 3rem 0;
}

.post-body .container {
    max-width: 800px;
    margin: 0 auto;
}

/* Prose content styling */
.post-content.prose {
    font-size: 1.125rem;  /* Increased from 1rem */
    line-height: 1.8;
    color: #333;
}

.post-content.prose p {
    margin-bottom: 1.5rem;
}

.post-content.prose h1,
.post-content.prose h2,
.post-content.prose h3,
.post-content.prose h4,
.post-content.prose h5,
.post-content.prose h6 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
    line-height: 1.3;
}

.post-content.prose h1 {
    font-size: 2.25rem;
    margin-top: 3rem;
}

.post-content.prose h2 {
    font-size: 1.875rem;
    margin-top: 2.5rem;
}

.post-content.prose h3 {
    font-size: 1.5rem;
}

.post-content.prose h4 {
    font-size: 1.25rem;
}

/* First heading after content start needs less margin */
.post-content.prose > h1:first-child,
.post-content.prose > h2:first-child,
.post-content.prose > h3:first-child {
    margin-top: 0;
}

/* Lists */
.post-content.prose ul,
.post-content.prose ol {
    margin-bottom: 1.5rem;
    margin-left: 2rem;
    padding-left: 1.5rem;
}

.post-content.prose li {
    margin-bottom: 0.5rem;
    line-height: 1.8;
}

/* Nested lists */
.post-content.prose ul ul,
.post-content.prose ol ol,
.post-content.prose ul ol,
.post-content.prose ol ul {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Blockquotes */
.post-content.prose blockquote {
    border-left: 4px solid var(--purple-light);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: #666;
}

/* Code blocks */
.post-content.prose pre {
    background: #f8f9fa;
    padding: 1.25rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 2rem 0;
    font-size: 0.9rem;
}

.post-content.prose code {
    background: rgba(102, 126, 234, 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-size: 0.9em;
}

/* Links */
.post-content.prose a {
    color: var(--purple-dark);
    text-decoration: none;
    border-bottom: 1px solid var(--purple-light);
    transition: all 0.3s ease;
    font-size: 0.95em;  /* Slightly smaller than surrounding text */
}

.post-content.prose a:hover {
    color: var(--purple-light);
    border-bottom-color: var(--purple-dark);
}

/* Keep normal size for heading links */
.post-content.prose h1 a,
.post-content.prose h2 a,
.post-content.prose h3 a,
.post-content.prose h4 a,
.post-content.prose h5 a,
.post-content.prose h6 a {
    font-size: inherit;
}

/* Images */
.post-content.prose img {
    max-width: 100%;
    height: auto;
    margin: 2rem 0;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Ensure proper line breaks */
.post-content.prose br {
    display: block;
    margin-bottom: 0.5rem;
}

/* Preserve formatting in pre/code blocks */
.post-content.prose pre {
    white-space: pre;
    overflow-x: auto;
}

.post-content.prose code {
    white-space: pre-wrap;
    word-break: break-word;
}

/* Comments Section */
.comments-section {
    background: var(--bg-light);
    padding: 4rem 0;
    border-top: 1px solid #e0e0e0;
}

.comments-title {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 2rem;
}

/* Comment Form */
.comment-form-wrapper {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 3rem;
}

.comment-form-wrapper h4 {
    color: var(--purple-dark);
    margin-bottom: 1.5rem;
}

.comment-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

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

.comment-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    font-weight: 500;
}

.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--purple-light);
}

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

/* Comments List */
.comments-list {
    margin-top: 2rem;
}

.comment {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 1.5rem;
}

.comment.reply {
    margin-left: 3rem;
    margin-top: 1rem;
    background: #f8f9fa;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

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

.comment-author a {
    color: inherit;
    text-decoration: none;
}

.comment-author a:hover {
    color: var(--purple-light);
}

.comment-date {
    font-size: 0.875rem;
    color: #666;
}

.comment-content {
    color: var(--text-dark);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.comment-actions {
    margin-top: 1rem;
}

.reply-btn {
    background: none;
    border: 1px solid var(--purple-light);
    color: var(--purple-light);
    padding: 0.25rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.reply-btn:hover {
    background: var(--purple-light);
    color: white;
}

.comment-replies {
    margin-top: 1.5rem;
}

.no-comments {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 2rem;
    background: white;
    border-radius: 10px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .blog-post.pinned {
        grid-template-columns: 1fr;
    }
    
    .pinned .post-image {
        height: 250px;
    }
    
    .blog-grid {
        grid-template-columns: 1fr;
    }
    
    .comment-form .form-row {
        grid-template-columns: 1fr;
    }
    
    .comment.reply {
        margin-left: 1rem;
    }
}
/* Related Posts Section */
.related-posts-section {
    padding: 3rem 0;
    background: #f8f9fa;
    margin-top: 3rem;
}

.related-posts-title {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 2rem;
    text-align: center;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.related-post-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.related-post-image {
    height: 200px;
    overflow: hidden;
}

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

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

.related-post-content {
    padding: 1.5rem;
}

.related-post-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.related-post-title a {
    color: var(--purple-dark);
    text-decoration: none;
    transition: color 0.3s ease;
}

.related-post-title a:hover {
    color: var(--purple-light);
}

.related-post-excerpt {
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.related-post-meta {
    font-size: 0.875rem;
    color: #666;
}

/* Subscribe Section */
.subscribe-section {
    padding: 3rem 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin-top: 3rem;
}

.subscribe-box {
    background: white;
    border-radius: 10px;
    padding: 2.5rem;
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.subscribe-box h3 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.subscribe-box p {
    color: #666;
    margin-bottom: 2rem;
}

.subscribe-form {
    max-width: 500px;
    margin: 0 auto;
}

.subscribe-form .form-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.subscribe-form input {
    padding: 0.75rem 1rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.subscribe-form input:focus {
    outline: none;
    border-color: var(--purple-light);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.subscribe-form button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.subscribe-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.subscribe-message {
    margin-top: 1rem;
}

.subscribe-message .success {
    color: #28a745;
    background: #d4edda;
    padding: 0.75rem;
    border-radius: 5px;
    margin: 0;
}

.subscribe-message .error {
    color: #dc3545;
    background: #f8d7da;
    padding: 0.75rem;
    border-radius: 5px;
    margin: 0;
}

@media (max-width: 768px) {
    .subscribe-form .form-row {
        grid-template-columns: 1fr;
    }
}

/* YouTube Video Embeds */
.video-embed {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    margin: 2rem 0;
    overflow: hidden;
}

.video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Edit from page button for admins */
.admin-edit-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-edit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.admin-edit-btn svg {
    width: 20px;
    height: 20px;
}
