/* =========================================================
   山形県立山形盲学校
   ユーザーテーマCSS 完全版 Ver.12.1.4 配色修正版

   STEP 1
   ・アクセシビリティバーの新デザイン
   ・文字サイズ、背景色、ふりがな、読み上げ案内
   ・PC／タブレット／スマートフォン対応
   ・既存の記事、写真、カレンダー、メニューを維持
========================================================= */

/* =====================================================
   1．基本設定
===================================================== */

body {
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        "Noto Sans JP",
        "Hiragino Kaku Gothic ProN",
        "Yu Gothic",
        Meiryo,
        sans-serif;
}

.bg-dark {
    background-color: #12335c !important;
    padding: 0;
}

.navbar-dark .navbar-brand {
    padding-left: 0.5rem;
    font-size: 1rem;
}

.navbar-dark .navbar-nav .nav-link {
    font-size: 0.8rem;
}

/* =====================================================
   2．横型・縦型メニュー
===================================================== */

.plugin-menus .nav-tabs li.nav-item > a,
.plugin-menus .list-group > a.list-group-item {
    background: #12335c;
    color: #ffffff;
}

.plugin-menus .nav-tabs li.nav-item {
    border-top: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
    border-left: 2px solid #ffffff;
}

.plugin-menus .nav-tabs li.nav-item:last-child {
    border-right: 2px solid #ffffff;
}

.plugin-menus .nav-tabs .nav-link {
    border-radius: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.4;
}

.plugin-menus .list-group > a.list-group-item {
    border: 0;
    border-radius: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.45;
}

.plugin-menus .nav-tabs a:hover,
.plugin-menus .nav-tabs a:focus-visible,
.plugin-menus .nav-tabs a.active,
.plugin-menus .list-group a:hover,
.plugin-menus .list-group a:focus-visible,
.plugin-menus .list-group a.active {
    background-color: #2d527f;
    color: #fff36a;
    text-decoration: none;
}

/* =====================================================
   3．リンク・フレームタイトル
===================================================== */

#ccMainArea a {
    color: #12335c;
    text-decoration: underline;
}

#ccMainArea a:hover {
    color: #315f91;
}

#ccMainArea a:focus-visible,
.plugin-menus a:focus-visible {
    outline: 3px solid #ffd800;
    outline-offset: 2px;
}

.card-header.bg-default {
    background: #12335c;
    border-color: #ffffff;
    border-bottom: 2px solid #ffffff;
    color: #ffffff;
}

/* =====================================================
   4．追加フレームカラー
===================================================== */

.frame-pink,
.frame-coral,
.frame-orange,
.frame-yellow,
.frame-green,
.frame-mint,
.frame-blue,
.frame-purple,
.frame-gray {
    overflow: hidden !important;
    border-radius: 12px !important;
    box-shadow: 0 3px 10px rgba(18, 51, 92, 0.12) !important;
}

.frame-pink .card,
.frame-coral .card,
.frame-orange .card,
.frame-yellow .card,
.frame-green .card,
.frame-mint .card,
.frame-blue .card,
.frame-purple .card,
.frame-gray .card {
    overflow: hidden !important;
    border-width: 2px !important;
    border-style: solid !important;
    border-radius: 12px !important;
    box-shadow: none !important;
}

.frame-pink .card-header,
.frame-coral .card-header,
.frame-orange .card-header,
.frame-yellow .card-header,
.frame-green .card-header,
.frame-mint .card-header,
.frame-blue .card-header,
.frame-purple .card-header,
.frame-gray .card-header {
    border-bottom-width: 2px !important;
    border-bottom-style: solid !important;
    border-radius: 10px 10px 0 0 !important;
    background-image: none !important;
    color: #24333d !important;
    font-weight: 700 !important;
}

