.poster_modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.9);

    &.hidden {
        display: none;
    }
}

.poster_modal.poster_modal--stacked {
    z-index: 10001;
}

.poster_modal-content {
    position: relative;
    width: 100%;
    height: calc(100vh - 50px);
    overflow-y: auto;
    overflow-x: hidden;
    border-radius: 8px;
    padding: 20px;
}

.poster_modal-body {
    height: 100%;
}

.single-poster-content {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 380px 50px;
    grid-template-rows: 94vh;
    grid-template-areas: "poster sidebar toolbar";
    gap: 10px;
    width: 100%;
    height: 100%;
}

.pst-member-post-media-viewer > .poster__header {
    display: none;
}

.pst-member-post-media-viewer__desktop-author {
    margin-bottom: 12px;
}

.poster__main {
    grid-area: poster;

    &.poster__main--grid {
        --nav-size: 80px;
        display: grid;
        grid-template-rows: calc(100% - var(--nav-size) - 30px) var(--nav-size);
        gap: 0.3rem;
        grid-template-areas: "poster" "nav";
        &.has-ad {
            grid-template-rows: 100px calc(100% - var(--nav-size) - 160px) var(--nav-size);
            grid-template-areas: "ad" "poster" "nav";  
            
            & > .advert {
                grid-area: ad;
            }
        }
    }
    
    &:not(.poster__main--grid).has-ad {
        grid-area: poster;
        display: grid;
        grid-template-rows: 100px calc(100% - 120px);
        grid-template-areas: "ad" "poster";
        height: 100%;

        & > .poster__primary-wrapper {
            grid-area: poster;
        }

        & > .advert {
            grid-area: ad;
        }
    }
}

.poster__sidebar {
    display: grid;
    grid-area: sidebar;
}

.poster__sidebar-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: auto;
}

.poster__sidebar-block {
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    background-color: rgba(0, 0, 0, 0.15);
    padding: 12px;
    -webkit-backdrop-filter: blur(4px) saturate(120%);
    backdrop-filter: blur(4px) saturate(120%);

    &.accordian > .poster__sidebar-block-toggle {
        display: flex;
    }

    &.accordian.close > *:not(.poster__sidebar-block-toggle):not(.poster__sidebar-block-title) {
        display: none;
    }

    &.accordian.close > .poster__sidebar-block-title {
        margin-bottom: 0;
    }

    & .comment-form {
        display: flex;
        justify-content: space-between;
        flex-wrap: wrap;
        border: 1px solid rgba(255, 255, 255, 0.2);
        padding: 5px 5px 5px 15px;
        border-radius: 30px;
        margin-bottom: 10px;


        & > p {
            margin: 0;
        }
    }
    
    & .poster__comment-message {
        width: 100%;
        margin: 0 0 3px;
        color: rgba(255, 255, 255, 0.58);
        font-size: 12px;
        line-height: 1.25;
    }

    & .poster__comment-message--error {
        color: rgba(255, 255, 255, 0.68);
    }

    & .comment-form-comment {
        display: flex;
        height: 30px;
        align-items: center;
        width: calc(100% - 34px);
 
        & > label {
            visibility: hidden;
            font-size: 0.1px;
        }

        & > textarea {
            resize: none;
            height: 18px;
            background-color: transparent;
            padding: 0;
            font-size: 85%;
            max-height: 200px;
            overflow: auto;
            field-sizing: content;
            outline: none;
        }
    }

    & .pst-submit {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background-color: var(--blue);
        color: #fff;
        padding: 0!important;
        width: 30px;
        height: 30px;
    }

    & .pst-submit.is-posting {
        cursor: wait;
    }

    & .comment.depth-1 > .children {
        padding-left: 48px;
    }

    & article.comment-body {
        font-size: 85%;
    }

    & .comment-author.vcard {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 10px;
        padding-left: 48px;

        & > b {
            line-height: 2.2;
        }

        & > img {
            position: absolute;
            top: 0;
            left: 0;
            width: 38px;
            height: 38px !important;
        }

        & > time {
            font-size: 80%;
        }
    }

    & .comment-content {
        padding: 0 0 12px 48px;

        & > p {
            margin: 0 0 0.3rem;
            font-size: inherit;
        }
    }

    & .poster__comment-formatting-hint {
        width: 100%;
        margin: 6px 0 0;
        color: rgba(255, 255, 255, 0.55);
        font-size: 70%;
        line-height: 1.4;

        & code {
            color: rgba(255, 255, 255, 0.82);
            font-size: inherit;
            background-color: #ffffff33;
            padding: 2px 4px;
            border-radius: 3px;
            border: 1px solid #ffffff44;
        }
    }

    & .comment-content blockquote {
        margin: 0 0 0.45rem;
        padding-left: 10px;
        border-left: 2px solid var(--blue);
        color: rgba(255, 255, 255, 0.76);
    }

    & .comment-content ul {
        margin: 0 0 0.45rem 1.1rem;
        padding: 0;
    }

    & .comment-content li {
        margin: 0 0 0.2rem;
    }

    & .poster-card-new__author-love {
        display: none;
    }
}

