/**
 * Styling for the single post page (article page).
 */

.post-page-container .post-page {
    display: flex;
    gap: var(--spacing-8);
}

.post-page .post-content-container {
    flex: 700px 1 1;
    height: fit-content;
    padding-top: var(--spacing-9);
    box-sizing: border-box;
}

@media screen and (max-width: 1080px) {
    .post-content-container {
        overflow: hidden;
    }
}

@media screen and (max-width: 780px) {
    .content-post-header {
        margin-bottom: 24px;
    }

    .content-post-header .content-post-title {
        font-size: 24px;
        line-height: 25px;
    }
}

/* region Page breadcrumb */

@media screen and (max-width: 780px) {
    .navigation-header {
        padding-bottom: 16px;
    }

    .post-content-container .navigation-header {
        overflow-x: scroll;
        padding-bottom: 16px;
        margin-bottom: 0;
    }
}

/* endregion */

.post-page-container .post-page .post-content-container .content-post-container {
    color: var(--color-copy-primary);
}

.post-page-container .content-post-header {
    color: var(--text-color-high);
    display: flex;
    justify-content: space-between;
}

.post-page-container .content-post-header .content-post-title {
    font: var(--font-h3);
    margin-bottom: var(--spacing-5);
    letter-spacing: var(--font-h3-spacing);
}

/* region publish date*/

.post-date {
    letter-spacing: var(--font-caption-lg-spacing);
    color: var(--color-copy-secondary);
    margin-bottom: var(--spacing-5);
}


/* region Share buttons */

.content-post-header-share {
    display: flex;
    gap: var(--spacing-5);
}
.content-post-header-share .share-block:first-child {
    margin-left: 0;
}
.content-post-header-share .share-block .share-tooltip-container {
    position: absolute;
    top: -52px;
    white-space: nowrap;
    background-color: var(--surface-grey-1-inverted);
    color: var(--text-color-high-inverted);
    border-radius: 8px;
    font-size: 14px;
    line-height: 20px;
    padding: 8px 12px;
    opacity: 0;
    visibility: hidden;
    z-index: 100;
}
.content-post-header-share .share-block .share-tooltip-container.success,
.content-post-header-share .share-block .share-tooltip-container.show {
    opacity: 1;
    visibility: visible;
}
.content-post-header-share .share-block .share-tooltip {
    position: relative;
    display: flex;
    justify-content: center;
}
.content-post-header-share .share-block .share-tooltip .arrow {
    position: absolute;
    width: 14px;
    height: 14px;
    background-color: var(--surface-grey-1-inverted);
    bottom: -14px;
    transform: rotate(45deg);
    border-radius: 2px;
}
.content-post-header-share .share-block:last-child {
    margin-right: 0 !important;
}
.share-block .copy-link {
    background-position: -33px -134px;
}

@media screen and (max-width: 1080px) {
    .content-post-header-share .copy-link-block.tooltip:before {
        left: 0;
    }
}

/* endregion */

/* region Article content */

.content-post-body {
    margin: 40px 0;
    font-size: 16px;
    line-height: 24px;
}

@media screen and (max-width: 780px) {
    .content-post-body {
        padding-top: 0;
    }
}

/* region Headings */

.content-post-body h1,
.content-post-body h2 {
    font: var(--font-h4);
    margin: var(--spacing-5) 0 var(--spacing-7);
}

.content-post-body h2,
.content-post-body h3,
.content-post-body h4 {
    color: var(--text-color-high);
}

.content-post-body h3 {
    font: var(--font-h5);
    margin: var(--spacing-5) 0 var(--spacing-7);
}

.content-post-body h4 {
    font: var(--font-copy-md-bold);
    margin-bottom: var(--spacing-5);
}

/* endregion */

.content-post-body p {
    margin-bottom: var(--spacing-7);
    line-height: 24px;
}

.content-post-body a {
    text-decoration: underline !important;
}

.content-post-body img {
    max-width: 100%;
    height: auto;
}

.content-post-body li img {
    margin-top: 12px;
}

/* region Lists */

.content-post-body ol {
    list-style-type: none;
    counter-reset: item;
    margin: 0;
    padding: 0;
}

.content-post-body ul {
    margin: 0;
}
.content-post-body li ul {
    padding-inline-start: 1em;
}

.content-post-body  ol > li {
    display: table;
    counter-increment: item;
    margin-top: 1em;
    font-variant-numeric: tabular-nums;
}

.content-post-body ul > li {
    margin-top: 1em;
}

.content-post-body  ul > li {
    padding-inline-start: 1em;
}

.content-post-body ul ul,
.content-post-body ol ol,
.content-post-body ul ol,
.content-post-body ol ul {
    margin-bottom: 0;
}

.content-post-body ol > li:before {
    content: counters(item, ".") ". ";
    display: table-cell;
    padding-inline-end: 1.5em;
}

.content-post-body ol ul li {
    counter-increment: unset;
}

.content-post-body ul ol > li:before {
    content: counter(item)". ";
}

.content-post-body ol ul > li:before {
    content: unset;
}

