/* Giscus Comments Styling */
.giscus-comments {
  margin: 3rem 0 2rem;
  padding-top: 2rem;
  border-top: 1px solid #e2e8f0;
}

[data-theme="dark"] .giscus-comments {
  border-top-color: #4a5568;
}

.comments-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: #2d3748;
  font-family: inherit;
}

[data-theme="dark"] .comments-title {
  color: #f7fafc;
}

.giscus-container {
  background: #f9fafb;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border: 1px solid #e2e8f0;
}

[data-theme="dark"] .giscus-container {
  background: #2d3748;
  border-color: #4a5568;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Giscus widget styling adjustments */
.giscus {
  width: 100%;
}

.giscus iframe {
  width: 100%;
  border: none;
  background: transparent;
}

/* Integration with existing post styling */
.post-support + .giscus-comments {
  margin-top: 2rem;
}

/* Ensure comments section doesn't interfere with other sections */
.giscus-comments + .post-support {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .giscus-comments {
    margin: 2rem -1rem 1rem -1rem;
    padding: 1rem 1rem 0 1rem;
  }

  .comments-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
  }

  .giscus-container {
    padding: 1rem;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
}

/* Small mobile devices */
@media (max-width: 480px) {
  .giscus-comments {
    margin: 1.5rem -1rem 1rem -1rem;
  }

  .comments-title {
    font-size: 1.125rem;
  }

  .giscus-container {
    padding: 0.75rem;
  }
}

/* Loading state styling */
.giscus-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100px;
  color: #6b7280;
  font-style: italic;
}

[data-theme="dark"] .giscus-loading {
  color: #9ca3af;
}

/* Ensure proper spacing with adjacent elements */
.giscus-comments:last-child {
  margin-bottom: 0;
}

/* Additional theme integration */
.giscus-comments h3 {
  border-bottom: none;
  margin-top: 0;
}

/* Hover effects for better UX */
.giscus-container:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: box-shadow 0.2s ease;
}

[data-theme="dark"] .giscus-container:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}