.poster__sidebar .pst-poster-stat-chart {
    min-width: 0;
}

.poster__sidebar .pst-poster-stat-chart__title {
    margin: 0 0 10px;
    color: #ffffff;
    font-size: 14px;
    line-height: 1.25;
}

.poster__sidebar .pst-poster-stat-chart .pst-poster-views-chart {
    padding: 12px;
}

.poster__sidebar .pst-poster-stat-chart .pst-poster-views-chart__summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
}

.poster__sidebar .pst-poster-stat-chart .pst-poster-views-chart__summary > span {
    font-size: 18px;
}

.poster__sidebar .pst-poster-stat-chart .pst-poster-views-chart__summary > small {
    text-align: left;
}


.poster__sidebar-block-toggle {
    position: absolute;
    top: 8px;
    right: 12px;
    display: none;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    cursor: pointer;
}

.poster__sidebar-block-title {
    display: block;
    margin-bottom: 16px;
    font-weight: 600;
}

.poster__sidebar-title {
    font-size: 18px;
    line-height: 1.4;
    font-weight: 700;
    font-family: inherit;
}

.poster__sidebar-description {
    display: block;
    margin-bottom: 22px;
    line-height: 1.4;
    & > p {
        margin: 0;
    }
}

.poster__sidebar-date {
    display: block;
    margin-bottom: 14px;
    font-size: 14px;
    color: #777;
}

.poster__toolbar {
    display: flex;
    flex-direction: column;
    gap: 4px;
    grid-area: toolbar;
}

.poster__toolbar-button-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
}

.poster__toolbar-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
    cursor: pointer;
    & > svg {
        height: auto;
        width: auto;
        max-height: 16px;
        /* max-width: 16px; */
    }
}

.poster-love {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;

    & > svg {
        pointer-events: none;
    }
}

.poster__details {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 20px;
    padding: 16px 8px;
    font-size: 0.9rem;
}

.poster__details-box {
    display: flex;
    align-items: center;
    gap: 5px;
    max-width: 180px;
    font-size: 90%;
    text-align: center;
    & > a:hover {
        text-decoration: underline;
    }
}

.poster__primary-carousel,
.poster__nav-carousel,
.poster__primary-wrapper,
.full-slide-wrapper {
    width: 100%;
}

.full-slide-wrapper,
.poster__primary-wrapper {
    height: 100%;
}

.poster__primary-carousel {
    grid-area: poster;
    & .full-slide {
        width: 100%;
        height: 100%;
        object-fit: contain;
        object-position: top;
    }
}

.poster__nav-carousel {
    grid-area: nav;
}

.poster__primary-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;

    & > img {
        max-width: 100%;
        max-height: 100%;
        width: 100%;
        height: auto;
        object-fit: contain;
    }
}

.nav-slide-wrapper {
    width: var(--nav-size);
    height: var(--nav-size);
    margin-right: 12px;
    overflow: hidden;
    border-radius: 12px;
    background-color: #000;

    & > img {
        width: 100%;
        height: 100%;
    }

    &:not(.is-selected) > img {
        opacity: 0.4;
    }
}

.poster__comments-list {
    max-height: 500px;
    overflow: auto;
}

.form-submit {
    display: flex;
    justify-content: flex-end;
}

