/**
 * Additional Components and Page-Specific Styles
 */

/* Share buttons styles */
.share-buttons {
  /* keep some spacing above and ensure it doesn't overlap preceding content */
  margin: 40px 0 0;
  padding: 16px 18px;
  border-radius: 12px;
  background: var(--panel-bg, #fff);
  position: relative;
  /* ensure standard flow (not absolutely positioned) */
  z-index: 1;
}

.recent-posts li {
  margin-bottom: 15px;
  border-bottom: 1px solid var(--light-gray);
  padding-bottom: 15px;
}

.recent-posts li:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.recent-posts a {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--text-color);
  transition: all 0.3s ease;
}

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

.recent-post-image {
  width: 60px;
  height: 60px;
  margin-right: 12px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}

.recent-post-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recent-post-content {
  flex: 1;
}

.recent-post-title {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.3;
  margin-bottom: 5px;
}

.recent-post-date {
  display: block;
  font-size: 0.8rem;
  color: var(--text-light);
}

/* Blog detail page recent posts */
.blog-sidebar {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 1px solid var(--light-gray);
}

.blog-sidebar .sidebar-section h2 {
  font-size: 1.5rem;
  margin-bottom: 20px;
  color: var(--secondary-color);
}

/* Category Page Styles */
.category-header {
  margin-bottom: var(--spacing-xl);
  text-align: center;
  padding: var(--spacing-xl) var(--spacing-md);
  background-color: var(--light-gray);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.category-icon-wrapper {
  width: 60px;
  height: 60px;
  background-color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 15px;
  box-shadow: var(--shadow-sm);
}

.category-icon-wrapper i {
  font-size: 24px;
  color: var(--secondary-color);
}

.category-title {
  font-size: 2.2rem;
  color: var(--primary-color);
  margin-bottom: var(--spacing-md);
  font-weight: 700;
}

.category-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-md);
  font-size: 0.9rem;
  color: var(--secondary-color);
}

.article-count {
  font-weight: var(--font-weight-semibold);
  padding: 5px 10px;
  background-color: #ffffff;
  border-radius: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
  color: var(--secondary-color);
  text-decoration: none;
}

.back-link:hover {
  color: var(--accent-color);
  transform: translateX(-3px);
}

.category-description {
  max-width: 600px;
  margin: 0 auto;
  color: #555;
  font-size: 1.05rem;
  line-height: 1.6;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--spacing-xl) var(--spacing-md);
  background-color: var(--light-gray);
  border-radius: 8px;
  margin: var(--spacing-lg) 0;
  box-shadow: var(--shadow-sm);
}

.empty-icon {
  font-size: 3.5rem;
  color: #ccc;
  margin-bottom: var(--spacing-md);
  opacity: 0.7;
}

.empty-state h2 {
  margin-bottom: var(--spacing-sm);
  color: var(--primary-color);
  font-size: 1.8rem;
}

.empty-state p {
  margin-bottom: var(--spacing-md);
  color: #666;
  font-size: 1.1rem;
}

.btn-primary {
  display: inline-block;
  padding: 10px 20px;
  background-color: var(--secondary-color);
  color: white;
  border-radius: 25px;
  font-weight: var(--font-weight-semibold);
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background-color: var(--accent-color);
  transform: translateY(-2px);
  color: white;
  box-shadow: var(--shadow-md);
}

.category-list {
  padding-left: 0;
}

.category-list li {
  margin-bottom: var(--spacing-sm);
  position: relative;
}

.category-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  transition: all 0.2s ease;
  position: relative;
  font-weight: 500;
}

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

.category-list a.active {
  color: var(--accent-color);
  font-weight: var(--font-weight-bold);
}

.active-marker {
  position: absolute;
  left: -15px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 20px;
  background-color: var(--accent-color);
  border-radius: 2px;
}

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

.popular-posts {
  list-style: none;
  padding-left: 0;
}

