.editor-content {
    --content-text: inherit;
    --content-muted: color-mix(in srgb, currentColor 68%, transparent);
    --content-border: rgba(0, 0, 0, 0.12);
    --content-border-strong: rgba(0, 0, 0, 0.18);
    --content-soft-bg: rgba(0, 0, 0, 0.03);
    --content-code-bg: rgba(0, 0, 0, 0.045);
    --content-radius: 0.75rem;
    --content-radius-sm: 0.5rem;
    --content-line-height: 1.75;
    --content-block-space: 1.15rem;
    --content-list-indent: 1.35rem;
    --content-side-image-width: min(45%, 380px);
    --content-selection: rgba(59, 130, 246, 0.18);

    color: var(--content-text);
    line-height: var(--content-line-height);
    word-break: break-word;
    overflow-wrap: break-word;
}

.dark .editor-content {
    --content-border: rgba(255, 255, 255, 0.12);
    --content-border-strong: rgba(255, 255, 255, 0.18);
    --content-soft-bg: rgba(255, 255, 255, 0.05);
    --content-code-bg: rgba(255, 255, 255, 0.06);
}

.editor-content::after {
    content: "";
    display: block;
    clear: both;
}

.editor-content *,
.editor-content *::before,
.editor-content *::after {
    box-sizing: border-box;
}

.editor-content > *:first-child {
    margin-top: 0 !important;
}

.editor-content > *:last-child {
    margin-bottom: 0 !important;
}

.editor-content p,
.editor-content ul,
.editor-content ol,
.editor-content dl,
.editor-content table,
.editor-content blockquote,
.editor-content pre,
.editor-content figure,
.editor-content hr {
    margin: var(--content-block-space) 0;
}

.editor-content li > p,
.editor-content li > ul,
.editor-content li > ol {
    margin-top: 0.45rem;
    margin-bottom: 0.45rem;
}

/* ==========================================================================
3) Typography
========================================================================== */

.editor-content h1,
.editor-content h2,
.editor-content h3,
.editor-content h4,
.editor-content h5,
.editor-content h6 {
    line-height: 1.25;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-top: 1.8em;
    margin-bottom: 0.65em;
    scroll-margin-top: 100px;
}

.editor-content h1:first-child,
.editor-content h2:first-child,
.editor-content h3:first-child,
.editor-content h4:first-child,
.editor-content h5:first-child,
.editor-content h6:first-child {
    margin-top: 0;
}

.editor-content h1 { font-size: clamp(2rem, 4vw, 2.5rem); }
.editor-content h2 { font-size: clamp(1.65rem, 3vw, 2rem); }
.editor-content h3 { font-size: clamp(1.35rem, 2.4vw, 1.55rem); }
.editor-content h4 { font-size: 1.2rem; }
.editor-content h5 { font-size: 1.05rem; }
.editor-content h6 { font-size: 0.95rem; }

.editor-content p {
    line-height: var(--content-line-height);
}

.editor-content strong,
.editor-content b {
    font-weight: 700;
}

.editor-content em,
.editor-content i {
    font-style: italic;
}

.editor-content small {
    font-size: 0.875em;
}

.editor-content mark {
    background: rgba(255, 230, 130, 0.55);
    padding: 0.08em 0.22em;
    border-radius: 0.2rem;
}

.dark .editor-content mark {
    background: rgba(255, 213, 79, 0.22);
}

.editor-content sub,
.editor-content sup {
    font-size: 0.75em;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
}

.editor-content sup { top: -0.5em; }
.editor-content sub { bottom: -0.2em; }

/* ==========================================================================
4) Links
========================================================================== */

.editor-content a {
    text-decoration: underline;
    text-underline-offset: 0.14em;
    text-decoration-thickness: 1px;
    transition: opacity 0.2s ease;
}

.editor-content a:hover {
    opacity: 0.85;
}

/* ==========================================================================
5) Lists
========================================================================== */

.editor-content ul,
.editor-content ol {
    padding-left: var(--content-list-indent);
}

.editor-content ul {
    list-style: disc;
}

.editor-content ol {
    list-style: decimal;
}

.editor-content ul ul {
    list-style: circle;
}

.editor-content ul ul ul {
    list-style: square;
}

.editor-content ol ol {
    list-style: lower-alpha;
}

.editor-content ol ol ol {
    list-style: lower-roman;
}

.editor-content li {
    margin: 0.35rem 0;
}

.editor-content li::marker {
    font-weight: 600;
}

/* ==========================================================================
6) Text alignment helpers
========================================================================== */

.editor-content .alignleft,
.editor-content .text-left { text-align: left; }

