/* Типографика HTML из CMS (TinyMCE). Подключается после Vite. */

.rich-text {
    font-size: 1rem;
    line-height: 1.7;
    overflow-wrap: break-word;
    overflow-x: hidden;
}

.rich-text * {
    font-family: inherit !important;
    max-width: 100%;
}

.rich-text p,
.rich-text span,
.rich-text div,
.rich-text li,
.rich-text td,
.rich-text th,
.rich-text strong,
.rich-text em,
.rich-text b,
.rich-text i {
    font-size: inherit !important;
    line-height: inherit !important;
    color: inherit !important;
    background-color: transparent !important;
}

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

.rich-text h2 {
    font-size: 1.5rem;
}

.rich-text h3 {
    font-size: 1.25rem;
}

.rich-text h4 {
    font-size: 1.125rem;
}

.rich-text h5,
.rich-text h6 {
    font-size: 1rem;
}

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

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

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

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

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

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

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

.rich-text a {
    color: #93c5fd;
    text-decoration: underline;
}

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

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

.rich-text iframe,
.rich-text video,
.rich-text embed {
    max-width: 100%;
}

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

.rich-text td,
.rich-text th {
    border: 1px solid #374151;
    padding: 0.5rem;
    vertical-align: top;
}

.rich-text th {
    font-weight: 600;
    color: #d1d5db;
}

.rich-text blockquote {
    margin: 0 0 1rem;
    padding: 0.5rem 0 0.5rem 1rem;
    border-left: 3px solid #374151;
}

.rich-text hr {
    margin: 1.5rem 0;
    border: 0;
    border-top: 1px solid #374151;
    opacity: 0.5;
}

@media (max-width: 767px) {
    .rich-text {
        overflow-x: hidden;
        word-break: break-word;
        font-size: 0.9375rem;
        line-height: 1.65;
    }

    .rich-text p {
        margin-bottom: var(--space-1);
    }

    .rich-text h2 {
        font-size: 1.25rem;
    }

    .rich-text h3 {
        font-size: 1.125rem;
    }

    .rich-text h4,
    .rich-text h5,
    .rich-text h6 {
        font-size: 1rem;
    }

    .rich-text h2,
    .rich-text h3,
    .rich-text h4,
    .rich-text h5,
    .rich-text h6 {
        margin: var(--space-2) 0 var(--space-1);
    }

    .rich-text img,
    .rich-text iframe,
    .rich-text video,
    .rich-text embed {
        max-width: 100% !important;
        height: auto !important;
    }

    .rich-text table {
        display: block;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .rich-text * {
        max-width: 100%;
    }

    .rich-text [style*="justify"] {
        text-align: left !important;
    }

    .rich-text p[style*="margin-left"],
    .rich-text div[style*="margin-left"],
    .rich-text p[style*="margin-right"],
    .rich-text p[style*="padding-left"],
    .rich-text div[style*="padding-left"] {
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 0 !important;
    }

    .rich-text p[style*="text-indent"],
    .rich-text div[style*="text-indent"] {
        text-indent: 0 !important;
    }
}