.content-post-body ul ol > li {
    counter-increment: item;
}

.content-post-body ol ul ol > li:before {
    content: counter(item)". ";
}

/* endregion */

/* region Tables */

.content-post-body table th,
.content-post-body table td {
    padding: 12px;
}

.content-post-body .wp-block-table.is-style-stripes {
    border-bottom: unset;
    margin: 0 0 1em;
}

figure.wp-block-table table {
    border-collapse: collapse;
}

figure.wp-block-table table td,
figure.wp-block-table table th {
    padding: var(--spacing-3);
    /* Default no style to MEGA Dashed */
    border: 1px dashed var(--color-grey-350);
    vertical-align: top;
}

figure.wp-block-table.justify-text {
    text-align: justify;
}

figure.wp-block-table.is-style-regular table td,
figure.wp-block-table.is-style-regular table th {
    border: 1px solid var(--color-grey-200);
}

figure.wp-block-table.is-style-dashed table td,
figure.wp-block-table.is-style-dashed table th {
    border: 1px dashed var(--color-grey-350);
}

figure.wp-block-table.is-style-stripes tbody tr:nth-child(odd) {
    background-color: var(--color-bg-surface-1);
}

/* Prevent custom table colours & font sizes displaying on page */
figure.wp-block-table table tr {
    color: var(--color-copy-primary);
    font-size: var(--spacing-5);
}

figure.wp-block-table table img {
    vertical-align: middle;
}

figure.wp-block-table table tr.bg-1,
figure.wp-block-table table td.bg-1,
figure.wp-block-table table th.bg-1 {
    background-color: var(--color-bg-surface-1);
}

figure.wp-block-table table tr.bg-2,
figure.wp-block-table table td.bg-2,
figure.wp-block-table table th.bg-2 {
    background-color: var(--color-bg-surface-2);
}

figure.wp-block-table table tr.bg-3,
figure.wp-block-table table td.bg-3,
figure.wp-block-table table th.bg-3 {
    background-color: var(--color-bg-surface-3);
}


/* Sync Icon Table */
.post-content-container figure.wp-block-table.sync-icons tr td:nth-child(2),
.post-content-container figure.wp-block-table.sync-icons tr td:nth-child(4) {
    display: none;
}

.post-content-container figure.wp-block-table.sync-icons img {
    max-width: none;
}

.theme-dark .post-content-container figure.wp-block-table.sync-icons tr td:nth-child(2),
.theme-dark .post-content-container figure.wp-block-table.sync-icons tr td:nth-child(4) {
    display: table-cell;
}

.theme-dark .post-content-container figure.wp-block-table.sync-icons tr td:nth-child(1),
.theme-dark .post-content-container figure.wp-block-table.sync-icons tr td:nth-child(3) {
    display: none;
}
/* endregion */

/* Breakpoint L */
@media screen and (min-width: 1080px) {
    figure.wp-block-table.medium-sized-table {
        grid-column: 3 / -3;
    }
}

/* Breakpoints S and M */
@media screen and (min-width: 0) and (max-width: 1080px) {
    figure.wp-block-table.medium-sized-table {
        grid-column: 1 / -1;
    }
}

/* Hide scrollbar for Chrome, Safari and Opera */
figure.wp-block-table::-webkit-scrollbar {
    display: none;
}

