/**
 * CSS for Blog Content and TinyMCE Output
 * Tamide Data Solutions
 */

/* Basic Content Styling */
.blog-content {
  color: #333;
  line-height: 1.7;
  font-size: 1.05rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.blog-content > * + * {
  margin-top: 1.5rem;
}

/* Headings */
.blog-content h1,
.blog-content h2,
.blog-content h3,
.blog-content h4,
.blog-content h5,
.blog-content h6 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-weight: 700;
  line-height: 1.3;
  color: #004d40;
}

.blog-content h1 {
  font-size: 2.25rem;
}

.blog-content h2 {
  font-size: 1.875rem;
  border-bottom: 2px solid rgba(0, 77, 64, 0.1);
  padding-bottom: 0.5rem;
}

.blog-content h3 {
  font-size: 1.5rem;
}

.blog-content h4 {
  font-size: 1.25rem;
}

/* Paragraph and Text */
.blog-content p {
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.blog-content strong {
  font-weight: 700;
}

.blog-content em {
  font-style: italic;
}

.blog-content del {
  text-decoration: line-through;
}

/* Links */
.blog-content a {
  color: #004d40;
  text-decoration: underline;
  transition: color 0.2s ease;
}

.blog-content a:hover {
  color: #00796b;
}

/* Lists */
.blog-content ul,
.blog-content ol {
  margin-top: 1rem;
  margin-bottom: 1rem;
  padding-left: 2rem;
}

.blog-content ul {
  list-style-type: disc;
}

.blog-content ol {
  list-style-type: decimal;
}

.blog-content li + li {
  margin-top: 0.5rem;
}

.blog-content li > ul,
.blog-content li > ol {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

/* Blockquotes */
.blog-content blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  border-left: 4px solid #004d40;
  background-color: rgba(0, 77, 64, 0.05);
  font-style: italic;
}

.blog-content blockquote p {
  margin: 0;
}

/* Code Blocks */
.blog-content pre {
  margin: 1.5rem 0;
  padding: 1rem;
  background-color: #1e1e1e;
  color: #f8f8f2;
  border-radius: 0.375rem;
  overflow-x: auto;
  font-family: monospace;
  font-size: 0.9rem;
}

.blog-content code {
  font-family: monospace;
  font-size: 0.9em;
  padding: 0.2em 0.4em;
  background-color: rgba(0, 0, 0, 0.05);
  border-radius: 0.25rem;
}

.blog-content pre code {
  background-color: transparent;
  padding: 0;
  border-radius: 0;
  color: inherit;
}

/* Tables - IMPORTANT FOR DISPLAYING TABLES CORRECTLY */
.blog-content table {
  width: 100%;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  border-collapse: collapse;
  overflow-x: auto;
  display: block; /* Makes table scrollable on mobile */
}

@media (min-width: 768px) {
  .blog-content table {
    display: table; /* Normal display on desktop */
  }
}

.blog-content th {
  background-color: #004d40;
  color: white;
  font-weight: 600;
  text-align: left;
}

.blog-content th,
.blog-content td {
  padding: 0.75rem 1rem;
  border: 1px solid #e5e7eb;
}

.blog-content tr:nth-child(even) {
  background-color: rgba(0, 0, 0, 0.025);
}

.blog-content tr:hover {
  background-color: rgba(0, 77, 64, 0.05);
}

/* Images */
.blog-content img {
  max-width: 100%;
  height: auto;
  margin: 1.5rem auto;
  border-radius: 0.375rem;
}

/* Horizontal Rule */
.blog-content hr {
  margin: 2rem 0;
  border: 0;
  border-top: 2px solid rgba(0, 77, 64, 0.1);
}

/* Media & Embeds */
.blog-content iframe,
.blog-content video,
.blog-content .media-embed {
  max-width: 100%;
  margin: 1.5rem auto;
}

/* Icons and Special Elements */
.blog-content .icon {
  display: inline-block;
  vertical-align: middle;
}

/* Component Styles that TinyMCE Might Generate */
.blog-content .mceNonEditable {
  opacity: 0.8;
  box-shadow: 0 0 0 1px #e5e7eb;
}

/* Custom Styles for Classes TinyMCE Might Use */
.blog-content .align-left {
  text-align: left;
}

.blog-content .align-center {
  text-align: center;
}

.blog-content .align-right {
  text-align: right;
}

.blog-content .text-tiny {
  font-size: 0.75rem;
}

.blog-content .text-small {
  font-size: 0.875rem;
}

.blog-content .text-big {
  font-size: 1.25rem;
}

.blog-content .text-huge {
  font-size: 1.5rem;
}

/* TinyMCE specific styles */
.blog-content [style*="text-align:center"] {
  text-align: center;
}

.blog-content [style*="text-align:right"] {
  text-align: right;
}

.blog-content [style*="text-align:justify"] {
  text-align: justify;
}

/* Table Component Styles */
.blog-content .table-container {
  overflow-x: auto;
  margin: 1.5rem 0;
}

.blog-content caption {
  font-style: italic;
  padding: 0.5rem;
  caption-side: bottom;
  color: #6b7280;
  text-align: center;
}

/* Custom Classes */
.blog-content .note {
  background-color: #e8f5e9;
  padding: 1rem;
  border-radius: 0.375rem;
  border-left: 4px solid #4caf50;
  margin: 1.5rem 0;
}

.blog-content .warning {
  background-color: #fff3e0;
  padding: 1rem;
  border-radius: 0.375rem;
  border-left: 4px solid #ff9800;
  margin: 1.5rem 0;
}

.blog-content .important {
  background-color: #ffebee;
  padding: 1rem;
  border-radius: 0.375rem;
  border-left: 4px solid #f44336;
  margin: 1.5rem 0;
}

/* Color Utilities from TinyMCE */
.blog-content span[style*="color:"] {
  display: inline;
}

/* Fix for emoji and special characters */
.blog-content .emoji {
  height: 1.2em;
  width: 1.2em;
  margin: 0 .05em 0 .1em;
  vertical-align: -0.1em;
}
