.mce {
    font-size: 16px;

    --color-primary: #8e7652;
    --color-primary-dark: #6b5739;
}

.mce .wp-block-heading {
    line-height: 1.3;
    clear: both;
    margin-top: 1.5em;
}


.mce > *:first-child {
    margin-top: 0!important;
}
.mce > *:last-child {
    margin-bottom: 0!important;
}



.mce h2,
.mce h3,
.mce h4 {
    font-family: 'PT Sans', sans-serif!important;
    margin-top: 1.4em;
    margin-bottom: .6em;
    color: #000000;
}

.mce h2 {
    font-family: 'PT Sans', sans-serif!important;
    font-size: 24px;
    font-weight: 700;
    line-height: 24px;
    text-align: left;
}

.mce h3 {
    font-size: 1.55em;
    font-weight: 700;
}

.mce h4 {
    font-size: 1.3em;
    font-weight: 700;
}

.mce h4,
.mce h4 strong {
    font-weight: normal;
}

.mce p {
    margin-top: 0.6em;
    line-height: 1.7;
}

.mce ul,
.mce ol {
    margin-top: .7em;
    padding-left: 1em;
}

.mce ul {
    list-style: none;
}

.mce li {
    line-height: 1.55;
}

.mce ul li {
    display: list-item;
    list-style: none;
    position: relative;
}

.mce ul li::before {
    display: block;
    position: absolute;
    content: "";
    width: 1em;
    height: 1em;
    background: url('../img/icon/chevron-dark-right.png') no-repeat center center;
    background-size: 50% auto;
    left: 0;
    transform: translateX(-100%);
    margin-left: -.2em;
    top: .25em;
}

.mce ul li + li {
    margin-top: .4em;
}

.mce a {
    text-decoration: underline;
    color: #000000;
}

.mce a:hover {
    text-decoration: none;
}

.mce > .wp-block-image {
    display: block;
    margin-top: 2em;
    margin-bottom: 36px;

    position: relative;
}


.mce > .wp-block-image img {
    display: block;
    border-radius: 6px;
    max-height: 80vh;
    object-fit: cover;
    max-width: 100%;
    height: auto;
}

.mce > .wp-block-image figcaption {
    font-size: 14px;
    margin-top: 1em;
    font-style: italic;
    color: #666666;
    line-height: 18px;
    font-family: 'PT Sans';
}

.mce > .wp-block-image .aligncenter figcaption {
    text-align: center;
}

.mce pre {
    margin-top: 1em;
    background-color: rgba(0,0,0,.05);
    padding: 1em;
    font-family: monospace;
    line-height: 1.6;
    border: 1px solid rgba(0,0,0,.05);
    overflow-x: auto;
    max-width: 100%;
    white-space: pre;
    -webkit-overflow-scrolling: touch;
    font-size: .8em;
}

.mce .wp-block-separator {
    margin-top: 70px;
    margin-bottom: 70px;
}

.mce .wp-block-embed {
    margin-top: 2em;
    margin-bottom: 2em;
}

.mce .wp-block-embed__wrapper {
    /*
        height: 0;
        padding-bottom: 56.25%;
    */
    position: relative;
    width: 100%;
}

.mce .wp-block-embed iframe {
    display: block;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    position: absolute;
}

.mce ol,
.mce ul {
    list-style-position: outside;
    padding-left: 25px;
}

.mce ol {
    list-style-type: decimal;
}

.mce ul {
    list-style-type: disc;
}

.mce ol li,
.mce ul li {
    display: list-item;
}

.mce .wp-block-columns {
    clear: both;
}

.mce .wp-block-table {
    overflow: visible;

    margin-top: 2.5em;
    margin-bottom: 2.5em;
}

.mce .wp-block-table .wp-element-caption {
    margin-top: .7em;
    font-style: italic;
}

.mce .wp-block-table table {
    width: 100%;

    /** con be configured via gutenberg block **/
    border-collapse: collapse;

    text-align: left;
    table-layout: fixed;
}

.mce .wp-block-table table th,
.mce .wp-block-table.is-style-stripes table th,
.mce .wp-block-table table td,
.mce .wp-block-table.is-style-stripes table td {
    font-size: 1em;
    padding: 1em 1.2em;
    border-color: var(--color-primary);

    border-top-width: 0;
    border-right-width: 0;
}