.form-submit > input,
.form-submit > button {
    border-radius: 100px !important;
}

.poster__info-list-title {
    margin: 0;
    line-height: 2;
}

.poster__info-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 12px;
}

.poster-mobile-tab-bar {
    display: none;
}

/* Colour Palette on single-poster.php */

.poster__palette {
    display: flex;
    width: 100%;
    margin: 8px 0;
}

.poster__palette-swatch-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    width: auto;
    height: 24px;
    cursor: pointer;
}

.poster__palette-swatch {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    width: auto;
    height: 24px;
    cursor: pointer;
}

.poster__palette-swatch-wrapper:first-of-type .poster__palette-swatch {
    border-radius: 6px 0 0 6px;
}

.poster__palette-swatch-wrapper:last-of-type .poster__palette-swatch {
    border-radius: 0 6px 6px 0;
}

.poster__palette-swatch::after {
    content: "\f002";
    display: block;
    width: 12px;
    height: 12px;
    color: #fff;
    font-size: 80%;
    font-family: FontAwesome;
    text-shadow: 0px 0px 4px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: all 0.2s;
}

@media screen and (min-width: 769px) {
    .poster__toolbar-button:hover {
        background-color: rgba(40, 40, 40, 0.8);
    }

    .poster__palette-swatch:hover::after {
        opacity: 1;
    }

    .poster__primary-carousel > .flickity-viewport {
        height: 100% !important;
    }
}

