/*
 * Typography for HTML written in the rich-text editor (product descriptions, AI-generated copy).
 * Tailwind's preflight reset removes margins, heading sizes and list bullets, so without this the stored
 * <h3>/<ul>/<p> markup looks like plain unspaced lines. Used by:
 *   - storefront: wrap the output in  <div class="rich-content">…</div>
 *   - admin:      CKEditor's editable area (.ck-editor__editable.ck-content) gets the same look, so the editor matches the page.
 * Sizes are in em so the text follows whatever font size the surrounding page uses.
 */
.rich-content,
.ck-editor__editable.ck-content { line-height: 1.65; overflow-wrap: anywhere; }

.rich-content > :first-child,
.ck-editor__editable.ck-content > :first-child { margin-top: 0; }
.rich-content > :last-child { margin-bottom: 0; }

.rich-content p,
.ck-editor__editable.ck-content p { margin: 0 0 .85em; }

.rich-content h3,
.ck-editor__editable.ck-content h3 { font-size: 1.2em; font-weight: 700; line-height: 1.3; margin: 1.35em 0 .5em; color: inherit; }
.rich-content h4,
.ck-editor__editable.ck-content h4 { font-size: 1.05em; font-weight: 600; line-height: 1.3; margin: 1.1em 0 .4em; color: inherit; }
.rich-content h2,
.ck-editor__editable.ck-content h2 { font-size: 1.35em; font-weight: 700; line-height: 1.25; margin: 1.5em 0 .55em; color: inherit; }

.rich-content ul,
.ck-editor__editable.ck-content ul { list-style: disc outside; padding-left: 1.5em; margin: 0 0 .95em; }
.rich-content ol,
.ck-editor__editable.ck-content ol { list-style: decimal outside; padding-left: 1.5em; margin: 0 0 .95em; }
.rich-content li,
.ck-editor__editable.ck-content li { margin: .3em 0; }
.rich-content li > p,
.ck-editor__editable.ck-content li > p { margin: 0; }
.rich-content ul ul, .rich-content ol ol, .rich-content ul ol, .rich-content ol ul,
.ck-editor__editable.ck-content ul ul, .ck-editor__editable.ck-content ol ol { margin: .3em 0; }

.rich-content strong, .rich-content b,
.ck-editor__editable.ck-content strong, .ck-editor__editable.ck-content b { font-weight: 700; }
.rich-content em, .rich-content i,
.ck-editor__editable.ck-content em, .ck-editor__editable.ck-content i { font-style: italic; }

.rich-content a,
.ck-editor__editable.ck-content a { color: #4338ca; text-decoration: underline; text-underline-offset: 2px; }

.rich-content blockquote,
.ck-editor__editable.ck-content blockquote { margin: 1em 0; padding: .1em 1em; border-left: 4px solid #d1d5db; color: #4b5563; font-style: italic; }

.rich-content table,
.ck-editor__editable.ck-content table { border-collapse: collapse; width: 100%; margin: 0 0 1em; }
.rich-content th, .rich-content td,
.ck-editor__editable.ck-content th, .ck-editor__editable.ck-content td { border: 1px solid #e5e7eb; padding: .5em .7em; text-align: left; }
.rich-content th,
.ck-editor__editable.ck-content th { background: #f9fafb; font-weight: 600; }

.rich-content img { max-width: 100%; height: auto; }
