/* S06 검색 — 페이지 전용. 데스크톱은 사이트 공통 콘텐츠 폭(1320px) + 결과 가로형 카드 2열(사용자 지시 2026-10-06, 맨 아래 PC 블록)
   (예전: 가운데 720px 컬럼 — 홈·랭킹·예고편 분석과 폭·왼쪽 선이 어긋나 제거) */
/* 페이지 제목: 폰은 검색창이 머리 역할이라 화면에서만 숨김(스크린 리더용 h1 유지), PC 는 다른 페이지처럼 보인다 */
.sr-head { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ── 검색 입력 (상단 고정) ── */
.sr-sticky {
  position: sticky; top: calc(var(--topbar-h) + 3px); z-index: 6;
  margin-inline: calc(var(--gutter) * -1); padding: var(--sp-2) var(--gutter);
  background: color-mix(in srgb, var(--c-bg) 94%, transparent);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
}
.sr-form { display: flex; align-items: center; gap: var(--sp-1); }
.sr-back { flex: none; margin-left: -8px; }
.sr-box {
  flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: var(--sp-2);
  height: 48px; padding: 0 4px 0 var(--sp-4); border-radius: var(--r-pill);
  background: var(--c-surface-2); border: 1px solid var(--c-line-strong); color: var(--c-text-muted);
  transition: border-color var(--dur-1), box-shadow var(--dur-1);
}
.sr-box:focus-within { border-color: var(--c-focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-focus) 28%, transparent); }
.sr-input {
  flex: 1 1 auto; min-width: 0; height: 100%; border: 0; background: transparent; color: var(--c-text);
  font-size: var(--fs-body); outline: none; -webkit-appearance: none; appearance: none;
}
.sr-input::placeholder { color: var(--c-text-faint); }
.sr-input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.sr-input:focus-visible { outline: none; }
.sr-clear { flex: none; width: 40px; height: 40px; position: relative; display: grid; place-items: center; border-radius: 50%; color: var(--c-text-muted); }
.sr-clear::after { content: ""; position: absolute; inset: -2px; border-radius: 50%; } /* 터치 44px(사용자 지시 2026-10-07 출시 전 감사 A-5) */
.sr-clear:hover { background: var(--c-surface-3); color: var(--c-text); }
.sr-submit { flex: none; min-height: 44px; }
.sr-hint { margin-top: var(--sp-1); font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--c-text-muted); }

