@charset "UTF-8";

/* ===================================
   Dark Mode Overrides
   Base layer only. Keep page-specific fixes in follow-up tasks.
   =================================== */

[data-theme="dark"] {
    color-scheme: dark;
}

[data-theme="dark"] html,
[data-theme="dark"] body {
    background: #000;
    color: var(--color-text);
}

[data-theme="dark"] body,
[data-theme="dark"] p,
[data-theme="dark"] li,
[data-theme="dark"] dt,
[data-theme="dark"] dd,
[data-theme="dark"] small,
[data-theme="dark"] strong,
[data-theme="dark"] em,
[data-theme="dark"] label,
[data-theme="dark"] figcaption,
[data-theme="dark"] blockquote,
[data-theme="dark"] cite {
    color: var(--color-text);
}

[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
    color: #fff;
}

[data-theme="dark"] a {
    color: #fff;
}

[data-theme="dark"] a:hover,
[data-theme="dark"] a:focus-visible {
    color: var(--color-text-light);
}

[data-theme="dark"] hr,
[data-theme="dark"] table,
[data-theme="dark"] th,
[data-theme="dark"] td,
[data-theme="dark"] thead,
[data-theme="dark"] tbody,
[data-theme="dark"] tr {
    border-color: var(--color-border);
}

[data-theme="dark"] th,
[data-theme="dark"] td {
    color: var(--color-text);
    background: transparent;
}

[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select,
[data-theme="dark"] option {
    background: #111;
    color: #fff;
    border-color: var(--color-border);
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
    color: var(--color-text-light);
}

[data-theme="dark"] input:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] select:focus {
    outline-color: #fff;
    border-color: #fff;
}

[data-theme="dark"] #wrapper,
[data-theme="dark"] #outerMenu,
[data-theme="dark"] .pages,
[data-theme="dark"] .inner,
[data-theme="dark"] .section-gutter,
[data-theme="dark"] .itemWrapStyle_07 .item,
[data-theme="dark"] .articleStyle_03,
[data-theme="dark"] .research-card,
[data-theme="dark"] .gallery-item,
[data-theme="dark"] .tag-btn {
    color: var(--color-text);
}

[data-theme="dark"] .articleStyle_03,
[data-theme="dark"] .research-card,
[data-theme="dark"] .gallery-item,
[data-theme="dark"] .tag-btn,
[data-theme="dark"] .section--relative-white,
[data-theme="dark"] .section--white,
[data-theme="dark"] .secStyle_06,
[data-theme="dark"] #container_01,
[data-theme="dark"] #homeContainer,
[data-theme="dark"] .directorsArchive::before,
[data-theme="dark"] .directorsArchive article .content,
[data-theme="dark"] .directorsArchive article a .eyecatch .imgStyle > .inner::after,
[data-theme="dark"] .masonry-gallery .gallery-item,
[data-theme="dark"] .footerNav,
[data-theme="dark"] .footerLine {
    background: #111;
    border-color: var(--color-border);
}

[data-theme="dark"] header,
[data-theme="dark"] #headerBg,
[data-theme="dark"] .site-header,
[data-theme="dark"] .fixedHeader .site-header {
    background-color: rgba(0, 0, 0, 0.92);
    color: #fff;
}

[data-theme="dark"] .globalNav,
[data-theme="dark"] .globalNav nav,
[data-theme="dark"] .globalNav ul,
[data-theme="dark"] .globalNav li,
[data-theme="dark"] .globalNav a,
[data-theme="dark"] .globalNav span,
[data-theme="dark"] .langSelector,
[data-theme="dark"] .langSelector a,
[data-theme="dark"] .langSelector li,
[data-theme="dark"] .language-switcher__name,
[data-theme="dark"] .headerMain > .inner > .col-nav a,
[data-theme="dark"] .globalNav ul.parent > li > a span {
    color: #fff !important;
}

