/* ============================================================================
   header-mobile-990.css  (Stage 2F-HOME-ONLY, Fix B)
   Restores the OLD-SITE mobile-header switch breakpoint of <=990px.

   WHY: clean Sakura v3.3.9 switches desktop->mobile header at <=860px; the OLD
   SITE switched at <=990px (prod style.css had its mobile-header @media at 990).
   In the 861-990 band the clean child kept the desktop header, so the fixed 28px
   logo collided with the right-hand search/nav (owner-reported ~988px). Switching
   to the mobile top bar (.openNav hamburger + #mo-nav drawer) at <=990 removes the
   collision. Desktop >990px UNTOUCHED (1200/1280/1366/1440 unchanged). No logo
   shrink, no clamp/vw, no invented 1180/920/1320 breakpoints.

   PART 1 below = header-SWITCH rules only (source: prod style.css 5211-5234), i.e.
   ONLY the header is moved to mobile; the mobile *content* rules (.post-list,
   .entry-title, .links, .author-box, #archives-temp) from prod's 990 block are
   DELIBERATELY NOT migrated, so category/archive/search/single/page CONTENT is not
   altered (only the shared header switches).
   PART 2 below = the .openNav bar / hamburger / #mo-nav drawer, migrated VERBATIM
   from prod style.css 5275-5490 (the drawer mechanism the mobile bar needs).
   ============================================================================ */

/* PART 1 — header-switch only (prod 5211-5234) */
@media (max-width: 1026px) {
    .site-header { display: none; }
    .lower { display: none !important; }
    .m-nav { display: block; }
    .site-branding {
        float: right;
        height: 50px;
        line-height: 43px;
        margin-right: -6px;
    }
    .site-title img {
        height: 40px;
        line-height: 40px;
        margin: 0;
        vertical-align: middle;
    }
    .site-title {
        font-size: 20px;
        margin-right: 10px;
    }
}

/* PART 2 — .openNav bar + hamburger + #mo-nav drawer (VERBATIM prod 5275-5490) */
@media (max-width: 1026px) {
    #main-container {
        transition: background,transform .5s !important;
        position: relative;
        overflow: hidden;
        z-index: 2
    }
    #main-container.open:before {
        content: "";
        width: 100%;
        height: 100%;
        position: fixed;
        background-color: rgba(0, 0, 0, .4);
        z-index: 99
    }
    #main-container.open {
        transform: translateX(250px) translateY(0);
        -webkit-transform: translateX(250px) translateY(0);
        position: fixed;
        right: 0;
        left: 0
    }
    .wrapper {
        transition-duration: .5s;
        width: 100%;
        height: auto;
        position: relative
    }
    #mo-nav.open {
        width: 250px
    }
    .wrapper section {
        max-width: 600px;
        padding: 0;
    }
    .wrapper section h1 {
        font-weight: 300;
        font-size: 30px;
        margin-bottom: 10px
    }
    .wrapper section h2 {
        font-weight: 300;
        font-size: 20px;
        margin-bottom: 40px
    }
    .wrapper section p {
        margin-bottom: 40px
    }
    .openNav {
        transition-duration: .5s;
        width: 100%;
        height: 50px;
        position: absolute;
        top: 0;
        z-index: 99999;
        display: block;
        background: 0 0
    }
    .iconflat {
        background: 0 0;
        width: 50px;
        height: 50px;
        float: left
    }
    .openNav .icon {
        transition-duration: .2s;
        position: absolute;
        width: 30px;
        height: 3px;
        background-color: #333;
        top: 24px;
        left: 10px
    }
    .openNav .icon:after,
    .openNav .icon:before {
        transition-duration: .5s;
        background-color: #333;
        position: absolute;
        content: "";
        width: 30px;
        height: 3px;
        left: 0
    }
    .openNav .icon:before {
        top: -8px
    }
    .openNav .icon:after {
        top: 8px
    }
    .openNav.open .icon {
        background-color: transparent !important
    }
    .openNav.open .icon:after,
    .openNav.open .icon:before {
        top: 0
    }
    .openNav.open .icon:before {
        transform: rotate(-45deg);
        -webkit-transform: rotate(-45deg);
        background: #FFF
    }
    .openNav.open .icon:after {
        transform: rotate(45deg);
        -webkit-transform: rotate(45deg);
        background: #FFF
    }
    #mo-nav {
        background-color: #FFF;
        width: 0;
        max-width: 250px !important;
        height: 100%;
        z-index: 999;
        position: absolute;
        top: 0;
        left: 0;
        display: block;
        overflow-x: hidden !important;
        overflow-y: auto
    }
    #mo-nav .m-avatar {
        position: relative;
        width: 250px;
        max-width: 250px;
        height: auto;
        margin: 0 auto;
        padding: 30px 0 20px;
        text-align: center
    }
    #mo-nav .m-avatar img {
        width: 90px;
        height: 90px;
        max-width: 90px;
        border-radius: 100%
    }
    #mo-nav .m-search form {
        position: relative;
        width: 250px;
        max-width: 250px;
        margin: 0 0 20px;
        padding: 8px 15px;
        background-color: #fafafa
    }
    #mo-nav .m-search input {
        width: 100%;
        border: 0;
        padding: 5px;
        text-align: center;
        border-radius: 3px;
        outline: 0
    }
    #mo-nav ul {
        width: 200px;
        height: auto;
        margin: 10px 9px
    }
    #mo-nav ul:hover li {
        color: rgba(255, 255, 255, .5)
    }
    #mo-nav ul li {
        transition-duration: .25s;
        display: block;
        padding: 6px 40px;
        color: #fff;
        letter-spacing: .02em;
        text-align: left
    }
    #mo-nav ul li a {
        color: #333;
        font-size: 15px
    }
    #mo-nav li ul {
        width: 250px;
        margin: 10px 0;
        padding-left: 10px
    }
    #mo-nav li ul li {
        padding: 5px 9px
    }
    #mo-nav li ul li a {
        font-size: 13px;
        color: #9CACC5
    }
    #mo-nav ul li a:hover {
        cursor: pointer;
        color: orange
    }
    .we-content li {
        height: 250px
    }
    .we-content {
        padding: 80px 1%
    }
    .we-icon {
        top: 30px
    }
    .wtitle {
        top: 110px
    }
    .sub-text {
        top: 150px
    }
    .works-list {
        width: 46.88%;
        margin: 0 1.5%
    }
    .works-main {
        height: 225px
    }
    .works-feature img {
        width: 100%;
        height: 225px
    }
    .works-entry {
        margin-bottom: 20px
    }
}