.mce .wp-block-table table > *:first-child > *:first-child > * {
    border-top: 1px solid var(--color-primary);
}

.mce .wp-block-table table tr *:last-child {
    border-right: 1px solid var(--color-primary);
}

.mce .wp-block-table.is-style-stripes tbody tr:nth-child(odd) {
    background-color: #8e76521f;
}

.mce .wp-block-table table thead {
    border-bottom-color: var(--color-primary);
}



/**
 * must match first cell in the first row (and it can be either in thead or in tbody)
*/
.mce table > *:first-child > *:first-child > *:first-child {
    border-top-left-radius: 5px;
}
.mce table > *:first-child > *:first-child > *:last-child {
    border-top-right-radius: 5px;
}

.mce table > *:last-child > *:last-of-type > *:first-of-type {
    border-bottom-left-radius: 5px;
}
.mce table > *:last-child > *:last-of-type > *:last-of-type {
    border-bottom-right-radius: 5px;
}


/** table of contents **/
.wm-table-of-contents {
    margin-top: 2em;
    margin-bottom: 2em;
    background-color: #8e76521f;
    border-radius: 10px;
    padding: var(--content-padding);
}

.wm-table-of-contents h3 {
    margin: 0;
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: .7em;
}

/** numering
 * https://stackoverflow.com/a/21909808/2880184
 **/
.wm-table-of-contents ol {
    counter-reset: section;
    list-style-type: none;
    margin-left: initial;
}

.wm-table-of-contents ol li::before {
    display: inline-block;
    counter-increment: section;
    content: counters(section, ".");
    margin-right: .4em;
}

.wm-table-of-contents ol li a {
    color: var(--color-primary);
}

/** update, removing the numbering **/
.wm-table-of-contents ol {padding-left: 0;}
.wm-table-of-contents ol li::before {display: none}



/** custom gutenberg block **/
.wp-block-wm-block-related-article {
    margin-top: 2em;
    margin-bottom: 2em;
}

/** this is a related post created by wpify/abcmedia plugin, which is not properly styled **/
.mce .related-post {
    display: none;
}

@media (max-width: 480px) {
    .wp-block-wm-block-related-article .listing-horizontal-item-social {
        font-size: 11px;
    }

    .wp-block-wm-block-related-article .listing-horizontal-item-social-item + .listing-horizontal-item-social-item {
        margin-left: .7em;
    }

    .wp-block-wm-block-related-article  .listing-horizontal-item-title {
        margin-top: 0;
    }

    .wp-block-wm-block-related-article .listing-horizontal-item {
        padding-left: calc(140px + var(--content-padding));
    }

    .wp-block-wm-block-related-article .listing-horizontal-item-image {
        width: 140px;
        height: 100px;
    }

    .wp-block-wm-block-related-article .listing-horizontal-item-excerpt {
        display: none;
    }
}

/* block youtube */
.mce .wp-block-embed-youtube .wp-block-embed__wrapper {
    height: 0;
    padding-bottom: 56.25%;
    position: relative;
    width: 100%;
}
/* block youtube end */

/** general block image source **/
.wp-block-image-caption {
    position: absolute;
    bottom: 0;
    right: 0;
}

.wp-block-image-caption:hover {
    height: 60px;
    left: 0;
    width: 100%;
    background: #000000a6;
    border-radius: 0 0 6px 6px;
}

.mce .wp-block-image .wp-block-image-source {
    position: absolute;
    right: 0;
    bottom: 0;
    display: block;
    max-width: 300px;
    text-align: left;
    user-select: none;
    z-index: 30;
    padding: .7em;
}

.mce .wp-block-image .wp-block-image-source-icon {
    width: 1.5em;
    height: 1.5em;
    display: block;
    cursor: pointer;
    background-size: 100% 100%;
    opacity: 1;
    transition: opacity 199ms ease-in;
}

.wp-block-image-source-icon .icon-info2,
.icon-info{
    color: white;
    font-size: 25px;
}

.mce .wp-block-image .wp-block-image-source:hover .wp-block-image-source-icon {
    opacity: 1;
}