.popular-posts li {
  margin-bottom: var(--spacing-sm);
  padding-bottom: var(--spacing-sm);
  border-bottom: 1px solid #eee;
}

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

.popular-posts a {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.4;
}

.popular-posts a i {
  margin-top: 4px;
  color: var(--accent-color);
  font-size: 0.8rem;
}

/* Blog Content Styles */
.blog-content img {
  max-width: 100%;
  height: auto;
  margin: var(--spacing-md) auto;
  display: block;
  border: 1px solid #eee;
  border-radius: 4px;
}

.blog-content h2 {
  color: var(--primary-color);
  margin: var(--spacing-xl) 0 var(--spacing-md);
  padding-bottom: var(--spacing-sm);
  border-bottom: 1px solid #eee;
  font-weight: var(--font-weight-bold);
}

.blog-content h3 {
  color: var(--secondary-color);
  margin: 30px 0 15px;
}

.blog-content figure {
  margin: 20px 0;
  text-align: center;
}

.blog-content figcaption {
  font-style: italic;
  color: #777;
  margin-top: 10px;
  font-size: 0.9rem;
}

.blog-content blockquote {
  margin: 30px 0;
  padding: 20px 25px;
  border-left: 4px solid var(--secondary-color);
  background-color: #f7f7f7;
  font-style: italic;
  color: #555;
  font-size: 1.1rem;
  line-height: 1.6;
}

.blog-content ul,
.blog-content ol {
  margin: 20px 0 20px 20px;
  padding-left: 20px;
}

.blog-content li {
  margin-bottom: 10px;
  line-height: 1.6;
}

.blog-content p {
  margin-bottom: 20px;
  line-height: 1.7;
}

.blog-content hr {
  margin: 30px 0;
  border: 0;
  height: 1px;
  background-color: #eee;
}

.blog-content a {
  color: var(--secondary-color);
  text-decoration: none;
  border-bottom: 1px dotted var(--secondary-color);
  transition: color 0.2s ease;
}

.blog-content a:hover {
  color: var(--accent-color);
}

.blog-content strong,
.blog-content b {
  color: var(--primary-color);
  font-weight: 600;
}

.blog-description {
  font-size: 1.2rem;
  line-height: 1.6;
  color: #555;
  margin: 0 auto 30px;
  max-width: 700px;
  font-style: italic;
  padding: 20px;
  background-color: #f7f7f7;
  border: 1px solid #eee;
}

.blog-footer {
  margin-top: 50px;
  padding-top: 30px;
  border-top: 1px solid var(--light-gray);
}

