/* Custom Styles for TinyMCE Content */
.post-body {
    font-family: "Dana", "Tahoma", sans-serif;
    line-height: 1.8;
    color: #1f2937;
}

/* Dark mode support */
.dark .post-body {
    color: #f3f4f6;
}

/* Headings */
.post-body h1 {
    font-size: 2.25rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #111827;
    border-bottom: 2px solid #4a6cf7;
    padding-bottom: 0.5rem;
}

.post-body h2 {
    font-size: 1.875rem;
    font-weight: 600;
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
    color: #1f2937;
    border-right: 4px solid #4a6cf7;
    padding-right: 1rem;
}

.post-body h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: #374151;
    border-right: 3px solid #4a6cf7;
    padding-right: 0.75rem;
}

.post-body h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    color: #4b5563;
    border-right: 2px solid #4a6cf7;
    padding-right: 0.5rem;
}

.post-body h5 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: #6b7280;
}

.post-body h6 {
    font-size: 1rem;
    font-weight: 600;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: #9ca3af;
}

/* Dark mode headings */
.dark .post-body h1 {
    color: #f9fafb;
}

.dark .post-body h2 {
    color: #e5e7eb;
}

.dark .post-body h3 {
    color: #d1d5db;
}

.dark .post-body h4 {
    color: #9ca3af;
}

.dark .post-body h5 {
    color: #6b7280;
}

.dark .post-body h6 {
    color: #4b5563;
}

/* Paragraphs */
.post-body p {
    margin-bottom: 1.25rem;
    line-height: 1.8;
    text-align: justify;
    text-justify: inter-word;
}

.post-body p:last-child {
    margin-bottom: 0;
}

/* Lists */
.post-body ul,
.post-body ol {
    margin: 1rem 0;
    padding-right: 1.5rem;
    line-height: 1.8;
}

.post-body ul {
    list-style-type: disc;
}

.post-body ol {
    list-style-type: decimal;
}

.post-body ul ul,
.post-body ol ol {
    margin: 0.5rem 0;
    padding-right: 1rem;
}

.post-body ul ul {
    list-style-type: circle;
}

.post-body ol ol {
    list-style-type: lower-alpha;
}

.post-body li {
    margin-bottom: 0.5rem;
    line-height: 1.8;
}

.post-body li:last-child {
    margin-bottom: 0;
}