.frame-pink .card { border-color: #bd7e89 !important; }
.frame-pink .card-header { background: #e5b7be !important; border-bottom-color: #bd7e89 !important; }
.frame-coral .card { border-color: #dc927b !important; }
.frame-coral .card-header { background: #fabea7 !important; border-bottom-color: #dc927b !important; }
.frame-orange .card { border-color: #d99b71 !important; }
.frame-orange .card-header { background: #fcc9ac !important; border-bottom-color: #d99b71 !important; }
.frame-yellow .card { border-color: #d1c968 !important; }
.frame-yellow .card-header { background: #fffac2 !important; border-bottom-color: #d1c968 !important; }
.frame-green .card { border-color: #88b17f !important; }
.frame-green .card-header { background: #c3dcbe !important; border-bottom-color: #88b17f !important; }
.frame-mint .card { border-color: #7faeaa !important; }
.frame-mint .card-header { background: #bad4d1 !important; border-bottom-color: #7faeaa !important; }
.frame-blue .card { border-color: #8094aa !important; }
.frame-blue .card-header { background: #b4c1d1 !important; border-bottom-color: #8094aa !important; }
.frame-purple .card { border-color: #9275ad !important; }
.frame-purple .card-header { background: #c5b2d6 !important; border-bottom-color: #9275ad !important; }
.frame-gray .card { border-color: #9ca8b3 !important; }
.frame-gray .card-header { background: #d7dde3 !important; border-bottom-color: #9ca8b3 !important; }

/* =====================================================
   5．アクセシビリティバー Ver.12.1.3
===================================================== */

#ym-accessibility-bar {
    position: relative;
    z-index: 1000;
    width: 100%;
    box-sizing: border-box;
    background: linear-gradient(135deg, #0b49a0 0%, #062c70 58%, #041f55 100%);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(7, 39, 91, 0.24);
    font-size: 15px !important;
    line-height: 1.35;
}

#ym-accessibility-bar * {
    box-sizing: border-box;
}

#ym-accessibility-bar button {
    font-family: inherit;
}

#ym-accessibility-bar .ym-accessibility-toggle {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 12px;
    min-width: 360px;
    padding: 12px 18px;
    border: 0;
    background: transparent;
    color: #ffffff;
    text-align: left;
    cursor: default;
}

#ym-accessibility-bar .ym-accessibility-symbol {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: #ffffff;
    color: #0b49a0;
    font-size: 31px !important;
    box-shadow: 0 2px 7px rgba(0, 0, 0, 0.16);
}

#ym-accessibility-bar .ym-accessibility-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

#ym-accessibility-bar .ym-accessibility-title {
    color: #ffffff;
    font-size: 24px !important;
    font-weight: 800;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

#ym-accessibility-bar .ym-accessibility-subtitle {
    color: #ffffff;
    font-size: 12px !important;
    font-weight: 600;
    opacity: 0.95;
    white-space: nowrap;
}

#ym-accessibility-bar .ym-accessibility-toggle-mark {
    display: none;
    margin-left: auto;
    color: #ffffff;
    font-size: 24px !important;
}

#ym-accessibility-bar .ym-accessibility-panel {
    min-width: 0;
    flex: 1 1 auto;
}

#ym-accessibility-bar {
    display: flex;
    align-items: stretch;
}

#ym-accessibility-bar .ym-accessibility-inner {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 18px;
    width: 100%;
    min-height: 82px;
    padding: 10px 18px 10px 6px;
}

#ym-accessibility-bar .ym-accessibility-group {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
}

#ym-accessibility-bar .ym-accessibility-divider {
    align-self: stretch;
    width: 1px;
    min-height: 54px;
    background: rgba(255, 255, 255, 0.28);
}

#ym-accessibility-bar .ym-accessibility-label {
    color: #ffffff;
    font-size: 15px !important;
    font-weight: 800;
    white-space: nowrap;
}

#ym-accessibility-bar .ym-segmented-control {
    display: inline-flex;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.62);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.13);
}

#ym-accessibility-bar .ym-segmented-control button {
    min-width: 58px;
    min-height: 44px;
    padding: 8px 13px;
    border: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.36);
    border-radius: 0;
    background: transparent;
    color: #ffffff;
    font-size: 15px !important;
    font-weight: 800;
    cursor: pointer;
}

#ym-accessibility-bar .ym-segmented-control button:last-child {
    border-right: 0;
}

#ym-accessibility-bar .ym-segmented-control button.is-active {
    background: #ffffff !important;
    color: #12335c !important;
    box-shadow: inset 0 0 0 2px rgba(18, 51, 92, 0.08);
}

#ym-accessibility-bar .ym-segmented-control button:hover,
#ym-accessibility-bar .ym-segmented-control button:focus-visible {
    background: rgba(255, 255, 255, 0.23);
}

#ym-accessibility-bar .ym-color-control {
    display: inline-flex;
    gap: 8px;
}

