/*
 * studio-core 베이스 리셋 — 모든 스튜디오 프론트의 공통 출발점 (beamers-core, 전역 enqueue).
 * (1) 기본 리셋  (2) 폼 컨트롤 평준화(브라우저 무관).
 *
 * 위치 이력: 본래 각 스튜디오 테마 reset.css 로 배포되던 것을 2026-06-12 플랫폼(beamers-core)으로
 * 승격 — 테마는 토큰(theme.json)과 브랜드 CSS 만 가진다. 문의 폼(beamers-forms)은 ACF/ACFE 필드
 * CSS 를 프론트에서 dequeue 하고 이 베이스 + forms.css 스킨으로 렌더된다.
 *
 * ── 특이도 계약 (forms.css 와 동일 정책) ─────────────────────────────────────
 * 전 룰을 :where(...) = (0,0,0) 으로 적재 — 테마의 어떤 셀렉터(element 1개 포함)도 무조건 이긴다.
 * 파일 내부 캐스케이드는 순서(나중=승리). 끄기: add_filter('beamers_core_reset_css','__return_false');
 *
 * 메모:
 *  - root 는 16px-rem 유지(forms.css·포트폴리오 토큰이 16px-rem 기준 — 62.5% 축소 금지).
 *  - --font-ko/--input-* 토큰은 theme.json(--wp--custom--bsp--*) 경유로 스튜디오가 재정의.
 *  - <select> 화살표는 인라인 data-URI SVG(외부 에셋 의존 0).
 */

:where(: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);
}

/* ── 기본 리셋 ─────────────────────────────────────────────────────────────── */
:where(body, ul, ol, dl, dt, dd, p, figure, blockquote) { margin: unset; padding: unset; }
:where(li) { list-style-type: none; }
:where(h1,h2,h3,h4,h5,h6) { font-size: unset; font-weight: unset; margin: unset; }
:where(img) { max-width: 100%; vertical-align: top; }

*, *::before, *::after { box-sizing: border-box; }   /* 전칭 셀렉터 = 본래 (0,0,0) */

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

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

/* ── 디자인 평준화(브라우저 무관) ──────────────────────────────────────────── */
:where(
	select,
	input[type="text"],
	input[type="password"],
	input[type="email"],
	textarea
) {
  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 — 공간/마우스 액션 제거(커스텀 컨트롤·칩이 시각 담당). */
:where(
	input[type="radio"],
	input[type="checkbox"]
) {
  pointer-events: none;
  position: absolute;
}

/* select — 인라인 SVG 화살표 + 긴 텍스트 말줄임 */
:where(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 평준화 */
:where(textarea) {
	height: auto;
}

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

:where(a,del) {
	color: unset;
	text-decoration: unset;
}

:where(strong,b,i,em) {
	font-weight: unset;
	font-style: unset;
}