/* ダークモード時のfixedHeader: ナビテキストを白で維持
   home.css .home.fixedHeader (specificity 0,5,1) より高 specificity で上書き */
[data-theme="dark"] .home.fixedHeader .headerMain > .inner > .col-nav a,
[data-theme="dark"] .home.fixedHeader .globalNav ul.parent > li > a span,
[data-theme="dark"] .setFv.fixedHeader .headerMain > .inner > .col-nav a,
[data-theme="dark"] .setFv.fixedHeader .globalNav ul.parent > li > a span,
[data-theme="dark"] .setFv_02.fixedHeader .headerMain > .inner > .col-nav a,
[data-theme="dark"] .setFv_02.fixedHeader .globalNav ul.parent > li > a span,
[data-theme="dark"] .setFvSp.fixedHeader .headerMain > .inner > .col-nav a,
[data-theme="dark"] .setFvSp.fixedHeader .globalNav ul.parent > li > a span {
    color: #fff !important;
}

[data-theme="dark"] .pages:not(.setFv):not(.setFv_02):not(.setFvSp):not(.fixedHeader) .headerMain > .inner > .col-nav a,
[data-theme="dark"] .pages:not(.setFv):not(.setFv_02):not(.setFvSp):not(.fixedHeader) .headerMain > .inner > .col-nav a span {
    color: #fff !important;
}

[data-theme="dark"] header .menuSection .col-ttl .ttlLink a,
[data-theme="dark"] header .menuSection .col-ttl .ttlLink p,
[data-theme="dark"] header .menuSection .col-ttl .ttlLink h2,
[data-theme="dark"] header .menuSection .col-nav > .inner .item .labelTx {
    color: #fff !important;
}

[data-theme="dark"] .burger span,
[data-theme="dark"] .hamburger__line {
    background-color: #fff;
}

[data-theme="dark"] footer,
[data-theme="dark"] .site-footer,
[data-theme="dark"] .site-footer__nav,
[data-theme="dark"] .site-footer__line,
[data-theme="dark"] .footer-campus-logo {
    background: #000;
    color: #fff;
}

[data-theme="dark"] footer a,
[data-theme="dark"] .site-footer a,
[data-theme="dark"] .footer-campus-logo a,
[data-theme="dark"] footer small {
    color: #fff;
}

.dark-mode-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-left: 12px;
    padding: 0;
    border: 1px solid currentColor;
    border-radius: 999px;
    background: transparent;
    color: inherit;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.dark-mode-toggle:hover,
.dark-mode-toggle:focus-visible {
    transform: translateY(-1px);
}

.dark-mode-toggle:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}

.dark-mode-toggle__icon {
    width: 18px;
    height: 18px;
}

.dark-mode-toggle__icon--moon {
    display: none;
}

[data-theme="dark"] .dark-mode-toggle,
[data-theme="dark"] .home.fixedHeader .dark-mode-toggle,
[data-theme="dark"] .pages.fixedHeader .dark-mode-toggle,
[data-theme="dark"] body.pages:not(.setFv) .dark-mode-toggle {
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
}

[data-theme="dark"] .dark-mode-toggle:hover,
[data-theme="dark"] .dark-mode-toggle:focus-visible,
[data-theme="dark"] .home.fixedHeader .dark-mode-toggle:hover,
[data-theme="dark"] .home.fixedHeader .dark-mode-toggle:focus-visible {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #fff !important;
}

[data-theme="dark"] .dark-mode-toggle__icon--sun {
    display: none;
}

[data-theme="dark"] .dark-mode-toggle__icon--moon {
    display: block;
}

/* ライトモード デフォルト：ヒーローなしページ、fixedHeader後 */
[data-theme="light"] .dark-mode-toggle {
    color: #231815;
    border-color: rgba(35, 24, 21, 0.35);
}

