/* il-search: 사이트 공통 검색창(입력칸 안 오른쪽에 돋보기)
   - 문서: docs/components/il-search.md, 예시: /ComponentGuide
   - 단순 검색은 ViewComponent(<vc:search-field-v5>)로 그린다. 정렬·검색 범위 선택이 함께 있는 검색은 같은 클래스를 호출부에서 직접 쓴다.
   - 입력칸과 돋보기는 .ilsearch-field로 묶는다. 돋보기가 제출 버튼이라 검색어 입력 후 돋보기나 Enter로 검색한다. 버튼 이름은 aria-label("검색").
   - 포커스는 입력칸 테두리만 브랜드색으로 바뀐다(바깥 빛 번짐 없음).
   - 변형: ilsearch--panel(흰 바탕 테두리 상자에 담음), ilsearch--compact(헤더·모바일 메뉴용 낮은 높이)
   - 값은 디자인 시스템 토큰(--il-*)과 그에 연결된 --ds-*만 쓴다. */

.label-v5 .ilsearch {
  display: flex;
  width: 100%;
  align-items: stretch;
  gap: var(--il-2);
}

/* 흰 바탕 테두리 상자: 목록 위에 따로 놓이는 검색(디자인 검색 등) */
.label-v5 .ilsearch--panel {
  padding: var(--il-4);
  border: 1px solid var(--ds-color-border-default);
  border-radius: var(--il-r-lg);
  background: var(--il-white);
}

/* 입력칸 + 안쪽 돋보기 묶음 */
.label-v5 .ilsearch-field {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
}

.label-v5 .ilsearch-input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: var(--il-12);
  padding-right: calc(var(--il-12) + var(--il-1));
  background: var(--il-white);
}

/* 포커스: 테두리 색만 브랜드색 */
.label-v5 .ilsearch .ilsearch-input:focus,
.label-v5 .ilsearch .ilsearch-select:focus {
  border-color: var(--ds-color-brand-primary);
  outline: 0;
  box-shadow: none;
}

/* 검색 범위·정렬 선택(있을 때만) */
.label-v5 .ilsearch-select {
  flex: 0 0 auto;
  width: auto;
  min-height: var(--il-12);
}

/* 돋보기(제출 버튼): 입력칸 안 오른쪽 */
.label-v5 .ilsearch-button {
  --bs-btn-color: var(--ds-color-text-muted);
  --bs-btn-bg: transparent;
  --bs-btn-border-color: transparent;
  --bs-btn-hover-color: var(--ds-color-brand-primary);
  --bs-btn-hover-bg: transparent;
  --bs-btn-hover-border-color: transparent;
  --bs-btn-active-color: var(--ds-color-brand-primary);
  --bs-btn-active-bg: transparent;
  --bs-btn-active-border-color: transparent;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  display: inline-flex;
  width: var(--il-12);
  height: auto;
  min-height: 0;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  color: var(--ds-color-text-muted);
  background: transparent;
  box-shadow: none;
  font-size: var(--ds-font-size-title);
}

.label-v5 .ilsearch-button:hover,
.label-v5 .ilsearch-button:active {
  color: var(--ds-color-brand-primary);
  background: transparent;
}

/* 검색창 옆 보조 버튼(조건 열기, 초기화 등)도 같은 높이 */
.label-v5 .ilsearch > .btn {
  flex: 0 0 auto;
  min-height: var(--il-12);
}

/* 헤더·모바일 메뉴용: 낮은 높이(--il-10) */
.label-v5 .ilsearch--compact .ilsearch-input,
.label-v5 .ilsearch--compact .ilsearch-select,
.label-v5 .ilsearch--compact > .btn {
  min-height: var(--il-10);
}

.label-v5 .ilsearch--compact .ilsearch-input { padding-right: calc(var(--il-10) + var(--il-1)); }
.label-v5 .ilsearch--compact .ilsearch-button { width: var(--il-10); font-size: var(--ds-font-size-body); }

@media (max-width: 575.98px) {
  .label-v5 .ilsearch { flex-wrap: wrap; }
  .label-v5 .ilsearch-field { flex-basis: 0; }
  .label-v5 .ilsearch-select { order: 3; flex: 1 1 100%; }
}
