/* ==========================================================================
   Pure CSS Custom Prose
   Tailwind Typography plugin replacement — no build step required.
   ========================================================================== */

.custom-prose {
  color: #1f2937; /* gray-800 */
  line-height: 1.75;
  font-size: 1rem;
  word-break: break-word;
  max-width: none;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Text elements */
.custom-prose p {
  margin: 1rem 0;
}

.custom-prose strong {
  font-weight: 600;
  color: #111827; /* gray-900 */
}

.custom-prose em {
  font-style: italic;
  color: #1f2937;
}

.custom-prose small {
  font-size: 0.875rem;
  color: #4b5563; /* gray-600 */
}

/* Links */
.custom-prose a {
  color: #4f46e5; /* indigo-600 */
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s ease;
}
.custom-prose a:hover {
  color: #4338ca; /* indigo-700 */
}

/* Headings */
.custom-prose h1 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.875rem; /* text-3xl */
  font-weight: 800;
  line-height: 1.25;
}
.custom-prose h2 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
}
.custom-prose h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
  font-weight: 600;
}
.custom-prose h4,
.custom-prose h5,
.custom-prose h6 {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

/* Lists */
.custom-prose ul,
.custom-prose ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
}
.custom-prose ul {
  list-style-type: disc;
}
.custom-prose ol {
  list-style-type: decimal;
}
.custom-prose li {
  margin: 0.5rem 0;
  line-height: 1.6;
}
.custom-prose li > ul,
.custom-prose li > ol {
  margin-top: 0.5rem;
  margin-bottom: 0;
}

/* Blockquotes */
.custom-prose blockquote {
  border-left: 4px solid #d1d5db; /* gray-300 */
  padding-left: 1rem;
  font-style: italic;
  margin: 1rem 0;
  color: #374151; /* gray-700 */
}
.custom-prose blockquote p:first-of-type::before {
  content: "“";
}
.custom-prose blockquote p:last-of-type::after {
  content: "”";
}

/* Code & Pre */
.custom-prose pre {
  background-color: #f3f4f6; /* gray-100 */
  padding: 1rem;
  border-radius: 0.375rem;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 1rem 0;
}
.custom-prose code {
  background-color: #f3f4f6;
  padding: 0.15rem 0.35rem;
  border-radius: 0.25rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9rem;
  color: #dc2626; /* red-600 */
}
.custom-prose pre code {
  background: transparent;
  padding: 0;
  color: inherit;
}

/* Tables */
.custom-prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 1rem 0;
}
.custom-prose thead {
  border-bottom: 1px solid #d1d5db;
}
.custom-prose th {
  text-align: left;
  padding-bottom: 0.5rem;
  font-weight: 600;
  color: #374151;
}
.custom-prose td {
  border-bottom: 1px solid #e5e7eb;
  padding: 0.5rem 0;
  color: #374151;
}

/* HR */
.custom-prose hr {
  margin: 2rem 0;
  border: none;
  border-top: 1px solid #e5e7eb;
}

/* Images & Figures */
.custom-prose img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  margin: 1rem 0;
  display: block;
}
.custom-prose figure {
  margin: 1.5rem 0;
  text-align: center;
}
.custom-prose figcaption {
  font-size: 0.875rem;
  color: #6b7280; /* gray-500 */
  margin-top: 0.5rem;
}

/* Details & Summary */
.custom-prose details {
  margin: 1rem 0;
  background-color: #f9fafb;
  border-radius: 0.375rem;
  padding: 0.75rem;
}
.custom-prose summary {
  cursor: pointer;
  font-weight: 600;
  color: #1f2937;
}

/* Inline elements */
.custom-prose mark {
  background-color: #fde68a; /* yellow-200 */
  color: #111827;
  padding: 0 0.2rem;
  border-radius: 0.125rem;
}
.custom-prose del {
  text-decoration: line-through;
  color: #6b7280;
}
.custom-prose ins {
  background-color: #bbf7d0; /* green-200 */
  padding: 0 0.2rem;
  border-radius: 0.125rem;
}

/* Alignments */
.custom-prose .align-center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}
.custom-prose .align-right {
  margin-left: auto;
  text-align: right;
}
.custom-prose .align-left {
  margin-right: auto;
  text-align: left;
}

/* Size variants */
.custom-prose--sm {
  font-size: 0.875rem;
  line-height: 1.65;
}
.custom-prose--lg {
  font-size: 1.125rem;
  line-height: 1.8;
}
.custom-prose--xl {
  font-size: 1.25rem;
  line-height: 1.85;
}

/* Spacing variants */
.custom-prose--tight p,
.custom-prose--tight li {
  margin: 0.5rem 0;
}
.custom-prose--relaxed p,
.custom-prose--relaxed li {
  margin: 1.25rem 0;
}

/* Center helper */
.custom-prose-center {
  max-width: 48rem;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

/* Dark mode */
.custom-prose.dark {
  color: #f3f4f6; /* gray-100 */
  background: transparent;
}
.custom-prose.dark strong { color: #f9fafb; }
.custom-prose.dark em { color: #e5e7eb; }
.custom-prose.dark a { color: #93c5fd; }
.custom-prose.dark a:hover { color: #bfdbfe; }
.custom-prose.dark blockquote {
  border-left-color: #374151;
  color: #d1d5db;
}
.custom-prose.dark pre,
.custom-prose.dark code {
  background-color: #1e293b;
  color: #fca5a5;
}
.custom-prose.dark table th,
.custom-prose.dark table td {
  border-color: #334155;
  color: #e5e7eb;
}
.custom-prose.dark hr {
  border-top-color: #334155;
}
.custom-prose.dark figcaption {
  color: #9ca3af;
}
.custom-prose.dark details {
  background-color: #1e293b;
}