/* ==========================================================================
   기구 가이드 — 검색형 목록 + 상세
   공용 시스템은 ../assets/css/tokens.css.

   목록은 Topview 골격을 따른다: 헤드라인 → 큰 입력창 → 그 아래 그리드.
   상세는 회원이 기구 앞에서 한 손으로 본다는 전제 — 모바일이 기본이고 데스크톱이 예외다.
   ========================================================================== */

.guide-list, .guide { padding-top: 4.5rem; }   /* 고정 헤더 높이 */

/* --------------------------------------------------------------------------
   검색 히어로
   -------------------------------------------------------------------------- */
.finder { padding-block: clamp(2.5rem, 2rem + 4vw, 6rem) clamp(1.5rem, 1rem + 2vw, 3rem); }
.finder__title { margin-top: 1rem; font-size: clamp(2.25rem, 1.4rem + 4.5vw, 4.5rem); }
.finder__lede { margin-top: 1.4rem; max-width: 46ch; color: var(--ink-dim); font-size: var(--text-lead); }

.finder__box {
  display: flex; align-items: center; gap: 0.9rem;
  margin-top: clamp(1.75rem, 1.2rem + 2vw, 2.75rem);
  padding: 0.35rem 0.35rem 0.35rem 1.2rem;
  background: var(--surface-1);
  border: 1px solid oklch(38% 0.008 275);
  transition: border-color var(--dur-1) var(--ease), background var(--dur-1) var(--ease);
}
.finder__box:focus-within { border-color: var(--gold); background: var(--surface-2); }
.finder__icon { width: 22px; height: 22px; flex-shrink: 0; color: var(--ink-faint); }
.finder__box:focus-within .finder__icon { color: var(--gold); }
.finder__box input {
  flex: 1; min-width: 0;
  padding: 1.05rem 0;
  background: none; border: 0; outline: none;
  font-size: clamp(1rem, 0.95rem + 0.4vw, 1.2rem);
  color: var(--ink);
}
.finder__box input::placeholder { color: var(--ink-faint); }
.finder__box input::-webkit-search-cancel-button { display: none; }
.finder__clear {
  flex-shrink: 0; width: 2.6rem; height: 2.6rem;
  color: var(--ink-dim);
  transition: color var(--dur-1) var(--ease);
}
.finder__clear:hover { color: var(--ink); }

/* 부위 칩 */
.chips { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 1.1rem; }
.chip {
  padding: 0.6em 1.1em;
  border: 1px solid oklch(32% 0.008 275);
  color: var(--ink-dim);
  font-size: 0.85rem;
  transition: color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease),
              background var(--dur-1) var(--ease);
}
.chip .num { color: var(--ink-faint); margin-left: 0.3em; }
.chip:hover { color: var(--ink); border-color: oklch(52% 0.01 275); }
.chip.is-on { background: var(--gold); border-color: var(--gold); color: var(--surface-0); font-weight: 700; }
.chip.is-on .num { color: oklch(30% 0.06 82); }

/* --------------------------------------------------------------------------
   타일 그리드
   -------------------------------------------------------------------------- */
.grid__status { margin-bottom: 1rem; }
.grid__empty { padding-block: 4rem; text-align: center; color: var(--ink-dim); }

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: clamp(0.5rem, 1.2vw, 1rem);
  padding-bottom: var(--section);
}

.tile {
  position: relative;
  display: flex; flex-direction: column; justify-content: flex-end;
  aspect-ratio: 3 / 4;
  padding: 0.9rem;
  background: var(--surface-1);
  border: 1px solid transparent;
  overflow: hidden;
  transition: border-color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}
.tile__shot { position: absolute; inset: 0; }
.tile__shot img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 32%;
  opacity: 0.62;
  transition: opacity var(--dur-2) var(--ease), transform var(--dur-2) var(--ease);
}
/* 사진 위 글자를 위한 스크림 — 사진이 밝으면 이름이 사라진다 */
.tile__shot::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, oklch(13% 0.006 275 / 0.95) 8%, oklch(13% 0.006 275 / 0.45) 52%, transparent 100%);
}
.tile > *:not(.tile__shot) { position: relative; z-index: 1; }

