/* Rendering for sanitized rich text content (e.g. product descriptions).
   Tailwind preflight resets headings/lists, so re-apply sensible defaults. */

.rich-text {
  color: #374151;
  line-height: 1.75;
  /* Lange deutsche Komposita werden am Zeilenende getrennt, statt komplett in die
     naechste Zeile zu rutschen. Braucht das lang-Attribut am <html> (base.html).
     overflow-wrap greift nur noch, wenn selbst die Silbentrennung nicht reicht.
     Bewusst als CSS und nicht als Tailwind-Utility: das Projekt hat kein
     Autoprefixer, und ohne -webkit-hyphens trennt Safari gar nicht. */
  -webkit-hyphens: auto;
  hyphens: auto;
  overflow-wrap: break-word;
}

.rich-text p {
  margin: 0 0 0.85rem;
}

.rich-text p:last-child {
  margin-bottom: 0;
}

.rich-text h1,
.rich-text h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #111827;
  margin: 1.4rem 0 0.6rem;
}

.rich-text h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #111827;
  margin: 1.2rem 0 0.5rem;
}

.rich-text h4 {
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
  margin: 1rem 0 0.4rem;
}

.rich-text h1:first-child,
.rich-text h2:first-child,
.rich-text h3:first-child,
.rich-text h4:first-child {
  margin-top: 0;
}

.rich-text ul,
.rich-text ol {
  margin: 0 0 0.85rem;
  padding-left: 1.5rem;
}

.rich-text ul {
  list-style: disc;
}

.rich-text ol {
  list-style: decimal;
}

/* Raw Quill markup stores bullet lists as <ol> with data-list attributes. */
.rich-text li[data-list="bullet"] {
  list-style-type: disc;
}

.rich-text li {
  margin: 0.25rem 0;
}

.rich-text a {
  color: #2563eb;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.rich-text a:hover {
  color: #1d4ed8;
}

.rich-text img {
  max-width: 100%;
  height: auto;
  border-radius: 1rem;
  margin: 1rem 0;
}

.rich-text blockquote {
  border-left: 4px solid #bfdbfe;
  background: #f8fafc;
  border-radius: 0 0.75rem 0.75rem 0;
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  color: #475569;
}

.rich-text pre {
  background: #f3f4f6;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  overflow-x: auto;
  font-size: 0.875rem;
}

.rich-text code {
  background: #f3f4f6;
  border-radius: 0.375rem;
  padding: 0.1rem 0.35rem;
  font-size: 0.875em;
}

.rich-text hr {
  border: 0;
  border-top: 1px solid #e5e7eb;
  margin: 1.25rem 0;
}

/* Quill alignment + indent helper classes survive sanitization. */
.rich-text .ql-align-center {
  text-align: center;
}

.rich-text .ql-align-right {
  text-align: right;
}

.rich-text .ql-align-justify {
  text-align: justify;
}

.rich-text .ql-indent-1 {
  padding-left: 2rem;
}

.rich-text .ql-indent-2 {
  padding-left: 4rem;
}

.rich-text .ql-indent-3 {
  padding-left: 6rem;
}
