/**
 * Стилі для HTML з CKEditor / адмінки.
 * Звичайний CSS — не потребує @tailwindcss/typography і npm на сервері.
 * Кольори узгоджені з tailwind.config.js (text, text-soft, primary, border).
 */
:root {
  --rich-text: #142033;
  --rich-text-soft: #4f6074;
  --rich-primary: #a0a080;
  --rich-border: #d1dbe6;
}

.rich-html {
  font-size: 1.125rem;
  line-height: 1.75;
  color: var(--rich-text-soft);
  max-width: none;
}

/* Таб «Опис» товару — компактніший */
.rich-html.rich-html-sm {
  font-size: 0.875rem;
  line-height: 1.625;
  color: #4b5563;
}

.rich-html > *:first-child {
  margin-top: 0;
}

.rich-html h1,
.rich-html h2,
.rich-html h3,
.rich-html h4,
.rich-html h5,
.rich-html h6 {
  font-weight: 700;
  color: var(--rich-text);
}

.rich-html h1 {
  font-size: 2.25rem;
  line-height: 1.2;
  margin-top: 0;
  margin-bottom: 1rem;
}

.rich-html h2 {
  font-size: 1.5rem;
  line-height: 1.3;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.rich-html h3 {
  font-size: 1.25rem;
  line-height: 1.4;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.rich-html h4 {
  font-size: 1.125rem;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

.rich-html p {
  margin-top: 0;
  margin-bottom: 1rem;
  line-height: 1.75;
}

.rich-html a {
  color: var(--rich-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.rich-html a:hover {
  opacity: 0.9;
}

.rich-html strong,
.rich-html b {
  color: var(--rich-text);
  font-weight: 600;
}

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

.rich-html ul {
  list-style-type: disc;
}

.rich-html ol {
  list-style-type: decimal;
}

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

.rich-html li > p {
  margin-bottom: 0.5rem;
}

.rich-html img {
  max-width: 100%;
  height: auto;
  border-radius: 0.75rem;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.rich-html blockquote {
  margin: 1rem 0;
  padding-left: 1rem;
  border-left: 4px solid var(--rich-primary);
  color: var(--rich-text-soft);
  font-style: italic;
}

.rich-html hr {
  margin: 1.5rem 0;
  border: 0;
  border-top: 1px solid var(--rich-border);
}

.rich-html table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.95em;
}

.rich-html th,
.rich-html td {
  border: 1px solid var(--rich-border);
  padding: 0.5rem 0.75rem;
  text-align: left;
}

.rich-html th {
  background: #f4f7fb;
  font-weight: 600;
  color: var(--rich-text);
}

.rich-html pre,
.rich-html code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9em;
}

.rich-html pre {
  overflow-x: auto;
  padding: 1rem;
  border-radius: 0.5rem;
  background: #f4f7fb;
  border: 1px solid var(--rich-border);
  margin: 1rem 0;
}

.rich-html :not(pre) > code {
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
  background: #f4f7fb;
}
