/* 2026-11-24 전체 메뉴(사이드바) 아래 「화면 모드」 라이트·다크 바로 전환.
   다크 준비가 된 화면(header.php $dohwaDarkReady)에서만 footer.php가 그린다. 저장 키는 환경설정과 같은 dohwasewon:theme:v1. */
.drawer-theme {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 0 6px;
    padding: 12px 12px 12px 14px;
    border: 1px solid #ebe2f2;
    border-radius: 16px;
    background: #fff;
}
.drawer-theme-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}
.drawer-theme-title {
    color: #2a2233;
    font-size: 13px;
    line-height: 1.45;
    font-weight: 700;
    letter-spacing: -0.25px;
}
.drawer-theme-sub {
    color: #9a8aa5;
    font-size: 11px;
    line-height: 1.45;
    font-weight: 500;
    letter-spacing: -0.15px;
}
.drawer-theme-switch {
    position: relative;
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 172px;
    padding: 3px;
    border: 1px solid #ebe2f2;
    border-radius: 999px;
    background: #f5f0fa;
    isolation: isolate;
}
.drawer-theme-thumb {
    position: absolute;
    z-index: -1;
    inset: 3px auto 3px 3px;
    width: calc(50% - 3px);
    border-radius: 999px;
    background: #7a5c9c;
    box-shadow: 0 4px 12px #5b3f7a33;
    transition: transform 0.28s cubic-bezier(0.2, 0.7, 0.2, 1), background-color 0.28s ease;
}
.drawer-theme-switch[data-current='dark'] .drawer-theme-thumb {
    transform: translateX(100%);
}
.drawer-theme-switch:not([data-current]) .drawer-theme-thumb {
    opacity: 0;
}
.drawer-theme-switch button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 38px;
    padding: 0 8px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #8a7d96;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: -0.2px;
    cursor: pointer;
    transition: color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}
.drawer-theme-switch button svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}
.drawer-theme-switch button[aria-checked='true'] {
    color: #fff;
}
.drawer-theme-switch button:not([aria-checked='true']):hover {
    color: #5e4677;
}
.drawer-theme-switch button:focus-visible {
    outline: 2px solid #9b7bbd;
    outline-offset: 1px;
}

/* 다크 */
html[data-theme='dark'] .drawer-theme {
    border-color: #2c3045;
    background: #181b29;
}
html[data-theme='dark'] .drawer-theme-title {
    color: #e9e9f2;
}
html[data-theme='dark'] .drawer-theme-sub {
    color: #8f8aa3;
}
html[data-theme='dark'] .drawer-theme-switch {
    border-color: #2c3045;
    background: #11131f;
}
html[data-theme='dark'] .drawer-theme-thumb {
    background: #cdb4ea;
    box-shadow: 0 4px 14px #00000059;
}
html[data-theme='dark'] .drawer-theme-switch button {
    color: #a3a6b8;
    background: transparent !important;
}
html[data-theme='dark'] .drawer-theme-switch button[aria-checked='true'] {
    color: #1b1529;
}
html[data-theme='dark'] .drawer-theme-switch button:not([aria-checked='true']):hover {
    color: #dcc8f0;
}

/* 바꿀 때 화면 색이 툭 끊기지 않게 잠깐만 부드럽게(움직임 줄이기면 생략) */
html.drawer-theme-fading,
html.drawer-theme-fading body,
html.drawer-theme-fading .side-drawer,
html.drawer-theme-fading .side-drawer *:not(.drawer-theme-thumb) {
    transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease !important;
}
@media (prefers-reduced-motion: reduce) {
    .drawer-theme-thumb {
        transition: none;
    }
}
html.reduce-motion .drawer-theme-thumb {
    transition: none;
}
@media (max-width: 340px) {
    .drawer-theme-sub {
        display: none;
    }
    .drawer-theme-switch {
        width: 150px;
    }
}