@media screen and (max-width: 768px) {
    .poster_modal {
        overflow: hidden;
    }

    /*
     * Keep legacy/desktop markup usable if client-side template switching is
     * unavailable. Without this override, the 380px sidebar and 50px toolbar
     * collapse the poster column to zero on a phone-sized viewport.
     */
    .single-poster-content:not(.single-poster-content--mobile) {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto auto;
        grid-template-areas:
            "poster"
            "sidebar";
        gap: 0;
        height: auto;
        min-height: 100%;
    }

    .poster_modal-content {
        height: 100vh;
        height: 100dvh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    .single-poster-content.single-poster-content--mobile {
        --poster-header-height: 64px;
        display: flex;
        flex-direction: column;
        gap: 0;
        min-height: 100%;
        height: auto;
        max-width: 620px;
        padding-bottom: 24px;
        background-color: #000;
    }

    .single-poster-content--mobile > .pst-mobile-modal-header {
        position: sticky;
        top: 0;
        left: 0;
        z-index: 100;
        display: grid;
        grid-template-columns: 42px minmax(0, 1fr) 42px;
        grid-template-areas: "back info options";
        gap: 12px;
        align-items: center;
        width: 100%;
        min-height: var(--poster-header-height);
        padding: 8px 12px;
        background-color: #000;
    }

    .single-poster-content--mobile > .pst-mobile-modal-header > .poster__modal-close {
        grid-area: back;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 42px;
        padding: 0;
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 50%;
        background-color: #141517;
        color: #fff;
        font-size: 18px;
        text-decoration: none;
        cursor: pointer;
    }

    .single-poster-content--mobile > .pst-mobile-modal-header > .poster-card-new__author-meta {
        grid-area: info;
        grid-template-columns: 32px minmax(0, 1fr);
        gap: 0 12px;
        min-width: 0;
    }

    .single-poster-content--mobile > .pst-mobile-modal-header > .poster-card-new__author-meta > img {
        width: 32px;
        height: 32px;
    }

    .single-poster-content--mobile > .pst-mobile-modal-header .poster-card-new__author-love {
        display: none;
    }

    .single-poster-content--mobile > .pst-mobile-modal-header > .pst-feed-item__post-options {
        grid-area: options;
    }

    .single-poster-content--mobile .pst-poster-mobile-post {
        width: 100%;
        padding: 0 16px;
        overflow: visible;
        border-bottom: 0;
    }

    .single-poster-content--mobile .pst-poster-mobile-post:hover {
        border-radius: 0;
        background-color: transparent;
    }

    .pst-poster-mobile-post__intro {
        padding: 16px 0 14px;
    }

    .pst-poster-mobile-post__title {
        margin: 0 0 6px;
        font-family: inherit;
        font-size: 20px;
        font-weight: 700;
        line-height: 1.2;
    }

    .pst-poster-mobile-post__description {
        /* font-size: 14px; */
        line-height: 1.4;
    }

    .pst-poster-mobile-post__description > :first-child {
        margin-top: 0;
    }

    .pst-poster-mobile-post__description > :last-child {
        margin-bottom: 8px;
    }

    .pst-poster-mobile-post__intro .pst-feed-item__body-date {
        margin-bottom: 0;
    }

    .pst-poster-mobile-post__media {
        width: 100%;
        overflow: hidden;
        border-radius: 8px;
        /* background-color: rgb(32, 32, 32); */
    }

    .pst-member-post-media-viewer > .poster__header {
        display: grid;
    }

    .pst-member-post-media-viewer__desktop-author {
        display: none;
    }

    .poster__main {
        margin-bottom: 20px;
        top: 0;
        /* padding-top: 64px; */
        &.poster__main--grid {
            grid-template-rows: auto 60px;
            align-content: start;
        }
    }

    .poster__sidebar {
        z-index: 1000;
        padding-bottom: 65px;

        & .poster__sidebar-content {
            gap: 0px;
        }

        & .poster__sidebar-block {

            border: 0;
            background-color: rgba(0, 0, 0, 0.8);
        }

        & .poster__sidebar-title {
            font-size: 20px;
            line-height: 1.1;
            margin: 5px 0;
        }

        & .poster__sidebar-description {
            margin-bottom: 6px;
            margin-top: 0;
            font-size: 13px;
            line-height: 1.3;
        }

        & .poster__sidebar-time {
            font-size: 12px;
            color: rgba(255, 255, 255, 0.68);
            margin-bottom: 10px;
        }

        & .poster__sidebar-category {
            background-color: #323940;
            display: inline-block;
            font-size: 12px;
            padding: 3px 8px;
            border-radius: 20px;
            margin-bottom: 8px;
        }
    }

    .poster__details {
        gap: 5px;
        padding: 0;
        margin-bottom: 12px;
        & > .poster__details-box {
            position: relative;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            appearance: none;
            -webkit-appearance: none;
            border-radius: 32px;
            cursor: pointer;
            transition: box-shadow .2s ease 0s;
            background-color: transparent;
            border: 0;
            color: #fff;
            font-size: 14px;
            font-weight: 600;
            padding: 8px 11px;
            margin: 2px 0;
            line-height: 1;
            text-decoration: none;
            vertical-align: middle;
        }
    }

    .poster__toolbar {
        flex-direction: row;
    }


    .nav-slide-wrapper {
        width: 60px;
        height: 60px;
    }

    .poster__primary-carousel {
        width: 100%;

        & .full-slide-wrapper {
            height: auto;
        }

        & .full-slide {
            display: block;
            width: 100%;
            height: auto;
            max-width: 100%;
        }
    }

    .poster_modal-content {
        padding: 0;
        border-radius: 0;
        background-color: #000;
    }

    .poster__main {
        margin-bottom: 0;
    }
    
    .poster__primary-wrapper {
    }

    .poster__toolbar {
        display: none;
    }

    .poster__toolbar-button-wrapper {
        width: 42px;
        height: 42px;
    }

    .poster_modal-close,
    .poster__toolbar-button {
        width: 100%;
        height: 100%;
    }

    .poster_modal-close {
        padding: 0 0 3px 1px;
    }

    .poster__main {
        &.poster__main--grid {
            position: relative;
            grid-template-rows: auto 10px;
            gap: 6px;
        }
    }

    .poster__nav-carousel {
        pointer-events: none;
    }

    .nav-slide-wrapper {
        width: 5px;
        height: 5px;
        margin-right: 6px;
        overflow: hidden;
        border-radius: 12px;
        background-color: #fff;
        display: block;
        opacity: 0.5;
        & > img {
            display: none;
        }

        &.is-selected {
            opacity: 1;
        }
    }

    .pst-poster-mobile-actions {
        padding: 8px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    }

    .pst-poster-mobile-actions__love .poster-love {
        width: auto;
        height: auto;
    }

    .pst-poster-mobile-actions__love .poster-love > svg {
        width: 14px;
        height: 14px;
    }

    .pst-poster-mobile-comments {
        width: 100%;
        margin: 16px;
        padding: 0;
        scroll-margin-top: calc(var(--poster-header-height) + 12px);
    }

    .pst-poster-mobile-comments > .must-log-in,
    .pst-poster-mobile-comments #respond > .must-log-in {
        margin: 0 0 12px;
        padding: 15px;
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 30px;
        font-size: 14px;
        text-align: center;
    }

    .pst-poster-mobile-comments__form {
        margin-bottom: 10px;
    }

    .pst-poster-mobile-comments__form .form-submit {
        flex: 0 0 auto;
        margin: 3px;
    }

    .pst-poster-mobile-comments__form .pst-member-post-comment-form__submit {
        white-space: nowrap;
    }

    .pst-poster-mobile-comments__list {
        max-height: none;
        margin: 0;
        padding: 0;
        overflow: visible;
        list-style: none;
    }

    .pst-poster-mobile-comments__list .comment {
        padding: 16px 0 10px;
    }

    .pst-poster-mobile-comments__list > .comment:not(:last-child) {
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    }

    .pst-poster-mobile-comments__list .comment.depth-1 > .children {
        padding-left: 48px;
    }

    .pst-poster-mobile-comments__list article.comment-body {
        font-size: 13px;
        line-height: 1.3;
    }

    .pst-poster-mobile-comments__list .comment-author.vcard {
        position: relative;
        display: flex;
        align-items: flex-end;
        justify-content: flex-start;
        gap: 10px;
        padding-left: 48px;
    }

    .pst-poster-mobile-comments__list .comment-author.vcard > img {
        position: absolute;
        top: 0;
        left: 0;
        width: 38px;
        height: 38px !important;
        border: 0;
    }

    .pst-poster-mobile-comments__list .comment-author.vcard > time {
        color: rgba(255, 255, 255, 0.58);
        font-size: 80%;
    }

    .pst-poster-mobile-comments__list .comment-content {
        padding: 0 0 12px 48px;
    }

    .pst-poster-mobile-comments__list .comment-content > p {
        margin: 0 0 0.3rem;
        font-size: inherit;
    }

    .pst-poster-mobile-comments__empty > p {
        margin: 0 0 10px;
        font-weight: 600;
    }

    .pst-poster-mobile-comments__empty > span {
        color: rgba(255, 255, 255, 0.58);
        font-size: 13px;
    }

    .pst-poster-mobile-ad {
        width: calc(100% - 32px);
        margin: 0 16px 16px;
    }

}

