/**
 * TheQnA - Single Article & Knowledge Post Styles
 * Designed by HR Rajput
 */

/* ==========================================================================
   1. Breadcrumbs
   ========================================================================== */
.theqna-breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--theqna-text-light);
  margin-bottom: 1.25rem;
}

.theqna-breadcrumbs a {
  color: var(--theqna-text-muted);
}

.theqna-breadcrumbs a:hover {
  color: var(--theqna-primary);
}

.theqna-breadcrumb-sep {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  color: var(--theqna-border-dark);
}

.theqna-breadcrumb-current {
  color: var(--theqna-text-body);
  font-weight: 500;
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   2. Article Header & Meta
   ========================================================================== */
.theqna-article-header {
  margin-bottom: 2rem;
}

.theqna-article-title {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--theqna-text-main);
  letter-spacing: -0.03em;
  margin-top: 0;
  margin-bottom: 1.25rem;
}

.theqna-article-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.15rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--theqna-border-color);
  font-size: 0.875rem;
  color: var(--theqna-text-muted);
}

.theqna-article-meta-row .theqna-category-badge {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--theqna-primary);
  background-color: #EFF6FF;
  border: 1px solid #DBEAFE;
  padding: 0.2rem 0.65rem;
  border-radius: var(--theqna-radius-full, 9999px);
  text-decoration: none;
  transition: var(--theqna-transition);
  display: inline-flex;
  align-items: center;
  line-height: 1.2;
}

.theqna-article-meta-row .theqna-category-badge:hover {
  background-color: var(--theqna-primary);
  color: #FFFFFF;
  border-color: var(--theqna-primary);
}

.theqna-author-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.theqna-author-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--theqna-border-color);
}

.theqna-author-name {
  font-weight: 600;
  color: var(--theqna-text-main);
}

.theqna-updated-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background-color: var(--theqna-bg-subtle);
  padding: 0.2rem 0.55rem;
  border-radius: var(--theqna-radius-sm);
  font-size: 0.8125rem;
  color: #166534;
  background-color: #f0fdf4;
  border: 1px solid #bbf7d0;
  font-weight: 600;
}

/* ==========================================================================
   3. Quick Answer Box
   ========================================================================== */
.theqna-quick-answer {
  background: #f8fafc;
  border: 2px solid var(--theqna-primary-border);
  border-left: 6px solid var(--theqna-primary);
  border-radius: var(--theqna-radius-md);
  padding: 1.5rem 1.75rem;
  margin-bottom: 2.25rem;
  box-shadow: 0 4px 12px -2px rgba(37, 99, 235, 0.06);
}

.theqna-quick-answer-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--theqna-primary);
  margin-bottom: 0.75rem;
}

.theqna-quick-answer-body {
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--theqna-text-main);
  font-weight: 500;
}

.theqna-quick-answer-body p:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   4. Featured Image in Single
   ========================================================================== */
.theqna-single-featured-image {
  margin-bottom: 2.25rem;
  border-radius: var(--theqna-radius-md);
  overflow: hidden;
  border: 1px solid var(--theqna-border-color);
  background-color: var(--theqna-bg-subtle);
}

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

/* ==========================================================================
   5. Table of Contents (TOC)
   ========================================================================== */
.theqna-toc {
  background-color: #ffffff;
  border: 1px solid var(--theqna-border-color);
  border-radius: var(--theqna-radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2.5rem;
  box-shadow: var(--theqna-shadow-xs);
}

.theqna-toc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

.theqna-toc-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--theqna-text-main);
}

.theqna-toc-toggle {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--theqna-primary);
  background: transparent;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.theqna-toc-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.theqna-toc.is-collapsed .theqna-toc-list {
  display: none;
}

.theqna-toc-list li a {
  display: inline-block;
  font-size: 0.9375rem;
  color: var(--theqna-text-body);
  transition: var(--theqna-transition);
  text-decoration: none;
}

.theqna-toc-list li a:hover,
.theqna-toc-list li a.active {
  color: var(--theqna-primary);
  font-weight: 600;
  transform: translateX(3px);
}

.theqna-toc-list li.theqna-toc-h3 {
  padding-left: 1.25rem;
  font-size: 0.875rem;
}

/* ==========================================================================
   6. Article Content Typography & Elements
   ========================================================================== */
.theqna-article-content {
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--theqna-text-body);
}

.theqna-article-content h2 {
  font-size: 1.75rem;
  margin-top: 2.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--theqna-border-subtle);
  position: relative;
}

