/* Shared typography for rich HTML from the admin editor (catalog, blog, pages). */
.rich-content {
    direction: rtl;
    text-align: right;
    line-height: 1.85;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    color: #3f3f46;
}

.dark .rich-content {
    color: #d4d4d8;
}

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

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

.rich-content p {
    margin: 0 0 1em;
}

.rich-content h1,
.rich-content h2,
.rich-content h3,
.rich-content h4,
.rich-content h5,
.rich-content h6 {
    font-weight: 800;
    line-height: 1.35;
    margin: 1.35em 0 0.65em;
    color: #18181b;
}

.dark .rich-content h1,
.dark .rich-content h2,
.dark .rich-content h3,
.dark .rich-content h4,
.dark .rich-content h5,
.dark .rich-content h6 {
    color: #fafafa;
}

.rich-content h1 { font-size: 2rem; }
.rich-content h2 { font-size: 1.625rem; }
.rich-content h3 { font-size: 1.375rem; }
.rich-content h4 { font-size: 1.2rem; }
.rich-content h5 { font-size: 1.05rem; }
.rich-content h6 { font-size: 0.95rem; }

.rich-content ul,
.rich-content ol {
    margin: 0.75em 0 1em;
    padding-right: 1.75em;
    padding-left: 0;
}

.rich-content ul {
    list-style: disc outside;
}

.rich-content ol {
    list-style: decimal outside;
}

.rich-content ul ul {
    list-style-type: circle;
}

.rich-content ul ul ul {
    list-style-type: square;
}

.rich-content li {
    margin: 0.35em 0;
}

.rich-content li > ul,
.rich-content li > ol {
    margin-top: 0.35em;
    margin-bottom: 0.35em;
}

.rich-content blockquote {
    margin: 1.25em 0;
    padding: 0.85em 1.25em;
    border-right: 4px solid #3b82f6;
    background: rgba(59, 130, 246, 0.06);
    border-radius: 0.5rem;
    color: #52525b;
}

.dark .rich-content blockquote {
    background: rgba(59, 130, 246, 0.12);
    color: #e4e4e7;
}

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

.dark .rich-content a {
    color: #60a5fa;
}

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

.dark .rich-content a:hover {
    color: #93c5fd;
}

.rich-content strong,
.rich-content b {
    font-weight: 700;
}

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

.rich-content u {
    text-decoration: underline;
}

.rich-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1em auto;
    border-radius: 0.5rem;
}

.rich-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.25em 0;
    font-size: 0.95em;
}

.rich-content th,
.rich-content td {
    border: 1px solid rgba(15, 23, 42, 0.15);
    padding: 0.55rem 0.75rem;
    text-align: center;
    vertical-align: middle;
}

.dark .rich-content th,
.dark .rich-content td {
    border-color: rgba(255, 255, 255, 0.12);
}

.rich-content th {
    font-weight: 700;
    background: rgba(15, 23, 42, 0.04);
}

.dark .rich-content th {
    background: rgba(255, 255, 255, 0.06);
}

.rich-content hr {
    margin: 1.5em 0;
    border: 0;
    border-top: 1px solid rgba(15, 23, 42, 0.12);
}

.dark .rich-content hr {
    border-top-color: rgba(255, 255, 255, 0.12);
}

.rich-content [style*="text-align: center"],
.rich-content [align="center"] {
    text-align: center !important;
}

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

.rich-content [style*="text-align: right"],
.rich-content [align="right"] {
    text-align: right !important;
}

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