#ym-accessibility-bar .ym-color-btn {
    position: relative;
    min-width: 48px;
    min-height: 44px;
    padding: 7px 10px;
    border: 2px solid transparent;
    border-radius: 10px;
    font-size: 14px !important;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 2px 7px rgba(0, 0, 0, 0.16);
}

#ym-accessibility-bar .ym-color-white {
    background: #ffffff;
    color: #111111;
}

#ym-accessibility-bar .ym-color-black {
    background: #000000;
    color: #ffffff;
}

#ym-accessibility-bar .ym-color-blue {
    background: #1968d2;
    color: #ffffff;
}

#ym-accessibility-bar .ym-color-beige {
    background: #f1dfc3;
    color: #24170d;
}

#ym-accessibility-bar .ym-color-btn.is-active {
    border-color: #ffffff;
    outline: 3px solid #ffd800;
    outline-offset: 2px;
}

#ym-accessibility-bar .ym-round-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 43px;
    height: 43px;
    border-radius: 50%;
    background: #ffffff;
    color: #0b49a0;
    font-size: 25px !important;
    font-weight: 900;
}

#ym-accessibility-bar .ym-two-buttons button {
    min-width: 48px;
}

#ym-accessibility-bar .ym-read-guide-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 56px;
    padding: 8px 14px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

#ym-accessibility-bar .ym-speaker-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 30px !important;
}

#ym-accessibility-bar .ym-read-guide-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    color: #ffffff;
    line-height: 1.15;
}

#ym-accessibility-bar .ym-read-guide-main {
    color: #ffffff;
    font-size: 18px !important;
    font-weight: 800;
}

#ym-accessibility-bar .ym-read-guide-sub {
    color: #ffffff;
    font-size: 12px !important;
    font-weight: 600;
}

#ym-accessibility-bar button:hover {
    filter: brightness(1.08);
}

#ym-accessibility-bar button:focus-visible {
    outline: 3px solid #ffd800;
    outline-offset: 3px;
}

/* =====================================================
   6．読み上げ案内ダイアログ
===================================================== */

html.ym-dialog-open,
html.ym-dialog-open body {
    overflow: hidden;
}

.ym-dialog-backdrop {
    position: fixed;
    z-index: 20000;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.62);
}

.ym-dialog-backdrop[hidden] {
    display: none !important;
}

.ym-dialog {
    width: min(620px, 100%);
    max-height: 90vh;
    overflow: auto;
    padding: 24px;
    border: 3px solid #12335c;
    border-radius: 14px;
    background: #ffffff;
    color: #212529;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.ym-dialog h2 {
    margin: 0 0 16px;
    color: #12335c;
    font-size: 1.5rem;
}

.ym-dialog p {
    margin: 0 0 1em;
    line-height: 1.8;
}

.ym-dialog-close {
    min-height: 44px;
    padding: 8px 22px;
    border: 0;
    border-radius: 8px;
    background: #12335c;
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
}

.ym-dialog-close:focus-visible {
    outline: 3px solid #ffd800;
    outline-offset: 3px;
}

/* =====================================================
   7．ページ上部へ戻る
===================================================== */

#page-top {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 9999;
    margin: 0;
}

#page-top a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #12335c;
    color: #ffffff;
    font-size: 2rem;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(18, 51, 92, 0.28);
}

#page-top a:hover {
    background: #2d527f;
    color: #ffffff;
}

#page-top a:focus-visible {
    outline: 3px solid #ffd800;
    outline-offset: 3px;
}

/* =====================================================
   8．文字拡大時の補助
===================================================== */

html.ym-font-large .plugin-menus .nav-tabs,
html.ym-font-xlarge .plugin-menus .nav-tabs {
    flex-wrap: wrap;
}

html.ym-font-large .plugin-menus .nav-tabs li.nav-item,
html.ym-font-xlarge .plugin-menus .nav-tabs li.nav-item {
    min-width: 0;
    flex: 1 1 auto;
}

html.ym-font-large [data-ym-font-recorded="true"],
html.ym-font-xlarge [data-ym-font-recorded="true"] {
    overflow-wrap: anywhere;
    word-break: normal;
}

html.ym-font-large #ccMainArea [data-ym-font-recorded="true"],
html.ym-font-xlarge #ccMainArea [data-ym-font-recorded="true"] {
    line-height: 1.65 !important;
}

html.ym-font-large #ccMainArea img,
html.ym-font-xlarge #ccMainArea img {
    max-width: 100% !important;
    height: auto !important;
}