.theqna-article-content h3 {
  font-size: 1.35rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.theqna-article-content h4 {
  font-size: 1.15rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.theqna-article-content p {
  margin-bottom: 1.35rem;
}

.theqna-article-content ul,
.theqna-article-content ol {
  margin-bottom: 1.5rem;
  padding-left: 1.75rem;
}

.theqna-article-content li {
  margin-bottom: 0.5rem;
}

.theqna-article-content blockquote {
  border-left: 4px solid var(--theqna-primary);
  padding: 1rem 1.5rem;
  background-color: var(--theqna-bg-subtle);
  border-radius: 0 var(--theqna-radius-sm) var(--theqna-radius-sm) 0;
  font-style: italic;
  margin: 1.75rem 0;
  color: var(--theqna-text-main);
}

/* Step-by-Step Instructions Styling */
.theqna-steps {
  list-style: none;
  counter-reset: theqna-step-counter;
  padding: 0;
  margin: 2rem 0;
}

.theqna-step {
  position: relative;
  padding-left: 3.5rem;
  margin-bottom: 2rem;
}

.theqna-step::before {
  counter-increment: theqna-step-counter;
  content: counter(theqna-step-counter);
  position: absolute;
  top: 0;
  left: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background-color: var(--theqna-primary);
  color: #ffffff;
  font-weight: 800;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

.theqna-step-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--theqna-text-main);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

/* Callout Boxes (Tips, Warnings, Notes) */
.theqna-callout {
  border-radius: var(--theqna-radius-md);
  padding: 1.25rem 1.5rem;
  margin: 1.75rem 0;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  border: 1px solid transparent;
}

.theqna-callout-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  margin-top: 2px;
}

.theqna-callout-content {
  flex: 1;
}

.theqna-callout-title {
  font-weight: 700;
  margin-bottom: 0.35rem;
  font-size: 1rem;
}

.theqna-callout-tip {
  background-color: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

.theqna-callout-tip .theqna-callout-title {
  color: #14532d;
}

.theqna-callout-warning {
  background-color: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.theqna-callout-warning .theqna-callout-title {
  color: #78350f;
}

.theqna-callout-note {
  background-color: #eff6ff;
  border-color: #bfdbfe;
  color: #1e40af;
}

.theqna-callout-note .theqna-callout-title {
  color: #1e3a8a;
}

/* Code Snippets */
.theqna-article-content pre {
  background-color: #0f172a;
  color: #e2e8f0;
  padding: 1.25rem 1.5rem;
  border-radius: var(--theqna-radius-md);
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 1.75rem 0;
  position: relative;
}

.theqna-article-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.875em;
  background-color: var(--theqna-bg-subtle);
  color: #db2777;
  padding: 0.2em 0.4em;
  border-radius: 4px;
  border: 1px solid var(--theqna-border-color);
}

.theqna-article-content pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  border: none;
  font-size: inherit;
}

/* Images & Screenshots */
.theqna-article-content img {
  border-radius: var(--theqna-radius-md);
  border: 1px solid var(--theqna-border-color);
  margin: 1.75rem auto;
}

/* ==========================================================================
   7. FAQ Accordion Section
   ========================================================================== */
.theqna-faq-section {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 2px solid var(--theqna-border-color);
}

.theqna-faq-heading {
  font-size: 1.625rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  color: var(--theqna-text-main);
}

.theqna-faq-item {
  border: 1px solid var(--theqna-border-color);
  border-radius: var(--theqna-radius-md);
  margin-bottom: 1rem;
  background-color: #ffffff;
  overflow: hidden;
  transition: var(--theqna-transition);
}

.theqna-faq-question {
  width: 100%;
  text-align: left;
  padding: 1.15rem 1.25rem;
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--theqna-text-main);
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.theqna-faq-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--theqna-primary);
  transition: transform 0.2s ease;
}

.theqna-faq-item.is-open .theqna-faq-icon {
  transform: rotate(180deg);
}

.theqna-faq-answer {
  display: none;
  padding: 0 1.25rem 1.25rem;
  font-size: 0.95rem;
  color: var(--theqna-text-body);
  line-height: 1.65;
}

.theqna-faq-item.is-open .theqna-faq-answer {
  display: block;
}

/* ==========================================================================
   8. Author Bio Box
   ========================================================================== */
.theqna-author-box {
  background-color: #ffffff;
  border: 1px solid var(--theqna-border-color);
  border-radius: var(--theqna-radius-md);
  padding: 1.75rem;
  margin-top: 3.5rem;
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.theqna-author-box-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--theqna-primary-border);
}

