/*
 * 접근성 (KWCAG 2.2 / OpenWAX) 공통 유틸리티
 *
 * 적용 범위:
 *  - 7.1.1 반복 영역 건너뛰기 — .ua-skip-nav
 *  - 5.1.1 키보드 사용 보장 — :focus-visible 시각화
 *  - 5.4.1 명도 대비 — 포커스 outline 색상 강화
 *  - 7.2.1 제목 제공 — visually-hidden 유틸 (스크린리더 전용 텍스트)
 *  - 6.4.1 마우스/키보드 동등 — 인터랙티브 요소 cursor·outline 강제
 */

/* (7.1.1) 반복 영역 건너뛰기 — 평소 화면 밖, 키보드 포커스 시 좌상단 노출 */
.ua-skip-nav {
  position: absolute;
  top: -100px;
  left: 0;
  z-index: 99999;
  padding: 12px 20px;
  background: #1f5fff;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  border-radius: 0 0 6px 0;
  transition: top 0.2s ease;
}
.ua-skip-nav:focus,
.ua-skip-nav:focus-visible {
  top: 0;
  outline: 3px solid #ffd400;
  outline-offset: 2px;
}

/* (5.1.1) 키보드 포커스 가시화 — 마우스 클릭은 outline 숨김, 키보드만 표시 */
:focus {
  outline: none;
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible,
[role="button"]:focus-visible,
[role="link"]:focus-visible {
  outline: 3px solid #1f5fff;
  outline-offset: 2px;
  border-radius: 4px;
}

/* (7.2.1) 스크린리더 전용 텍스트 — 시각적으로는 보이지 않지만 SR에 읽힘 */
.visually-hidden,
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* 인터랙티브 요소 커서 — 마우스 사용자 명시적 피드백 */
button,
[role="button"],
a[href],
[tabindex="0"] {
  cursor: pointer;
}

/* 비활성 상태 명시 */
button[disabled],
[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.6;
}

/* (5.3.1) 표 caption — 스크린리더 안내용 */
.ua-table-caption {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* (반응형 보강) 작은 화면에서 가독성 유지 */
@media (max-width: 768px) {
  html {
    -webkit-text-size-adjust: 100%;
  }
  .ua-main {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* (7.3.1) 사용자 prefers-reduced-motion 존중 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* (5.4.1) 명도 대비 보강 — 텍스트 회색 너무 옅을 때 보강 */
.ua-text-muted-accessible {
  color: #595959;
}

/* (6.5.1) 레이블 — input과 시각적으로 분리되어도 연결되어야 함 */
input:required,
textarea:required,
select:required {
  /* 표시는 라벨 텍스트로 (* 표시), 별도 ARIA 미사용 */
}
