/* ============================================================
   Editorial Article Layout — Manus refactor
   Cleaner longform reading experience inspired by the provided
   reference while preserving the theme system and Ghost structure.
   ============================================================ */

.post-content-and-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(240px, 0.7fr) minmax(180px, 0.42fr);
    grid-template-areas: "article sidebar-featured sidebar-info";
    gap: 0 28px;
    align-items: start;
    width: 100%;
    max-width: 1580px;
    margin: 0 auto;
    padding: 0 42px;
    box-sizing: border-box;
    position: relative;
}

.post-content-outer {
    grid-area: article;
    min-width: 0 !important;
    width: 100% !important;
    padding: 0 14px 0 0 !important;
    margin: 0 !important;
    box-sizing: border-box;
}

.post-content-outer-without-sidebar {
    grid-column: 1 / -1;
    padding-right: 0 !important;
}

.post-sidebar,
.post-sidebar-info {
    width: 100% !important;
    min-width: 0;
    margin-top: 18px;
    position: sticky;
    top: 96px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--text-color) transparent;
    box-sizing: border-box;
}

.post-sidebar::-webkit-scrollbar,
.post-sidebar-info::-webkit-scrollbar {
    width: 4px;
}

.post-sidebar::-webkit-scrollbar-thumb,
.post-sidebar-info::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--text-color) 50%, transparent);
}

.post-sidebar {
    grid-area: sidebar-featured;
    padding: 0 0 0 22px;
    border-left: 1px solid color-mix(in srgb, var(--text-color) 22%, transparent);
}

.post-sidebar-info {
    grid-area: sidebar-info;
    padding: 0 0 0 18px;
    border-left: 1px solid color-mix(in srgb, var(--text-color) 18%, transparent);
}

.sidebar-left .post-content-and-sidebar {
    grid-template-columns: minmax(180px, 0.42fr) minmax(240px, 0.7fr) minmax(0, 1.7fr);
    grid-template-areas: "sidebar-info sidebar-featured article";
}

.sidebar-left .post-content-outer {
    padding: 0 0 0 14px !important;
}

.sidebar-left .post-sidebar,
.sidebar-left .post-sidebar-info {
    border-left: 0;
    border-right: 1px solid color-mix(in srgb, var(--text-color) 18%, transparent);
    padding-left: 0;
}

.sidebar-left .post-sidebar {
    padding-right: 22px;
}

.sidebar-left .post-sidebar-info {
    padding-right: 18px;
}

.post-sidebar .section-heading,
.post-sidebar-info .section-heading,
.sidebar-info-section-heading.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0 10px 0;
    margin-bottom: 14px;
    border-bottom: 1px solid color-mix(in srgb, var(--text-color) 22%, transparent);
}

.post-sidebar .section-heading span,
.post-sidebar-info .section-heading span,
.sidebar-info-section-heading.section-heading span {
    font-size: 10px;
    letter-spacing: 0.16em;
    line-height: 1;
    text-transform: uppercase;
    opacity: 0.78;
}

.post-sidebar .slide-card {
    padding: 0 0 18px;
    margin: 0 0 18px;
    border-bottom: 1px solid color-mix(in srgb, var(--text-color) 16%, transparent);
}

.post-sidebar .slide-card:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: 0;
}

.post-sidebar .slide-card .small-card-heading,
.post-sidebar .slide-card .extra-small-side-card-heading,
.post-sidebar .slide-card .slide-card-heading {
    font-size: 1.18rem;
    line-height: 1.28;
}

.post-sidebar .slide-card time,
.post-sidebar .slide-card .post-date,
.post-sidebar .slide-card small {
    font-size: 0.93rem;
    opacity: 0.7;
}

.sidebar-info-pride-bar {
    width: 100%;
    height: 12px;
    border-radius: 0;
    margin: 0 0 14px;
    background:
        linear-gradient(
            90deg,
            #000000 0%,
            #000000 10%,
            #784f17 10%,
            #784f17 20%,
            #5bcffb 20%,
            #5bcffb 30%,
            #f5abb9 30%,
            #f5abb9 40%,
            #ffffff 40%,
            #ffffff 50%,
            #f5abb9 50%,
            #f5abb9 60%,
            #5bcffb 60%,
            #5bcffb 70%,
            #613915 70%,
            #613915 80%,
            #000000 80%,
            #000000 90%,
            #9c27b0 90%,
            #9c27b0 100%
        );
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--text-color) 10%, transparent);
}