/* Clean, consolidated footer styles */
.site-footer {
  margin-top: 50px;
  background-color: var(--footer-bg, #fafafa);
  color: var(--footer-text, #6b6b6b);
  font-size: 0.95rem;
}

.site-footer .footer-container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 24px 20px;
}

.site-footer .footer-columns {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  align-items: start;
}

.site-footer .footer-col h4 {
  margin: 0 0 8px 0;
  font-size: 1rem;
  color: var(--primary-color, #1f6feb);
}

.site-footer .footer-col p,
.site-footer .footer-col a {
  margin: 6px 0;
  color: var(--footer-text, #6b6b6b);
  text-decoration: none;
}

.site-footer .footer-col a:hover {
  color: var(--primary-color, #1f6feb);
  text-decoration: underline;
}

.site-footer .footer-bottom {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 0.9rem;
  text-align: center;
}

/* Responsive: switch to 4 columns on medium+ screens */
@media (min-width: 768px) {
  .site-footer .footer-columns {
    /* One footer column was removed; use 3 columns on medium+ screens */
    grid-template-columns: repeat(3, 1fr);
  }

  .site-footer .footer-container {
    padding: 32px 24px;
  }
}

@media (prefers-color-scheme: dark) {
  .site-footer {
    background-color: #111;
    color: #cfcfcf;
  }

  .site-footer .footer-col a:hover {
    color: #9ecbff;
  }
}

.keywords h3 {
  margin-bottom: 15px;
  color: var(--primary-color);
  font-size: 1.2rem;
}

.keyword-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.keyword-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background-color: #f7f7f7;
  color: #555;
  padding: 8px 12px;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.keyword-tag:hover {
  color: var(--secondary-color);
}

/* Enhanced image container for home page */
.blog-card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
  text-decoration: none;
}

.blog-card:hover .blog-card-overlay {
  opacity: 1;
}

.read-overlay {
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  padding: 12px 24px;
  background-color: rgba(0, 0, 0, 0.6);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 30px;
  transform: translateY(10px);
  transition: transform 0.3s ease;
}

.blog-card:hover .read-overlay {
  transform: translateY(0);
}

.read-more-btn {
  display: inline-block;
  padding: 8px 18px;
  background-color: var(--secondary-color);
  color: white;
  border-radius: 25px;
  font-weight: 600;
  font-size: 0.9rem;
  margin-top: 15px;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.read-more-btn:hover {
  background-color: var(--accent-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  color: white;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .blog-detail {
    padding: 20px;
  }

  .blog-featured-image {
    margin: -20px -20px 20px;
    height: 250px;
  }

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

  .blog-description {
    font-size: 1rem;
    padding: 15px;
  }

  .blog-content {
    font-size: 1rem;
  }

  .category-title {
    font-size: 1.5rem;
  }

  .category-meta {
    flex-direction: column;
    gap: var(--spacing-sm);
  }

  .sidebar-section {
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
  }

  .sidebar-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
  }

  .category-layout .blog-list {
    margin-top: 0;
  }
}

/* Share buttons styles */
.share-buttons {
  margin: 30px 0;
  padding: 16px 18px;
  border-radius: 12px;
  background: var(--panel-bg, #fff);
}

.share-buttons h3 {
  margin: 0 0 12px 0;
  font-size: 1.1rem;
  color: var(--primary-color);
}

.share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  height: 46px;
  padding: 0 12px;
  border-radius: 999px;
  /* pill */
  background: var(--light-gray, #f5f5f5);
  color: var(--text-color, #222);
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
  font-size: 0.95rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.share-btn i {
  pointer-events: none;
}

.share-btn:hover {
  transform: translateY(-3px);
  background: var(--accent-color, #e9f3ff);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
}

.share-btn.facebook {
  background: #3b5998;
  color: #fff;
}

.share-btn.instagram {
  background: linear-gradient(45deg, #feda75, #d62976);
  color: #fff;
}

.share-btn.pinterest {
  background: #bd081c;
  color: #fff;
}

.share-btn.reddit {
  background: #ff4500;
  color: #fff;
}

.share-btn.whatsapp {
  background: #25D366;
  color: #fff;
}

.share-btn.telegram {
  background: #2AABEE;
  color: #fff;
}

.share-btn.twitter {
  background: #1DA1F2;
  color: #fff;
}

.share-btn.copy {
  background: #6c757d;
  color: #fff;
}

.share-feedback {
  margin-top: 10px;
  font-size: 0.95rem;
  color: var(--secondary-color, #1f6feb);
}

@media (max-width: 480px) {
  .share-actions {
    gap: 8px;
  }

  .share-btn {
    min-width: 40px;
    height: 40px;
    padding: 0 8px;
    font-size: 0.9rem;
  }
}

/* share panel wrapper to align with article width */
/* Share panel wrapper to align with article width */

.share-panel {
  /* force it into document flow at the end of the article
     - display:block to behave like a normal block-level wrapper
     - clear:both to avoid floating elements overlapping it
     - margin-top provides breathing room from article content
  */
  display: block;
  clear: both;
  justify-content: center;
  margin-top: 20px;
}

.share-panel .share-buttons {
  width: 100%;
  max-width: 740px;
  /* aligns with main content width */
}