/* カレンダー、検索、管理部品は拡大しない */
.plugin-calendars,
.plugin-calendar,
[class*="plugin-calendar"],
[id*="plugin-calendar"],
.plugin-searchs,
.plugin-search {
    max-width: 100%;
    line-height: normal;
}

#ccMainArea .btn,
#ccMainArea .badge,
#ccMainArea button,
#ccMainArea input,
#ccMainArea select,
#ccMainArea textarea {
    line-height: normal;
}

/* =====================================================
   9．ふりがな
===================================================== */

html.ym-furigana-off rt {
    display: none !important;
}

/* =====================================================
   10．背景色切替
===================================================== */

html.ym-theme-white {
    --ym-page-bg: #ffffff;
    --ym-surface-bg: #ffffff;
    --ym-surface-alt: #f4f6f9;
    --ym-header-bg: #12335c;
    --ym-menu-bg: #12335c;
    --ym-menu-hover: #2d527f;
    --ym-text: #212529;
    --ym-link: #12335c;
    --ym-link-hover: #315f91;
    --ym-border: #c8ced8;
    --ym-input-bg: #ffffff;
    --ym-input-text: #212529;
    --ym-focus: #ffd800;
}

html.ym-theme-black {
    --ym-page-bg: #000000;
    --ym-surface-bg: #000000;
    --ym-surface-alt: #1f1f1f;
    --ym-header-bg: #1f1f1f;
    --ym-menu-bg: #000000;
    --ym-menu-hover: #333333;
    --ym-text: #ffffff;
    --ym-link: #fff36a;
    --ym-link-hover: #7fe7ff;
    --ym-border: #ffffff;
    --ym-input-bg: #111111;
    --ym-input-text: #ffffff;
    --ym-focus: #ffd800;
}

html.ym-theme-blue {
    --ym-page-bg: #063a85;
    --ym-surface-bg: #063a85;
    --ym-surface-alt: #03265c;
    --ym-header-bg: #03265c;
    --ym-menu-bg: #03265c;
    --ym-menu-hover: #001b44;
    --ym-text: #ffffff;
    --ym-link: #fff36a;
    --ym-link-hover: #9beeff;
    --ym-border: #ffffff;
    --ym-input-bg: #03265c;
    --ym-input-text: #ffffff;
    --ym-focus: #ffd800;
}

html.ym-theme-beige {
    --ym-page-bg: #f7efd8;
    --ym-surface-bg: #f7efd8;
    --ym-surface-alt: #e7d5ae;
    --ym-header-bg: #e7d5ae;
    --ym-menu-bg: #5a452b;
    --ym-menu-hover: #3f2d19;
    --ym-text: #1f1a14;
    --ym-link: #12335c;
    --ym-link-hover: #7a2100;
    --ym-border: #6b5b45;
    --ym-input-bg: #fffaf0;
    --ym-input-text: #1f1a14;
    --ym-focus: #d45500;
}

html[class*="ym-theme-"] body,
html[class*="ym-theme-"] #ccMainArea,
html[class*="ym-theme-"] #ccLeftArea,
html[class*="ym-theme-"] #ccRightArea,
html[class*="ym-theme-"] #ccCenterArea,
html[class*="ym-theme-"] #ccHeaderArea,
html[class*="ym-theme-"] #headerArea,
html[class*="ym-theme-"] #ccFooterArea {
    background-color: var(--ym-page-bg) !important;
    color: var(--ym-text) !important;
}

html.ym-theme-black #ccMainArea .card,
html.ym-theme-blue #ccMainArea .card,
html.ym-theme-beige #ccMainArea .card,
html.ym-theme-black #ccMainArea .card-body,
html.ym-theme-blue #ccMainArea .card-body,
html.ym-theme-beige #ccMainArea .card-body,
html.ym-theme-black #ccLeftArea .card,
html.ym-theme-blue #ccLeftArea .card,
html.ym-theme-beige #ccLeftArea .card,
html.ym-theme-black #ccRightArea .card,
html.ym-theme-blue #ccRightArea .card,
html.ym-theme-beige #ccRightArea .card {
    border-color: var(--ym-border) !important;
    background-color: var(--ym-surface-bg) !important;
    color: var(--ym-text) !important;
}

