/* 道具詳細彈窗
 *
 * 原站的彈窗用 Tailwind 的 sm:max-w-lg / bg-black/50 / bg-muted/50 等 class，
 * 但這些沒有被編譯進 theme.css（原站是隨 JS chunk 動態載入的）。
 * 所以外框樣式在這裡用原生 CSS 寫，並沿用站上的 CSS 變數，
 * 分類色票則照原站的 Tailwind class（那些確實在 theme.css 裡）。
 */

.im-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgb(0 0 0 / .5);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.im-backdrop[hidden] { display: none !important; }

.im-panel {
  background: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--border);
  border-radius: .75rem;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / .2), 0 4px 6px -4px rgb(0 0 0 / .2);
  width: 100%;
  max-width: 32rem;
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
  padding: 1.5rem;
  margin: auto;
  position: relative;
}

.im-close {
  position: absolute;
  top: .75rem;
  right: .75rem;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: none;
  border-radius: .375rem;
  color: var(--muted-foreground);
  cursor: pointer;
  font: inherit;
  transition: background-color .15s, color .15s;
}
.im-close:hover { background: var(--muted); color: var(--foreground); }

.im-head { display: flex; align-items: center; gap: .75rem; padding-right: 2rem; }
.im-thumb {
  width: 64px; height: 64px; flex: 0 0 64px;
  background: var(--muted); border-radius: .5rem; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.im-thumb img { width: 64px; height: 64px; object-fit: contain; }
.im-thumb svg { width: 32px; height: 32px; color: var(--muted-foreground); }

.im-title { font-size: 1.25rem; line-height: 1.75rem; font-weight: 700; margin: 0; }
.im-cats { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-top: .25rem; }

.im-desc {
  font-size: .875rem;
  color: var(--muted-foreground);
  margin: .75rem 0 0;
  white-space: pre-line;
}

.im-sec { margin-top: 1rem; }
.im-sec-t {
  font-size: .75rem;
  font-weight: 500;
  color: var(--muted-foreground);
  margin-bottom: .375rem;
}
.im-sec-hint {
  font-size: .6875rem;
  color: color-mix(in srgb, var(--muted-foreground) 70%, transparent);
  margin: -.25rem 0 .375rem;
}

/* 條列（取得方式 / 配方取得方式） */
.im-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; }
.im-list li {
  font-size: .875rem;
  color: var(--muted-foreground);
  display: flex;
  align-items: flex-start;
  gap: .375rem;
}
.im-dot {
  flex: 0 0 4px; width: 4px; height: 4px; border-radius: 999px; margin-top: .4rem;
  background: var(--primary);
}
.im-dot.amber { background: #e8b700; }

/* 材料 / 食材 / 廚具的小方塊 */
.im-chips { display: flex; flex-wrap: wrap; gap: .375rem; }
.im-chip {
  display: inline-flex; align-items: center; gap: .375rem;
  background: color-mix(in srgb, var(--muted) 60%, transparent);
  border: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
  border-radius: .375rem;
  font-size: .875rem;
  padding: .25rem .5rem;
  color: var(--foreground);
}
.im-chip img { width: 20px; height: 20px; object-fit: contain; flex: 0 0 20px; }
.im-chip .qty { color: var(--muted-foreground); font-variant-numeric: tabular-nums; }

/* 棲息地連結列 */
.im-habs { display: grid; gap: .375rem; }
.im-hab {
  display: flex; align-items: center; gap: .625rem;
  padding: .5rem; border-radius: .375rem;
  background: color-mix(in srgb, var(--muted) 50%, transparent);
  border: 1px solid var(--border);
  transition: border-color .15s, background-color .15s;
}
.im-hab:hover {
  border-color: color-mix(in srgb, var(--primary) 40%, transparent);
  background: var(--muted);
}
.im-hab-img {
  width: 40px; height: 40px; flex: 0 0 40px; border-radius: .375rem;
  overflow: hidden; background: var(--muted);
}
.im-hab-img img { width: 100%; height: 100%; object-fit: cover; }
.im-hab-n { flex: 1; min-width: 0; font-size: .875rem; font-weight: 500; line-height: 1.25; }
.im-hab-q { font-size: .75rem; color: var(--muted-foreground); flex-shrink: 0; }

/* 食譜的兩欄小資訊 */
.im-kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .375rem; }
@media (max-width: 400px) { .im-kv { grid-template-columns: 1fr; } }
.im-kv > div {
  background: color-mix(in srgb, var(--muted) 50%, transparent);
  border: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
  border-radius: .375rem;
  padding: .375rem .5rem;
}
.im-kv dt { font-size: .6875rem; color: var(--muted-foreground); }
.im-kv dd { font-size: .875rem; margin: .125rem 0 0; }

.im-none { font-size: .875rem; color: var(--muted-foreground); margin: .75rem 0 0; }

/* 可點擊的道具卡／格子 */
[data-item] { cursor: pointer; }