/* Hide scrollbar for IE, Edge and Firefox */
figure.wp-block-table {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

figure.wp-block-table table td,
figure.wp-block-table table th {
    padding: var(--spacing-5);
}

figure.wp-block-table table td.has-text-align-center .icon-box {
    margin: 0 auto;
}

figure.wp-block-table table td.has-text-align-center .icon-box .icon.x-mro {
    color: var(--color-link-disabled);
}

figure.wp-block-table figcaption {
    margin-top: var(--spacing-7);
    font: var(--font-copy-sm);
    color: var(--color-copy-secondary);
}

figure.wp-block-image figcaption {
    margin: var(--spacing-7) 0 0;
    font: var(--font-copy-sm);
    color: var(--color-copy-secondary);
}


/* Breakpoint S */
@media screen and (min-width: 0) and (max-width: 768px) {
    figure.wp-block-table table {
        width: 720px;
    }
}

/* endregion */

/* region Notes */

.content-post-body .note {
    background-color: var(--color-bg-surface-1);
    border: 1px solid var(--color-grey-150);
    padding: 28px 25px 28px 16px;
    margin: var(--spacing-7) 0;
    border-radius: 8px;
    border-inline-start-color: var(--color-primary-red-500);
    border-inline-start-width: 9px;
}
.content-post-body .note h4.note-header:before {
    mask-image: var(--icon-mono-file-edit-mro);
    -webkit-mask-image: var(--icon-mono-file-edit-mro);
}
.content-post-body .note.info h4.note-header:before {
    mask-image: var(--icon-mono-info-mro);
    -webkit-mask-image: var(--icon-mono-info-mro);
}
.content-post-body .note.warning h4.note-header:before {
    mask-image: var(--icon-mono-alert-triangle-sro);
    -webkit-mask-image: var(--icon-mono-alert-triangle-sro);
}
.content-post-body .note.tip h4.note-header:before {
    mask-image: var(--icon-mono-lightbulb-mro);
    -webkit-mask-image: var(--icon-mono-lightbulb-mro);
}
.content-post-body .note h4.note-header:before {
    content: '';
    display: block;
    width: 24px;
    height: 24px;
    mask-position: center;
    -webkit-mask-position: center;
    mask-size: contain;
    -webkit-mask-size: contain;
    mask-repeat: no-repeat;
    -webkit-mask-repeat: no-repeat;
    color: inherit;
    background-color: currentColor;
    position: absolute;
    left: 0;
}
.direction-rtl .content-post-body .note h4.note-header:before {
    right: 0;
    left: unset;
}
.content-post-body .note *:not(h4.note-header) {
    font-size: 14px;
    line-height: 20px;
    margin: 0;
}
.content-post-body .note h4.note-header {
    margin-top: 0;
    margin-bottom: 14px;
    font-size: 16px;
    line-height: 24px;
    padding-inline-start: 32px;
    opacity: 1;
    position: relative;
    display: flex;
    align-items: center;
}

/* endregion */

/* endregion */


/* region Feedback */

.feedback {
    border-top: 1px solid var(--divider-border);
    border-bottom: 1px solid var(--divider-border);
    padding: 50px 16px;
    margin-top: 30px;
}
.feedback .feedback-text {
    opacity: 0.7;
}
.feedback-prompt {
    display: flex;
    justify-content: space-between;
}
.feedback-yes,
.feedback-no {
    display: inline-block;
    padding-inline-start: 34px;
    cursor: pointer;
    user-select: none;
    position: relative;
}
.feedback-yes {
    margin-inline-end: 72px;
}
.feedback-yes .feedback-yes-icon {
    position: absolute;
    left: 0;
    height: 24px;
    width: 24px;
    background-position: -74px -248px;
}
.feedback-yes:hover .feedback-yes-icon {
    background-position: -171px -248px;
}
.feedback-no .feedback-no-icon {
    position: absolute;
    left: 0;
    height: 24px;
    width: 24px;
    background-position: -33px -248px;
}
.feedback-no:hover .feedback-no-icon {
    background-position: -216px -248px;
}
.feedback-form .feedback-user-label {
    display: block;
    opacity: 0.7;
}
.feedback-form .feedback-user-textarea {
    display: block;
}
.feedback-form .feedback-user-textarea {
    resize: none;
    background: var(--surface-main);
    border: 1px solid #ececec;
    border-radius: 4px;
    padding: 14px;
    font-size: 13px;
    color: var(--surface-main-inverted);
    width: 84%;
    margin-top: 24px;
}
.feedback-form .feedback-send {
    padding: 10px 24px;
    cursor: pointer;
    margin-top: 24px;
}

@media screen and (max-width: 780px) {
    .post-content-container .feedback {
        width: 100%;
        padding-right: 0;
        padding-left: 0;
    }

    .feedback {
        padding-top: 26px;
        padding-bottom: 44px;
    }
    .feedback .feedback-prompt {
        display: block;
        text-align: center;
    }
    .feedback .feedback-prompt .feedback-text {
        margin-bottom: 42px;
    }
}

/* endregion */

/* region Related articles */

.related-articles h4 {
    color: var(--color-primary-red-500);
    font: var(--font-h5);
    margin-top: 0;
    margin-bottom: 44px;
}

.related-articles {
    padding: 60px 0 110px;
}
.related-articles .post-list-item {
    margin-bottom: 18px;
    display: block;
}
.related-articles .post-list-item:hover {
    text-decoration: underline !important;
}

@media screen and (max-width: 780px) {
    .related-articles h4 {
        margin-bottom: 20px;
    }

    .related-articles .post-list-item {
        font-size: 14px;
    }
}

/* endregion */

/* region Article navigation */

nav.article-nav {
    flex: 220px 0 0;
    height: fit-content;
    position: sticky;
    top: var(--spacing-9);
    margin-bottom: var(--spacing-9);
    display: flex;
    flex-direction: column;
    padding: 27px 0;
    box-sizing: border-box;
    border: 1px solid var(--color-grey-150);
    border-radius: 4px;
    box-shadow: 0 1px 6px 0 rgba(142, 142, 142, 0.5);
}
.theme-dark nav.article-nav {
    box-shadow: none;
}

nav.article-nav .heading {
    margin: 0 0 24px;
    padding: 0 32px;
    font: var(--font-copy-md-bold);
}

nav.article-nav .nav-item {
    padding: 11px 28px;
    font: var(--font-copy-md);
    cursor: pointer;
    box-sizing: border-box;
    border-inline-start: 4px solid transparent;
}
nav.article-nav .nav-item.active {
    border-inline-start: 4px solid var(--color-primary-red-500);
    background-color: var(--color-bg-surface-1);
    color: var(--color-primary-red-500);
    font: var(--font-copy-md-bold)
}

@media screen and (max-width: 1080px) {
    nav.article-nav {
        display: none;
    }
}

/* endregion */
