/* ============================================
   PROSE - Typography for content
   Vanilla CSS equivalent of @tailwindcss/typography
   ============================================ */

.prose {
  color: var(--gray-700);
  max-width: 65ch;
  font-size: 1rem;
  line-height: 1.75;
}

.dark .prose {
  color: var(--gray-300);
}

.prose.max-w-none {
  max-width: none;
}

/* Paragraphs */
.prose p {
  margin-top: 1.25em;
  margin-bottom: 1.25em;
}

/* Links */
.prose a {
  color: var(--primary-500);
  text-decoration: underline;
  font-weight: 500;
  transition: color 0.15s ease;
}

.prose a:hover {
  color: var(--primary-600);
}

.dark .prose a:hover {
  color: var(--primary-400);
}

/* Bold */
.prose strong {
  color: var(--gray-900);
  font-weight: 600;
}

.dark .prose strong {
  color: var(--gray-100);
}

/* Headings */
.prose h1,
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
  color: var(--gray-900);
  font-weight: 700;
  letter-spacing: -0.025em;
}

.dark .prose h1,
.dark .prose h2,
.dark .prose h3,
.dark .prose h4,
.dark .prose h5,
.dark .prose h6 {
  color: var(--gray-100);
}

.prose h1 {
  font-size: 2.25em;
  margin-top: 0;
  margin-bottom: 0.889em;
  line-height: 1.1;
}

.prose h2 {
  font-size: 1.5em;
  margin-top: 2em;
  margin-bottom: 1em;
  line-height: 1.33;
}

.prose h3 {
  font-size: 1.25em;
  margin-top: 1.6em;
  margin-bottom: 0.6em;
  line-height: 1.6;
  font-weight: 600;
}

.prose h4 {
  font-size: 1em;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  line-height: 1.5;
}

/* Lists */
.prose ul,
.prose ol {
  margin-top: 1.25em;
  margin-bottom: 1.25em;
  padding-left: 1.625em;
}

.prose ul {
  list-style-type: disc;
}

.prose ol {
  list-style-type: decimal;
}

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

.prose li::marker {
  color: var(--gray-400);
}

.dark .prose li::marker {
  color: var(--gray-500);
}

.prose ul > li::marker {
  color: var(--gray-400);
}

.prose ol > li::marker {
  font-weight: 400;
  color: var(--gray-500);
}

/* Nested lists */
.prose ul ul,
.prose ul ol,
.prose ol ul,
.prose ol ol {
  margin-top: 0.75em;
  margin-bottom: 0.75em;
}

/* Blockquotes */
.prose blockquote {
  font-style: italic;
  font-weight: 500;
  color: var(--gray-900);
  border-left: 4px solid var(--gray-200);
  margin-top: 1.6em;
  margin-bottom: 1.6em;
  padding-left: 1em;
}

.dark .prose blockquote {
  color: var(--gray-100);
  border-left-color: var(--gray-700);
}

.prose blockquote p:first-of-type::before {
  content: none;
}

.prose blockquote p:last-of-type::after {
  content: none;
}

/* Horizontal rule */
.prose hr {
  border-color: var(--gray-200);
  border-top-width: 1px;
  margin-top: 3em;
  margin-bottom: 3em;
}

.dark .prose hr {
  border-color: var(--gray-700);
}

/* Code inline */
.prose code {
  color: var(--primary-500);
  font-weight: 600;
  font-size: 0.875em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.prose code::before {
  content: '`';
}

.prose code::after {
  content: '`';
}

/* Code blocks (pre > code) */
.prose pre {
  color: var(--gray-200);
  background-color: var(--gray-800);
  overflow-x: auto;
  font-weight: 400;
  font-size: 0.875em;
  line-height: 1.714;
  margin-top: 1.714em;
  margin-bottom: 1.714em;
  border-radius: 0.375rem;
  padding: 0.857em 1.143em;
}

.prose pre code {
  background-color: transparent;
  border-width: 0;
  border-radius: 0;
  padding: 0;
  font-weight: inherit;
  color: inherit;
  font-size: inherit;
  font-family: inherit;
  line-height: inherit;
}

.prose pre code::before {
  content: none;
}

.prose pre code::after {
  content: none;
}

/* Images */
.prose img {
  margin-top: 2em;
  margin-bottom: 2em;
  border-radius: 0.375rem;
}

.prose figure {
  margin-top: 2em;
  margin-bottom: 2em;
}

.prose figure > * {
  margin-top: 0;
  margin-bottom: 0;
}

.prose figcaption {
  color: var(--gray-500);
  font-size: 0.875em;
  line-height: 1.428;
  margin-top: 0.857em;
  text-align: center;
}

/* Tables */
.prose table {
  width: 100%;
  table-layout: auto;
  text-align: left;
  margin-top: 2em;
  margin-bottom: 2em;
  font-size: 0.875em;
  line-height: 1.714;
}

.prose thead {
  border-bottom-width: 1px;
  border-bottom-color: var(--gray-300);
}

.dark .prose thead {
  border-bottom-color: var(--gray-600);
}

.prose thead th {
  color: var(--gray-900);
  font-weight: 600;
  vertical-align: bottom;
  padding-right: 0.571em;
  padding-bottom: 0.571em;
  padding-left: 0.571em;
}

.dark .prose thead th {
  color: var(--gray-100);
}

.prose tbody tr {
  border-bottom-width: 1px;
  border-bottom-color: var(--gray-200);
}

.dark .prose tbody tr {
  border-bottom-color: var(--gray-700);
}

.prose tbody tr:last-child {
  border-bottom-width: 0;
}

.prose tbody td {
  vertical-align: baseline;
  padding: 0.571em;
}

.prose tfoot {
  border-top-width: 1px;
  border-top-color: var(--gray-300);
}

.dark .prose tfoot {
  border-top-color: var(--gray-600);
}

.prose tfoot td {
  vertical-align: top;
  padding: 0.571em;
}

/* Video */
.prose video {
  margin-top: 2em;
  margin-bottom: 2em;
}

/* First child no top margin */
.prose > :first-child {
  margin-top: 0;
}

/* Last child no bottom margin */
.prose > :last-child {
  margin-bottom: 0;
}

/* Footnotes */
.prose .footnotes {
  margin-top: 3rem;
  border-top: 1px solid var(--gray-200);
  padding-top: 2rem;
  font-size: 0.875em;
}

.dark .prose .footnotes {
  border-top-color: var(--gray-700);
}

.prose .data-footnote-backref {
  text-decoration: none;
}

/* Task lists */
.prose .task-list-item::before {
  display: none;
}

.prose .task-list-item {
  list-style: none;
}

/* Citations */
.prose .csl-entry {
  margin-top: 1.25rem;
  margin-bottom: 1.25rem;
}

/* Header links */
.prose .content-header-link {
  opacity: 0;
  margin-left: -1.5rem;
  padding-right: 0.25rem;
}

.prose .content-header:hover .content-header-link,
.prose .content-header-link:hover {
  opacity: 1;
}

.prose .linkicon {
  display: inline-block;
  vertical-align: middle;
}
