/* =============================================================================
   Rich Text Content Styling - News Articles & Product Descriptions
   ============================================================================= */

/* Article content styling for rich text output */
.article-text,
.rich-text-content {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1.1rem;
  line-height: 1.7;
  color: #374151;
  max-width: none;
}

/* Typography hierarchy */
.article-text h1, .rich-text-content h1,
.article-text h2, .rich-text-content h2,
.article-text h3, .rich-text-content h3,
.article-text h4, .rich-text-content h4,
.article-text h5, .rich-text-content h5,
.article-text h6, .rich-text-content h6 {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 700;
  color: #1f2937;
  margin-top: 2rem;
  margin-bottom: 1rem;
  line-height: 1.3;
}

.article-text h1, .rich-text-content h1 { font-size: 2rem; }
.article-text h2, .rich-text-content h2 { font-size: 1.75rem; }
.article-text h3, .rich-text-content h3 { font-size: 1.5rem; }
.article-text h4, .rich-text-content h4 { font-size: 1.25rem; }
.article-text h5, .rich-text-content h5 { font-size: 1.125rem; }
.article-text h6, .rich-text-content h6 { font-size: 1rem; }

/* Paragraphs */
.article-text p,
.rich-text-content p {
  margin-bottom: 1.5rem;
  text-align: justify;
}

/* Lists */
.article-text ul,
.article-text ol {
  margin-bottom: 1.5rem;
  padding-left: 2rem;
}

.article-text li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.article-text ul li {
  list-style-type: disc;
}

.article-text ol li {
  list-style-type: decimal;
}

/* Links */
.article-text a {
  color: #3b82f6;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: all 0.2s ease;
}

.article-text a:hover {
  color: #2563eb;
  border-bottom-color: #2563eb;
  text-decoration: none;
}

/* Images */
.article-text img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 2rem 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* Blockquotes */
.article-text blockquote {
  border-left: 4px solid #3b82f6;
  margin: 2rem 0;
  padding: 1.5rem 2rem;
  background: #f8fafc;
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: #4b5563;
  position: relative;
}

.article-text blockquote::before {
  content: '"';
  font-size: 3rem;
  color: #3b82f6;
  position: absolute;
  top: -0.5rem;
  left: 1rem;
  font-family: serif;
}

/* Code blocks */
.article-text pre {
  background: #1f2937;
  color: #f9fafb;
  padding: 1.5rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 2rem 0;
  font-family: 'Monaco', 'Consolas', monospace;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Inline code */
.article-text code {
  background: #f3f4f6;
  color: #e11d48;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: 'Monaco', 'Consolas', monospace;
  font-size: 0.9em;
}

.article-text pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  font-size: inherit;
}

/* Tables */
.article-text table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.article-text th,
.article-text td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

.article-text th {
  background: #f9fafb;
  font-weight: 600;
  color: #1f2937;
}

.article-text tr:last-child td {
  border-bottom: none;
}

.article-text tr:hover {
  background: #f9fafb;
}

/* Horizontal rules */
.article-text hr {
  border: none;
  height: 2px;
  background: linear-gradient(to right, #3b82f6, #10b981);
  margin: 3rem 0;
  border-radius: 2px;
}

/* Strong and emphasis */
.article-text strong {
  font-weight: 700;
  color: #1f2937;
}

.article-text em {
  font-style: italic;
  color: #4b5563;
}

/* CKEditor specific classes */
.article-text .image-style-align-left {
  float: left;
  margin: 0 2rem 1rem 0;
  max-width: 50%;
}

.article-text .image-style-align-right {
  float: right;
  margin: 0 0 1rem 2rem;
  max-width: 50%;
}

.article-text .image-style-align-center {
  display: block;
  margin: 2rem auto;
  text-align: center;
}

/* Clear floats */
.article-text::after {
  content: "";
  display: table;
  clear: both;
}

/* Code snippet styling for CKEditor code plugin */
.article-text .hljs {
  background: #1f2937 !important;
  color: #f9fafb !important;
  border-radius: 8px;
  padding: 1.5rem !important;
  margin: 2rem 0;
  overflow-x: auto;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .article-text {
    font-size: 1rem;
    line-height: 1.6;
  }
  
  .article-text h1 { font-size: 1.75rem; }
  .article-text h2 { font-size: 1.5rem; }
  .article-text h3 { font-size: 1.25rem; }
  
  .article-text ul,
  .article-text ol {
    padding-left: 1.5rem;
  }
  
  .article-text blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
  }
  
  .article-text .image-style-align-left,
  .article-text .image-style-align-right {
    float: none;
    margin: 1rem 0;
    max-width: 100%;
    display: block;
  }
  
  .article-text table {
    font-size: 0.875rem;
  }
  
  .article-text th,
  .article-text td {
    padding: 0.75rem 0.5rem;
  }
}