/*
 * studio-core 베이스 리셋 — 모든 스튜디오 테마의 공통 출발점.
 * (1) 기본 리셋  (2) 폼 컨트롤 평준화(브라우저 무관).
 * 문의 폼(beamers-forms)은 ACF/ACFE 필드 CSS 를 프론트에서 dequeue 하고, 이 베이스 + forms.css 스킨으로 렌더된다.
 * 각 스튜디오 테마(theme.json 토큰 + style.css)는 이 위에 브랜드 변화를 얹는다. 테마보다 먼저 enqueue 한다.
 *
 * Beamers 최적화 메모:
 *  - 변수는 Beamers 토큰계로 매핑: --font-ko/--input-* 를 여기서 정의(원본의 미정의 변수 해소).
 *  - 원본의 font-size:62.5%(10px-rem)는 미적용 — 공유 studio-core CSS(forms.css)·포트폴리오 토큰이
 *    16px-rem 기준이라 전역 축소가 발생. root 는 16px-rem 유지(rem 호환).
 *  - <select> 화살표는 외부 에셋(images/arrow.svg) 대신 인라인 data-URI SVG(누락 에셋 0).
 */

:root {
  /* 폼 컨트롤 평준화용 토큰 — 각 테마가 theme.json/style.css 로 재정의 가능. */
  --font-ko:       var(--wp--custom--bsp--font-body, system-ui, -apple-system, 'Pretendard Variable', Pretendard, sans-serif);
  --input-height:  2.75rem;
  --input-padding: 0.95rem;
  --input-rule:    var(--wp--custom--bsp--rule-strong, rgba(20, 20, 20, .22));
  font-family: var(--font-ko);
}

/* ── 기본 리셋 ─────────────────────────────────────────────────────────────── */
body, ul, ol { margin: unset; padding: unset; }
li { list-style-type: none; }
h1 { font-size: unset; font-weight: unset; margin: unset; }
img { max-width: 100%; vertical-align: top; }

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

fieldset, legend {
  /* 모든 속성 unset 후 block — 사용자 에이전트 기본 외형 제거(접근성 기능 자체는 유지). */
  all: unset;
  display: block;
}

/* all:unset 으로 담백한 버튼 — 시각 특성은 사라지나 submit/focus 등 HTML 고유 기능은 유지. */
button {
  all: unset;
  display: block;
}

/* input·select·textarea = 공공 UI → 초기화 후 디자인 평준화. */
input, select, textarea { all: unset; }

/* ── 디자인 평준화(브라우저 무관) ──────────────────────────────────────────── */
select,
input[type="text"],
input[type="password"],
input[type="email"] {
  display: block;
  width: 100%;                 /* width:auto 는 컨테이너를 채우지 않으므로 강제 100% */
  height: var(--input-height);
  line-height: var(--input-height);
  padding: 0 var(--input-padding);
  box-sizing: border-box;      /* width:100% + padding 넘침 방지 */
  font-family: var(--font-ko);
}

/* 네이티브 radio/checkbox — 공간/마우스 액션 제거(커스텀 컨트롤·칩이 시각 담당). */
input[type="radio"],
input[type="checkbox"] {
  pointer-events: none;
  position: absolute;
}

/* select — 인라인 SVG 화살표 + 긴 텍스트 말줄임 */
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23141414' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center right 15px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  padding-right: 45px;
  cursor: pointer;
}

/* textarea 평준화 */
textarea {
  display: block;
  width: 100%;
  padding: var(--input-padding);
  box-sizing: border-box;
  font-family: var(--font-ko);
}

/* 접근성 — 키보드 포커스 가시성(테마가 강조색 지정 가능). */
:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
