/* FILE: css/community/view-content.css */
/* Styles for displaying WYSIWYG editor content on view pages */

/* Question Body Content Styling */
.q-body-content,
.a-body-content {
  font-size: 15px;
  line-height: 1.7;
  color: #1f2937;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Headings */
.q-body-content h1,
.q-body-content h2,
.q-body-content h3,
.q-body-content h4,
.q-body-content h5,
.q-body-content h6,
.a-body-content h1,
.a-body-content h2,
.a-body-content h3,
.a-body-content h4,
.a-body-content h5,
.a-body-content h6 {
  font-weight: 600;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  line-height: 1.3;
  color: #111827;
}

.q-body-content h1:first-child,
.q-body-content h2:first-child,
.q-body-content h3:first-child,
.q-body-content h4:first-child,
.a-body-content h1:first-child,
.a-body-content h2:first-child,
.a-body-content h3:first-child,
.a-body-content h4:first-child {
  margin-top: 0;
}

.q-body-content h1,
.a-body-content h1 { font-size: 2em; }

.q-body-content h2,
.a-body-content h2 { font-size: 1.5em; }

.q-body-content h3,
.a-body-content h3 { font-size: 1.25em; }

.q-body-content h4,
.a-body-content h4 { font-size: 1.1em; }

/* Paragraphs */
.q-body-content p,
.a-body-content p {
  margin-bottom: 1em;
}

.q-body-content p:last-child,
.a-body-content p:last-child {
  margin-bottom: 0;
}

/* Text Formatting */
.q-body-content strong,
.q-body-content b,
.a-body-content strong,
.a-body-content b {
  font-weight: 600;
  color: #111827;
}

.q-body-content em,
.q-body-content i,
.a-body-content em,
.a-body-content i {
  font-style: italic;
}

.q-body-content u,
.a-body-content u {
  text-decoration: underline;
}

.q-body-content strike,
.q-body-content s,
.a-body-content strike,
.a-body-content s {
  text-decoration: line-through;
  opacity: 0.7;
}

/* Lists */
.q-body-content ul,
.q-body-content ol,
.a-body-content ul,
.a-body-content ol {
  margin: 1em 0;
  padding-left: 2em;
}

.q-body-content ul,
.a-body-content ul {
  list-style-type: disc;
}

.q-body-content ol,
.a-body-content ol {
  list-style-type: decimal;
}

.q-body-content li,
.a-body-content li {
  margin-bottom: 0.5em;
  line-height: 1.6;
}

.q-body-content li:last-child,
.a-body-content li:last-child {
  margin-bottom: 0;
}

/* Nested lists */
.q-body-content ul ul,
.q-body-content ol ol,
.q-body-content ul ol,
.q-body-content ol ul,
.a-body-content ul ul,
.a-body-content ol ol,
.a-body-content ul ol,
.a-body-content ol ul {
  margin: 0.5em 0;
}

.q-body-content ul ul,
.a-body-content ul ul {
  list-style-type: circle;
}

.q-body-content ul ul ul,
.a-body-content ul ul ul {
  list-style-type: square;
}

/* Links */
.q-body-content a,
.a-body-content a {
  color: #2563eb;
  text-decoration: underline;
  transition: color 0.2s;
}

.q-body-content a:hover,
.a-body-content a:hover {
  color: #1d4ed8;
}

.q-body-content a:visited,
.a-body-content a:visited {
  color: #7c3aed;
}

/* Images */
.q-body-content img,
.a-body-content img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 1em 0;
  display: block;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Code blocks */
.q-body-content pre,
.a-body-content pre {
  background: #1f2937;
  color: #f3f4f6;
  padding: 16px;
  border-radius: 6px;
  overflow-x: auto;
  margin: 1em 0;
  font-family: 'Courier New', Courier, monospace;
  font-size: 14px;
  line-height: 1.5;
}

.q-body-content code,
.a-body-content code {
  background: #f3f4f6;
  color: #dc2626;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.9em;
}

.q-body-content pre code,
.a-body-content pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

/* Horizontal rule */
.q-body-content hr,
.a-body-content hr {
  border: none;
  border-top: 2px solid #e5e7eb;
  margin: 2em 0;
}

/* Blockquotes */
.q-body-content blockquote,
.a-body-content blockquote {
  border-left: 4px solid #e5e7eb;
  padding-left: 1em;
  margin: 1em 0;
  color: #6b7280;
  font-style: italic;
}

/* Tables (if you add table support later) */
.q-body-content table,
.a-body-content table {
  border-collapse: collapse;
  width: 100%;
  margin: 1em 0;
}

.q-body-content table th,
.q-body-content table td,
.a-body-content table th,
.a-body-content table td {
  border: 1px solid #e5e7eb;
  padding: 8px 12px;
  text-align: left;
}

.q-body-content table th,
.a-body-content table th {
  background: #f9fafb;
  font-weight: 600;
}

/* Text alignment classes (from editor) */
.q-body-content [style*="text-align: center"],
.a-body-content [style*="text-align: center"] {
  text-align: center;
}

.q-body-content [style*="text-align: right"],
.a-body-content [style*="text-align: right"] {
  text-align: right;
}

.q-body-content [style*="text-align: left"],
.a-body-content [style*="text-align: left"] {
  text-align: left;
}

/* Ensure proper spacing for first/last elements */
.q-body-content > *:first-child,
.a-body-content > *:first-child {
  margin-top: 0 !important;
}

.q-body-content > *:last-child,
.a-body-content > *:last-child {
  margin-bottom: 0 !important;
}

/* Empty state styling */
.q-body-content:empty::before,
.a-body-content:empty::before {
  content: "No content available.";
  color: #9ca3af;
  font-style: italic;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .q-body-content,
  .a-body-content {
    font-size: 14px;
  }
  
  .q-body-content h1,
  .a-body-content h1 { font-size: 1.75em; }
  
  .q-body-content h2,
  .a-body-content h2 { font-size: 1.4em; }
  
  .q-body-content h3,
  .a-body-content h3 { font-size: 1.2em; }
  
  .q-body-content pre,
  .a-body-content pre {
    font-size: 13px;
    padding: 12px;
  }
  
  .q-body-content ul,
  .q-body-content ol,
  .a-body-content ul,
  .a-body-content ol {
    padding-left: 1.5em;
  }
}