html.ym-theme-black #ccMainArea :is(p, li, dt, dd, div, span, small, strong, em, b, td, th, h1, h2, h3, h4, h5, h6, figcaption),
html.ym-theme-blue #ccMainArea :is(p, li, dt, dd, div, span, small, strong, em, b, td, th, h1, h2, h3, h4, h5, h6, figcaption),
html.ym-theme-beige #ccMainArea :is(p, li, dt, dd, div, span, small, strong, em, b, td, th, h1, h2, h3, h4, h5, h6, figcaption) {
    color: var(--ym-text) !important;
}

html.ym-theme-black #ccMainArea a,
html.ym-theme-blue #ccMainArea a,
html.ym-theme-beige #ccMainArea a {
    color: var(--ym-link) !important;
    text-decoration-color: var(--ym-link) !important;
}

html.ym-theme-black #ccMainArea a:hover,
html.ym-theme-blue #ccMainArea a:hover,
html.ym-theme-beige #ccMainArea a:hover {
    color: var(--ym-link-hover) !important;
    text-decoration-color: var(--ym-link-hover) !important;
}

html.ym-theme-black .plugin-menus a,
html.ym-theme-blue .plugin-menus a,
html.ym-theme-beige .plugin-menus a {
    border-color: var(--ym-border) !important;
    background-color: var(--ym-menu-bg) !important;
    color: #ffffff !important;
    text-decoration-color: #ffffff !important;
}

html.ym-theme-black .plugin-menus a:hover,
html.ym-theme-black .plugin-menus a:focus-visible,
html.ym-theme-black .plugin-menus a.active,
html.ym-theme-blue .plugin-menus a:hover,
html.ym-theme-blue .plugin-menus a:focus-visible,
html.ym-theme-blue .plugin-menus a.active,
html.ym-theme-beige .plugin-menus a:hover,
html.ym-theme-beige .plugin-menus a:focus-visible,
html.ym-theme-beige .plugin-menus a.active {
    background-color: var(--ym-menu-hover) !important;
    color: #fff36a !important;
}

html.ym-theme-black input,
html.ym-theme-black select,
html.ym-theme-black textarea,
html.ym-theme-blue input,
html.ym-theme-blue select,
html.ym-theme-blue textarea,
html.ym-theme-beige input,
html.ym-theme-beige select,
html.ym-theme-beige textarea {
    border-color: var(--ym-border) !important;
    background-color: var(--ym-input-bg) !important;
    color: var(--ym-input-text) !important;
}

/* 画像の色は変更しない */
html.ym-theme-black #ccMainArea img,
html.ym-theme-blue #ccMainArea img,
html.ym-theme-beige #ccMainArea img {
    filter: none !important;
    opacity: 1 !important;
}

/* カレンダーは文字サイズを変えず、表本体だけを配色する
   子要素すべてに背景色を指定すると罫線を覆うため、対象を限定します。 */
html.ym-theme-black .plugin-calendars,
html.ym-theme-black .plugin-calendar,
html.ym-theme-blue .plugin-calendars,
html.ym-theme-blue .plugin-calendar,
html.ym-theme-beige .plugin-calendars,
html.ym-theme-beige .plugin-calendar {
    background-color: var(--ym-surface-bg) !important;
    color: var(--ym-text) !important;
}

html.ym-theme-black .plugin-calendars table,
html.ym-theme-black .plugin-calendar table,
html.ym-theme-blue .plugin-calendars table,
html.ym-theme-blue .plugin-calendar table,
html.ym-theme-beige .plugin-calendars table,
html.ym-theme-beige .plugin-calendar table {
    width: 100%;
    border-collapse: collapse !important;
    border-spacing: 0 !important;
    background-color: var(--ym-surface-bg) !important;
    color: var(--ym-text) !important;
}

html.ym-theme-black .plugin-calendars th,
html.ym-theme-black .plugin-calendars td,
html.ym-theme-black .plugin-calendar th,
html.ym-theme-black .plugin-calendar td,
html.ym-theme-blue .plugin-calendars th,
html.ym-theme-blue .plugin-calendars td,
html.ym-theme-blue .plugin-calendar th,
html.ym-theme-blue .plugin-calendar td,
html.ym-theme-beige .plugin-calendars th,
html.ym-theme-beige .plugin-calendars td,
html.ym-theme-beige .plugin-calendar th,
html.ym-theme-beige .plugin-calendar td {
    border: 1px solid var(--ym-border) !important;
    background-color: var(--ym-surface-bg) !important;
    color: var(--ym-text) !important;
    background-clip: padding-box !important;
}