/* ── 자동완성 드롭다운 ── */
.sr-suggest {
  position: absolute; left: var(--gutter); right: var(--gutter); top: calc(100% - 4px);
  max-height: min(60vh, 520px); overflow: auto; padding: 6px;
  border-radius: var(--r-lg); background: var(--c-surface); border: 1px solid var(--c-line-strong); box-shadow: var(--shadow-2);
}
.sr-opt {
  display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: var(--sp-3);
  min-height: 52px; padding: 6px 8px; border-radius: var(--r-sm); color: var(--c-text);
}
.sr-opt:hover, .sr-opt[aria-selected="true"] { background: var(--c-surface-2); }
.sr-opt[aria-selected="true"] { box-shadow: inset 3px 0 0 var(--c-primary); }
.sr-opt__thumb { width: 64px; height: 36px; border-radius: 4px; overflow: hidden; background: #000; }
.sr-opt__thumb img { width: 100%; height: 100%; object-fit: cover; }
.sr-opt__avatar { width: 36px; height: 36px; margin-inline: 14px; border-radius: 50%; display: grid; place-items: center; background: var(--c-violet-soft); color: var(--c-violet); }
.sr-opt__text { display: grid; min-width: 0; }
.sr-opt__text b { font-size: var(--fs-sm); font-weight: var(--fw-bold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-opt__text small { color: var(--c-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-suggest__none { padding: var(--sp-3); font-size: var(--fs-caption); color: var(--c-text-muted); }
mark { background: var(--c-primary-soft); color: var(--c-primary-text); border-radius: 3px; padding: 0 1px; font-weight: inherit; }

/* ── 대기 화면 ── */
.sr-section { margin-top: var(--sp-6); }
.sr-section__head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); margin-bottom: var(--sp-2); }
.sr-section__title { font-size: var(--fs-body); line-height: var(--lh-body); font-weight: var(--fw-bold); }
.sr-textbtn { min-height: 36px; padding: 0 var(--sp-2); font-size: var(--fs-caption); color: var(--c-text-muted); text-decoration: underline; text-underline-offset: 3px; display: inline-flex; align-items: center; }
.sr-textbtn:hover { color: var(--c-text); }
.sr-recent { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.sr-recent__item { display: inline-flex; align-items: center; border-radius: var(--r-pill); border: 1px solid var(--c-line-strong); background: var(--c-surface); }
.sr-recent__q { min-height: 40px; padding: 0 4px 0 14px; font-size: var(--fs-sm); font-weight: var(--fw-semibold); max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-recent__x { width: 36px; height: 40px; display: grid; place-items: center; color: var(--c-text-muted); border-radius: 0 var(--r-pill) var(--r-pill) 0; }
.sr-recent__x:hover { color: var(--c-text); background: var(--c-surface-2); }
.sr-empty-line { font-size: var(--fs-sm); color: var(--c-text-muted); }
.sr-top { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; border-radius: var(--r-lg); background: var(--c-surface); border: 1px solid var(--c-line); padding: 6px; }
.sr-top__item { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: var(--sp-2); min-height: var(--touch); padding: 0 var(--sp-2); border-radius: var(--r-sm); }
.sr-top__item:hover { background: var(--c-surface-2); }
.sr-top__rank { font-weight: var(--fw-black); font-size: var(--fs-h3); color: var(--c-text); text-align: center; }
.sr-top li:first-child .sr-top__rank { color: var(--c-gold-text); }
.sr-top__title { font-weight: var(--fw-semibold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-top__dday { font-size: var(--fs-caption); color: var(--c-text-muted); font-variant-numeric: tabular-nums; }

/* ── 결과 ── */
.sr-results { margin-top: var(--sp-4); }
.sr-results__head { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; margin-bottom: var(--sp-2); }
.sr-results__title { font-size: var(--fs-h3); line-height: var(--lh-h3); flex: 1 1 auto; min-width: 0; }
.sr-list { display: grid; gap: var(--sp-3); margin-top: var(--sp-4); }
.sr-card {
  display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: var(--sp-3); align-items: start;
  padding: var(--sp-3); border-radius: var(--r-lg); background: var(--c-surface); border: 1px solid var(--c-line);
}
.sr-card__thumb { display: block; aspect-ratio: 16 / 9; border-radius: var(--r-sm); overflow: hidden; background: #000; }
.sr-card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.sr-card__body { min-width: 0; display: grid; gap: 2px; }
.sr-card__top { display: flex; align-items: center; gap: var(--sp-2); min-height: 22px; font-size: var(--fs-caption); }
.sr-rank { display: inline-flex; align-items: baseline; gap: 2px; padding: 2px 8px; border-radius: var(--r-pill); background: var(--c-surface-2); color: var(--c-text-muted); line-height: 1.2; }
.sr-rank b { font-size: var(--fs-sm); font-weight: var(--fw-black); color: var(--c-text); }
.sr-rank.is-top { background: var(--c-gold-soft); }
.sr-rank.is-top b { color: var(--c-gold-text); }
.sr-card__title { font-size: var(--fs-body); line-height: 22px; font-weight: var(--fw-bold); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sr-card__title a:hover { text-decoration: underline; text-underline-offset: 3px; }
.sr-card__en { font-size: var(--fs-caption); color: var(--c-text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-card__meta { font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--c-text-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sr-card__actions { display: flex; align-items: center; gap: var(--sp-1); margin-top: var(--sp-1); }
.sr-heart[aria-pressed="true"] svg path { fill: currentColor; }

.sr-person { padding: var(--sp-3); border-radius: var(--r-lg); background: var(--c-surface); border: 1px solid var(--c-line); }
.sr-person__head { display: flex; align-items: center; gap: var(--sp-2); }
.sr-person__head .sr-opt__avatar { margin: 0; width: 40px; height: 40px; }
.sr-person__name { font-size: var(--fs-body); line-height: 22px; }
.sr-person__role { font-size: var(--fs-caption); color: var(--c-text-muted); }
.sr-person__list { list-style: none; padding: 0; margin: var(--sp-2) 0 0; display: grid; gap: 2px; }
.sr-person__movie { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: center; gap: var(--sp-3); min-height: var(--touch); padding: 4px; border-radius: var(--r-sm); }
.sr-person__movie:hover { background: var(--c-surface-2); }
.sr-person__thumb { width: 96px; height: 54px; border-radius: var(--r-xs); overflow: hidden; background: #000; }
.sr-person__thumb img { width: 100%; height: 100%; object-fit: cover; }
.sr-person__mt { display: grid; min-width: 0; }
.sr-person__mt b { font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-person__mt small { color: var(--c-text-muted); }

.sr-foot { margin-top: var(--sp-6); font-size: var(--fs-sm); color: var(--c-text-muted); text-align: center; }
.sr-inline-btn { font-size: inherit; font-weight: var(--fw-bold); min-height: 32px; position: relative; }
.sr-inline-btn::after { content: ""; position: absolute; inset: -6px 0; } /* 터치 44px(사용자 지시 2026-10-07 출시 전 감사 A-5) */
.sr-noresult .btn { margin-top: var(--sp-2); }

@media (max-width: 380px) {
  .sr-card { grid-template-columns: 104px minmax(0, 1fr); }
  .sr-submit { display: none; }
}
@media (min-width: 900px) {
  .sr-sticky { margin-inline: 0; padding-inline: 0; border-radius: 0; }
  .sr-suggest { left: 44px; right: 0; }
  .sr-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sr-card { grid-template-columns: minmax(0, 1fr); }
  .sr-list--people { grid-template-columns: minmax(0, 1fr); }
}

/* ── PC 규격 통일(사용자 지시 2026-10-06: 캘린더·검색·마이를 홈·랭킹·예고편 분석과 같은 규격으로) ──
   폭 = .container(1320px) · 제목 = .page-title · 검색창 = 랭킹 PC 필터 바와 같은 표면 패널 · 대기 화면 2단 ·
   결과 = 가로형 카드 2열(썸네일 | 글), 글자는 랭킹 카드 체계(components.css 끝 「PC 페이지 셸 통일」 블록) */
@media (min-width: 900px) {
  .sr-head { position: static !important; width: auto; height: auto; margin: 0 0 var(--sp-3); overflow: visible; clip: auto; white-space: normal; }
  .sr-head .page-title { margin-bottom: 0; }
  .sr-sticky { top: calc(var(--topbar-h) + var(--sp-2)); margin-inline: 0; padding: var(--sp-3) var(--sp-4); border-radius: var(--r-lg); background: var(--c-surface); border: 1px solid var(--c-line); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .sr-back { display: none; } /* PC 는 상단 내비가 있어 뒤로 버튼이 필요 없다 */
  .sr-form { gap: var(--sp-2); }
  .sr-box { height: 52px; }
  .sr-submit { min-height: 48px; padding-inline: var(--sp-6); }
  .sr-suggest { left: var(--sp-4); right: var(--sp-4); top: calc(100% + 4px); }
  .sr-hint { margin-top: var(--sp-2); }
  /* 대기 화면: 최근 검색 | TOP 5 두 단, 섹션 제목은 .section-title 크기 */
  #sr-idle:not(:empty) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-6); align-items: start; margin-top: var(--sp-8); }
  #sr-idle > .sr-section { margin-top: 0; }
  .sr-section__head { margin-bottom: var(--sp-3); }
  .sr-section__title { font-size: var(--fs-h2); line-height: var(--lh-h2); letter-spacing: var(--ls-tight); }
  .sr-recent__q { min-height: 44px; font-size: var(--fs-body); }
  .sr-recent__x { height: 44px; }
  .sr-top { padding: var(--sp-2); }
  .sr-top__item { grid-template-columns: 40px minmax(0, 1fr) auto; min-height: 52px; padding: 0 var(--sp-3); }
  .sr-top__title { font-size: 17px; letter-spacing: 0.01em; }
  .sr-top__dday { font-size: var(--fs-sm); }
  /* 결과: 가로형 카드 2열 */
  .sr-results { margin-top: var(--sp-6); }
  .sr-results__title { font-size: var(--fs-h2); line-height: var(--lh-h2); letter-spacing: var(--ls-tight); }
  .sr-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); }
  .sr-card { grid-template-columns: minmax(0, 44%) minmax(0, 1fr); gap: var(--sp-5); padding: var(--sp-4); align-items: center; }
  .sr-card__body { gap: 4px; }
  .sr-card__en { font-size: var(--fs-sm); white-space: normal; }
  .sr-card__actions { margin-top: var(--sp-2); }
  .sr-list--people { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } /* 인물 카드도 영화 결과와 같은 2열 */
  .sr-person { padding: var(--sp-4) var(--sp-5); }
  .sr-person__name { font-size: var(--fs-h3); line-height: var(--lh-h3); }
  .sr-person__list { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--sp-2) var(--sp-4); margin-top: var(--sp-3); }
  .sr-person__movie { grid-template-columns: 128px minmax(0, 1fr); }
  .sr-person__thumb { width: 128px; height: 72px; }
  .sr-person__mt b { font-size: var(--fs-body); white-space: normal; }
  .sr-noresult { padding-block: var(--sp-12); }
  .sr-foot { margin-top: var(--sp-8); }
}
