/*
 * YS Note Child - single post/page design layer
 * Extends the current minimalist archive language into post detail views.
 */

body.single .content-area,
body.single .widget-area,
body.single .right-sidebar {
    margin-top: 0 !important;
}

body.single .inside-right-sidebar {
    position: sticky;
    top: calc(var(--ys-header-offset) + 20px);
    align-self: start;
    max-height: calc(100vh - var(--ys-header-offset) - 44px);
    overflow-y: auto;
    padding-right: 4px;
    gap: 28px;
}

body.single .inside-right-sidebar::-webkit-scrollbar {
    width: 6px;
}

body.single .inside-right-sidebar::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.4);
    border-radius: 999px;
}

body.single .sidebar .widget {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    margin-bottom: 28px !important;
}

.single .site-main .post,
.page .site-main .page {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin-bottom: 0 !important;
}

.single .inside-article>.featured-image,
.single .inside-article>.post-image,
.single .inside-article>.featured-image.page-header-image-single,
.single .inside-article>.page-header-image-single {
    display: none !important;
}

.single.separate-containers .inside-article,
.page.separate-containers .inside-article {
    background: var(--ys-bg-card) !important;
    border: 1px solid var(--ys-border) !important;
    border-radius: 24px !important;
    box-shadow: none !important;
    padding: 40px !important;
}

[data-theme="dark"] .single.separate-containers .inside-article,
[data-theme="dark"] .page.separate-containers .inside-article {
    background: var(--ys-bg-card) !important;
}

.single .entry-header,
.page .entry-header {
    margin-bottom: 28px;
}

.single .entry-title,
.page .entry-title {
    color: var(--ys-text-title) !important;
    font-size: clamp(1.6rem, 3vw, 2.1rem) !important;
    font-weight: 500 !important;
    letter-spacing: -0.04em !important;
    line-height: 1.2 !important;
    margin-bottom: 16px !important;
}

.single .entry-meta,
.page .entry-meta,
.single .entry-meta a,
.page .entry-meta a {
    color: var(--ys-text-meta) !important;
}

.single .entry-content,
.page .entry-content {
    color: var(--ys-text-body);
}

.single .entry-content>*,
.page .entry-content>* {
    max-width: min(100%, 760px);
}

.single .entry-content>.alignwide,
.page .entry-content>.alignwide,
.single .entry-content>.alignfull,
.page .entry-content>.alignfull,
.single .entry-content>.wp-block-image,
.page .entry-content>.wp-block-image,
.single .entry-content>.table-of-contents,
.page .entry-content>.table-of-contents,
.single .entry-content>.sharedaddy,
.page .entry-content>.sharedaddy,
.single .entry-content>.sd-sharing-enabled,
.page .entry-content>.sd-sharing-enabled {
    max-width: 100%;
}

.single .entry-content p,
.page .entry-content p,
.single .entry-content li,
.page .entry-content li {
    color: var(--ys-text-body);
    font-size: 1rem;
    line-height: 1.85;
}

.single .entry-content h2,
.page .entry-content h2,
.single .entry-content h3,
.page .entry-content h3,
.single .entry-content h4,
.page .entry-content h4 {
    color: var(--ys-text-title);
    border-color: var(--ys-border) !important;
}

.single .entry-content a,
.page .entry-content a {
    color: var(--ys-accent);
}

.single .entry-content .syntaxhighlighter,
.page .entry-content .syntaxhighlighter {
    width: 100% !important;
    max-width: 100% !important;
    margin: 28px 0 !important;
    padding: 18px 20px !important;
    border: 1px solid var(--ys-border) !important;
    border-radius: 18px !important;
    box-shadow: none !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    font-family: "JetBrains Mono", "Fira Code", Consolas, monospace !important;
    font-size: 0.92rem !important;
    line-height: 1.75 !important;
}

.single .entry-content .syntaxhighlighter,
.page .entry-content .syntaxhighlighter,
.single .entry-content .syntaxhighlighter *,
.page .entry-content .syntaxhighlighter * {
    background: var(--ys-bg-card) !important;
}

.single .entry-content .syntaxhighlighter table,
.page .entry-content .syntaxhighlighter table {
    width: 100% !important;
    min-width: max-content !important;
}