/* 予定名などの内側要素は透明にし、セルの罫線を覆わせない */
html.ym-theme-black .plugin-calendars td *,
html.ym-theme-black .plugin-calendar td *,
html.ym-theme-blue .plugin-calendars td *,
html.ym-theme-blue .plugin-calendar td *,
html.ym-theme-beige .plugin-calendars td *,
html.ym-theme-beige .plugin-calendar td * {
    background-color: transparent !important;
}

html.ym-theme-black .plugin-calendars a,
html.ym-theme-black .plugin-calendar a,
html.ym-theme-blue .plugin-calendars a,
html.ym-theme-blue .plugin-calendar a,
html.ym-theme-beige .plugin-calendars a,
html.ym-theme-beige .plugin-calendar a {
    color: var(--ym-link) !important;
}

/* =====================================================
   アクセシビリティバーとダイアログは常に専用配色
   Ver.12.1.4 配色修正

   背景色「黒・青・ベージュ」を選択しても、
   アクセシビリティバー自体の青いデザインと
   各ボタンの文字色を変更しません。
===================================================== */

/* PC・タブレット：バー全体は常に濃い青 */
html.ym-theme-white #ym-accessibility-bar,
html.ym-theme-black #ym-accessibility-bar,
html.ym-theme-blue #ym-accessibility-bar,
html.ym-theme-beige #ym-accessibility-bar {
    background: linear-gradient(135deg, #0b49a0 0%, #062c70 58%, #041f55 100%) !important;
    color: #ffffff !important;
}

/* 見出し・説明文・開閉記号 */
html[class*="ym-theme-"] #ym-accessibility-bar .ym-accessibility-title,
html[class*="ym-theme-"] #ym-accessibility-bar .ym-accessibility-subtitle,
html[class*="ym-theme-"] #ym-accessibility-bar .ym-accessibility-toggle-mark,
html[class*="ym-theme-"] #ym-accessibility-bar .ym-accessibility-label {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* 文字サイズ・ふりがなの未選択ボタン */
html[class*="ym-theme-"] #ym-accessibility-bar .ym-segmented-control button {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* 文字サイズ・ふりがなの選択中ボタン */
html[class*="ym-theme-"] #ym-accessibility-bar .ym-segmented-control button.is-active {
    background: #ffffff !important;
    color: #12335c !important;
    -webkit-text-fill-color: #12335c !important;
}

/* ふりがなアイコン */
html[class*="ym-theme-"] #ym-accessibility-bar .ym-round-icon {
    background: #ffffff !important;
    color: #0b49a0 !important;
    -webkit-text-fill-color: #0b49a0 !important;
}

/* 読み上げボタン、タイトル、スピーカーアイコン */
html[class*="ym-theme-"] #ym-accessibility-bar .ym-read-guide-btn,
html[class*="ym-theme-"] #ym-accessibility-bar .ym-read-guide-text,
html[class*="ym-theme-"] #ym-accessibility-bar .ym-read-guide-main,
html[class*="ym-theme-"] #ym-accessibility-bar .ym-read-guide-sub,
html[class*="ym-theme-"] #ym-accessibility-bar .ym-speaker-icon,
html[class*="ym-theme-"] #ym-accessibility-bar .ym-speaker-icon i {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* 背景色ボタンは各ボタン固有の色を維持 */
html[class*="ym-theme-"] #ym-accessibility-bar .ym-color-white {
    background: #ffffff !important;
    color: #111111 !important;
    -webkit-text-fill-color: #111111 !important;
}

html[class*="ym-theme-"] #ym-accessibility-bar .ym-color-black {
    background: #000000 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

html[class*="ym-theme-"] #ym-accessibility-bar .ym-color-blue {
    background: #1968d2 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

html[class*="ym-theme-"] #ym-accessibility-bar .ym-color-beige {
    background: #f1dfc3 !important;
    color: #24170d !important;
    -webkit-text-fill-color: #24170d !important;
}

/* 読み上げ案内ダイアログ */
html.ym-theme-black .ym-dialog,
html.ym-theme-blue .ym-dialog,
html.ym-theme-beige .ym-dialog {
    background: #ffffff !important;
    color: #212529 !important;
}

html.ym-theme-black .ym-dialog *,
html.ym-theme-blue .ym-dialog *,
html.ym-theme-beige .ym-dialog * {
    color: inherit;
}

