/* =========================================================
   CKEditor Frontend Content Styles
   Scope: .editor-content
   ========================================================= */

.editor-content {
    line-height: 1.7;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.editor-content::after {
    content: "";
    display: block;
    clear: both;
}

/* ---------------------------------------------------------
   Paragraphs
   --------------------------------------------------------- */
.editor-content p {
    margin: 0 0 1rem;
}

.editor-content p:last-child {
    margin-bottom: 0;
}

/* ---------------------------------------------------------
   Headings
   --------------------------------------------------------- */
.editor-content h1,
.editor-content h2,
.editor-content h3,
.editor-content h4,
.editor-content h5,
.editor-content h6 {
    line-height: 1.3;
    font-weight: 700;
    margin: 1.4em 0 0.6em;
}

.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: 2rem;
}

.editor-content h2 {
    font-size: 1.75rem;
}

.editor-content h3 {
    font-size: 1.5rem;
}

.editor-content h4 {
    font-size: 1.25rem;
}

.editor-content h5 {
    font-size: 1.1rem;
}

.editor-content h6 {
    font-size: 1rem;
}

/* ---------------------------------------------------------
   Links
   --------------------------------------------------------- */
.editor-content a {
    text-decoration: underline;
    word-break: break-word;
}

.editor-content a:hover {
    text-decoration: none;
}

/* ---------------------------------------------------------
   Images
   CKEditor output: <figure class="image ..."><img></figure>
   --------------------------------------------------------- */
.editor-content figure.image {
    margin: 1.25rem 0;
}

.editor-content figure.image img {
    display: block;
    max-width: 100%;
    height: auto;
}

.editor-content figure.image figcaption {
    margin-top: 0.5rem;
    font-size: 0.92rem;
    line-height: 1.5;
    text-align: center;
    opacity: 0.8;
}

/* Image alignments */
.editor-content figure.image.image-style-block-align-left,
.editor-content figure.image.image-style-align-left {
    float: left;
    max-width: 50%;
    margin: 0.25rem 1.25rem 1rem 0;
}

.editor-content figure.image.image-style-block-align-right,
.editor-content figure.image.image-style-align-right {
    float: right;
    max-width: 50%;
    margin: 0.25rem 0 1rem 1.25rem;
}

.editor-content figure.image.image-style-align-center {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.editor-content figure.image.image_resized {
    max-width: 100%;
}

/* ---------------------------------------------------------
   Tables
   CKEditor output: <figure class="table"><table>...</table></figure>
   --------------------------------------------------------- */
.editor-content figure.table {
    margin: 1.25rem 0;
    width: 100%;
    overflow-x: auto;
}

.editor-content figure.table table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
}

.editor-content figure.table th,
.editor-content figure.table td {
    border: 1px solid #dcdcdc;
    padding: 0.75rem 0.875rem;
    vertical-align: top;
    text-align: left;
}

.editor-content figure.table th {
    font-weight: 700;
}

.editor-content figure.table figcaption {
    margin-top: 0.5rem;
    font-size: 0.92rem;
    line-height: 1.5;
    text-align: center;
    opacity: 0.8;
}

/* ---------------------------------------------------------
   Blockquote
   --------------------------------------------------------- */
.editor-content blockquote {
    margin: 1.25rem 0;
    padding: 0.75rem 1rem;
    border-left: 4px solid #d0d0d0;
    font-style: italic;
}

.editor-content blockquote p:last-child {
    margin-bottom: 0;
}

/* ---------------------------------------------------------
   Lists
   --------------------------------------------------------- */
.editor-content ul,
.editor-content ol {
    margin: 0 0 1rem 1.5rem;
    padding: 0;
}

.editor-content ul li,
.editor-content ol li {
    margin-bottom: 0.35rem;
}

.editor-content ul ul,
.editor-content ul ol,
.editor-content ol ul,
.editor-content ol ol {
    margin-top: 0.35rem;
    margin-bottom: 0.35rem;
}

/* CKEditor list style support */
.editor-content ul[style],
.editor-content ol[style] {
    padding-left: 1.5rem;
}

