/* 이 파일은 bookjeok-frontend-shared/css/base.css 에서 복사됩니다. 직접 고치지 마세요.
   원본을 고친 뒤 node bookjeok-frontend-shared/scripts/sync-partials.mjs 를 실행하면 반영됩니다. */

/* ============================================================
   base — reset · 타이포 · 접근성 기본
   접근성 규칙은 conventions/02-접근성-체크리스트.md 참조
   ============================================================ */

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

/* hidden 속성이 컴포넌트의 display 선언에 밀리지 않게 한다.
   이 프로젝트는 hidden 을 드롭다운·[data-auth]·더보기 버튼의 표시 수단으로 쓴다. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: var(--fw-medium);
  line-height: var(--lh-body);
  letter-spacing: var(--tracking);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

h1 { font-size: var(--fs-h1); letter-spacing: var(--tracking); font-weight: var(--fw-extrabold); line-height: var(--lh-h1); }
h2 { font-size: var(--fs-h2); letter-spacing: var(--tracking); font-weight: var(--fw-extrabold); line-height: var(--lh-h2); }
h3 { font-size: var(--fs-h3); letter-spacing: var(--tracking); font-weight: var(--fw-extrabold); line-height: var(--lh-h3); }
h4 { font-size: var(--fs-h4); letter-spacing: var(--tracking); font-weight: var(--fw-bold); line-height: var(--lh-h4); }

img, video, svg { max-width: 100%; height: auto; display: block; }

a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
}
a:hover { text-decoration-thickness: 2px; }

button, input, select, textarea {
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
}
button { cursor: pointer; }

table { border-collapse: collapse; width: 100%; }

/* ---- 포커스 표시 ----
   지시서 10 "키보드만으로 전체 기능 조작". outline: none 은 금지한다. */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ---- 반복 영역 건너뛰기 링크 (제안서 기재) ---- */
.skip-link {
  position: absolute;
  inset-inline-start: var(--sp-4);
  inset-block-start: -100px;
  z-index: calc(var(--z-header) + 1);
  padding: var(--sp-3) var(--sp-5);
  background: var(--primary-500);
  color: var(--gray-900); /* 주황 위 진한 글씨 5.68:1 */
  font-weight: var(--fw-bold);
  text-decoration: none;
  border-radius: var(--radius);
  transition: inset-block-start 0.15s ease;
}
.skip-link:focus { inset-block-start: var(--sp-4); }

/* ---- 스크린리더 전용 ---- */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---- 타이포 유틸 ----
   Figma 스타일가이드 Typography `70:3` 의 이름을 그대로 쓴다.
   제목 단계를 건너뛰지 않으려고 h1~h4 대신 이 클래스를 쓰는 경우가 있다
   (접근성 체크리스트: 페이지마다 h1 하나, 단계 건너뛰기 금지). */
.t-h1 { font-size: var(--fs-h1);
  letter-spacing: var(--tracking); font-weight: var(--fw-extrabold); line-height: var(--lh-h1); }
.t-h2 { font-size: var(--fs-h2); letter-spacing: var(--tracking); font-weight: var(--fw-extrabold); line-height: var(--lh-h2); }
.t-h3 { font-size: var(--fs-h3); letter-spacing: var(--tracking); font-weight: var(--fw-extrabold); line-height: var(--lh-h3); }
.t-h4 { font-size: var(--fs-h4); letter-spacing: var(--tracking); font-weight: var(--fw-bold); line-height: var(--lh-h4); }
.t-body { font-size: var(--fs-body); letter-spacing: var(--tracking); font-weight: var(--fw-medium); line-height: var(--lh-body); }
.t-body-em { font-size: var(--fs-body); letter-spacing: var(--tracking); font-weight: var(--fw-bold); line-height: var(--lh-body); }
.t-caption { font-size: var(--fs-caption); letter-spacing: var(--tracking); font-weight: var(--fw-medium); line-height: var(--lh-caption); }
.t-caption-em { font-size: var(--fs-caption); letter-spacing: var(--tracking); font-weight: var(--fw-bold); line-height: var(--lh-caption); }
/* Smalltext 만 자간이 0 이다 (시안 mobile/Smalltext). */
.t-small { font-size: var(--fs-small); font-weight: var(--fw-medium); line-height: var(--lh-small); letter-spacing: var(--tracking-small); }
.t-small-em { font-size: var(--fs-small); font-weight: var(--fw-semibold); line-height: var(--lh-small); letter-spacing: var(--tracking-small); }
.t-muted { color: var(--text-muted); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
