/*
 * GitHub-style prose for Markdown-rendered note content
 */

.prose {
  color: #1f2328;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.5;
  overflow-wrap: break-word;
  word-break: break-word;
}

.prose * {
  box-sizing: border-box;
}

.prose > * + * {
  margin-top: 1em;
}

/* Headings */
.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
  color: #1f2328;
  font-weight: 600;
  line-height: 1.25;
  margin-top: 1.5em !important;
  margin-bottom: 0.5em;
}

.prose h1 { font-size: 1.5em; padding-bottom: 0.3em; border-bottom: 1px solid #d1d9e0; }
.prose h2 { font-size: 1.25em; padding-bottom: 0.3em; border-bottom: 1px solid #d1d9e0; }
.prose h3 { font-size: 1.1em; }
.prose h4 { font-size: 1em; }

.prose h1:first-child,
.prose h2:first-child,
.prose h3:first-child,
.prose h4:first-child,
.prose h5:first-child,
.prose h6:first-child {
  margin-top: 0 !important;
}

/* Links */
.prose a {
  color: #0969da;
  text-decoration: underline;
  text-decoration-color: rgba(9, 105, 218, 0.4);
  text-underline-offset: 2px;
}

.prose a:hover {
  text-decoration-color: #0969da;
}

/* Text styles */
.prose strong {
  font-weight: 600;
  color: inherit;
}

.prose em {
  font-style: italic;
}

.prose del {
  text-decoration: line-through;
  color: #656d76;
}

.prose mark {
  background-color: #fff8c5;
  padding: 0.1em 0.2em;
  border-radius: 0.2em;
}

/* Blockquote */
.prose blockquote {
  border-left: 4px solid #d1d9e0;
  margin-left: 0;
  padding: 0 1em;
  color: #656d76;
}

.prose blockquote p:last-child {
  margin-bottom: 0;
}

/* Lists */
.prose ul {
  list-style-type: disc;
  padding-left: 2em;
}

.prose ul > li {
  margin-top: 0.25em;
}

.prose ol {
  list-style-type: decimal;
  padding-left: 2em;
}

.prose ol > li {
  margin-top: 0.25em;
}

.prose li > p {
  margin-bottom: 0.5em;
}

.prose ul ul,
.prose ul ol,
.prose ol ul,
.prose ol ol {
  margin-top: 0.35em;
  margin-bottom: 0;
}

/* Code */
.prose pre {
  display: block;
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.875em;
  line-height: 1.45;
  padding: 1em;
  background-color: #f6f8fa;
  border-radius: 6px;
  overflow-x: auto;
  white-space: pre;
}

.prose code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.875em;
  background-color: rgba(175, 184, 193, 0.2);
  color: #e11d48;
  padding: 0.2em 0.4em;
  border-radius: 6px;
}

.prose pre code {
  background: none;
  padding: 0;
  font-size: inherit;
  border-radius: 0;
  color: inherit;
}

/* Tables */
.prose table {
  display: block;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-collapse: collapse;
  font-size: 0.9em;
}

.prose th {
  text-align: left;
  font-weight: 600;
  background-color: #f6f8fa;
  border: 1px solid #d1d9e0;
  padding: 0.4em 0.8em;
}

.prose td {
  border: 1px solid #d1d9e0;
  padding: 0.4em 0.8em;
  vertical-align: top;
}

.prose tr:nth-child(even) td {
  background-color: #f6f8fa;
}

/* Images */
.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

/* HR */
.prose hr {
  border: none;
  border-top: 4px solid #d1d9e0;
  margin: 1.5em 0;
}

/* Task lists */
.prose input[type="checkbox"] {
  margin-right: 0.5em;
}

/* Footnotes */
.prose .footnotes {
  margin-top: 0;
  font-size: 0.875em;
  color: #656d76;
  border-top: 1px solid #d1d9e0;
  padding-top: 1em;
}

.prose .footnotes hr {
  display: none;
}

/* Dark mode */
.dark .prose {
  color: #e6edf3;
}

.dark .prose h1,
.dark .prose h2,
.dark .prose h3,
.dark .prose h4,
.dark .prose h5,
.dark .prose h6 {
  color: #e6edf3;
  border-color: #30363d;
}

.dark .prose strong {
  color: inherit;
}

.dark .prose a {
  color: #4493f8;
  text-decoration-color: rgba(68, 147, 248, 0.4);
}

.dark .prose blockquote {
  border-color: #3d444d;
  color: #9198a1;
}

.dark .prose del {
  color: #9198a1;
}

.dark .prose mark {
  background-color: rgba(187, 128, 0, 0.15);
  color: #e6edf3;
}

.dark .prose pre {
  background-color: #161b22;
  color: #e6edf3;
}

.dark .prose code {
  background-color: rgba(110, 118, 129, 0.4);
  color: #fda4af;
}

.dark .prose pre code {
  background: none;
  color: #e6edf3;
}

.dark .prose th {
  background-color: #161b22;
  border-color: #3d444d;
  color: #e6edf3;
}

.dark .prose td {
  border-color: #3d444d;
}

.dark .prose tr:nth-child(even) td {
  background-color: #161b22;
}

.dark .prose hr {
  border-color: #3d444d;
}

.dark .prose .footnotes {
  border-color: #3d444d;
  color: #9198a1;
}
