/* ==========================================================================
   작업물 목록 (/workorders)
   - 카드는 4:5 격자다. 다단(columns)은 칸마다 높이가 달라 줄이 안 맞아 보였다.
   - 마우스를 올리면 카드 위로 정보 패널(.wk-pop)이 올라온다.
   ========================================================================== */

.wk-page { padding-bottom: 60px; }

/* ---------- 머리말 ---------- */
.wk-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 24px; flex-wrap: wrap; padding: 28px 0 20px;
}
.wk-head h1 { font-size: 28px; font-weight: 800; letter-spacing: -.03em; }
.wk-head p { margin-top: 8px; font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.wk-head-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.wk-search {
  display: flex; align-items: center; gap: 8px;
  width: min(420px, 60vw); height: 44px; padding: 0 14px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-full); box-shadow: var(--sh-sm);
}
.wk-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.wk-search input {
  flex: 1 1 auto; min-width: 0; border: 0; outline: 0; background: none;
  font-size: 14px; color: var(--ink);
}
.wk-search input::placeholder { color: var(--ink-3); }
.wk-search button { background: none; border: 0; cursor: pointer; color: var(--ink-3); line-height: 0; }
.wk-search button:hover { color: var(--brand); }

/* ---------- 분야 칩 ---------- */
.wk-cats { display: flex; flex-wrap: wrap; gap: 8px; }
.wk-cat {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: var(--r-full);
  background: var(--surface); border: 1px solid var(--line);
  font-size: 13.5px; font-weight: 600; color: var(--ink-2);
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.wk-cat:hover { border-color: var(--brand-soft-2); color: var(--brand); }
.wk-cat .n { font-size: 11.5px; font-weight: 700; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.wk-cat.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.wk-cat.on .n { color: #fff; opacity: .8; }

/* ---------- 정렬 · 보기 ---------- */
.wk-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin: 20px 0 16px;
  padding-bottom: 12px; border-bottom: 1px solid var(--line);
}
.wk-sorts { display: flex; gap: 16px; }
.wk-sort {
  position: relative; padding-bottom: 10px; margin-bottom: -13px;
  font-size: 14px; font-weight: 600; color: var(--ink-3);
}
.wk-sort:hover { color: var(--ink); }
.wk-sort.on { color: var(--brand); }
.wk-sort.on::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 2px; background: var(--brand); border-radius: 2px;
}

.wk-tools { display: flex; align-items: center; gap: 10px; }
.wk-view {
  display: flex; gap: 2px; padding: 3px;
  background: #F1F3F8; border-radius: var(--r-sm);
}
.wk-view button {
  width: 32px; height: 28px; display: grid; place-items: center;
  background: none; border: 0; border-radius: 6px; cursor: pointer; color: var(--ink-3);
}
.wk-view button.on { background: var(--surface); color: var(--brand); box-shadow: var(--sh-sm); }
.wk-period select {
  height: 34px; padding: 0 30px 0 12px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--surface);
  font-size: 13px; color: var(--ink-2); cursor: pointer;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%),
                    linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 16px) 15px, calc(100% - 11px) 15px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.wk-qnote { margin-bottom: 14px; font-size: 13.5px; color: var(--ink-2); }
.wk-qnote a { margin-left: 8px; font-size: 12.5px; color: var(--brand); font-weight: 600; }

/* ---------- 카드 목록 ----------
   다단(columns)으로 쌓으면 칸마다 높이가 달라 줄이 안 맞아 보인다.
   썸네일을 4:5 로 잘라 격자로 맞춘다. */
.wk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
}
.wk {
  position: relative;
  border-radius: var(--r-lg); overflow: hidden; background: var(--surface);
  border: 1px solid var(--line);
}
.wk-shot { display: block; position: relative; line-height: 0; aspect-ratio: 4 / 5; }
.wk-shot img {
  width: 100%; height: 100%; display: block;
  object-fit: cover; transition: transform .5s ease;
}
.wk:hover .wk-shot img { transform: scale(1.03); }
.wk-noimg {
  display: grid; place-items: center; height: 180px;
  background: #EFF1F6; color: var(--ink-3);
}
.wk-lock, .wk-count {
  position: absolute; left: 10px; top: 10px;
  display: inline-flex; align-items: center; gap: 4px;
  height: 24px; padding: 0 9px; border-radius: var(--r-full);
  background: rgba(23, 26, 35, .72); color: #fff; font-size: 11.5px; font-weight: 700;
}
.wk-count { left: auto; right: 44px; }

