/* Markdown content styling */
/* Include via: stylesheet_link_tag "happee_metronic/markdown" */

.markdown-content {
  color: var(--tw-foreground, #1f2937);
  font-size: 1rem;
  line-height: 1.625;
}

.markdown-content h1 {
  font-size: 1.875rem;
  font-weight: 700;
  margin-top: 2.5rem;
  margin-bottom: 1.5rem;
  color: var(--tw-foreground, #111827);
  border-bottom: 1px solid var(--tw-border, #e5e7eb);
  padding-bottom: 0.75rem;
}

.markdown-content h1:first-child {
  margin-top: 0;
}

.markdown-content h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 2.5rem;
  margin-bottom: 1.25rem;
  color: var(--tw-foreground, #111827);
}

.markdown-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: var(--tw-foreground, #111827);
}

.markdown-content h4 {
  font-size: 1.125rem;
  font-weight: 500;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--tw-foreground, #111827);
}

.markdown-content h5,
.markdown-content h6 {
  font-size: 1rem;
  font-weight: 500;
  margin-top: 1.25rem;
  margin-bottom: 0.75rem;
  color: var(--tw-muted-foreground, #6b7280);
}

.markdown-content p {
  margin-bottom: 1.5rem;
  line-height: 1.625;
}

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

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

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

.markdown-content ul > li,
.markdown-content ol > li {
  padding-left: 0.5rem;
  line-height: 1.625;
  margin-bottom: 0.5rem;
}

.markdown-content li > p {
  margin-bottom: 0.75rem;
}

.markdown-content ul ul,
.markdown-content ul ol,
.markdown-content ol ul,
.markdown-content ol ol {
  margin-top: 0.75rem;
  margin-bottom: 0.5rem;
}

.markdown-content strong {
  font-weight: 600;
  color: var(--tw-foreground, #111827);
}

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

.markdown-content a {
  color: var(--tw-primary, #3b82f6);
  text-decoration: none;
}

.markdown-content a:hover {
  text-decoration: underline;
}

.markdown-content blockquote {
  border-left: 4px solid var(--tw-border, #e5e7eb);
  padding-left: 1.5rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  font-style: italic;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--tw-muted-foreground, #6b7280);
  line-height: 1.625;
}

.markdown-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}

.markdown-content th {
  background-color: var(--tw-secondary, #f3f4f6);
  border: 1px solid var(--tw-border, #e5e7eb);
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
}

.markdown-content td {
  border: 1px solid var(--tw-border, #e5e7eb);
  padding: 0.75rem 1rem;
}

/* Right-align numeric columns (all columns except first) for financial tables */
.markdown-content th:not(:first-child),
.markdown-content td:not(:first-child) {
  text-align: right;
}

.markdown-content hr {
  margin-top: 2.5rem;
  margin-bottom: 2.5rem;
  border: none;
  border-top: 1px solid var(--tw-border, #e5e7eb);
}

.markdown-content img {
  max-width: 100%;
  height: auto;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  border-radius: 0.375rem;
}

/* Code blocks */
.markdown-content .code-block {
  margin-bottom: 1.5rem;
  border-radius: 0.5rem;
  overflow: hidden;
  border: 1px solid var(--tw-border, #e5e7eb);
}

.markdown-content .code-header {
  background-color: var(--tw-secondary, #f3f4f6);
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: var(--tw-muted-foreground, #6b7280);
  border-bottom: 1px solid var(--tw-border, #e5e7eb);
}

.markdown-content .code-language {
  text-transform: uppercase;
  font-weight: 600;
}

.markdown-content pre.highlight {
  background-color: #272822;
  padding: 1.25rem;
  overflow-x: auto;
  margin: 0;
  line-height: 1.6;
}

.markdown-content pre.highlight code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.875rem;
  background: none;
  padding: 0;
  color: #f8f8f2;
}

/* Plain pre without code-block wrapper (no language specified) */
.markdown-content pre:not(.highlight) {
  background-color: var(--tw-secondary, #f3f4f6);
  padding: 1.25rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
  border-radius: 0.5rem;
  border: 1px solid var(--tw-border, #e5e7eb);
  line-height: 1.6;
}

.markdown-content pre:not(.highlight) code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.875rem;
  background: none;
  padding: 0;
}

/* Inline code */
.markdown-content :not(pre) > code {
  background-color: var(--tw-secondary, #f3f4f6);
  color: var(--tw-foreground, #1f2937);
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* Syntax highlighting - Monokai theme */
.highlight .hll { background-color: #49483e }
.highlight { background: #272822; color: #f8f8f2 }
.highlight .c { color: #75715e } /* Comment */
.highlight .err { color: #960050; background-color: #1e0010 } /* Error */
.highlight .k { color: #66d9ef } /* Keyword */
.highlight .l { color: #ae81ff } /* Literal */
.highlight .n { color: #f8f8f2 } /* Name */
.highlight .o { color: #f92672 } /* Operator */
.highlight .p { color: #f8f8f2 } /* Punctuation */
.highlight .ch { color: #75715e } /* Comment.Hashbang */
.highlight .cm { color: #75715e } /* Comment.Multiline */
.highlight .cp { color: #75715e } /* Comment.Preproc */
.highlight .cpf { color: #75715e } /* Comment.PreprocFile */
.highlight .c1 { color: #75715e } /* Comment.Single */
.highlight .cs { color: #75715e } /* Comment.Special */
.highlight .gd { color: #f92672 } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gi { color: #a6e22e } /* Generic.Inserted */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #75715e } /* Generic.Subheading */
.highlight .kc { color: #66d9ef } /* Keyword.Constant */
.highlight .kd { color: #66d9ef } /* Keyword.Declaration */
.highlight .kn { color: #f92672 } /* Keyword.Namespace */
.highlight .kp { color: #66d9ef } /* Keyword.Pseudo */
.highlight .kr { color: #66d9ef } /* Keyword.Reserved */
.highlight .kt { color: #66d9ef } /* Keyword.Type */
.highlight .ld { color: #e6db74 } /* Literal.Date */
.highlight .m { color: #ae81ff } /* Literal.Number */
.highlight .s { color: #e6db74 } /* Literal.String */
.highlight .na { color: #a6e22e } /* Name.Attribute */
.highlight .nb { color: #f8f8f2 } /* Name.Builtin */
.highlight .nc { color: #a6e22e } /* Name.Class */
.highlight .no { color: #66d9ef } /* Name.Constant */
.highlight .nd { color: #a6e22e } /* Name.Decorator */
.highlight .ni { color: #f8f8f2 } /* Name.Entity */
.highlight .ne { color: #a6e22e } /* Name.Exception */
.highlight .nf { color: #a6e22e } /* Name.Function */
.highlight .nl { color: #f8f8f2 } /* Name.Label */
.highlight .nn { color: #f8f8f2 } /* Name.Namespace */
.highlight .nx { color: #a6e22e } /* Name.Other */
.highlight .py { color: #f8f8f2 } /* Name.Property */
.highlight .nt { color: #f92672 } /* Name.Tag */
.highlight .nv { color: #f8f8f2 } /* Name.Variable */
.highlight .ow { color: #f92672 } /* Operator.Word */
.highlight .w { color: #f8f8f2 } /* Text.Whitespace */
.highlight .mb { color: #ae81ff } /* Literal.Number.Bin */
.highlight .mf { color: #ae81ff } /* Literal.Number.Float */
.highlight .mh { color: #ae81ff } /* Literal.Number.Hex */
.highlight .mi { color: #ae81ff } /* Literal.Number.Integer */
.highlight .mo { color: #ae81ff } /* Literal.Number.Oct */
.highlight .sa { color: #e6db74 } /* Literal.String.Affix */
.highlight .sb { color: #e6db74 } /* Literal.String.Backtick */
.highlight .sc { color: #e6db74 } /* Literal.String.Char */
.highlight .dl { color: #e6db74 } /* Literal.String.Delimiter */
.highlight .sd { color: #e6db74 } /* Literal.String.Doc */
.highlight .s2 { color: #e6db74 } /* Literal.String.Double */
.highlight .se { color: #ae81ff } /* Literal.String.Escape */
.highlight .sh { color: #e6db74 } /* Literal.String.Heredoc */
.highlight .si { color: #e6db74 } /* Literal.String.Interpol */
.highlight .sx { color: #e6db74 } /* Literal.String.Other */
.highlight .sr { color: #e6db74 } /* Literal.String.Regex */
.highlight .s1 { color: #e6db74 } /* Literal.String.Single */
.highlight .ss { color: #e6db74 } /* Literal.String.Symbol */
.highlight .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */
.highlight .fm { color: #a6e22e } /* Name.Function.Magic */
.highlight .vc { color: #f8f8f2 } /* Name.Variable.Class */
.highlight .vg { color: #f8f8f2 } /* Name.Variable.Global */
.highlight .vi { color: #f8f8f2 } /* Name.Variable.Instance */
.highlight .vm { color: #f8f8f2 } /* Name.Variable.Magic */
.highlight .il { color: #ae81ff } /* Literal.Number.Integer.Long */

/* ==========================================================================
   Dark Mode Overrides
   ========================================================================== */

/* Dark mode: Use lighter text colors for readability */
.dark .markdown-content {
  color: #d1d5db; /* gray-300 */
}

.dark .markdown-content h1,
.dark .markdown-content h2,
.dark .markdown-content h3,
.dark .markdown-content h4 {
  color: #f3f4f6; /* gray-100 */
}

.dark .markdown-content h5,
.dark .markdown-content h6 {
  color: #9ca3af; /* gray-400 */
}

.dark .markdown-content h1 {
  border-bottom-color: #374151; /* gray-700 */
}

.dark .markdown-content strong {
  color: #f9fafb; /* gray-50 */
}

.dark .markdown-content a {
  color: #60a5fa; /* blue-400 */
}

.dark .markdown-content blockquote {
  border-left-color: #4b5563; /* gray-600 */
  color: #9ca3af; /* gray-400 */
}

.dark .markdown-content th {
  background-color: #1f2937; /* gray-800 */
  border-color: #374151; /* gray-700 */
}

.dark .markdown-content td {
  border-color: #374151; /* gray-700 */
}

.dark .markdown-content hr {
  border-top-color: #374151; /* gray-700 */
}

/* Dark mode code blocks */
.dark .markdown-content .code-block {
  border-color: #374151; /* gray-700 */
}

.dark .markdown-content .code-header {
  background-color: #1f2937; /* gray-800 */
  border-bottom-color: #374151; /* gray-700 */
  color: #9ca3af; /* gray-400 */
}

.dark .markdown-content pre:not(.highlight) {
  background-color: #1f2937; /* gray-800 */
  border-color: #374151; /* gray-700 */
}

.dark .markdown-content pre:not(.highlight) code {
  color: #d1d5db; /* gray-300 */
}

/* Dark mode inline code */
.dark .markdown-content :not(pre) > code {
  background-color: #374151; /* gray-700 */
  color: #e5e7eb; /* gray-200 */
}