.single .entry-content .syntaxhighlighter .line,
.page .entry-content .syntaxhighlighter .line,
.single .entry-content .syntaxhighlighter .plain,
.page .entry-content .syntaxhighlighter .plain,
.single .entry-content .syntaxhighlighter .plain a,
.page .entry-content .syntaxhighlighter .plain a {
    color: var(--ys-text-body) !important;
}

.single .entry-content .syntaxhighlighter .gutter .line,
.page .entry-content .syntaxhighlighter .gutter .line {
    color: var(--ys-text-meta) !important;
    opacity: 0.7;
}

.single .entry-content .syntaxhighlighter .keyword,
.page .entry-content .syntaxhighlighter .keyword,
.single .entry-content .syntaxhighlighter .color1,
.page .entry-content .syntaxhighlighter .color1 {
    color: #2563eb !important;
}

.single .entry-content .syntaxhighlighter .string,
.page .entry-content .syntaxhighlighter .string,
.single .entry-content .syntaxhighlighter .color2,
.page .entry-content .syntaxhighlighter .color2 {
    color: #0f766e !important;
}

.single .entry-content .syntaxhighlighter .comments,
.page .entry-content .syntaxhighlighter .comments,
.single .entry-content .syntaxhighlighter .color3,
.page .entry-content .syntaxhighlighter .color3 {
    color: var(--ys-text-meta) !important;
}

[data-theme="dark"] .single .entry-content .syntaxhighlighter,
[data-theme="dark"] .page .entry-content .syntaxhighlighter,
[data-theme="dark"] .single .entry-content .syntaxhighlighter *,
[data-theme="dark"] .page .entry-content .syntaxhighlighter * {
    background: #111827 !important;
}

[data-theme="dark"] .single .entry-content .syntaxhighlighter,
[data-theme="dark"] .page .entry-content .syntaxhighlighter {
    border-color: rgba(255, 255, 255, 0.08) !important;
}

@media (max-width: 768px) {

    .single .entry-content .syntaxhighlighter,
    .page .entry-content .syntaxhighlighter {
        padding: 16px !important;
    }

    .single .entry-content .syntaxhighlighter table,
    .page .entry-content .syntaxhighlighter table {
        min-width: 0 !important;
    }

    .single .entry-content .syntaxhighlighter .line,
    .page .entry-content .syntaxhighlighter .line,
    .single .entry-content .syntaxhighlighter .plain,
    .page .entry-content .syntaxhighlighter .plain,
    .single .entry-content .syntaxhighlighter .plain a,
    .page .entry-content .syntaxhighlighter .plain a {
        white-space: pre-wrap !important;
        word-break: break-word !important;
        overflow-wrap: anywhere !important;
    }
}

.comments-area,
#comments,
#respond,
.comment-respond {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.comments-area {
    margin-top: 40px;
}

.comments-title,
.comment-reply-title {
    color: var(--ys-text-title);
}

.comment-form textarea,
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"] {
    background: var(--ys-bg-card) !important;
    border: 1px solid var(--ys-border) !important;
    border-radius: 18px !important;
    box-shadow: none !important;
}

.comment-form textarea {
    min-height: 220px;
    padding: 20px !important;
}

.comment-form .submit {
    border-radius: 16px !important;
}

.table-of-contents {
    background: var(--ys-bg-card) !important;
    border: 1px solid var(--ys-border) !important;
    border-left: 0 !important;
    border-radius: 20px !important;
    padding: 22px 24px !important;
    margin: 0 0 32px !important;
    box-shadow: none !important;
}

.table-of-contents--sidebar {
    margin: 0 0 28px !important;
    padding: 20px !important;
    border-radius: 18px !important;
}

.toc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 8px;
}