/* 「閉じる」ボタンは常に濃紺背景・白文字 */
html[class*="ym-theme-"] .ym-dialog .ym-dialog-close,
html[class*="ym-theme-"] .ym-dialog .ym-dialog-close * {
    background-color: #12335c !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* =====================================================
   11．タブレット
===================================================== */

@media (max-width: 1280px) {
    #ym-accessibility-bar .ym-accessibility-toggle {
        min-width: 300px;
        padding-right: 10px;
        padding-left: 14px;
    }

    #ym-accessibility-bar .ym-accessibility-title {
        font-size: 21px !important;
    }

    #ym-accessibility-bar .ym-accessibility-inner {
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 10px 14px;
        padding: 10px 12px;
    }

    #ym-accessibility-bar .ym-accessibility-divider {
        display: none;
    }
}

/* =====================================================
   12．スマートフォン
===================================================== */

@media (max-width: 767px) {
    #ym-accessibility-bar {
        display: block;
        border-radius: 0;
        box-shadow: 0 3px 10px rgba(7, 39, 91, 0.2);
    }

    #ym-accessibility-bar .ym-accessibility-toggle {
        width: 100%;
        min-width: 0;
        min-height: 74px;
        padding: 10px 14px;
        cursor: pointer;
    }

    #ym-accessibility-bar .ym-accessibility-symbol {
        width: 46px;
        height: 46px;
        font-size: 27px !important;
    }

    #ym-accessibility-bar .ym-accessibility-title {
        font-size: 19px !important;
    }

    #ym-accessibility-bar .ym-accessibility-subtitle {
        font-size: 11px !important;
    }

    #ym-accessibility-bar .ym-accessibility-toggle-mark {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    #ym-accessibility-bar .ym-accessibility-panel {
        display: none;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        background: #ffffff;
    }

    #ym-accessibility-bar .ym-accessibility-panel.is-open {
        display: block;
    }

    #ym-accessibility-bar .ym-accessibility-inner {
        display: grid;
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 15px 14px 16px;
    }

    #ym-accessibility-bar .ym-accessibility-group {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    #ym-accessibility-bar .ym-accessibility-label {
        color: #12335c;
        font-size: 15px !important;
    }

    #ym-accessibility-bar .ym-accessibility-divider {
        display: none;
    }

    #ym-accessibility-bar .ym-segmented-control {
        border: 1px solid #b7c3d2;
        background: #ffffff;
        box-shadow: 0 2px 6px rgba(18, 51, 92, 0.08);
    }

    #ym-accessibility-bar .ym-segmented-control button {
        min-height: 46px;
        border-right: 1px solid #c5d0dc;
        background: #ffffff;
        color: #12335c;
        font-size: 15px !important;
    }

    #ym-accessibility-bar .ym-segmented-control button.is-active {
        background: #0b49a0 !important;
        color: #ffffff !important;
    }

    #ym-accessibility-bar .ym-color-control {
        flex-wrap: wrap;
    }

    #ym-accessibility-bar .ym-color-btn {
        min-width: 54px;
        min-height: 46px;
    }

    #ym-accessibility-bar .ym-round-icon {
        background: #0b49a0;
        color: #ffffff;
    }

    #ym-accessibility-bar .ym-furigana-group {
        align-items: center;
    }

    #ym-accessibility-bar .ym-read-guide-btn {
        width: 100%;
        min-height: 56px;
        justify-content: center;
        border: 1px solid #b7c3d2;
        border-radius: 12px;
        background: #ffffff;
        color: #12335c;
        box-shadow: 0 2px 6px rgba(18, 51, 92, 0.1);
    }

    #ym-accessibility-bar .ym-speaker-icon {
        color: #0b49a0;
        font-size: 28px !important;
    }

    #ym-accessibility-bar .ym-read-guide-text,
    #ym-accessibility-bar .ym-read-guide-main,
    #ym-accessibility-bar .ym-read-guide-sub {
        color: #12335c;
    }

    #ym-accessibility-bar .ym-read-guide-main {
        font-size: 16px !important;
    }

    #ym-accessibility-bar .ym-read-guide-sub {
        font-size: 11px !important;
    }

    #page-top {
        right: 12px;
        bottom: 12px;
    }

    #page-top a {
        width: 54px;
        height: 54px;
        font-size: 1.65rem;
    }

    html.ym-font-large .plugin-menus .nav-tabs,
    html.ym-font-xlarge .plugin-menus .nav-tabs {
        display: block;
    }

    html.ym-font-large .plugin-menus .nav-tabs li.nav-item,
    html.ym-font-xlarge .plugin-menus .nav-tabs li.nav-item {
        width: 100%;
    }

    html.ym-font-large .plugin-menus .nav-tabs .dropdown-toggle,
    html.ym-font-xlarge .plugin-menus .nav-tabs .dropdown-toggle {
        width: 100%;
        justify-content: flex-start;
    }
}

