/* drawer (좌측 패널)

   community-header.css 가 800줄을 넘겨 갈라 놓은 것이다. 규칙을 옮기지 않고 자르기만
   했으므로, 로더가 원래 순서대로 이어서 실으면 어느 선언이 이기는지가
   달라지지 않는다. */

/* --- Drawer (좌측 패널) -------------------------------------------------
   레퍼런스 index-uiux2.html 의 drawer 를 그대로 옮긴다. 헤드와 하단 동작은
   제자리에 두고 nav 만 스크롤하도록 3행 그리드로 세운다.
   테마의 --radius-field 는 4px 이라 레퍼런스의 8px 모서리와 다르다.
   같은 모양을 내야 하므로 여기서는 .5rem 을 그대로 적는다. */
.clarity-community-drawer-side { z-index: 120; }
.clarity-community-drawer-side .drawer-overlay { border: 0; padding: 0; }

.clarity-community-drawer-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    width: min(20.5rem, 86vw);
    height: 100dvh;
    border-right: 1px solid var(--clarity-border);
    /* 시안은 배경을 bg-base-100 에 맡기지만, 이 테마의 다크 base-100 은
       초록기가 돌아 헤드·하단의 남색과 어긋난다. 테마 표면색을 직접 준다.
       라이트에서는 #ffffff 로 시안과 같은 값이다. */
    background: var(--clarity-surface);
    box-shadow: 8px 0 28px -12px rgb(15 23 42 / .28);
    overscroll-behavior: contain;
}
html[data-theme="dark"] .clarity-community-drawer-panel { box-shadow: 8px 0 28px -12px rgb(0 0 0 / .7); }
/* 다크에서 로고가 남색 헤드에 묻는다. drawer 안에서만 반전한다. */
html[data-theme="dark"] .clarity-community-drawer-brand .clarity-community-logo { filter: brightness(0) invert(1); opacity: .92; }

.clarity-community-drawer-head {
    display: flex; align-items: center; justify-content: space-between; gap: .75rem;
    min-height: 4rem; padding: .9rem 1rem;
    border-bottom: 1px solid var(--clarity-border);
    background: var(--clarity-surface-soft);
}
.clarity-community-drawer-brand { display: inline-flex; min-width: 0; flex: 0 0 auto; align-items: center; color: var(--clarity-text); }

.clarity-community-drawer-close {
    flex: 0 0 auto;
    width: 2.75rem; height: 2.75rem; min-height: 2.75rem;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0; border: 0; border-radius: .5rem;
    background: transparent;
    /* daisyUI btn-sm 이 글리프를 12px/600 으로 줄인다. 시안은 16px/400 이다. */
    font-size: 1rem; font-weight: 400;
    color: color-mix(in oklab, var(--color-base-content) 60%, transparent);
    transition: background .18s ease, color .18s ease;
}
.clarity-community-drawer-close:hover,
.clarity-community-drawer-close:focus-visible {
    background: color-mix(in oklab, var(--color-base-content) 8%, transparent);
    color: var(--color-base-content);
}

.clarity-community-drawer-nav {
    min-height: 0;
    overflow-y: auto; overscroll-behavior: contain;
    padding: .85rem .75rem 1rem;
    scrollbar-color: var(--clarity-border-strong) transparent;
    scrollbar-width: thin;
}
/* daisyUI 의 .menu 를 쓰면 li 가 flex 가 되고 자식에 padding-inline 12px 과
   폭 보정이 붙어, 행이 부모보다 21px 넓어지고 하위 메뉴 들여쓰기가 먹지 않는다.
   시안도 .menu 를 쓰지 않는다. 전용 클래스로 갈아 끼운다. */
.clarity-community-drawer-menu { display: grid; gap: .1rem; width: 100%; margin: 0; padding: 0; list-style: none; }
.clarity-community-drawer-menu li { display: list-item; margin: 0; padding: 0; }

.clarity-community-drawer-menu .clarity-community-drawer-menu-row { display: flex; align-items: center; gap: .15rem; }

.clarity-community-drawer-menu .clarity-community-drawer-menu-link {
    flex: 1 1 auto; min-width: 0;
    display: flex; align-items: center; gap: .65rem;
    min-height: 2.75rem;
    padding: .5rem .55rem;
    border: 0; border-radius: .5rem;
    background: transparent;
    font-size: .875rem; font-weight: 600; letter-spacing: -.01em; line-height: 1.35;
    color: color-mix(in oklab, var(--color-base-content) 82%, transparent);
    transition: background .18s ease, color .18s ease;
}
.clarity-community-drawer-menu .clarity-community-drawer-menu-link:hover,
.clarity-community-drawer-menu .clarity-community-drawer-menu-link:focus-visible {
    background: color-mix(in oklab, var(--color-primary) 9%, transparent);
    color: var(--color-primary);
}
.clarity-community-drawer-menu .clarity-community-drawer-menu-link span,
.clarity-community-drawer-nav .clarity-community-drawer-submenu-link span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clarity-community-drawer-menu .clarity-community-drawer-menu-link i {
    flex: 0 0 auto; width: 1.1rem;
    text-align: center;
    color: color-mix(in oklab, var(--color-base-content) 45%, transparent);
    transition: color .18s ease;
}
.clarity-community-drawer-menu .clarity-community-drawer-menu-link:hover i,
.clarity-community-drawer-menu .clarity-community-drawer-menu-link:focus-visible i { color: var(--color-primary); }