.mce .wp-block-image .wp-block-image-source-text {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    color: white;
    padding: 1em .7em;
    font-size: 13px;
    border-radius: 4px;
    display: none;
    white-space: nowrap;
    font-family: 'PT Sans';
    padding-left: 20px;
}

.mce .wp-block-image .wp-block-image-caption:hover .wp-block-image-source-text {
    display: flex;
    align-items: center;
}

/* related post remove caption */
.mce-wm-gutenberg-block.mce-wm-gutenberg-block-related-post .wp-block-image-caption {
    display: none;
}

.mce > .wp-block-image > a {
    display: block;
    text-decoration: none;
    position: relative;
}

.image-figure-wrapper {
    position: relative;
}

/** gallery styles **/
.mce .wp-block-gallery {
    --gallery-block--gutter-size: 1em;

    margin-top: var(---gallery-block--gutter-size, var(--content-padding));
    margin-bottom: var(---gallery-block--gutter-size, var(--content-padding));
}

.mce .wp-block-gallery.has-nested-images figure.wp-block-image img {
    border-radius: 0;
}

.mce .wp-block-gallery.has-nested-images figure.wp-block-image {
    aspect-ratio: 1 / 1 ;
    position: relative;
    overflow: hidden;
    border-radius: 6px;

    flex-grow: 0;

    background-color: rgba(0,0,0,.1);
}

.mce .wp-block-gallery.has-nested-images figure.wp-block-image.wp-block-image-can-grow {
    flex-grow: 1;
}

.mce .wp-block-gallery figure.wp-block-image img {
    backface-visibility: hidden;
    width: 100%;
    height: 100%;
    object-fit: cover;

    transition: transform 199ms ease-out;
}

.mce .wp-block-gallery .wp-block-image:hover img {
    transform:scale(1.06);
}

.mce .wp-block-gallery .wp-block-image .wp-block-image-source {
    display: none;
}

.mce .wp-block-image-has-show-more {
    position: relative;
}

.mce .wp-block-image-has-show-more .wp-block-gallery-show-more-info {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    color: white;
    display: flex;
    font-weight: 900;
    justify-content: center;
    font-size: 2em;
    background: #262626d6;
    background-size: 25% auto;
    transition: background-color 199ms ease-out;

    cursor: pointer;
    user-select: none;
    align-items: center;
    flex-direction: row!important;
}

.icon-layers{
    color: white;
    margin-right: 5px;
}

.mce .wp-block-image-has-show-more .wp-block-gallery-show-more-info:hover {
    background-color: rgba(38, 38, 38, 0.91);
}

.wm-block-infobox {
    background: #8e76521f no-repeat right 1em top 1em url("../img/icon/info.png?v2");
    background-size: 1em auto;
    padding: 1em;
    margin-top: calc(2 * 1em);
    margin-bottom: calc(2 * 1em);

    border-radius: 8px;
}

.wm-block-infobox-title {
    margin: 0;
    color: var(--color-primary);
    font-weight: bold;
    line-height: 1.4;
    font-size: 1.2em;
}

.wm-block-infobox-content {
    margin: 0;
    white-space: pre-line;
}

.wm-block-infobox-title + .wm-block-infobox-content {
    margin-top: .7em;
}

.mce-wm-gutenberg-block {
    font-size: 1rem;
    margin-top: var(--content-padding);
    margin-bottom: var(--content-padding);
}


@media (max-width: 992px) {
    .mce .wp-block-table {
        overflow-x: auto;
    }
}

@media (max-width: 768px) {
    .mce .wp-block-image-has-show-more .wp-block-gallery-show-more-info {
        font-size: 1em;
    }

    .mce .wp-block-image .wp-block-image-source:hover .wp-block-image-source-text {
        left: initial;
        right: var(--content-padding);
        transform: initial;
    }
}

@media (max-width: 600px) {

    .mce .wp-block-gallery {
        gap: 0;
    }

    .mce .wp-block-gallery.has-nested-images figure.wp-block-image.wp-block-image-can-grow {
        flex-basis: 18%;
        max-width: 20%;
    }

    .mce .wp-block-gallery.has-nested-images figure.wp-block-image.wp-block-image-can-grow + .wp-block-image {
        margin-left: .2em!important;
    }
}