/* =====================================================
   13．横型メニューのプルダウン親項目補正
===================================================== */

.plugin-menus .nav-tabs .dropdown-toggle,
.plugin-menus .nav-tabs .dropdown-toggle span {
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: normal;
    line-height: 1.35;
}

html.ym-font-large .plugin-menus .nav-tabs .dropdown-toggle,
html.ym-font-xlarge .plugin-menus .nav-tabs .dropdown-toggle {
    min-height: 100%;
    padding-top: 0.65em !important;
    padding-bottom: 0.65em !important;
}

html.ym-font-large .plugin-menus .nav-tabs li.nav-item,
html.ym-font-xlarge .plugin-menus .nav-tabs li.nav-item {
    display: flex;
    align-items: stretch;
}

html.ym-font-large .plugin-menus .nav-tabs li.nav-item > a,
html.ym-font-xlarge .plugin-menus .nav-tabs li.nav-item > a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}


/* =====================================================
   14．Ver.12.1.4 スマートフォン配色 最終補正
===================================================== */

@media (max-width: 767px) {
    /* 上部見出しは常に青背景・白文字 */
    html[class*="ym-theme-"] #ym-accessibility-bar .ym-accessibility-toggle {
        background: transparent !important;
        color: #ffffff !important;
    }

    html[class*="ym-theme-"] #ym-accessibility-bar .ym-accessibility-title,
    html[class*="ym-theme-"] #ym-accessibility-bar .ym-accessibility-subtitle,
    html[class*="ym-theme-"] #ym-accessibility-bar .ym-accessibility-toggle-mark,
    html[class*="ym-theme-"] #ym-accessibility-bar .ym-accessibility-toggle-mark i {
        color: #ffffff !important;
        -webkit-text-fill-color: #ffffff !important;
    }

    /* 展開部分は常に白背景・濃紺文字 */
    html[class*="ym-theme-"] #ym-accessibility-bar .ym-accessibility-panel {
        background: #ffffff !important;
        color: #12335c !important;
    }

    html[class*="ym-theme-"] #ym-accessibility-bar .ym-accessibility-label {
        color: #12335c !important;
        -webkit-text-fill-color: #12335c !important;
    }

    /* 未選択ボタンは白背景・濃紺文字 */
    html[class*="ym-theme-"] #ym-accessibility-bar .ym-segmented-control button {
        background: #ffffff !important;
        color: #12335c !important;
        -webkit-text-fill-color: #12335c !important;
    }

    /* 選択中ボタンは青背景・白文字 */
    html[class*="ym-theme-"] #ym-accessibility-bar .ym-segmented-control button.is-active {
        background: #0b49a0 !important;
        color: #ffffff !important;
        -webkit-text-fill-color: #ffffff !important;
    }

    /* ふりがなアイコン */
    html[class*="ym-theme-"] #ym-accessibility-bar .ym-round-icon {
        background: #0b49a0 !important;
        color: #ffffff !important;
        -webkit-text-fill-color: #ffffff !important;
    }

    /* 読み上げ案内は白背景・濃紺文字・青アイコン */
    html[class*="ym-theme-"] #ym-accessibility-bar .ym-read-guide-btn {
        background: #ffffff !important;
        color: #12335c !important;
    }

    html[class*="ym-theme-"] #ym-accessibility-bar .ym-read-guide-text,
    html[class*="ym-theme-"] #ym-accessibility-bar .ym-read-guide-main,
    html[class*="ym-theme-"] #ym-accessibility-bar .ym-read-guide-sub {
        color: #12335c !important;
        -webkit-text-fill-color: #12335c !important;
    }

    html[class*="ym-theme-"] #ym-accessibility-bar .ym-speaker-icon,
    html[class*="ym-theme-"] #ym-accessibility-bar .ym-speaker-icon i {
        color: #0b49a0 !important;
        -webkit-text-fill-color: #0b49a0 !important;
    }
}