/* Align default styles of editor with acticle page for WYSIWYG[TM] experience */
.summernote-editor {
  max-width: 1180px;
  max-width: calc(70vw - 24px );
}

.note-frame {
    font-size: 18px;
    font-family: 'NotoSansJP', sans-serif !important;
    font-weight: 400;
    line-height: normal;
}



.note-dropdown-menu.dropdown-fontname {
    max-height: 200px;
    overflow-y: scroll;
}

.summernote-editor .note-editing-area .note-editable {
    padding-left: 24px !important;
    padding-right: 24px !important;
}

.note-editor .note-editing-area .note-editable img.note-float-left,
.note-float-left {
    margin-right: 20px !important;
}

.note-editor .note-editing-area .note-editable img.note-float-right,
.note-float-right {
    margin-left: 10px !important; 
}

/* Fix for large font names wrapping in toolbar */
.note-editor .note-toolbar .note-dropdown-menu, .note-popover .popover-content .note-dropdown-menu {
    min-width: 200px !important;
}

/* Center image button, we do not handle removal of class so this is workaround */
.note-align-center:not(.note-float-left):not(.note-float-right) {
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Override default list styles for editor and article detail page */
.note-editable ol,
.article-detail-content ol {
    list-style: decimal;
    list-style-position: outside;
    padding-left: 0;
    margin-left: 0;
}
.note-editable ul,
.article-detail-content ul {
    list-style: disc;
    list-style-position: outside;
    padding-left: 0;
    margin-left: 0;
}



.note-editable ul, 
.note-editable ol,
.note-editable ul li,
.note-editable ol li {
    list-style-position: outside !important;
}

.note-editable ul.list-style-inside,
.note-editable ol.list-style-inside,
.note-editable ul.list-style-inside li,
.note-editable ol.list-style-inside li,
.article-detail-content ul.list-style-inside,
.article-detail-content ol.list-style-inside {
    list-style-position: inside !important;
}



/* Clears floated images so following content starts below them */
.float-clear {
    clear: both;
    height: 12px;
    margin: 0;
    padding: 0;
    line-height: 0;
    overflow: hidden;
}

/* Visible marker in the editor only */
.note-editable .float-clear {
    height: 12px;
    margin: 4px 0;
    border: 2px solid #e11d48;
    background-color: rgba(225, 29, 72, 0.25);
    overflow: visible;
    cursor: pointer;
}

.note-editable .float-clear.float-clear-active {
    outline: 2px solid #be123c;
    outline-offset: 1px;
}

.note-float-clear-popover {
    z-index: 1060;
}

/* Reusable article block with one image and an editable text column */
.note-editable .image-text-block,
.article-detail-content .image-text-block {
    display: flex;
    align-items: center;
    gap: 24px;
    margin: 20px 0;
}

.note-editable .image-text-block--image-right,
.article-detail-content .image-text-block--image-right {
    flex-direction: row-reverse;
}


.note-editable .image-text-block__media,
.article-detail-content .image-text-block__media {
    flex: none;
}

.note-editable .image-text-block__text,
.article-detail-content .image-text-block__text {
    flex: 1 1 0;
    min-width: 0;
}

.note-editable .image-text-block__media img,
.article-detail-content .image-text-block__media img {
    max-width: 100%;
    height: auto;
}

.note-editable .image-text-block__text > :first-child,
.article-detail-content .image-text-block__text > :first-child {
    margin-top: 0;
}

.note-editable .image-text-block__text > :last-child,
.article-detail-content .image-text-block__text > :last-child {
    margin-bottom: 0;
}

/* Editor-only affordances; these classes are harmless on the public article page. */
.note-editable .image-text-block {
    position: relative;
    padding: 10px;
    border: 1px dashed #94a3b8;
    border-radius: 4px;
}

.note-editable .image-text-block:hover,
.note-editable .image-text-block.image-text-block-active {
    border-color: #2563eb;
}

.note-editable .image-text-block.image-text-block-active {
    outline: 2px solid rgba(37, 99, 235, 0.3);
    outline-offset: 1px;
}

.note-editable .image-text-block__text {
    position: relative;
    min-height: 1.5em;
}

.note-editable .image-text-block__text:has(> p:only-child > br:only-child)::before {
    content: 'Введите текст';
    position: absolute;
    color: #94a3b8;
    pointer-events: none;
}

.note-image-text-block-popover {
    z-index: 1060;
}

.note-image-text-block-icon {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: -0.5px;
}


/* Mobile image styles for inverting image/text order*/
@media (max-width: 785px) {
    .note-editable .image-text-block,
    .note-editable .image-text-block--image-right,
    .article-detail-content .image-text-block,
    .article-detail-content .image-text-block--image-right {
        flex-direction: column;
        gap: 14px;
    }

    
    .note-editable .image-text-block__media,
    .article-detail-content .image-text-block__media {
        order: 2;
    }

    .note-editable .image-text-block__media,
    .note-editable .image-text-block__text,
    .article-detail-content .image-text-block__media,
    .article-detail-content .image-text-block__text {
        width: 100%;
    }

    .article-detail-content p:has(>img) {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .article-detail-content p:has(>img) img {
        float:none !important;
        order: 1;
        max-width: 100% !important;
        height: auto !important;
    }
}


/* Fixes to list issues */
.article-detail-content ul,
.article-detail-content ol {
    list-style: none;
    counter-reset: list-counter;
    padding-left: 10px;    
}

.article-detail-content li::before {
    display: inline-block;
    width: 1em;
    padding-right: 0.5em;
    margin-left: -1em;
    text-align: right;
}

.article-detail-content ol li::before {
    content: counter(list-counter) ".";
    counter-increment: list-counter;
}

.article-detail-content ul li::before {
    content: "•";
}

/* Inside markers: keep ::before in the text flow (article uses custom bullets) */
.article-detail-content ul.list-style-inside li::before,
.article-detail-content ol.list-style-inside li::before {
    margin-left: 0;
}