[data-theme="light"] .dark-mode-toggle:hover,
[data-theme="light"] .dark-mode-toggle:focus-visible {
    background: rgba(35, 24, 21, 0.06);
}

/* ライトモード ヒーロー表示中（スクロール前）：白文字（暗い背景の上） */
/* fixedHeaderはbodyではなく#wrapperに付与される（master.js） */
/* mix-blend-modeをnormalにして、color: #fff を確実に白として表示する */
[data-theme="light"] .home:not(.fixedHeader):not(.menuOpen) .dark-mode-toggle,
[data-theme="light"] .setFv:not(.fixedHeader):not(.menuOpen) .dark-mode-toggle,
[data-theme="light"] .setFv_02:not(.fixedHeader):not(.menuOpen) .dark-mode-toggle,
[data-theme="light"] .setFvSp:not(.fixedHeader):not(.menuOpen) .dark-mode-toggle {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.4);
    mix-blend-mode: normal;
}

[data-theme="light"] .home:not(.fixedHeader):not(.menuOpen) .dark-mode-toggle:hover,
[data-theme="light"] .home:not(.fixedHeader):not(.menuOpen) .dark-mode-toggle:focus-visible,
[data-theme="light"] .setFv:not(.fixedHeader):not(.menuOpen) .dark-mode-toggle:hover,
[data-theme="light"] .setFv:not(.fixedHeader):not(.menuOpen) .dark-mode-toggle:focus-visible {
    background: rgba(255, 255, 255, 0.12);
}

/* ライトモード fixedHeader後、またはメニューオープン時：黒に戻す */
/* mix-blend-mode: differenceが親(.col-nav)に残るため、normalで明示的に打ち消す */
[data-theme="light"] .fixedHeader .dark-mode-toggle,
[data-theme="light"] .menuOpen .dark-mode-toggle {
    color: #231815 !important;
    border-color: rgba(35, 24, 21, 0.35) !important;
    mix-blend-mode: normal !important;
    transition: background-color 0.2s ease, transform 0.2s ease !important;
}

[data-theme="dark"] #siteLogo .st0,
[data-theme="dark"] .site-header__logo svg .st0,
[data-theme="dark"] body.home header #siteLogo .st0,
[data-theme="dark"] body.pages header #siteLogo .st0,
[data-theme="dark"] .menuOpen header #siteLogo .st0,
[data-theme="dark"] .fixedHeader .site-header__logo a svg .st0,
[data-theme="dark"] .pages.fixedHeader .site-header__logo a svg .st0,
[data-theme="dark"] .pages:not(.setFv):not(.setFv_02):not(.setFvSp):not(.fixedHeader) .site-header__logo a svg .st0,
[data-theme="dark"] .home.fixedHeader header #siteLogo .st0,
[data-theme="dark"] .home.fixedHeader .headerMain .col-logo a svg .st0 {
    fill: #fff !important;
}

[data-theme="dark"] .site-footer__logo svg g,
[data-theme="dark"] .site-footer__logo svg path,
[data-theme="dark"] .site-footer__logo svg [fill],
[data-theme="dark"] .footer-campus-logo,
[data-theme="dark"] .footer-campus-logo svg,
[data-theme="dark"] .footer-campus-logo path {
    color: #fff;
    fill: #fff !important;
}

[data-theme="dark"] .header-contactBtn,
[data-theme="dark"] body.home .header-contactBtn,
[data-theme="dark"] body.page-template-page-sustainability .header-contactBtn,
[data-theme="dark"] .home.fixedHeader .header-contactBtn {
    background: transparent;
    border: 1px solid #fff !important;
    color: #fff !important;
    mix-blend-mode: normal !important;
}

[data-theme="dark"] .header-contactBtn span,
[data-theme="dark"] .home.fixedHeader .header-contactBtn span {
    color: #fff !important;
}

[data-theme="dark"] .header-contactBtn:hover,
[data-theme="dark"] .header-contactBtn:focus-visible {
    background: #fff;
    color: #000 !important;
}