.editor-content .aligncenter,
.editor-content .text-center { text-align: center; }

.editor-content .alignright,
.editor-content .text-right { text-align: right; }

.editor-content .alignjustify,
.editor-content .text-justify { text-align: justify; }

/* ==========================================================================
7) Blockquote
========================================================================== */

.editor-content blockquote {
    border-left: 4px solid var(--content-border-strong);
    padding: 0.2rem 0 0.2rem 1rem;
    color: var(--content-muted);
    font-style: italic;
}

.editor-content blockquote > *:first-child {
    margin-top: 0;
}

.editor-content blockquote > *:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
8) Code / pre
========================================================================== */

.editor-content code,
.editor-content kbd,
.editor-content samp {
    font-family:
            ui-monospace,
            SFMono-Regular,
            Menlo,
            Monaco,
            Consolas,
            "Liberation Mono",
            "Courier New",
            monospace;
    font-size: 0.92em;
}

.editor-content :not(pre) > code,
.editor-content :not(pre) > kbd,
.editor-content :not(pre) > samp {
    background: var(--content-code-bg);
    padding: 0.18rem 0.38rem;
    border-radius: 0.4rem;
    border: 1px solid var(--content-border);
}

.editor-content pre {
    background: var(--content-code-bg);
    border: 1px solid var(--content-border);
    border-radius: var(--content-radius);
    padding: 1rem 1.1rem;
    overflow-x: auto;
    line-height: 1.65;
}

.editor-content pre code {
    background: transparent;
    padding: 0;
    border: 0;
    border-radius: 0;
    white-space: pre;
}

/* ==========================================================================
9) Horizontal rule
========================================================================== */

.editor-content hr {
    border: 0;
    border-top: 1px solid var(--content-border);
    margin: 2rem 0;
}

/* ==========================================================================
10) Generic media
========================================================================== */

.editor-content img,
.editor-content video,
.editor-content iframe,
.editor-content svg {
    max-width: 100%;
}

.editor-content img {
    height: auto;
}

.editor-content figure {
    max-width: 100%;
}

.editor-content figcaption {
    margin-top: 0.65rem;
    font-size: 0.92rem;
    line-height: 1.55;
    color: var(--content-muted);
    text-align: center;
}

/* ==========================================================================
11) TinyMCE / Metronic image output
Handles:

* <figure class="image">
* <figure class="image align-right">
* <figure class="image image-style-side align-right">
* <img class="align-left|align-right|aligncenter">

========================================================================== */

/* Base image figure */
.editor-content figure.image {
    display: table;
    max-width: 100%;
    margin: 1.25rem auto;
    border: 0;
    background: transparent;
}

/* Image inside figure */
.editor-content figure.image img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: var(--content-radius-sm);
}

/* Caption */
.editor-content figure.image figcaption {
    display: table-caption;
    caption-side: bottom;
    margin: 0;
    padding-top: 0.65rem;
    text-align: center;
    color: var(--content-muted);
    font-size: 0.92rem;
    line-height: 1.55;
}

/* --------------------------------------------------
Figure alignments
TinyMCE docs officially mention align-left / align-right.
Senin gerçek çıktında align-right geliyor.
-------------------------------------------------- */

.editor-content figure.align-left,
.editor-content figure.alignleft,
.editor-content figure.image.align-left,
.editor-content figure.image.alignleft {
    float: left;
    clear: left;
    margin: 0.35rem 1.5rem 1rem 0;
}

.editor-content figure.align-right,
.editor-content figure.alignright,
.editor-content figure.image.align-right,
.editor-content figure.image.alignright {
    float: right;
    clear: right;
    margin: 0.35rem 0 1rem 1.5rem;
}

.editor-content figure.align-center,
.editor-content figure.aligncenter,
.editor-content figure.image.align-center,
.editor-content figure.image.aligncenter {
    margin-left: auto;
    margin-right: auto;
}

/* --------------------------------------------------
image-style-side
Senin örnekte gelen ana class bu.
Bu class varsa desktop'ta side image gibi davranmalı.
-------------------------------------------------- */

.editor-content figure.image.image-style-side {
    max-width: 100%;
}

@media (min-width: 1024px) {
    .editor-content figure.image.image-style-side {
        width: var(--content-side-image-width);
        max-width: var(--content-side-image-width);
    }
}

/* image-style-side + align-right */
@media (min-width: 1024px) {
    .editor-content figure.image.image-style-side.align-right,
    .editor-content figure.image.image-style-side.alignright {
        float: right;
        clear: right;
        margin: 0.35rem 0 1rem 1.5rem;
    }

    .editor-content figure.image.image-style-side.align-left,
    .editor-content figure.image.image-style-side.alignleft {
        float: left;
        clear: left;
        margin: 0.35rem 1.5rem 1rem 0;
    }
}