a.tile:hover, a.tile:focus-visible { border-color: var(--gold); }
a.tile:hover .tile__shot img, a.tile:focus-visible .tile__shot img { opacity: 0.85; transform: scale(1.04); }

.tile__badge {
  position: absolute; top: 0.9rem; left: 0.9rem;
  padding: 0.35em 0.6em;
  background: var(--gold); color: var(--surface-0);
  z-index: 1;
}
.tile > .tile__badge { position: absolute; }
.tile__badge--wait { background: none; border: 1px solid oklch(38% 0.008 275); color: var(--ink-faint); }
.tile__name { font-size: 0.98rem; font-weight: 700; line-height: 1.25; }
.tile__cat { margin-top: 0.35rem; }

/* 영상 없는 타일은 링크가 아니다 — 누를 곳이 없으면 그렇게 보여야 한다 */
.tile--wait { background: var(--surface-1); }
.tile--wait .tile__name { font-weight: 500; color: var(--ink-dim); }

/* --------------------------------------------------------------------------
   상세 — 영상 무대
   -------------------------------------------------------------------------- */
.stage { display: grid; place-items: center; padding: clamp(1rem, 2vw, 2rem) 0; background: var(--surface-1); }
.stage__video,
.stage__frame {
  width: min(100%, calc((100svh - 14rem) * 9 / 16));
  aspect-ratio: 9 / 16;
  max-height: calc(100svh - 14rem);
  background: #000;
}
.stage__frame { position: relative; }
.stage__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.stage--wait { padding-block: clamp(3rem, 2rem + 5vw, 6rem); }
.stage__wait {
  max-width: 34ch; padding: clamp(1.5rem, 1rem + 2vw, 2.5rem);
  border: 1px solid oklch(32% 0.008 275);
  text-align: center; color: var(--ink-dim);
}
.stage__wait p { margin-top: 0.8rem; }

/* --------------------------------------------------------------------------
   상세 — 본문
   -------------------------------------------------------------------------- */
.guide__body { padding-block: clamp(2rem, 1.5rem + 3vw, 4rem) var(--section); }
.guide__meta { color: var(--ink-dim); }
.guide__title { margin-top: 0.9rem; font-size: clamp(2rem, 1.4rem + 3.4vw, 3.75rem); }
.guide__en { margin-top: 0.7rem; color: var(--ink-faint); font-size: 0.95rem; }

.block { margin-top: var(--section); }
.block .sec-head h2 { font-size: clamp(1.5rem, 1.2rem + 1.6vw, 2.25rem); }

/* 세팅 — 순서가 있는 작업이라 번호를 세운다 */
.steps { display: grid; gap: 0; }
.steps li {
  display: grid; grid-template-columns: 3.5ch 1fr; gap: 1.2rem;
  align-items: baseline;
  padding-block: 1.2rem;
  border-bottom: var(--rule);
}
.steps li:first-child { border-top: var(--rule); }
.step__no { color: var(--gold); }

/* 동작 */
.rows { display: grid; }
.rows .row {
  display: grid; grid-template-columns: 8ch 1fr; gap: 1.2rem;
  align-items: baseline;
  padding-block: 1.2rem;
  border-bottom: var(--rule);
}
.rows .row:first-child { border-top: var(--rule); }
.rows dd p + p { margin-top: 0.6rem; }
@media (max-width: 460px) {
  .rows .row { grid-template-columns: 1fr; gap: 0.45rem; }
}

/* 자극 부위 — 3단계를 명도로 구분 */
.mgroup { display: grid; gap: 0.7rem; }
.mgroup + .mgroup { margin-top: 1.6rem; }
.mchips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.mchip { padding: 0.5em 0.9em; background: var(--surface-1); font-size: 0.9rem; }
.mchip--primary { background: var(--gold); color: var(--surface-0); font-weight: 700; }
.mchip--secondary { background: var(--surface-3); }
.mchip--stabilizer { background: var(--surface-1); color: var(--ink-dim); }
.mbasis {
  margin-top: 1.6rem; padding-left: 1.1rem;
  border-left: 1px solid var(--gold-deep);
  font-size: 0.88rem; color: var(--ink-faint);
}