.pst-poster-mobile-comments__empty {
        display: flex;
        align-items: center;
        flex-direction: column;
        justify-content: center;
        min-height: 140px;
    }

@media screen and (min-width: 481px) and (max-width: 768px) {
    .single-poster-content {
        grid-template-rows: 50px auto 1fr;
        grid-template-areas:
            "toolbar"
            "poster"
            "sidebar";
    }

    .poster__toolbar-button-wrapper {
        width: 42px;
        height: 42px;
    }
}


.poster__primary-carousel .flickity-prev-next-button {
    display: none;
}

@media (min-width: 769px) {
    .poster__primary-carousel .flickity-prev-next-button {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 50px;
        background-color: rgba(0, 0, 0, 0.8);
        color: #fff;
        opacity: 1;
        padding: 2px;
        margin: 0;
    }

    .poster__primary-carousel .flickity-prev-next-button.previous {
        left: 12px;
    }

    .poster__primary-carousel .flickity-prev-next-button.next {
        right: 12px;
    }

    .poster__primary-carousel .flickity-prev-next-button:hover {
        background-color: rgba(0, 0, 0, 0.8);
        color: #fff;
    }

    .poster__primary-carousel .flickity-prev-next-button:focus {
        outline: none;
        box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.45);
    }

    .poster__primary-carousel .flickity-prev-next-button:disabled {
        opacity: 0;
    }

    .poster__primary-carousel .flickity-prev-next-button .flickity-button-icon {
        position: static;
        width: 15px;
        height: 15px;
        fill: currentColor;
    }
}
