/* ============================================================
   Tranquil Soul Single Post Layout
   File: assets/css/single-post.css
============================================================ */

.ts-single-post-page {
    width: 100%;
    background: var(--color-background, #ffffff);
    color: var(--color-text, #063642);
}

.ts-single-post-layout {
    width: min(1280px, calc(100% - 48px));
    max-width: 1280px;
    margin: 64px auto 90px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 34px;
    align-items: start;
}

.ts-single-post-content {
    min-width: 0;
    background: #ffffff;
    border: 1px solid var(--color-card-border, rgba(0, 0, 0, 0.12));
    border-radius: 22px;
    padding: clamp(26px, 4vw, 46px);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.07);
}

.ts-single-post-header {
    margin-bottom: 30px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.ts-single-post-category {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.ts-single-post-category a {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(33, 128, 141, 0.10);
    color: var(--color-primary, #21808d);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
}

.ts-single-post-title {
    margin: 0;
    color: var(--color-text, #063642);
    font-size: clamp(36px, 4.8vw, 64px);
    line-height: 1.03;
    font-weight: 950;
    letter-spacing: -0.055em;
}

.ts-single-post-meta {
    margin-top: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    align-items: center;
    color: var(--color-text-secondary, #626c71);
    font-size: 14px;
    line-height: 1.4;
}

.ts-post-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ts-post-meta-icon {
    width: 16px;
    height: 16px;
    display: inline-flex;
    color: var(--color-primary, #21808d);
}

.ts-post-meta-icon svg {
    width: 16px;
    height: 16px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ts-post-meta-separator {
    opacity: 0.45;
}

.ts-single-post-thumbnail {
    margin: 0 0 34px;
    border-radius: 18px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.04);
}

.ts-single-post-thumbnail img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}

.ts-single-post-body {
    color: var(--color-text, #063642);
    font-size: 18px;
    line-height: 1.85;
}

.ts-single-post-body > *:first-child {
    margin-top: 0;
}

.ts-single-post-body > *:last-child {
    margin-bottom: 0;
}

.ts-single-post-body p {
    margin: 0 0 22px;
}

.ts-single-post-body a {
    color: var(--color-primary, #21808d);
    font-weight: 800;
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.18em;
}

.ts-single-post-body h2,
.ts-single-post-body h3,
.ts-single-post-body h4 {
    color: var(--color-text, #063642);
    font-weight: 900;
    letter-spacing: -0.025em;
    scroll-margin-top: 120px;
}

.ts-single-post-body h2 {
    margin: 42px 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(33, 128, 141, 0.18);
    font-size: clamp(26px, 2.8vw, 36px);
    line-height: 1.18;
}

.ts-single-post-body h3 {
    margin: 34px 0 14px;
    font-size: clamp(22px, 2.2vw, 28px);
    line-height: 1.22;
}

.ts-single-post-body h4 {
    margin: 28px 0 12px;
    font-size: 21px;
    line-height: 1.28;
}

.ts-single-post-body ul,
.ts-single-post-body ol {
    margin: 18px 0 24px;
    padding-left: 28px;
}

.ts-single-post-body li {
    margin-bottom: 10px;
}

.ts-single-post-body blockquote {
    margin: 34px 0;
    padding: 26px 28px;
    border-left: 5px solid var(--color-primary, #21808d);
    border-radius: 16px;
    background: rgba(33, 128, 141, 0.08);
    color: var(--color-text, #063642);
    font-size: 20px;
    line-height: 1.65;
    font-weight: 650;
}

.ts-single-post-body img {
    max-width: 100%;
    height: auto;
    border-radius: 14px;
}

.ts-single-post-footer {
    margin-top: 38px;
    padding-top: 24px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.ts-single-post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    color: var(--color-text-secondary, #626c71);
    font-size: 14px;
}

.ts-single-post-tags-label {
    font-weight: 900;
    color: var(--color-text, #063642);
}

.ts-single-post-tags a {
    display: inline-flex;
    padding: 6px 11px;
    border-radius: 999px;
    background: rgba(33, 128, 141, 0.08);
    color: var(--color-primary, #21808d);
    font-weight: 800;
    text-decoration: none;
}

.ts-single-post-pagination {
    margin-top: 34px;
}

/* Table of Contents */
.ts-single-post-toc {
    min-width: 0;
}

.ts-single-post-toc-inner {
    position: sticky;
    top: 112px;
    max-height: calc(100vh - 136px);
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid var(--color-card-border, rgba(0, 0, 0, 0.12));
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.07);
}

.ts-single-post-toc-title {
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--color-primary, #21808d);
    color: var(--color-text, #063642);
    font-size: 18px;
    line-height: 1.2;
    font-weight: 900;
}

.ts-single-post-toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 6px;
}

.ts-single-post-toc-list a {
    display: block;
    padding: 9px 12px;
    border-left: 3px solid transparent;
    border-radius: 9px;
    color: var(--color-text-secondary, #626c71);
    font-size: 14px;
    line-height: 1.35;
    text-decoration: none;
    transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.ts-single-post-toc-list a:hover,
.ts-single-post-toc-list a.is-active {
    background: rgba(33, 128, 141, 0.09);
    color: var(--color-primary, #21808d);
    border-left-color: var(--color-primary, #21808d);
}

.ts-single-post-toc-list a[data-depth="3"] {
    padding-left: 24px;
    font-size: 13px;
}

.ts-single-post-toc-list a[data-depth="4"] {
    padding-left: 36px;
    font-size: 13px;
    opacity: 0.92;
}

.ts-single-post-comments {
    width: min(920px, calc(100% - 48px));
    max-width: 920px;
    margin: -40px auto 90px;
    background: #ffffff;
    border: 1px solid var(--color-card-border, rgba(0, 0, 0, 0.12));
    border-radius: 22px;
    padding: clamp(24px, 3vw, 36px);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.07);
}

/* Responsive */
@media (max-width: 1080px) {
    .ts-single-post-layout {
        grid-template-columns: 1fr;
    }

    .ts-single-post-toc {
        order: -1;
    }

    .ts-single-post-toc-inner {
        position: relative;
        top: auto;
        max-height: none;
    }

    .ts-single-post-toc-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .ts-single-post-layout {
        width: min(100% - 28px, 1280px);
        margin: 42px auto 64px;
        gap: 22px;
    }

    .ts-single-post-content {
        padding: 24px 18px;
        border-radius: 18px;
    }

    .ts-single-post-title {
        font-size: 34px;
    }

    .ts-single-post-body {
        font-size: 16px;
        line-height: 1.75;
    }

    .ts-single-post-toc-list {
        grid-template-columns: 1fr;
    }

    .ts-single-post-comments {
        width: min(100% - 28px, 920px);
    }
}

/* ============================================================
   FINAL Single Blog Post Width Fix
   Keeps post readable but no longer boxed too narrow
============================================================ */

body.single-post .ts-single-post-page {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

body.single-post .ts-single-post-layout {
    width: min(1320px, calc(100% - 56px)) !important;
    max-width: 1320px !important;
    margin: 70px auto 96px !important;
    padding: 0 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 880px) 320px !important;
    gap: 36px !important;
    align-items: start !important;
    justify-content: center !important;
}

body.single-post .ts-single-post-content {
    width: 100% !important;
    max-width: 880px !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: clamp(34px, 4vw, 54px) !important;
}

body.single-post .ts-single-post-toc {
    width: 100% !important;
    max-width: 320px !important;
    min-width: 0 !important;
}

body.single-post .ts-single-post-toc-inner {
    width: 100% !important;
}

/* Stop old blog.css / parent theme wrappers from shrinking the post */
body.single-post .entry-content-wrapper,
body.single-post .entry-content,
body.single-post .post-content,
body.single-post .site-content,
body.single-post .content-area,
body.single-post #primary,
body.single-post main.site-main {
    max-width: none !important;
}

/* Better image sizing inside the article */
body.single-post .ts-single-post-thumbnail img {
    width: 100% !important;
    max-height: 540px !important;
    object-fit: cover !important;
    object-position: center !important;
}

/* Make the title strong but not absurdly narrow */
body.single-post .ts-single-post-title {
    max-width: 820px !important;
}

/* Tablet */
@media (max-width: 1100px) {
    body.single-post .ts-single-post-layout {
        width: min(100% - 40px, 920px) !important;
        grid-template-columns: 1fr !important;
        gap: 28px !important;
    }

    body.single-post .ts-single-post-content {
        max-width: none !important;
    }

    body.single-post .ts-single-post-toc {
        max-width: none !important;
        order: -1 !important;
    }

    body.single-post .ts-single-post-toc-inner {
        position: relative !important;
        top: auto !important;
        max-height: none !important;
    }
}

/* Mobile */
@media (max-width: 640px) {
    body.single-post .ts-single-post-layout {
        width: min(100% - 24px, 920px) !important;
        margin: 38px auto 64px !important;
    }

    body.single-post .ts-single-post-content {
        padding: 24px 18px !important;
        border-radius: 18px !important;
    }

    body.single-post .ts-single-post-title {
        font-size: 34px !important;
    }
}