/* Estilo padrão de rich text (Wagtail RichTextField / CKEditor5) usado em todo o projeto.
   Aplicar a classe .rich-text no elemento que envolve o HTML gerado por esses campos. */

.rich-text,
.rich-text * {
    overflow-wrap: break-word;
}

.rich-text {
    color: #434A54;
    font-weight: 500;
    line-height: 1.7;
}

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

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

.rich-text h1,
.rich-text h2,
.rich-text h3,
.rich-text h4,
.rich-text h5,
.rich-text h6 {
    margin: 1.75rem 0 0.75rem;
    font-weight: 600;
    line-height: 1.3;
    color: #024248;
}

.rich-text h1 { font-size: 2rem; }
.rich-text h2 { font-size: 1.5rem; }
.rich-text h3 { font-size: 1.25rem; }
.rich-text h4 { font-size: 1.1rem; }
.rich-text h5 { font-size: 1rem; letter-spacing: 0.02em; }

.rich-text h6 {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

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

.rich-text strong,
.rich-text b {
    font-weight: 600;
}

.rich-text em,
.rich-text i {
    font-style: italic;
}

.rich-text u {
    text-decoration: underline;
    text-decoration-color: currentColor;
}

.rich-text a {
    color: #007D7A;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s ease;
}

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

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

.rich-text li {
    margin-bottom: 0.4rem;
}

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

.rich-text li > ul,
.rich-text li > ol {
    margin-top: 0.4rem;
    margin-bottom: 0;
}

.rich-text blockquote {
    margin: 1rem 0;
    padding: 0.5rem 0 0.5rem 1rem;
    border-left: 4px solid var(--primary, #024248);
    color: var(--light-text, #64748b);
    font-style: italic;
}

.rich-text code {
    background: var(--light-bg, #f8fafc);
    border: 1px solid var(--border, #e2e8f0);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
}

.rich-text pre {
    background: var(--light-bg, #f8fafc);
    border: 1px solid var(--border, #e2e8f0);
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1rem 0;
}

.rich-text pre code {
    background: none;
    border: none;
    padding: 0;
}

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

.rich-text hr {
    border: none;
    border-top: 1px solid var(--border, #e2e8f0);
    margin: 1.5rem 0;
}

.rich-text table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

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

.rich-text th {
    background: var(--light-bg, #f8fafc);
    font-weight: 700;
}