/* PART 3 (2024版) — 让新版「2 行竖排(巫偉鑫上 / Wu Weixin下)+ 右侧竖印」logo 等比缩进
   50px 的 .openNav 手机条:排版与桌面一致,只整体缩小 + 竖印按比例缩小并在右侧留位,
   => 不改排版、不删印、不压字。根因:旧 PART3 的 padding:0 8px 把桌面为竖印预留的
   右侧 58px 抹掉了,竖印才压到字上;line-height:50px 也不适配 2 行。这里改对。
   仅作用于 .openNav(≤990 才出现),桌面 >990 不受影响。 */
.openNav .site-branding .logolink.moe-mashiro a {
    height: auto;
    line-height: 1.12;
    padding: 0 46px 0 5px;   /* 右侧给竖印留位(=压字的根,不删印) */
    font-size: 21px;
    float: none;
}
.openNav .site-branding .logolink.moe-mashiro .fioritura-logofont { font-size: 23px; }
.openNav .site-branding .logolink.moe-mashiro .shironeko  { font-size: 14px; margin-left: 0; margin-top: 1px; padding-left: 0; }
.openNav .site-branding .logolink.moe-mashiro a::after {
    width: 34px;
    height: 48px;
    right: 4px;
}


/* ============================================================================
 * 首页多了骰子 -> 导航更宽,首页需要 ≤1026 才切手机(上面两个 @media 已从 990 提到 1026)。
 * 但非首页没骰子,991–1026 仍放得下桌面版 -> 这里把「非首页 + ≥991」拉回桌面版;
 * ≤990 时本规则不生效,非首页照旧 ≤990 切手机。body.home 才是首页,精准区分,不误伤内页。
 * ========================================================================== */
@media (min-width: 991px) {
    body:not(.home) .site-header { display: block; }
    body:not(.home) .openNav,
    body:not(.home) .m-nav { display: none; }
    body:not(.home) .lower { display: flex !important; }   /* 抵消 PART1 的 .lower{display:none!important} */
    body:not(.home) .site-branding { float: none; height: auto; line-height: 1.2; margin: 0; }
    body:not(.home) .site-title { margin-right: 0; }
}
