/* 딥스카이 카탈로그 (/deepsky/) — site.css 의 색 변수·카드를 그대로 쓴다 */
.main > .card.ds { padding: 0 24px 22px; overflow: hidden; }
.ds [hidden] { display: none !important; }   /* .btn 등의 display 가 hidden 을 이기지 않게 */
.ds-h { margin: 0 -24px 16px; padding: 14px 24px; background: var(--band); color: var(--band-ink); }
.ds-h h1 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -.02em; line-height: 1.3; }
.ds-h h1 small { margin-left: 6px; font-size: 14px; font-weight: 600; color: var(--band-soft); }
.ds-h h1 small a { color: inherit; text-decoration: underline; text-decoration-color: rgba(244, 244, 245, .35); text-underline-offset: 3px; }
.ds-h .meta { margin: 2px 0 0; color: var(--band-soft); }
.ds-back { display: inline-block; margin-bottom: 2px; font-size: 12.5px; color: var(--band-soft); }
.ds-back:hover { color: var(--band-ink); }

/* 목록 고르기 · 찾기 */
.ds-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 14px; }
.ds-tabs { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--card2);
           max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.ds-tabs a { flex: none; padding: 5px 13px; border-radius: 999px; color: var(--soft); font-size: 13px; font-weight: 600; white-space: nowrap; }
.ds-tabs a small { margin-left: 2px; font-size: 11px; font-weight: 500; color: var(--faint); font-variant-numeric: tabular-nums; }
.ds-tabs a:hover { color: var(--ink); text-decoration: none; }
.ds-tabs a[aria-selected=true] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 0 0 1px var(--line); }
.ds-f { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ds-q { position: relative; display: flex; }
.ds-q .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--faint); pointer-events: none; }
.ds-q input { width: 230px; padding-left: 32px; }
.ds-chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--soft); cursor: pointer; user-select: none; }
.ds-count { display: flex; align-items: center; gap: 10px; min-height: 26px; margin: 12px 0 10px; color: var(--soft); font-size: 12.5px; }

/* 카드 격자 */
.ds-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: 12px; }
.ds-card { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
           background: var(--card); color: var(--ink); text-decoration: none !important; scroll-margin-top: 16px;
           transition: border-color .15s, box-shadow .15s, transform .15s; content-visibility: auto; contain-intrinsic-size: auto 250px; }
.ds-card:hover { border-color: var(--ring); box-shadow: var(--shadow); transform: translateY(-1px); }
.ds-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ds-card:target { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.ds-th { display: block; aspect-ratio: 1; background: #050507; overflow: hidden; }
.ds-th.neg { background: #fff; }
.ds-th img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ds-th img.ph, .ds-th img[data-fallback] { object-fit: none; background: var(--card2); }
.ds-b { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px 10px; min-width: 0; }
.ds-b strong { font-size: 14px; font-weight: 700; letter-spacing: -.01em; }
.ds-b small { font-size: 11.5px; color: var(--soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-n { margin-top: 2px; font-size: 12.5px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: keep-all; }
.ds-m { margin-top: 3px; font-size: 11.5px; color: var(--faint); }
.ds-m i { font-style: normal; }
.ds-m i::before { content: "·"; margin: 0 4px; }
.ds-empty { padding: 40px 0; text-align: center; color: var(--faint); }
.ds-src { margin: 18px 0 0; line-height: 1.7; }

/* 한 천체 */
.ds-dl { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 20px; align-items: start; }
.ds-pics figure { margin: 0 0 18px; }
.ds-pic { display: block; line-height: 0; }
.ds-pic img { max-width: 100%; height: auto; border-radius: 10px; background: #050507; }
.ds-pic.neg img { background: #fff; }
.ds-lost { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 180px; border-radius: 10px;
           background: var(--card2); border: 1px dashed var(--line); line-height: 1.4; color: var(--faint); font-size: 12.5px; }
.ds-pics figcaption { margin-top: 8px; }
.ds-pics figcaption img { max-width: 100%; height: auto; border-radius: 6px; }
.ds-facts { position: sticky; top: 16px; display: grid; gap: 14px; }
.ds-facts dl { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 7px 10px; margin: 0; font-size: 13.5px; }
.ds-facts dt { color: var(--soft); font-size: 12.5px; }
.ds-facts dd { margin: 0; }
.ds-facts .num { font-variant-numeric: tabular-nums; }
.ds-raw { color: var(--faint); font-size: 12px; }
.ds-map { width: 100%; height: 36px; }
.ds-facts .ds-src { margin: 0; }
.ds-pn { display: flex; justify-content: space-between; gap: 10px; margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13.5px; }

/* 흰 바탕의 건판 사진(음화)과 설명 스캔은 어두운 화면에서 반전해 눈부심을 줄인다 */
@media (prefers-color-scheme: dark) {
    .ds-th.neg { background: #000; }
    .ds-th.neg img:not([data-fallback]), .ds-pic.neg img, .ds-pics figcaption img.neg { filter: invert(1); }
    .ds-pic.neg img { background: #000; }
}

@media (max-width: 820px) {
    .main > .card.ds { padding: 0 16px 16px; }
    .ds-h { margin: 0 -16px 14px; padding: 12px 16px; }
    .ds-bar, .ds-f { width: 100%; }
    .ds-q { flex: 1 1 100%; }
    .ds-q input { width: 100%; }
    .ds-f select { flex: 1; }
    .ds-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
    .ds-dl { grid-template-columns: minmax(0, 1fr); }
    .ds-facts { position: static; }
}
@media (max-width: 480px) {
    .ds-tabs { display: flex; }
    .ds-tabs a { flex: 1; padding: 5px 8px; text-align: center; }
    .ds-tabs a small { display: none; }
}
@media (max-width: 380px) {
    .ds-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