[data-theme="dark"] .header-contactBtn:hover span,
[data-theme="dark"] .header-contactBtn:focus-visible span {
    color: #000 !important;
}

[data-theme="dark"] .directorsArchive .inner .btnSec,
[data-theme="dark"] .directorsArchive .inner .btnSec a {
    border-color: #fff;
    color: #fff;
}

[data-theme="dark"] .directorsArchive .inner .btnSec:hover,
[data-theme="dark"] .directorsArchive .inner .btnSec a:hover,
[data-theme="dark"] .directorsArchive .inner .btnSec:focus-visible,
[data-theme="dark"] .directorsArchive .inner .btnSec a:focus-visible {
    background: #fff;
    color: #000;
}

[data-theme="dark"] .btn-link {
    background: #111;
    border-color: #444;
    color: #fff;
}

[data-theme="dark"] .btn-link:hover,
[data-theme="dark"] .btn-link:focus-visible {
    background: #fff;
    border-color: #fff;
    color: #000;
}

[data-theme="dark"] .btnStyle_08 .arrow span {
    background-color: #fff;
}

[data-theme="dark"] #home-news .news-date {
    color: #fff;
}

[data-theme="dark"] .cdcSec .ttl > span + span {
    color: #fff;
}

[data-theme="dark"] .home.fixedHeader .burgerNav .burger span,
[data-theme="dark"] .menuOpen .burgerNav .burger span {
    background-color: #fff !important;
}

[data-theme="dark"] .home.fixedHeader .langSelector li,
[data-theme="dark"] .home.fixedHeader .langSelector a,
[data-theme="dark"] .home.fixedHeader .langSelector .language-switcher__name {
    color: #fff !important;
}

[data-theme="dark"] .view-more-btn {
    border-color: #fff;
    color: #fff;
}

[data-theme="dark"] .view-more-btn:hover,
[data-theme="dark"] .view-more-btn:focus-visible {
    background: #fff;
    color: #000;
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .tag-btn {
    background: #111;
    color: #aaa;
    border-color: #333;
}

[data-theme="dark"] a.tag-btn,
[data-theme="dark"] .tag-filter .tag-btn,
[data-theme="dark"] .tagStyle_01 a {
    background: #111 !important;
    background-color: #111 !important;
    color: #aaa !important;
    border-color: #333;
}

[data-theme="dark"] .tag-btn:hover,
[data-theme="dark"] .tag-btn:focus-visible,
[data-theme="dark"] a.tag-btn:hover,
[data-theme="dark"] a.tag-btn:focus-visible,
[data-theme="dark"] .tagStyle_01 a:hover,
[data-theme="dark"] .tagStyle_01 a:focus-visible {
    background: #2a2a2a !important;
    background-color: #2a2a2a !important;
    border-color: #555;
    color: #fff;
}

[data-theme="dark"] .tag-btn.active {
    background: #fff;
    color: #000;
    border-color: #fff;
}

[data-theme="dark"] a.tag-btn.active {
    color: #000;
}

[data-theme="dark"] .tagStyle_01 a,
[data-theme="dark"] .tagStyle_01 a span,
[data-theme="dark"] .tagStyle_01 a span.hash {
    color: #aaa !important;
}

[data-theme="dark"] ::selection {
    background: var(--color-selection);
    color: var(--color-selection-text);
}

[data-theme="dark"] ::-moz-selection {
    background: var(--color-selection-firefox);
    color: var(--color-selection-text);
}

@media screen and (max-width: 768px) {
    .dark-mode-toggle {
        width: 40px;
        height: 40px;
        margin-left: 10px;
    }
}

/* imgタグで読み込むSVGアイコン（fill指定あり）をダーク時に白反転 */
[data-theme="dark"] img[src*="icon-bluesky.svg"] {
    filter: brightness(0) invert(1);
}
