/**
 * main.css の直後に読み込むレイアウト上書き。
 * 以前は functions.php の wp_add_inline_style にあったルール。
 * !important は当時の詳細度・競合対策を維持するため残す。
 */
/**
 * 全ページ共通の最背面: 雪月夜の森（hero-banner-bg-night-snow.png）＋月光オーバーレイ
 * body 直塗りだと <main> などに隠れて見えないことがあるため fixed 疑似要素で最背面に固定。
 */
html {
    background-color: #0a1528 !important;
}

body {
    position: relative;
    background: none !important;
    background-color: transparent !important;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-color: #0a1528;
    background-image:
        radial-gradient(ellipse 130% 90% at 50% -8%, rgba(220, 240, 255, 0.22) 0%, rgba(120, 175, 230, 0.08) 38%, transparent 62%),
        radial-gradient(ellipse 50% 35% at 82% 12%, rgba(200, 230, 255, 0.18) 0%, transparent 72%),
        linear-gradient(180deg, rgba(6, 12, 26, 0.55) 0%, rgba(8, 16, 32, 0.25) 48%, rgba(10, 20, 40, 0.5) 100%),
        url("../images/hero-banner-bg-night-snow.png?v=20260416b");
    background-size: cover, cover, cover, cover;
    background-position: center top, right 18% top, center, center center;
    background-repeat: no-repeat;
}

/* 全面に降る雪: .hero-snow-layer--full-banner と同じタイル寸法・キーフレーム距離（main.css と一致） */
@keyframes mtl-snow-page-bg {
    from {
        background-position: 0 0, 22px -40px;
    }
    to {
        background-position: 0 300px, 22px 320px;
    }
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    -webkit-forced-color-adjust: none;
    forced-color-adjust: none;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    mix-blend-mode: normal;
    opacity: 0.4;
    background-image: url("../images/hero-snow-tile-a.svg"), url("../images/hero-snow-tile-b.svg");
    /* PC ヒーロー全面雪と同じ（132 / 168） */
    background-size: 132px 132px, 168px 168px;
    background-repeat: repeat, repeat;
    background-position: 0 0, 22px -40px;
    /* mtl-snow-fb-svg-a と同じ 44s（二層は 1 要素のため結合キーフレーム） */
    animation: mtl-snow-page-bg 44s linear infinite;
}

/* スマホのヒーロー全面雪（100 / 120）に合わせる */
@media (max-width: 640px) {
    body::after {
        background-size: 100px 100px, 120px 120px;
    }
}

body.home body::after {
    opacity: 0.22;
}

@media (prefers-reduced-motion: reduce) {
    body::after {
        animation: none;
    }
}

.site-main {
    background: none !important;
    background-color: transparent !important;
    position: relative;
    z-index: 1;
}

.site-footer {
    position: relative;
    z-index: 1;
}

.site-main-inner {
    box-sizing: border-box !important;
    width: min(1100px, 92%) !important;
    max-width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    background-color: var(--bg) !important;
    padding: 2rem clamp(0.85rem, 3.5vw, 1.5rem) 3rem !important;
    border-radius: 0 !important;
}