/* Optional support if Tiny/Metronic emits these too later */
.editor-content figure.image.image-style-block-left {
    margin-left: 0;
    margin-right: auto;
}

.editor-content figure.image.image-style-block-right {
    margin-left: auto;
    margin-right: 0;
}

.editor-content figure.image.image-style-center {
    margin-left: auto;
    margin-right: auto;
}

/* --------------------------------------------------
Image classes directly on <img>
-------------------------------------------------- */

.editor-content img.align-left,
.editor-content img.alignleft {
    float: left;
    clear: left;
    margin: 0.35rem 1.5rem 1rem 0;
}

.editor-content img.align-right,
.editor-content img.alignright {
    float: right;
    clear: right;
    margin: 0.35rem 0 1rem 1.5rem;
}

.editor-content img.align-center,
.editor-content img.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* ==========================================================================
12) Tables
========================================================================== */

.editor-content table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
}

.editor-content table th,
.editor-content table td {
    border: 1px solid var(--content-border);
    padding: 0.75rem 0.9rem;
    vertical-align: top;
    text-align: left;
}

.editor-content table th {
    font-weight: 700;
    background: var(--content-soft-bg);
}

.editor-content table thead th {
    border-bottom-color: var(--content-border-strong);
}

.editor-content table tbody tr:nth-child(even) td {
    background: color-mix(in srgb, var(--content-soft-bg) 60%, transparent);
}

.editor-content table caption {
    caption-side: bottom;
    text-align: center;
    color: var(--content-muted);
    font-size: 0.92rem;
    padding-top: 0.7rem;
}

/* ==========================================================================
13) TinyMCE TOC
========================================================================== */

.editor-content .mce-toc {
    border: 1px solid var(--content-border);
    border-radius: var(--content-radius);
    padding: 1rem 1.1rem;
    background: var(--content-soft-bg);
    margin: 1.25rem 0;
}

.editor-content .mce-toc h2,
.editor-content .mce-toc h3,
.editor-content .mce-toc h4 {
    margin: 0 0 0.8rem;
    font-size: 1.15rem;
    line-height: 1.35;
}

.editor-content .mce-toc ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.editor-content .mce-toc li {
    margin: 0.45rem 0;
}

.editor-content .mce-toc a {
    text-decoration: none;
}

.editor-content .mce-toc a:hover {
    text-decoration: underline;
}

/* ==========================================================================
14) Embedded media
========================================================================== */

.editor-content iframe {
    display: block;
    width: 100%;
    max-width: 100%;
    border: 0;
    border-radius: var(--content-radius-sm);
}

.editor-content .video-wrapper,
.editor-content .embed-responsive,
.editor-content .media-embed,
.editor-content .mce-preview-object {
    position: relative;
    width: 100%;
    max-width: 100%;
}

/* ==========================================================================
15) Misc
========================================================================== */

.editor-content p:empty {
    min-height: 1em;
}

.editor-content img[width][height] {
    height: auto;
}

.editor-content ::selection {
    background: var(--content-selection);
}

/* ==========================================================================
16) Mobile fixes
========================================================================== */

@media (max-width: 1023.98px) {
    .editor-content figure.align-left,
    .editor-content figure.alignleft,
    .editor-content figure.align-right,
    .editor-content figure.alignright,
    .editor-content figure.image.align-left,
    .editor-content figure.image.alignleft,
    .editor-content figure.image.align-right,
    .editor-content figure.image.alignright,
    .editor-content figure.image.image-style-side,
    .editor-content figure.image.image-style-side.align-right,
    .editor-content figure.image.image-style-side.alignright,
    .editor-content figure.image.image-style-side.align-left,
    .editor-content figure.image.image-style-side.alignleft,
    .editor-content img.align-left,
    .editor-content img.alignleft,
    .editor-content img.align-right,
    .editor-content img.alignright {
        float: none !important;
        clear: both !important;
        display: table;
        width: auto !important;
        max-width: 100% !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
}

@media (max-width: 767.98px) {
    .editor-content {
        --content-block-space: 1rem;
        --content-list-indent: 1.15rem;
    }

    .editor-content h1 { font-size: 1.85rem; }
    .editor-content h2 { font-size: 1.55rem; }
    .editor-content h3 { font-size: 1.3rem; }

    .editor-content table th,
    .editor-content table td {
        padding: 0.7rem 0.75rem;
    }

    .editor-content pre {
        padding: 0.9rem;
    }
}
