/*
 * prose.css — Manual Tailwind Typography (prose) styles
 * Replaces @tailwindcss/typography plugin for blog article content.
 *
 * Color palette:
 *   primary:        #635bff
 *   primary-dark:   #0a2540
 *   text-primary:   #0a2540
 *   text-secondary: #425466
 *   bg-primary:     #f6f9fc
 *   border-default: #e6ebf1
 */

/* ------------------------------------------------------------------ */
/*  Base prose container                                               */
/* ------------------------------------------------------------------ */

.prose {
  color: #425466;
  line-height: 1.75;
  max-width: 65ch;
}

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

/* prose-lg bumps the base font size */
.prose.prose-lg {
  font-size: 1.125rem; /* 18px */
  line-height: 1.75;
}

/* ------------------------------------------------------------------ */
/*  Headings                                                           */
/* ------------------------------------------------------------------ */

.prose h1,
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
  color: #0a2540;
  font-weight: 700;
}

/* h2: ~24px, top margin, bottom border, spacing */
.prose h2 {
  font-size: 1.5rem;   /* 24px */
  margin-top: 2.5rem;  /* mt-10 */
  margin-bottom: 1rem; /* mb-4 */
  border-bottom: 1px solid #e6ebf1;
  padding-bottom: 0.5rem; /* pb-2 */
  line-height: 1.3;
}

/* h3: ~20px, spacing */
.prose h3 {
  font-size: 1.25rem;  /* 20px */
  margin-top: 2rem;    /* mt-8 */
  margin-bottom: 0.75rem; /* mb-3 */
  line-height: 1.4;
}

.prose h4 {
  font-size: 1.125rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

/* ------------------------------------------------------------------ */
/*  Paragraphs                                                         */
/* ------------------------------------------------------------------ */

.prose p {
  color: #425466;
  line-height: 1.7;
  margin-bottom: 1.25rem; /* mb-5 */
}

/* ------------------------------------------------------------------ */
/*  Links                                                              */
/* ------------------------------------------------------------------ */

.prose a {
  color: #635bff;
  text-decoration: none;
  transition: text-decoration 0.15s ease;
}

.prose a:hover {
  text-decoration: underline;
}

/* ------------------------------------------------------------------ */
/*  Strong / Bold                                                      */
/* ------------------------------------------------------------------ */

.prose strong {
  color: #0a2540;
  font-weight: 600;
}

/* ------------------------------------------------------------------ */
/*  Lists                                                              */
/* ------------------------------------------------------------------ */

.prose ul,
.prose ol {
  margin-bottom: 1.5rem; /* mb-6 */
  padding-left: 1.5rem;
}

.prose li {
  color: #425466;
  margin-bottom: 0.5rem; /* mb-2 */
}

.prose li::marker {
  color: #425466;
}

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

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

/* Nested lists */
.prose li > ul,
.prose li > ol {
  margin-top: 0.5rem;
  margin-bottom: 0;
}

/* ------------------------------------------------------------------ */
/*  Blockquotes                                                        */
/* ------------------------------------------------------------------ */

.prose blockquote {
  border-left: 4px solid #635bff;
  color: #425466;
  padding: 1rem 1.5rem; /* py-4 px-6 */
  margin-bottom: 1.5rem; /* mb-6 */
  margin-left: 0;
  margin-right: 0;
  background: rgba(99, 91, 255, 0.03);
  border-radius: 0 0.375rem 0.375rem 0;
}

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

/* ------------------------------------------------------------------ */
/*  Tables                                                             */
/* ------------------------------------------------------------------ */

.prose table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 0.5rem; /* rounded-lg */
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
  margin-bottom: 1.5rem;
}

.prose thead th {
  background-color: #f6f9fc;
  color: #0a2540;
  font-weight: 600;
  padding: 0.75rem 1rem; /* px-4 py-3 */
  text-align: left;
}

.prose tbody td {
  padding: 0.75rem 1rem; /* px-4 py-3 */
  border-top: 1px solid #e6ebf1;
}