.wk-like {
  position: absolute; right: 10px; top: 10px; z-index: 3;
  width: 30px; height: 30px; display: grid; place-items: center;
  border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(255, 255, 255, .92); color: var(--ink-3);
  box-shadow: var(--sh-sm); transition: color .15s ease, transform .15s ease;
}
.wk-like:hover { transform: scale(1.06); color: #F43F5E; }
.wk-like.on { color: #F43F5E; }
.wk-like.on svg { fill: currentColor; }

/* 마우스를 올렸을 때 뜨는 정보 패널 */
.wk-pop {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 14px; display: grid; gap: 9px;
  background: var(--surface);
  border-top: 1px solid var(--line);
  transform: translateY(100%);
  transition: transform .28s ease, opacity .28s ease;
  opacity: 0;
}
.wk:hover .wk-pop, .wk:focus-within .wk-pop { transform: none; opacity: 1; }
.wk-pop-head b { font-size: 14px; font-weight: 800; letter-spacing: -.01em; line-height: 1.4; }
.wk-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.wk-tag {
  font-size: 11.5px; font-weight: 600; color: var(--brand-ink);
  background: var(--brand-soft); border-radius: var(--r-full); padding: 3px 8px;
}
.wk-by { display: flex; align-items: center; gap: 7px; min-width: 0; }
.wk-av { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; flex: none; }
.wk-nm {
  font-size: 12.5px; font-weight: 600; color: var(--ink-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wk-price { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--brand); }
.wk-stat { display: flex; gap: 12px; font-size: 12px; color: var(--ink-3); }
.wk-stat span { display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.wk-stat i { font-style: normal; }
.wk-cta { width: 100%; justify-content: center; }

/* 목록 보기 */
.wk-grid.list { grid-template-columns: 1fr; gap: 12px; }
.wk-grid.list .wk { display: grid; grid-template-columns: 180px 1fr; align-items: stretch; }
.wk-grid.list .wk-shot img { height: 100%; object-fit: cover; }
.wk-grid.list .wk-pop {
  position: static; transform: none; opacity: 1;
  border-top: 0; border-left: 1px solid var(--line);
  align-content: start;
}
.wk-grid.list .wk-cta { justify-self: start; width: auto; padding: 0 16px; }

/* 목록 보기에서는 썸네일이 칸 높이를 따라간다 */
.wk-grid.list .wk-shot { aspect-ratio: auto; height: 100%; }

/* 빈 상태 · 더 보기
   ⚠ display 를 주면 hidden 속성(display:none)을 덮어써서 숨겨지지 않는다.
   실제로 "작업물이 없습니다" 가 목록과 함께 계속 떠 있었다. */
.wk-empty[hidden], .wk-more[hidden] { display: none; }
.wk-empty { padding: 48px 0; text-align: center; color: var(--ink-3); display: grid; gap: 12px; justify-items: center; }
.wk-err { padding: 24px 0; color: var(--danger); font-size: 13.5px; }
.wk-more { display: grid; justify-items: center; margin-top: 26px; }
.wk-loading { font-size: 13px; color: var(--ink-3); }

@media (max-width: 1024px) {
  .wk-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .wk-head-right { width: 100%; }
  .wk-search { width: 100%; }
}
@media (max-width: 640px) {
  .wk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  /* 좁은 화면에선 마우스 올리기가 없다 — 패널을 항상 보여준다 */
  .wk-pop { position: static; transform: none; opacity: 1; }
  .wk-grid.list .wk { grid-template-columns: 110px 1fr; }
  .wk-bar { gap: 10px; }
}
