/*
Theme Name: JustNews Child
Author: Codex
Description: JustNews 二次开发子主题，保留父主题更新能力。
Template: justnews
Version: 1.1.16
Requires at least: 6.4
Requires PHP: 7.4
Text Domain: justnews-child
*/

/* 后续自定义样式写在这里。 */

/* Keep centered navigation/content aligned when short pages need no root scrollbar.
   Overlay scrollbars do not reserve additional space. No body widths or JS offsets. */
html { scrollbar-gutter: stable; }

/* Establish the normal theme shell's height before JS runs. Special previews and
   member screens keep their own layout; an absent shell also keeps parent behavior. */
@media screen {
    body:not(.visual-editor, .widget-priview, .wpcom-member, .member-login, .member-register, .member-lostpassword):has(> header.header + #wrap + footer.footer) {
        display: flex;
        flex-direction: column;
        min-height: calc(100vh - var(--jnc-admin-bar-space, 0px));
        min-height: calc(100dvh - var(--jnc-admin-bar-space, 0px));
    }

    body.admin-bar {
        --jnc-admin-bar-space: var(--wp-admin--admin-bar--height, 32px);
    }

    @media (max-width: 782px) {
        body.admin-bar {
            --jnc-admin-bar-space: var(--wp-admin--admin-bar--height, 46px);
        }
    }

    body:not(.visual-editor, .widget-priview, .wpcom-member, .member-login, .member-register, .member-lostpassword):has(> header.header + #wrap + footer.footer) > #wrap {
        flex: 1 0 auto;
        /* Only override the parent's late, inline min-height calculation. */
        min-height: 0 !important;
    }

    body:not(.visual-editor, .widget-priview, .wpcom-member, .member-login, .member-register, .member-lostpassword):has(> header.header + #wrap + footer.footer) > :is(header.header, .top-news, footer.footer) {
        flex: 0 0 auto;
    }
}

/* Only the verified sidebar's root list gets a scrollport; nested lists stay natural. */
.sidebar .ez-toc-widget-container .jnc-toc-scroll-list {
    box-sizing: border-box;
    max-height: var(--jnc-toc-list-height);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scroll-behavior: auto;
}

.sidebar .ez-toc-widget-container .jnc-toc-scroll-list a.ez-toc-link {
    overflow-wrap: anywhere;
}

.sidebar .ez-toc-widget-container .jnc-toc-scroll-list:focus-visible {
    outline: 2px solid var(--theme-hover, #1677ff);
    outline-offset: 2px;
}
:root{--theme-color: #3b6fd8; --theme-hover: #2d58af; --logo-height: 40px; --logo-height-mobile: 26px; --menu-item-gap: 28px; --mobile-menu-color: rgba(255, 255, 255, .98); --mobile-menu-active-color: #fff; --mobile-menu-bg-color: var(--theme-color); --theme-border-radius-s: 3px; --theme-border-radius-m: 5px; --theme-border-radius-l: 8px; --theme-border-radius-xl: 12px; --thumb-ratio-default: 480 / 300; --thumb-ratio-post: 480 / 300; --dark-style-logo: url('https://www.xianou.com/wp-content/uploads/2026/10/xianou-horizontal-white-transparent-v2.png');}
#modules-1{margin-top: 20px;margin-bottom: 20px;} 