.sidebar-info-content {
    font-size: 0.96rem;
    line-height: 1.65;
}

.sidebar-info-content--editorial {
    padding-top: 2px;
}

.sidebar-info-content h2,
.sidebar-info-content h3,
.sidebar-info-content h4 {
    margin: 18px 0 10px;
    padding: 0 0 6px;
    border-bottom: 1px solid color-mix(in srgb, var(--text-color) 18%, transparent);
    font-size: 0.96rem;
    line-height: 1.35;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sidebar-info-content h2:first-child,
.sidebar-info-content h3:first-child,
.sidebar-info-content h4:first-child,
.sidebar-info-content p:first-child {
    margin-top: 0;
}

.sidebar-info-content p,
.sidebar-info-content li {
    font-size: 0.96rem;
    line-height: 1.68;
    opacity: 0.9;
}

.sidebar-info-content img {
    width: 100%;
    height: auto;
    display: block;
    margin: 0 0 12px;
}

.sidebar-info-content a {
    text-decoration: underline;
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.16em;
}

.sidebar-info-content hr {
    margin: 14px 0;
    height: 1px;
    border: 0;
    background: color-mix(in srgb, var(--text-color) 16%, transparent);
}

.sidebar-info-placeholder p {
    opacity: 0.58;
    font-style: italic;
}

.sidebar-info-loading {
    font-size: 0.84rem;
    opacity: 0.45;
    font-style: italic;
    padding: 8px 0;
}

.post-content-outer::after {
    content: none;
}

html[data-theme="dark"] .post-sidebar,
html[data-theme="dark"] .post-sidebar-info {
    border-left-color: rgba(255, 255, 255, 0.14);
}

html[data-theme="dark"] .sidebar-left .post-sidebar,
html[data-theme="dark"] .sidebar-left .post-sidebar-info {
    border-right-color: rgba(255, 255, 255, 0.14);
    border-left: 0;
}

html[data-theme="light"] .sidebar-info-pride-bar {
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

@media (min-width: 1439px) {
    .post-content-and-sidebar {
        gap: 0 calc(1.95vw * var(--scale));
        padding-left: calc(2.92vw * var(--scale));
        padding-right: calc(2.92vw * var(--scale));
    }

    .post-sidebar {
        padding-left: calc(1.53vw * var(--scale));
    }

    .post-sidebar-info {
        padding-left: calc(1.25vw * var(--scale));
    }

    .sidebar-left .post-sidebar {
        padding-right: calc(1.53vw * var(--scale));
    }

    .sidebar-left .post-sidebar-info {
        padding-right: calc(1.25vw * var(--scale));
    }

    .post-sidebar .slide-card .small-card-heading,
    .post-sidebar .slide-card .extra-small-side-card-heading,
    .post-sidebar .slide-card .slide-card-heading {
        font-size: calc(1.04vw * var(--scale));
    }
}

@media (max-width: 1180px) {
    .post-content-and-sidebar {
        grid-template-columns: minmax(0, 1.55fr) minmax(220px, 0.68fr) minmax(165px, 0.4fr);
        gap: 0 22px;
    }
}

@media (max-width: 991px) {
    .post-content-and-sidebar {
        display: flex;
        flex-direction: column;
        width: 100%;
        padding-left: 0;
        padding-right: 0;
    }

    .post-content-outer,
    .sidebar-left .post-content-outer {
        width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        order: 1;
    }

    .post-content-outer-without-sidebar {
        grid-column: unset;
    }

    .post-sidebar,
    .post-sidebar-info,
    .sidebar-left .post-sidebar,
    .sidebar-left .post-sidebar-info {
        width: 100% !important;
        max-height: none;
        position: static;
        border-left: 0;
        border-right: 0;
        border-top: 1px solid color-mix(in srgb, var(--text-color) 18%, transparent);
        padding-left: 0;
        padding-right: 0;
    }

    .post-sidebar {
        margin-top: 28px;
        padding-top: 22px;
        order: 2;
    }

    .post-sidebar-info {
        margin-top: 0;
        padding-top: 22px;
        order: 3;
    }
}

@media (max-width: 479px) {
    .post-sidebar,
    .post-sidebar-info {
        padding-top: 18px;
    }

    .sidebar-info-pride-bar {
        height: 10px;
        margin-bottom: 12px;
    }
}