/* ---------------------------------------------------------
   Horizontal line
   --------------------------------------------------------- */
.editor-content hr {
    border: 0;
    border-top: 1px solid #ddd;
    margin: 2rem 0;
}

/* ---------------------------------------------------------
   Code / pre
   --------------------------------------------------------- */
.editor-content code {
    font-family: Consolas, Monaco, monospace;
    font-size: 0.95em;
    padding: 0.12rem 0.3rem;
    border-radius: 4px;
}

.editor-content pre {
    overflow-x: auto;
    padding: 1rem;
    border-radius: 6px;
    margin: 1.25rem 0;
}

.editor-content pre code {
    padding: 0;
    background: transparent;
    border: 0;
}

/* ---------------------------------------------------------
   Media embeds / iframe / YouTube
   CKEditor media embed çıktıları için
   --------------------------------------------------------- */
.editor-content .media,
.editor-content oembed,
.editor-content .raw-html-embed,
.editor-content iframe {
    max-width: 100%;
}

.editor-content .media {
    margin: 1.25rem 0;
}

/* Responsive iframe wrapper benzeri davranış */
.editor-content .media iframe,
.editor-content p iframe,
.editor-content iframe {
    display: block;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    min-height: 240px;
    border: 0;
}

/* ---------------------------------------------------------
   Images inside paragraphs (just in case)
   --------------------------------------------------------- */
.editor-content p img {
    max-width: 100%;
    height: auto;
}

/* ---------------------------------------------------------
   Alignment classes from CKEditor
   --------------------------------------------------------- */
.editor-content .text-left {
    text-align: left;
}

.editor-content .text-center {
    text-align: center;
}

.editor-content .text-right {
    text-align: right;
}

.editor-content .text-justify {
    text-align: justify;
}

/* CKEditor sometimes uses inline styles/classes from pasted content */
.editor-content [style*="text-align:center"] {
    text-align: center;
}

.editor-content [style*="text-align:right"] {
    text-align: right;
}

.editor-content [style*="text-align:left"] {
    text-align: left;
}

.editor-content [style*="text-align:justify"] {
    text-align: justify;
}

/* ---------------------------------------------------------
   Generic embedded objects safety
   --------------------------------------------------------- */
.editor-content embed,
.editor-content object,
.editor-content video {
    max-width: 100%;
}

/* ---------------------------------------------------------
   Empty spacing fixes
   --------------------------------------------------------- */
.editor-content > *:first-child {
    margin-top: 0 !important;
}

.editor-content > *:last-child {
    margin-bottom: 0 !important;
}

/* ---------------------------------------------------------
   Mobile adjustments
   --------------------------------------------------------- */
@media (max-width: 768px) {
    .editor-content h1 {
        font-size: 1.75rem;
    }

    .editor-content h2 {
        font-size: 1.5rem;
    }

    .editor-content h3 {
        font-size: 1.3rem;
    }

    .editor-content h4 {
        font-size: 1.15rem;
    }

    .editor-content figure.image.image-style-block-align-left,
    .editor-content figure.image.image-style-align-left,
    .editor-content figure.image.image-style-block-align-right,
    .editor-content figure.image.image-style-align-right {
        float: none;
        max-width: 100%;
        margin: 1rem 0;
    }

    .editor-content figure.table th,
    .editor-content figure.table td {
        padding: 0.65rem 0.75rem;
    }

    .editor-content .media iframe,
    .editor-content p iframe,
    .editor-content iframe {
        min-height: 200px;
    }
}

/* QUILL ALIGN SUPPORT */
.editor-content .ql-align-center {
    text-align: center;
}

.editor-content .ql-align-right {
    text-align: right;
}

.editor-content .ql-align-left {
    text-align: left;
}

.editor-content .ql-align-justify {
    text-align: justify;
}

.editor-content .ql-align-center img {
    margin-left: auto;
    margin-right: auto;
}

.editor-content .ql-align-right img {
    margin-left: auto;
}

.editor-content .ql-align-left img {
    margin-right: auto;
}