.site-nav .menu {
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.site-nav .menu > li > a,
.site-nav .menu .sub-menu a {
    border-radius: 10px !important;
    border: 1.5px solid rgba(255, 255, 255, 0.92) !important;
    box-sizing: border-box !important;
    background:
        linear-gradient(
            120deg,
            rgba(34, 60, 102, 0.88) 0%,
            rgba(28, 49, 84, 0.9) 52%,
            rgba(22, 38, 67, 0.92) 100%
        ) !important;
    box-shadow:
        0 4px 14px rgba(8, 14, 32, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

.site-nav .menu > li > a {
    padding: 0.42rem 0.85rem !important;
}

.site-nav .menu .sub-menu a {
    padding: 0.52rem 0.85rem !important;
}

@media (min-width: 1025px) {
    .site-nav .menu {
        gap: 0.5rem 0.75rem !important;
    }

    .site-nav .menu li + li {
        border-left: none !important;
        padding-left: 0 !important;
    }
}

@media (max-width: 1024px) {
    .site-nav .mtl-primary-nav-accordion__panel .menu {
        background: transparent !important;
        box-shadow: none !important;
        border: none !important;
        border-radius: 0 !important;
    }

    .site-nav .menu li + li {
        border-left: none !important;
        border-top: none !important;
        padding-left: 0 !important;
        margin-top: 0.4rem !important;
    }

    .site-nav .menu .sub-menu {
        background: transparent !important;
        border-top: none !important;
        padding-top: 0.35rem !important;
    }

    .site-nav .menu .sub-menu li + li {
        border-top: none !important;
        margin-top: 0.3rem !important;
    }

    .site-nav .menu a {
        padding: 0.68rem 0.95rem !important;
    }
}

/* トップ: .hero-menu-nav を .site-nav と同じメニュー見た目に */
.hero-menu-nav {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

.hero-menu-nav .menu {
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.hero-menu-nav .menu > li > a,
.hero-menu-nav .menu .sub-menu a {
    border-radius: 10px !important;
    border: 1.5px solid rgba(255, 255, 255, 0.92) !important;
    box-sizing: border-box !important;
    background:
        linear-gradient(
            120deg,
            rgba(34, 60, 102, 0.88) 0%,
            rgba(28, 49, 84, 0.9) 52%,
            rgba(22, 38, 67, 0.92) 100%
        ) !important;
    box-shadow:
        0 4px 14px rgba(8, 14, 32, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

.hero-menu-nav .menu > li > a {
    padding: 0.42rem 0.85rem !important;
}

.hero-menu-nav .menu .sub-menu a {
    padding: 0.52rem 0.85rem !important;
}

@media (min-width: 1025px) {
    .hero-menu-nav .menu {
        gap: 0.5rem 0.75rem !important;
    }

    .hero-menu-nav .menu li + li {
        border-left: none !important;
        padding-left: 0 !important;
    }
}

@media (max-width: 1024px) {
    .hero-menu-nav .mtl-primary-nav-accordion__panel .menu {
        background: transparent !important;
        box-shadow: none !important;
        border: none !important;
        border-radius: 0 !important;
    }

    .hero-menu-nav .menu li + li {
        border-left: none !important;
        border-top: none !important;
        padding-left: 0 !important;
        margin-top: 0.4rem !important;
    }

    .hero-menu-nav .menu .sub-menu {
        background: transparent !important;
        border-top: none !important;
        padding-top: 0.35rem !important;
    }

    .hero-menu-nav .menu .sub-menu li + li {
        border-top: none !important;
        margin-top: 0.3rem !important;
    }

    .hero-menu-nav .menu a {
        padding: 0.68rem 0.95rem !important;
    }
}

/* トップバナー「更新情報」: メイン枠・メニューと同じ白枠（1.5px） */
@media (min-width: 641px) {
    .hero-banner-update {
        border: 1.5px solid rgba(255, 255, 255, 0.92) !important;
        border-radius: 10px !important;
    }

    .hero-banner-update__list {
        border-top: 1.5px solid rgba(255, 255, 255, 0.38) !important;
    }
}

body:not(.home) .site-header {
    top: clamp(10px, 1.6vw, 18px) !important;
    background: transparent !important;
    border-top: none !important;
    border-bottom: none !important;
}

body.admin-bar:not(.home) .site-header {
    top: calc(32px + clamp(10px, 1.6vw, 18px)) !important;
}

@media (max-width: 782px) {
    body.admin-bar:not(.home) .site-header {
        top: calc(46px + clamp(10px, 1.6vw, 18px)) !important;
    }
}

.site-header .container,
.site-footer .container {
    padding-left: clamp(0.85rem, 3.5vw, 1.5rem) !important;
    padding-right: clamp(0.85rem, 3.5vw, 1.5rem) !important;
    box-sizing: border-box !important;
}

/* Software アイキャッチ */
.software-card__thumb {
    display: block;
    margin: 0 0 0.75rem;
    border-radius: 8px;
    overflow: hidden;
    line-height: 0;
}

.software-card__thumb-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    aspect-ratio: 1 / 1;
}

/* フロント: ソフトカードの CTA 右に対応OS */
.software-card__footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    margin-top: 0.75rem;
}

.software-card__footer .software-cta {
    margin: 0;
}

.software-card__os {
    flex-shrink: 0;
    font-size: 0.86rem;
    color: var(--muted);
    line-height: 1.4;
    text-align: right;
}

.software-card__os-label {
    margin-right: 0.35rem;
    color: var(--text);
    opacity: 0.85;
}

.software-single__thumb {
    margin: 0 0 1.25rem;
    max-width: min(520px, 100%);
    border-radius: 10px;
    overflow: hidden;
    line-height: 0;
}

.software-single__thumb-img {
    width: 100%;
    height: auto;
    display: block;
}

.mtl-x-banner {
    position: relative;
    z-index: 2;
    display: inline-flex;
    flex-direction: column;
    gap: 0.45rem;
    text-decoration: none;
    color: #edf6ff;
}

.mtl-x-banner__image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
    border: 1.5px solid rgba(255, 255, 255, 0.88);
    box-shadow:
        0 8px 22px rgba(8, 14, 32, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.mtl-x-banner__fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 3.2rem;
    padding: 0.7rem 1rem;
    border-radius: 12px;
    border: 1.5px solid rgba(255, 255, 255, 0.88);
    background: linear-gradient(
        120deg,
        rgba(34, 60, 102, 0.88) 0%,
        rgba(28, 49, 84, 0.9) 52%,
        rgba(22, 38, 67, 0.92) 100%
    );
    color: #edf6ff;
    font-weight: 700;
    line-height: 1.35;
    text-align: center;
    box-shadow:
        0 8px 22px rgba(8, 14, 32, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.mtl-x-banner__meta {
    font-size: 0.88rem;
    line-height: 1.45;
    color: #d7e8ff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.mtl-x-banner:hover .mtl-x-banner__image,
.mtl-x-banner:focus-visible .mtl-x-banner__image,
.mtl-x-banner:hover .mtl-x-banner__fallback,
.mtl-x-banner:focus-visible .mtl-x-banner__fallback {
    border-color: rgba(160, 210, 255, 0.98);
    box-shadow:
        0 10px 26px rgba(8, 14, 32, 0.42),
        0 0 0 2px rgba(126, 200, 255, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.mtl-x-banner:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
    border-radius: 12px;
}

.mtl-x-banner--header {
    flex: 0 0 auto;
    width: min(280px, 100%);
}

.mtl-x-banner--footer {
    width: min(320px, 100%);
    align-items: center;
}

.mtl-x-banner--footer .mtl-x-banner__meta {
    text-align: center;
}

.mtl-mobile-top-x-banner {
    display: none;
    margin: 0 0 1rem;
}

.mtl-x-banner--mobile-top {
    width: min(100%, 420px);
    margin: 0 auto;
    align-items: center;
}

.mtl-x-banner--mobile-top .mtl-x-banner__meta {
    text-align: center;
}

.site-footer__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
}

.site-footer__inner > p {
    margin: 0;
}

.hero-banner-update__x-link {
    color: #dfefff;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.4;
    text-decoration: none;
    display: none;
}

.hero-banner-update__x-link:hover,
.hero-banner-update__x-link:focus-visible {
    color: #9fd0ff;
    text-decoration: none;
}

@media (min-width: 1025px) {
    .hero-banner-update__head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.85rem;
    }

    .hero-banner-update__x-link {
        display: inline-block;
        flex: 0 0 auto;
        font-size: 0.75rem;
        letter-spacing: 0.04em;
        white-space: nowrap;
        padding: 0.26rem 0.7rem;
        border-radius: 999px;
        border: 1px solid rgba(168, 218, 255, 0.4);
        background: rgba(36, 78, 136, 0.18);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
        transition:
            color 0.18s ease,
            border-color 0.18s ease,
            background-color 0.18s ease,
            box-shadow 0.18s ease;
    }

    .hero-banner-update__x-link:hover,
    .hero-banner-update__x-link:focus-visible {
        border-color: rgba(168, 218, 255, 0.62);
        background: rgba(36, 78, 136, 0.3);
        box-shadow:
            0 4px 12px rgba(8, 14, 32, 0.18),
            inset 0 1px 0 rgba(255, 255, 255, 0.1);
    }

    .site-header .container {
        align-items: center;
        justify-content: space-between;
    }

    .site-nav {
        flex: 1 1 auto;
    }

    .site-nav .menu {
        justify-content: flex-start !important;
    }
}

@media (max-width: 1024px) {
    .mtl-x-banner--header {
        width: min(340px, 100%);
    }
}

@media (max-width: 700px) {
    .site-header .container {
        align-items: stretch !important;
    }

    .mtl-mobile-top-x-banner {
        display: block;
    }

    .mtl-x-banner--header,
    .mtl-x-banner--footer,
    .mtl-x-banner--mobile-top {
        width: 100%;
    }

    .site-footer__inner {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
}