.toc-title {
    margin: 0;
    color: var(--ys-text-title);
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.toc-toggle {
    width: 34px;
    height: 34px;
    border: 1px solid var(--ys-border) !important;
    border-radius: 999px;
    background: transparent !important;
    color: var(--ys-text-meta) !important;
    box-shadow: none !important;
}

.toc-toggle:hover {
    background: var(--ys-accent-soft) !important;
    color: var(--ys-accent) !important;
    border-color: transparent !important;
}

.toc-list {
    max-height: none;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.toc-list.collapsed {
    max-height: 0;
}

.toc-item {
    margin-bottom: 0;
}

.toc-item a {
    display: block;
    padding: 4px 0;
    color: var(--ys-text-body);
    font-size: 0.88rem;
    line-height: 1.45;
}

.toc-item a:hover {
    color: var(--ys-accent);
}

.toc-item.is-active a {
    color: var(--ys-accent);
    font-weight: 600;
}

.toc-item.is-active a::before {
    opacity: 1;
    background: var(--ys-accent);
}

.toc-item--sub {
    padding-left: 12px;
}

.toc-item--sub a {
    color: var(--ys-text-meta);
    font-size: 0.82rem;
}

.toc-item--sub a::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 1px;
    margin-right: 8px;
    background: var(--ys-border-hover);
    vertical-align: middle;
}

.post-nav-thumbnails {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin: 40px 0 0;
}

.post-nav-card {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    align-items: stretch;
    background: var(--ys-bg-card) !important;
    border: 1px solid var(--ys-border) !important;
    border-radius: 20px !important;
    box-shadow: none !important;
    overflow: hidden;
}

.post-nav-card--next {
    grid-template-columns: minmax(0, 1fr) 104px;
}

.post-nav-card:hover {
    transform: translateY(-3px);
    border-color: var(--ys-border-hover) !important;
    box-shadow: none !important;
}

.post-nav-card--empty {
    background: transparent !important;
    border-style: dashed !important;
}

.post-nav-card__image {
    display: block;
    width: 104px;
    min-height: 78px;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-color: var(--ys-accent-soft);
}

.post-nav-card__content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    padding: 14px 16px !important;
}

.post-nav-card__label {
    color: var(--ys-text-meta) !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.post-nav-card__title {
    color: var(--ys-text-title) !important;
    font-size: 1rem !important;
    font-weight: 500 !important;
    line-height: 1.45 !important;
}

.post-nav-card:hover .post-nav-card__title,
.post-nav-card--prev .post-nav-card__label,
.post-nav-card--next .post-nav-card__label {
    color: var(--ys-accent) !important;
}

.single .featured-section {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 48px 0 0 !important;
}

.single .featured-section__header {
    margin-bottom: 18px;
}

.featured-section__title-link {
    display: block;
    text-decoration: none;
}

.featured-section__title-link:hover {
    text-decoration: none;
}

.single .featured-section__title {
    color: var(--ys-text-meta) !important;
    font-size: 0.82rem !important;
    font-weight: 500 !important;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.single .featured-section__more {
    color: var(--ys-text-meta) !important;
    font-size: inherit !important;
    font-weight: inherit !important;
}

.featured-section__title-link:hover .featured-section__title,
.featured-section__title-link:hover .featured-section__more {
    color: var(--ys-accent) !important;
}

.single .featured-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.single .featured-card {
    display: block;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.single .featured-card__image {
    height: 0;
    padding-bottom: 60%;
    border: 1px solid var(--ys-border);
    border-radius: 16px;
    background-color: var(--ys-accent-soft);
}

.single .featured-card__title {
    margin: 12px 0 0;
    padding: 0;
    background: transparent;
    color: var(--ys-text-title);
    font-size: 0.98rem;
    font-weight: 500;
    line-height: 1.45;
}

.single .featured-card:hover .featured-card__title {
    color: var(--ys-accent);
}

.single .entry-meta.entry-meta-footer,
.single .footer-entry-meta,
.single .cat-links,
.single .tags-links {
    margin-top: 32px;
    color: var(--ys-text-meta);
}

.single .entry-meta.entry-meta-footer a,
.single .footer-entry-meta a,
.single .cat-links a,
.single .tags-links a {
    color: var(--ys-text-body);
}

@media (max-width: 768px) {

    .single.separate-containers .inside-article,
    .page.separate-containers .inside-article {
        padding: 24px !important;
        border-radius: 18px !important;
    }

    .single .entry-title,
    .page .entry-title {
        font-size: clamp(1.4rem, 6.8vw, 1.9rem) !important;
    }

    .single .entry-content>*,
    .page .entry-content>* {
        max-width: 100%;
    }

    .comments-area {
        margin-top: 32px;
    }

    .table-of-contents {
        padding: 18px !important;
        border-radius: 16px !important;
    }

    .post-nav-thumbnails,
    .single .featured-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .post-nav-card__image {
        width: 84px;
        min-height: 72px;
    }

    .post-nav-card {
        grid-template-columns: 84px minmax(0, 1fr);
    }

    .post-nav-card--next {
        grid-template-columns: minmax(0, 1fr) 84px;
    }
}