/* 사용자 페이지 — 공통 기본 스타일 (가이드 §0, §1, §7-1) */

/* Pretendard GOV Variable — 단일 woff2로 100~900 모든 weight 커버 */
@font-face {
    font-family: 'Pretendard GOV';
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
    src: url('/static/front/assets/fonts/pretendard-gov/PretendardGOVVariable.woff2') format('woff2-variations'),
         url('/static/front/assets/fonts/pretendard-gov/PretendardGOVVariable.woff2') format('woff2');
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: var(--font-family);
    font-size: 17px;   /* body-medium */
    font-weight: 400;
    line-height: 1.5;
    color: var(--neutral-basic);
    background: var(--neutral-bg);
    min-height: 100vh;
    min-height: 100dvh;   /* 모바일 주소창 변동 대응 — 셸(.dashboard-page: 100dvh)과 기준 통일 (하단 빈 칸 방지) */
    /* 한글 줄바꿈을 어절(띄어쓰기) 단위로 — 단어 중간에서 어색하게 끊기는 것 방지.
       공백 없는 긴 문자열(URL·코드 등)은 overflow-wrap으로 넘침 방지. */
    word-break: keep-all;
    overflow-wrap: break-word;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea,
select {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    border: 0;
    background: none;
    cursor: pointer;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

img,
svg {
    display: block;
    max-width: 100%;
}

/* ── Focus Outline (가이드 §7-1) ───────────────────────────
   모든 인터랙티브 요소에 dashed 표준 적용.
   outline: none / 0 사용 절대 금지. */
*:focus-visible {
    outline: var(--focus-outline);
    outline-offset: var(--focus-outline-offset);
}

/* ── 커스텀 스크롤바 (전역) ──────────────────────────────
   chat-area / app-content / modal / textarea 등 공통 적용. */
::-webkit-scrollbar {
    width: 5px;
    height: 8px;
}
::-webkit-scrollbar-thumb {
    background-color: rgb(220, 220, 220);
    border-radius: 100px;
}
::-webkit-scrollbar-track {
    background-color: transparent;
}

/* ── Typography Heading (§1.1) ──────────────────────────── */
.heading-xlarge {
    font-size: 28px; font-weight: 700; line-height: 1.5; letter-spacing: 1px;
}
.heading-large {
    font-size: 24px; font-weight: 700; line-height: 1.5; letter-spacing: 1px;
}
.heading-medium {
    font-size: 22px; font-weight: 700; line-height: 1.5;
}
.heading-small {
    font-size: 19px; font-weight: 700; line-height: 1.5;
}
.heading-xsmall {
    font-size: 17px; font-weight: 700; line-height: 1.5;
}
.heading-xxsmall {
    font-size: 15px; font-weight: 700; line-height: 1.5;
}

@media (min-width: 768px) {
    .heading-xlarge { font-size: 40px; }
    .heading-large  { font-size: 32px; }
    .heading-medium { font-size: 24px; }
}

/* ── Typography Body (§1.2) ─────────────────────────────── */
.body-large       { font-size: 19px; font-weight: 400; line-height: 1.5; }
.body-large-bold  { font-size: 19px; font-weight: 700; line-height: 1.5; }
.body-medium      { font-size: 17px; font-weight: 400; line-height: 1.5; }
.body-medium-bold { font-size: 17px; font-weight: 700; line-height: 1.5; }
.body-small       { font-size: 15px; font-weight: 400; line-height: 1.5; }
.body-small-bold  { font-size: 15px; font-weight: 700; line-height: 1.5; }
.body-xsmall      { font-size: 13px; font-weight: 400; line-height: 1.5; }
.body-xsmall-bold { font-size: 13px; font-weight: 700; line-height: 1.5; }

/* ── 색상 유틸 ──────────────────────────────────────────── */
.text-basic    { color: var(--neutral-basic); }
.text-subtle   { color: var(--neutral-subtle); }
.text-primary  { color: var(--primary-50); }
.text-critical { color: var(--status-critical); }
.text-success  { color: var(--status-success); }

/* ── 공통 유틸 ──────────────────────────────────────────── */
.is-hidden { display: none !important; }
.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ── 공통 헤더: 햄버거(전체메뉴) 버튼 + 전체메뉴 드로어 ──────
   index(.app-header) · result(.global-nav) 헤더 공통.
   1000px 이하에서 인라인 메뉴 대신 노출. */
.nav-burger {
    display: none;                 /* 데스크톱(>1000px): 숨김 */
    align-items: center;
    flex-shrink: 0;
    gap: 6px;
    padding: var(--spacing-2);
    border-radius: var(--radius-md);
    background: none;
    color: var(--neutral-basic);
    cursor: pointer;
}

@media (hover: hover) {
    .nav-burger:hover { background: var(--neutral-bg); }
}

.nav-burger-box {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.nav-burger-box svg { width: 20px; height: 20px; }

.nav-burger-text { font-size: 15px; font-weight: 500; }

/* 열림/닫힘 아이콘 토글 (열리면 햄버거 자리에 X) */
.nav-burger-close { display: none; }
.nav-burger[aria-expanded="true"] .nav-burger-open  { display: none; }
.nav-burger[aria-expanded="true"] .nav-burger-close { display: inline-flex; }

/* 전체메뉴 드로어 — 헤더 아래부터 화면 전체를 덮음 */
.nav-drawer {
    position: fixed;
    left: 0;
    right: 0;
    top: 80px;                     /* 헤더 높이만큼 내림 */
    bottom: 0;
    z-index: 40;                   /* 헤더(z-index:50)보다 아래 */
    background: var(--primary-0);
    overflow-y: auto;
    animation: navDrawerIn var(--motion-base);
}

.nav-drawer[hidden] { display: none; }

body.nav-drawer-open { overflow: hidden; }

@keyframes navDrawerIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.nav-drawer-menu {
    display: flex;
    flex-direction: column;
    max-width: 1152px;
    margin: 0 auto;
    padding: 0 var(--spacing-4);
}

.nav-drawer-link {
    display: flex;
    align-items: center;
    padding: var(--spacing-5) var(--spacing-2);
    font-size: 19px;
    font-weight: 700;
    color: var(--neutral-basic);
}

.nav-drawer-link.is-active { color: var(--primary-90); }

@media (hover: hover) {
    .nav-drawer-link:hover { color: var(--primary-90); }
}

/* 1000px 이하: 햄버거 노출 */
@media (max-width: 1000px) {
    .nav-burger { display: inline-flex; }
}

/* ── Reduce Motion ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition: none !important;
        animation: none !important;
    }
}