.prose tbody tr:first-child td {
  border-top: 1px solid #e6ebf1;
}

/* ------------------------------------------------------------------ */
/*  Horizontal Rules                                                   */
/* ------------------------------------------------------------------ */

.prose hr {
  margin-top: 2rem;    /* my-8 */
  margin-bottom: 2rem;
  border: none;
  border-top: 1px solid #e6ebf1;
}

/* ------------------------------------------------------------------ */
/*  Images                                                             */
/* ------------------------------------------------------------------ */

.prose img {
  border-radius: 0.5rem; /* rounded-lg */
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
  margin-top: 1.5rem;    /* my-6 */
  margin-bottom: 1.5rem;
  max-width: 100%;
  height: auto;
}

/* ------------------------------------------------------------------ */
/*  Inline Code                                                        */
/* ------------------------------------------------------------------ */

.prose code {
  color: #635bff;
  background-color: rgba(99, 91, 255, 0.05); /* primary/5 */
  border-radius: 0.25rem; /* rounded */
  padding: 0.125rem 0.375rem; /* py-0.5 px-1.5 */
  font-size: 0.875em;
  font-weight: 500;
}

/* Don't style code inside pre (code blocks) */
.prose pre code {
  color: inherit;
  background-color: transparent;
  border-radius: 0;
  padding: 0;
  font-size: inherit;
  font-weight: inherit;
}

/* ------------------------------------------------------------------ */
/*  Code Blocks (pre)                                                  */
/* ------------------------------------------------------------------ */

.prose pre {
  background-color: #1e293b;
  color: #e2e8f0;
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  line-height: 1.7;
}

/* ------------------------------------------------------------------ */
/*  Figures                                                            */
/* ------------------------------------------------------------------ */

.prose figure {
  margin-bottom: 1.5rem;
}

.prose figcaption {
  color: #425466;
  font-size: 0.875rem;
  margin-top: 0.5rem;
  text-align: center;
}

/* ------------------------------------------------------------------ */
/*  First child / last child margin cleanup                            */
/* ------------------------------------------------------------------ */

.prose > :first-child {
  margin-top: 0;
}

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

/* ------------------------------------------------------------------ */
/*  Quick Answer Box (GEO — top-of-page answer for LLM extraction)    */
/* ------------------------------------------------------------------ */

.answer-box {
  background: linear-gradient(135deg, rgba(99, 91, 255, 0.06), rgba(99, 91, 255, 0.02));
  border-left: 4px solid #635bff;
  border-radius: 0 0.5rem 0.5rem 0;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  font-size: 1.05rem;
  line-height: 1.6;
  color: #0a2540;
}

.answer-box strong {
  color: #635bff;
  font-weight: 700;
}

/* ------------------------------------------------------------------ */
/*  Collapsible Details/Summary                                        */
/* ------------------------------------------------------------------ */

.prose details {
  border: 1px solid #e6ebf1;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  background: #fafbfc;
}

.prose details[open] {
  padding-bottom: 1rem;
}

.prose summary {
  font-weight: 600;
  color: #0a2540;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.prose summary::before {
  content: "\25B6";
  font-size: 0.7em;
  transition: transform 0.2s ease;
  color: #635bff;
}

.prose details[open] summary::before {
  transform: rotate(90deg);
}

.prose summary::-webkit-details-marker {
  display: none;
}

.prose details > *:not(summary) {
  margin-top: 0.75rem;
}

/* ── Mobile Responsiveness ─────────────────────────────── */
@media (max-width: 767px) {
  .prose table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 639px) {
  .prose h2 {
    font-size: 1.25rem;
    margin-top: 1.75rem;
  }
  .prose h3 {
    font-size: 1.125rem;
    margin-top: 1.5rem;
  }
  .prose blockquote {
    padding: 0.75rem 1rem;
  }
  .prose pre {
    font-size: 0.8125rem;
    padding: 0.75rem 1rem;
  }
}
