/* CSS Variables for consistent styling */
:root {
  --primary-color: #4f46e5;
  --secondary-color: #6b7280;
  --secondary-light: #e5e7eb;
  --success-color: #10b981;
  --card-bg: #ffffff;
  --light-bg: #f9fafb;
  --highlight-bg: #e0e7ff;
  --text-color: #1f2937;
  --heading-color: #111827;
  --muted-text: #6b7280;
  --border-color: #e5e7eb;
}

/* Blog styles for both index and post pages */

/* Blog header */
.blog-header-container {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.blog-title {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.blog-subtitle {
    font-size: 1.2rem;
    color: var(--muted-color);
}

/* Blog index page */
#blog-index {
    padding: 3rem 0;
    background-color: #f9f9f9;
}

.blog-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

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

.blog-card:hover {
    transform: translateY(-5px);
}

.blog-card-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.blog-card-content {
    padding: 1.5rem;
}

.post-meta {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
}

.blog-card h2 {
    font-size: 1.5rem;
    margin: 0 0 1rem;
}

.blog-card h2 a {
    color: var(--dark-color);
    text-decoration: none;
}

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

.post-excerpt {
    color: #444;
    margin-bottom: 1.5rem;
}

.post-tags {
    margin-bottom: 1rem;
}

.post-tag {
    display: inline-block;
    background-color: #f0f0f0;
    padding: 0.3rem 0.6rem;
    border-radius: 3px;
    font-size: 0.8rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    color: #555;
    text-decoration: none;
    transition: background-color 0.3s;
}

.post-tag:hover {
    background-color: #e0e0e0;
}

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

.read-more:hover {
    text-decoration: underline;
}

.no-posts {
    grid-column: 1 / -1;
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    color: #666;
}

/* Blog sidebar */
.blog-sidebar {
    position: sticky;
    top: 2rem;
}

.sidebar-widget {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.sidebar-widget h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.3rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.sidebar-widget h3:after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 50px;
    height: 3px;
    background-color: var(--primary-color);
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    display: inline-block;
    background-color: #f0f0f0;
    padding: 0.4rem 0.8rem;
    border-radius: 3px;
    font-size: 0.9rem;
    color: #555;
    text-decoration: none;
    transition: all 0.3s;
}

.tag:hover, .tag.active {
    background-color: var(--primary-color);
    color: white;
}

.featured-post {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.featured-post:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.featured-post h4 {
    margin: 0 0 0.3rem;
    font-size: 1rem;
}

.featured-post h4 a {
    color: var(--dark-color);
    text-decoration: none;
}

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

.newsletter-widget p {
    margin-bottom: 1rem;
}

.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.newsletter-form input {
    padding: 0.7rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.newsletter-form button {
    background-color: var(--primary-color);
    color: white;
    padding: 0.7rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s;
}

.newsletter-form button:hover {
    background-color: #3367d6;
}

/* Blog post page */
#blog-post {
    padding: 3rem 0;
    background-color: #f9f9f9;
}

.post-container {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 2rem;
}

.post-content {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 2rem;
}

.header-meta {
    display: flex;
    gap: 1rem;
    color: #fff;
    opacity: 0.8;
    font-size: 1rem;
}

.post-body {
    line-height: 1.7;
    margin: 2rem 0;
}

.post-body h2 {
    margin: 2rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

.post-body h3 {
    margin: 1.5rem 0 1rem;
}

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

.post-body ul, .post-body ol {
    margin: 1rem 0 1rem 1.5rem;
}

.post-body li {
    margin-bottom: 0.5rem;
}

.post-body img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 1.5rem 0;
}

.post-body code {
    background-color: #f5f5f5;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: monospace;
}

.post-body pre {
    background-color: #f5f5f5;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    font-family: monospace;
    margin: 1.5rem 0;
}

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

.media-gallery {
    margin: 2rem 0;
    border-top: 1px solid #eee;
    padding-top: 1.5rem;
}

.media-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.media-item {
    border-radius: 4px;
    overflow: hidden;
}

.media-item img, .media-item video {
    width: 100%;
    height: auto;
    display: block;
}

/* Book review styles */
.book-review {
    margin: 2rem 0;
    border-top: 1px solid #eee;
    padding-top: 1.5rem;
}

.book-info {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
}

.book-cover {
    width: 150px;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.book-details p {
    margin-bottom: 0.5rem;
}

.rating {
    margin: 0.5rem 0;
}

.book-link {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    margin-top: 1rem;
    transition: background-color 0.3s;
}

.book-link:hover {
    background-color: #3367d6;
}

/* Post footer */
.post-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

.share-buttons h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.share-links {
    display: flex;
    gap: 1rem;
}

.share-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #f0f0f0;
    color: #555;
    text-decoration: none;
    transition: all 0.3s;
}

.share-link:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Comments section */
.comments-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

.comments-list {
    margin-top: 1.5rem;
}

.comment {
    padding: 1.5rem;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    background-color: #f9f9f9;
}

.comment-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.comment-author {
    font-weight: 500;
}

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

.no-comments {
    text-align: center;
    color: #666;
    padding: 1rem;
}

.comment-form-container {
    margin-top: 2rem;
}

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

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

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

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

.form-group textarea {
    resize: vertical;
}

.word-count {
    font-size: 0.8rem;
    color: #666;
    text-align: right;
    margin-top: 0.3rem;
}

.submit-comment-btn {
    background-color: var(--primary-color);
    color: white;
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.submit-comment-btn:hover {
    background-color: #3367d6;
}

/* Author box and related posts */
.author-box, .related-posts, .subscription-box {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.author-box h3, .related-posts h3, .subscription-box h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.related-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.related-list li {
    margin-bottom: 0.8rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid #eee;
}

.related-list li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.related-list a {
    color: var(--dark-color);
    text-decoration: none;
    transition: color 0.3s;
}

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

.subscription-box p {
    margin-bottom: 1rem;
}

.subscribe-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.subscribe-form input {
    padding: 0.7rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.subscribe-btn {
    background-color: var(--primary-color);
    color: white;
    padding: 0.7rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s;
}

.subscribe-btn:hover {
    background-color: #3367d6;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .blog-container, .post-container {
        grid-template-columns: 1fr;
    }

    .blog-sidebar {
        position: static;
    }
}

@media (max-width: 576px) {
    .blog-grid {
        grid-template-columns: 1fr;
    }

    .blog-title {
        font-size: 2rem;
    }

    .book-info {
        flex-direction: column;
    }

    .book-cover {
        margin: 0 auto 1.5rem;
    }
}

/* Social share buttons styling */
.share-buttons {
  margin: 30px 0;
}

.share-buttons h3 {
  margin-bottom: 20px;
  font-size: 1.2rem;
  color: var(--dark-color);
}

.share-links {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  margin-top: 15px;
}

.share-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  background-color: var(--gray-100);
  border-radius: var(--border-radius);
  color: var(--gray-600);
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
  min-width: 80px; /* Ensure consistent width */
  text-align: center;
}

.share-link i {
  margin-right: 6px; /* More space between icon and text */
  font-size: 1.2rem; /* Larger icons */
}

.share-link:hover {
  background-color: var(--gray-200);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

/* Platform-specific styling */
.share-link:hover .fa-x-twitter {
  color: #000;
}

.share-link:hover .fa-linkedin {
  color: #0077b5;
}

.share-link:hover .fa-envelope {
  color: #ea4335;
}

.share-link:hover .fa-instagram {
  color: #e1306c;
}

.share-link:hover .fa-threads {
  color: #000;
}

/* Responsive adjustments */
@media (max-width: 576px) {
  .share-links {
    justify-content: flex-start;
  }

  .share-link {
    padding: 6px 12px;
    font-size: 0.9rem;
  }
}

/* Blog post card styles */
.blog-post-card {
    position: relative;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.blog-post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
    border-color: #ccc;
}

/* Blog post image */
.post-image {
    height: 200px;
    overflow: hidden;
}

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

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

/* Blog post content */
.post-content {
    padding: 20px;
}

.post-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
    font-size: 0.85rem;
    color: #666;
}

.post-category {
    background-color: #f0f0f0;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 500;
}

/* Title link */
.post-title-link {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: 600;
    display: inline-block;
    position: relative;
    z-index: 2;
}

.post-title-link:hover {
    color: #0056b3;
}

/* Read more button with emphasize clickability */
.read-more-btn {
    display: inline-flex;
    align-items: center;
    color: #0056b3;
    text-decoration: none;
    font-weight: 600;
    margin-top: 15px;
    padding: 5px 12px;
    border-radius: 4px;
    background-color: rgba(0, 86, 179, 0.08);
    transition: all 0.3s ease;
    position: relative;
    z-index: 10; /* Higher z-index to ensure clickability */
}

.read-more-btn:hover {
    background-color: rgba(0, 86, 179, 0.15);
    color: #003d7a;
    transform: translateX(5px);
}

/* View All Posts button with improved clickability */
.view-all-posts-btn {
    display: inline-block;
    padding: 12px 24px;
    background-color: #f8f9fa;
    color: #333;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid #ddd;
    text-align: center;
    margin-top: 30px;
    position: relative;
    z-index: 5;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.view-all-posts-btn:hover {
    background-color: #e9ecef;
    border-color: #0056b3;
    color: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* CTA container */
.cta-container {
    text-align: center;
    margin-top: 30px;
}

/* Enhanced styles for blog links */
.read-more {
    display: inline-block;
    color: #0056b3;
    text-decoration: none;
    font-weight: 600;
    padding: 6px 12px;
    background-color: rgba(0, 86, 179, 0.08);
    border-radius: 4px;
    margin-top: 15px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 10;
    cursor: pointer;
}

.read-more:hover {
    background-color: #0056b3;
    color: white;
    transform: translateX(5px);
}

.read-more:active {
    transform: translateX(5px) scale(0.98);
}

.read-more::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: transparent;
    z-index: -1;
}

.cta-button.secondary {
    display: inline-block;
    padding: 12px 30px;
    background-color: #0056b3;
    color: white;
    text-decoration: none;
    font-weight: 600;
    border-radius: 6px;
    margin-top: 30px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 10;
    cursor: pointer;
}

.cta-button.secondary:hover {
    background-color: #003d7a;
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.cta-button.secondary:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Fix for any potential overlap issues */
.post-content {
    position: relative;
}

/* Make sure links are above any other elements */
.post-content a {
    position: relative;
    z-index: 5;
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .view-all-posts-btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
}