.clarity-community-drawer-nav .clarity-community-drawer-submenu-toggle {
    flex: 0 0 auto;
    width: 2.75rem; height: 2.75rem; min-height: 2.75rem;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0; border: 0; border-radius: .5rem;
    background: transparent; cursor: pointer;
    font-size: .7rem; font-weight: 400;
    color: color-mix(in oklab, var(--color-base-content) 45%, transparent);
    transition: background .18s ease, color .18s ease;
}
.clarity-community-drawer-nav .clarity-community-drawer-submenu-toggle:hover,
.clarity-community-drawer-nav .clarity-community-drawer-submenu-toggle:focus-visible {
    background: color-mix(in oklab, var(--color-base-content) 8%, transparent);
    color: var(--color-base-content);
}
.clarity-community-drawer-nav .clarity-community-drawer-submenu-toggle i { transition: transform .25s ease; }
.clarity-community-drawer-nav .clarity-community-drawer-submenu-toggle[aria-expanded="true"] { color: var(--color-primary); }
.clarity-community-drawer-nav .clarity-community-drawer-submenu-toggle[aria-expanded="true"] i { transform: rotate(180deg); }

/* 하위 메뉴는 얇은 레일에 걸어 둔다. 깊게 들여쓰지 않아도 중첩이 읽힌다. */
.clarity-community-drawer-nav .clarity-community-drawer-submenu {
    display: grid; gap: .05rem;
    margin: .1rem 0 .35rem 1.3rem;
    padding: 0 0 0 .75rem;
    border-left: 1px solid var(--clarity-border);
}
.clarity-community-drawer-nav .clarity-community-drawer-submenu-link {
    display: flex; align-items: center;
    min-height: 2.5rem;
    padding: .4rem .55rem;
    border: 0; border-radius: .5rem;
    background: transparent;
    font-size: .82rem; font-weight: 500; line-height: 1.35;
    color: color-mix(in oklab, var(--color-base-content) 68%, transparent);
    transition: background .18s ease, color .18s ease;
}
.clarity-community-drawer-nav .clarity-community-drawer-submenu-link:hover,
.clarity-community-drawer-nav .clarity-community-drawer-submenu-link:focus-visible {
    background: color-mix(in oklab, var(--color-primary) 9%, transparent);
    color: var(--color-primary);
}
.clarity-community-drawer-nav .clarity-community-drawer-submenu[hidden] { display: none; }

/* 하단 동작. 주 CTA 를 두지 않아 두 개가 서로 대등하게 읽힌다.
   -edit 는 파란 강조, -logout 은 세션을 끝낸다는 신호로 따뜻한 hover 를 쓴다. */
.clarity-community-drawer-actions {
    display: grid; grid-template-columns: 1fr 1fr; gap: .5rem;
    padding: .85rem 1rem calc(.85rem + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--clarity-border);
    background: var(--clarity-surface-soft);
}
.clarity-drawer-action {
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
    min-height: 2.75rem;
    padding: .5rem .6rem;
    border: 1px solid var(--clarity-border);
    border-radius: .5rem;
    background: var(--color-base-100);
    font-size: .82rem; font-weight: 700; letter-spacing: -.01em;
    color: color-mix(in oklab, var(--color-base-content) 80%, transparent);
    transition: background .18s ease, border-color .18s ease, color .18s ease;
}
.clarity-drawer-action i { font-size: .85rem; }
.clarity-drawer-action-edit:hover,
.clarity-drawer-action-edit:focus-visible {
    border-color: color-mix(in oklab, var(--color-primary) 45%, transparent);
    background: color-mix(in oklab, var(--color-primary) 10%, var(--color-base-100));
    color: var(--color-primary);
}
.clarity-drawer-action-logout:hover,
.clarity-drawer-action-logout:focus-visible {
    border-color: color-mix(in oklab, var(--color-error) 45%, transparent);
    background: color-mix(in oklab, var(--color-error) 10%, var(--color-base-100));
    color: var(--color-error);
}


/* 시안은 hover 와 키보드 포커스를 같은 9% 틴트 하나로 처리하고 outline 을 지운다.
   ui-ux-pro-max 의 Focus States(severity High)는 "대체 없이 outline 을 없애지 말 것,
   모든 조작 요소에 보이는 포커스 링을 둘 것"이라고 한다. 틴트만으로는 키보드
   사용자가 현재 위치를 짚기 어려워, hover 모양은 시안 그대로 두고 포커스에만
   링을 되돌린다. */