.theqna-author-box-name {
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--theqna-text-main);
  margin-bottom: 0.35rem;
}

.theqna-author-box-bio {
  font-size: 0.9375rem;
  color: var(--theqna-text-muted);
  line-height: 1.55;
  margin-bottom: 0.5rem;
}

/* ==========================================================================
   9. Post Navigation (Prev / Next)
   ========================================================================== */
.theqna-post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--theqna-border-color);
}

.theqna-post-nav-card {
  background-color: #ffffff;
  border: 1px solid var(--theqna-border-color);
  border-radius: var(--theqna-radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  transition: var(--theqna-transition);
}

.theqna-post-nav-card:hover {
  border-color: var(--theqna-primary);
  box-shadow: var(--theqna-shadow-sm);
}

.theqna-post-nav-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--theqna-text-light);
  margin-bottom: 0.35rem;
}

.theqna-post-nav-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--theqna-text-main);
  line-height: 1.4;
}

/* ==========================================================================
   10. Related Questions Section
   ========================================================================== */
.theqna-related-posts {
  margin-top: 4rem;
  padding-top: 2.5rem;
  border-top: 2px solid var(--theqna-border-color);
}

/* ==========================================================================
   11. Comments Template
   ========================================================================== */
.theqna-comments-area {
  margin-top: 4rem;
  padding-top: 2.5rem;
  border-top: 2px solid var(--theqna-border-color);
}

.theqna-comments-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--theqna-text-main);
  margin-bottom: 2rem;
}

.comment-list {
  list-style: none;
  padding: 0;
  margin: 0 0 3rem 0;
}

.comment-list .comment {
  margin-bottom: 1.75rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--theqna-border-subtle);
}

.comment-list .children {
  list-style: none;
  padding-left: 2rem;
  margin-top: 1.5rem;
  border-left: 2px solid var(--theqna-border-color);
}

.comment-body {
  position: relative;
}

.comment-meta {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.comment-author .avatar {
  border-radius: 50%;
}

.comment-author .fn {
  font-weight: 700;
  color: var(--theqna-text-main);
  font-style: normal;
}

.comment-metadata {
  font-size: 0.8125rem;
  color: var(--theqna-text-light);
}

.comment-content {
  font-size: 0.9375rem;
  color: var(--theqna-text-body);
  line-height: 1.6;
}

.reply a {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--theqna-primary);
  margin-top: 0.5rem;
}

/* Comment Form */
.comment-respond {
  background-color: #ffffff;
  border: 1px solid var(--theqna-border-color);
  border-radius: var(--theqna-radius-md);
  padding: 2rem;
}

.comment-reply-title {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 1.25rem;
  color: var(--theqna-text-main);
}

.comment-form p {
  margin-bottom: 1.25rem;
}

.comment-form label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--theqna-text-main);
  margin-bottom: 0.4rem;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--theqna-radius-md);
  border: 1px solid var(--theqna-border-color);
  background-color: var(--theqna-bg-body);
  font-size: 0.95rem;
  outline: none;
  transition: var(--theqna-transition);
}

.comment-form input:focus,
.comment-form textarea:focus {
  border-color: var(--theqna-primary);
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.comment-form .form-submit input[type="submit"] {
  background-color: var(--theqna-primary);
  color: #ffffff;
  border: none;
  border-radius: var(--theqna-radius-md);
  padding: 0.75rem 1.75rem;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--theqna-transition);
}

.comment-form .form-submit input[type="submit"]:hover {
  background-color: var(--theqna-primary-hover);
}

@media (max-width: 768px) {
  .theqna-article-title {
    font-size: 1.85rem;
  }
  .theqna-post-nav {
    grid-template-columns: 1fr;
  }
  .theqna-author-box {
    flex-direction: column;
    text-align: center;
  }
}

/* ==========================================================================
   Single Post Sidebar Alignment
   Aligns the top of the sidebar (Trending widget) horizontally with the Article Title
   ========================================================================== */
@media (min-width: 1024px) {
  .single .theqna-sidebar-col,
  .theqna-single-layout .theqna-sidebar-col {
    padding-top: 0;
  }
}

.theqna-widget,
.theqna-sidebar-col .widget,
.theqna_trending_widget,
.theqna_categories_widget {
  margin-bottom: 2.75rem !important;
}

.theqna_categories_widget,
.theqna-categories-widget {
  margin-top: 1.25rem;
}

.theqna-title-icon {
  margin-right: 0.65rem !important;
}