/* Links */
.post-body a {
    color: #4a6cf7;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

.post-body a:hover {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

.post-body a:visited {
    color: #7c3aed;
}

/* Images */
.post-body img {
    max-width: 100%;
    height: max-content;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06);
    margin: 1.5rem 0;
    display: block;
}

.post-body img:hover {
    transform: scale(1.02);
    transition: transform 0.3s ease;
}

/* Blockquotes */
.post-body blockquote {
    border-right: 4px solid #4a6cf7;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background-color: #f8fafc;
    border-radius: 0.5rem;
    font-style: italic;
    position: relative;
}

.post-body blockquote::before {
    content: '"';
    font-size: 3rem;
    color: #4a6cf7;
    position: absolute;
    top: -0.5rem;
    right: 1rem;
    line-height: 1;
}

.dark .post-body blockquote {
    background-color: #1f2937;
    color: #e5e7eb;
}

/* Code blocks */
.post-body pre {
    background-color: #1f2937;
    color: #f3f4f6;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    font-family: "Fira Code", "Monaco", "Consolas", monospace;
    font-size: 0.875rem;
    line-height: 1.6;
}

.post-body code {
    background-color: #f3f4f6;
    color: #dc2626;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-family: "Fira Code", "Monaco", "Consolas", monospace;
    font-size: 0.875rem;
}

.dark .post-body code {
    background-color: #374151;
    color: #fbbf24;
}

/* Tables */
.post-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.post-body th,
.post-body td {
    padding: 0.75rem;
    text-align: right;
    border-bottom: 1px solid #e5e7eb;
}

.post-body th {
    background-color: #4a6cf7;
    color: white;
    font-weight: 600;
}

.post-body tr:nth-child(even) {
    background-color: #f9fafb;
}

.post-body tr:hover {
    background-color: #f3f4f6;
}

.dark .post-body th,
.dark .post-body td {
    border-bottom-color: #374151;
}

.dark .post-body tr:nth-child(even) {
    background-color: #1f2937;
}

.dark .post-body tr:hover {
    background-color: #374151;
}

/* Horizontal rules */
.post-body hr {
    border: none;
    height: 2px;
    background: linear-gradient(to left, #4a6cf7, #3b82f6);
    margin: 2rem 0;
    border-radius: 1px;
}

/* Emphasis and strong text */
.post-body strong,
.post-body b {
    font-weight: 700;
    color: #1f2937;
}

.dark .post-body strong,
.dark .post-body b {
    color: #f3f4f6;
}

.post-body em,
.post-body i {
    font-style: italic;
    color: #6b7280;
}

.dark .post-body em,
.dark .post-body i {
    color: #9ca3af;
}

/* Highlighted text */
.post-body mark {
    background-color: #fef3c7;
    color: #92400e;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
}

.dark .post-body mark {
    background-color: #451a03;
    color: #fbbf24;
}

/* Subscript and superscript */
.post-body sub,
.post-body sup {
    font-size: 0.75em;
    line-height: 0;
}

.post-body sub {
    vertical-align: sub;
}

.post-body sup {
    vertical-align: super;
}

/* Definition lists */
.post-body dl {
    margin: 1.5rem 0;
}

.post-body dt {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.post-body dd {
    margin-right: 1rem;
    margin-bottom: 1rem;
    padding-right: 1rem;
    border-right: 2px solid #e5e7eb;
}

.dark .post-body dt {
    color: #f3f4f6;
}

.dark .post-body dd {
    border-right-color: #374151;
}

/* Address */
.post-body address {
    font-style: normal;
    margin: 1rem 0;
    padding: 1rem;
    background-color: #f8fafc;
    border-radius: 0.5rem;
    border-right: 3px solid #4a6cf7;
}

.dark .post-body address {
    background-color: #1f2937;
}

/* Small text */
.post-body small {
    font-size: 0.875rem;
    color: #6b7280;
}

.dark .post-body small {
    color: #9ca3af;
}

/* Abbreviations */
.post-body abbr {
    border-bottom: 1px dotted #6b7280;
    cursor: help;
}

.dark .post-body abbr {
    border-bottom-color: #9ca3af;
}

/* Citations */
.post-body cite {
    font-style: italic;
    color: #6b7280;
}

.dark .post-body cite {
    color: #9ca3af;
}

/* Responsive design */
@media (max-width: 768px) {
    .post-body h1 {
        font-size: 1.875rem;
    }

    .post-body h2 {
        font-size: 1.5rem;
    }

    .post-body h3 {
        font-size: 1.25rem;
    }

    .post-body h4 {
        font-size: 1.125rem;
    }

    .post-body {
        font-size: 0.95rem;
    }

    .post-body ul,
    .post-body ol {
        padding-right: 1rem;
    }

    .post-body blockquote {
        padding: 0.75rem 1rem;
    }

    .post-body table {
        font-size: 0.875rem;
    }

    .post-body th,
    .post-body td {
        padding: 0.5rem;
    }
}

/* Print styles */
@media print {
    .post-body {
        color: #000;
        background: #fff;
    }

    .post-body a {
        color: #000;
        text-decoration: underline;
    }

    .post-body img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }

    .post-body h1,
    .post-body h2,
    .post-body h3,
    .post-body h4,
    .post-body h5,
    .post-body h6 {
        page-break-after: avoid;
    }

    .post-body blockquote {
        page-break-inside: avoid;
    }

    .post-body table {
        page-break-inside: avoid;
    }
}