.clarity-community-drawer-panel :is(a, button, label):focus-visible {
    outline: 2px solid var(--clarity-primary);
    outline-offset: 2px;
}
/* 스크롤되는 nav 안에서 포커스가 위아래 끝에 붙어 잘리지 않게 한다.
   (Focus Not Obscured (Minimum), WCAG 2.2 AA) */
.clarity-community-drawer-nav { scroll-padding-block: .75rem; }
.clarity-community-brand { display: inline-flex; order: 0; align-items: center; color: var(--clarity-text); letter-spacing: 0; flex-shrink: 0; }
.clarity-community-logo { display: block; height: 2rem; width: auto; }
.clarity-community-mega { display: flex; order: 0; min-width: 0; flex: 1 1 auto; align-self: stretch; align-items: center; }
.clarity-community-mega-list { display: flex; max-width: none; min-width: 0; flex-wrap: wrap; align-items: center; gap: .15rem; margin-left: 1rem; overflow: visible; }
.clarity-community-mega-item { position: relative; display: flex; }
.clarity-community-mega-trigger { display: inline-flex; align-items: center; gap: .35rem; border: 0; border-radius: .5rem; background: transparent; color: color-mix(in oklab, var(--color-base-content) 78%, transparent); cursor: pointer; padding: .6rem .8rem; font: inherit; font-size: .875rem; font-weight: 700; letter-spacing: -.015em; line-height: 1.6; white-space: nowrap; transition: background-color .2s ease, color .2s ease; }
.clarity-community-mega-item:hover > .clarity-community-mega-trigger, .clarity-community-mega-item:focus-within > .clarity-community-mega-trigger, .clarity-community-mega-trigger:hover, .clarity-community-mega-trigger:focus-visible, .clarity-community-mega-trigger-active { background: var(--clarity-primary-soft); color: var(--clarity-primary); }
body.clarity-page .clarity-community-mega-trigger i { font-size: .5rem !important; transition: transform .16s; }
.clarity-community-mega-item:hover > .clarity-community-mega-trigger i, .clarity-community-mega-item:focus-within > .clarity-community-mega-trigger i, .clarity-community-mega-trigger-active i { transform: rotate(180deg); }
.clarity-community-mega-panel { position: absolute; z-index: 80; top: 100%; left: 0; width: max-content; min-width: 12rem; max-width: min(34rem, calc(100vw - 2rem)); visibility: hidden; border: 1px solid var(--clarity-border); border-radius: .625rem; background: var(--clarity-surface); box-shadow: 0 18px 36px color-mix(in srgb, var(--clarity-text) 10%, transparent); opacity: 0; pointer-events: none; transform: translateY(-.35rem); transition: opacity .16s, transform .16s, visibility .16s; }
.clarity-community-mega-item:hover > .clarity-community-mega-panel, .clarity-community-mega-item:focus-within > .clarity-community-mega-panel, .clarity-community-mega-panel-open { visibility: visible; opacity: 1; pointer-events: auto; transform: translateY(0); }
.clarity-community-mega-panel-inner { display: grid; justify-content: start; padding: .875rem; }
.clarity-community-mega-section { min-width: 12rem; }
.clarity-community-mega-links { display: grid; gap: .25rem; }
.clarity-community-mega-link { display: flex; min-height: 2.25rem; align-items: center; border-radius: .5rem; color: var(--clarity-muted); padding-inline: .75rem; font-size: .875rem; font-weight: 500; line-height: 1.6; }
.clarity-community-mega-link:hover, .clarity-community-mega-link:focus-visible { background: var(--clarity-surface-soft); color: var(--clarity-primary); }
.clarity-community-mega-empty { color: var(--clarity-muted); cursor: default; }
.clarity-community-search-control { position: relative; order: 0; flex: none; margin-left: auto; }
.clarity-community-search-toggle { width: 2.75rem; height: 2.75rem; min-height: auto; padding: 0; border-color: transparent; border-radius: .7rem; background: transparent; color: var(--clarity-text); transition: background-color .16s, box-shadow .16s, color .16s; }
.clarity-community-search-toggle:hover, .clarity-community-search-toggle:focus-visible, .clarity-community-search-control-open .clarity-community-search-toggle { background: var(--clarity-primary-soft); color: var(--clarity-primary); }
.clarity-community-search-control-open .clarity-community-search-toggle { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--clarity-primary) 28%, transparent); }
.clarity-community-search-dock { position: absolute; z-index: 70; top: 100%; right: 0; left: 0; display: none; border-bottom: 1px solid var(--clarity-border); background: var(--clarity-surface); box-shadow: 0 4px 12px color-mix(in srgb, var(--clarity-text) 7%, transparent); animation: clarity-search-slide-down .16s ease-out both; }
.clarity-community-search-dock-open { display: block; }
.clarity-community-header-sticky.clarity-community-search-active .clarity-community-header { border-bottom: 0; box-shadow: none; }
.clarity-community-search-dock > .clarity-shell { padding-block: 1.75rem 2rem; }
@keyframes clarity-search-slide-down { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
