/* =============================================================
 * base.css — 베이스 리셋 + html/body 기본 타이포.
 * 토큰 변수는 tokens.css 이후 로드되므로 var(--ws-*) 사용 가능.
 * 섹션/컴포넌트 스타일은 절대 여기 두지 말 것 (이름 공간 충돌 방지).
 * ============================================================= */

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

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    /* 페이지마다 vertical scrollbar 발생 여부에 따른 viewport 폭 변화 방지
       (콘텐츠가 짧은 페이지에서 화면이 좌측으로 시프트되는 문제 해결).
       1) 모던 브라우저: scrollbar 공간 항상 예약
       2) 폴백: 항상 vertical scrollbar 표시 */
    scrollbar-gutter: stable;
    overflow-y: scroll;
}

body {
    margin: 0;
    background: var(--ws-color-bg);
    color: var(--ws-color-text);
    font-family: var(--ws-font-body);
    font-size: var(--ws-fs-body-1);
    line-height: var(--ws-lh-loose);
    letter-spacing: var(--ws-ls-normal);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Sticky footer — 글 적은 페이지(블로그·공지 빈 상태)에서 푸터가 화면 하단에 붙어있게 */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* main(콘텐츠) 이 남는 공간 차지 → footer 가 자연스럽게 viewport 하단으로 */
.ws-main {
    flex: 1 0 auto;
}

.ws-footer {
    flex-shrink: 0;
}

img, picture, svg, video {
    display: block;
    max-width: 100%;
    height: auto;
}

svg {
    fill: currentColor;
}

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

a:hover,
a:focus-visible {
    text-decoration: underline;
}

button {
    font: inherit;
    color: inherit;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
}

input, textarea, select {
    font: inherit;
}

ul, ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

p, figure, blockquote {
    margin: 0;
}

/* -----------------------------------------------------------------
 * Heading defaults.
 * 페이지·카드별로 .ws-fs-* 같은 변수 클래스로 덮어쓸 수 있도록 최소만.
 * ----------------------------------------------------------------- */

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-family: var(--ws-font-display);
    font-weight: var(--ws-fw-bold);
    line-height: var(--ws-lh-snug);
    letter-spacing: var(--ws-ls-tight);
    color: var(--ws-color-text);
}

h1 { font-size: var(--ws-fs-h1); }
h2 { font-size: var(--ws-fs-h2); }
h3 {
    font-size: var(--ws-fs-h3);
    line-height: var(--ws-lh-base);
}
h4 {
    font-size: var(--ws-fs-h4);
    font-weight: var(--ws-fw-medium);
}

/* 포커스 접근성 — 기본 outline 유지 (시안 단계에서 별도 디자인 들어오면 갱신) */
:focus-visible {
    outline: 2px solid var(--ws-color-primary);
    outline-offset: 2px;
}