/* 주의 */
.warn { padding: 1.1rem 1.3rem; background: var(--surface-1); border-left: 2px solid var(--gold-deep); }
.warn + .warn { margin-top: 1px; }

.back {
  display: inline-block; margin-top: var(--section);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--gold);
  color: var(--gold);
  font-size: var(--text-label); font-weight: 700;
  letter-spacing: var(--track-label); text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   저수지 존 — 계약 전이라 슬롯 구조만. 링크는 비어 있다.
   -------------------------------------------------------------------------- */
.reservoir { margin-top: var(--section); padding-top: var(--gap-3); border-top: var(--rule); }
.reservoir__banner {
  padding: clamp(1.2rem, 1rem + 1.5vw, 2rem);
  border: 1px dashed oklch(34% 0.008 275);
  color: var(--ink-faint);
}
.reservoir__banner p { margin-top: 0.5rem; }
.reservoir__slots {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1px; margin-top: 1px;
  background: oklch(30% 0.008 275);
  border: var(--rule);
}
.slot {
  display: grid; gap: 0.45rem;
  padding: clamp(1.2rem, 1rem + 1.5vw, 1.9rem);
  background: var(--surface-0);
  font-size: 0.9rem; color: var(--ink-dim);
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.slot:hover, .slot:focus-visible { background: var(--surface-1); color: var(--ink); }

/* Production polish: the library is the product, ready videos lead the grid. */
.guide-list, .guide { padding-top: 4.25rem; }
.finder { padding-top: clamp(3.5rem, 5vw, 6.5rem); }
.finder__title { max-width: 10ch; font-size: clamp(3rem, 2rem + 4.8vw, 5.8rem); }
.finder__lede { max-width: 37ch; }
.finder__box { min-height: 64px; border-color: oklch(34% 0.01 275); }
.chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: .35rem; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; min-height: 44px; }

.tiles { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); grid-auto-flow: dense; }
a.tile { grid-column: span 2; grid-row: span 2; order: -1; }
.tile--wait { aspect-ratio: 1.12 / 1; background: linear-gradient(145deg, var(--surface-1), oklch(15% 0.008 265)); }
.tile--wait::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .12;
  background: repeating-linear-gradient(135deg, transparent 0 18px, oklch(40% 0.01 265) 18px 19px);
}
.tile--wait > .tile__name, .tile--wait > .tile__cat { position: relative; z-index: 1; }
a.tile .tile__name { font-size: clamp(1.2rem, 1rem + .7vw, 1.65rem); }
a.tile .tile__shot img { opacity: .78; }
.tile__badge { letter-spacing: .12em; }
.stage { min-height: calc(100dvh - 4.25rem); padding: 1rem; }
.stage__video, .stage__frame { background: var(--surface-0); }
.guide__body { padding-top: clamp(2.5rem, 5vw, 4.5rem); }
.guide__title { max-width: 13ch; }
.block { scroll-margin-top: 6rem; }
.draft-note { display: none; }

@media (max-width: 520px) {
  .finder { padding-top: 3rem; }
  .finder__title { font-size: clamp(2.75rem, 13vw, 4.25rem); }
  .finder__lede { font-size: 1rem; }
  .finder__box { position: sticky; top: 4.8rem; z-index: 10; box-shadow: 0 12px 32px oklch(5% 0.01 265 / .3); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  a.tile { grid-column: 1 / -1; aspect-ratio: 16 / 12; }
  .tile--wait { aspect-ratio: 1 / 1; }
  .tile { padding: .8rem; }
  .tile__badge { top: .8rem; left: .8rem; }
  .stage { min-height: 0; padding: 0; }
  .stage__video, .stage__frame { width: 100%; max-height: none; }
}
