/* ============================================================
   service.css — art.sw1d.com 공개 검색 페이지
   ============================================================ */
:root {
    --bg: #f6f3ec; --paper: #fffdf8; --ink: #1d1a16; --muted: #6f675c; --line: #e6dfd2;
    --navy: #17233b; --navy2: #24375c; --gold: #a8843f; --gold-soft: #f3ead6; --violet: #6d4fc2;
    --radius: 14px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { background: var(--bg); color: var(--ink); font-family: 'Noto Sans KR', sans-serif; font-size: 15px; line-height: 1.55; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
.hidden { display: none !important; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 16px; }

/* ── 상단 ── */
.topnav { display: flex; justify-content: space-between; align-items: center; max-width: 1280px; margin: 0 auto; padding: 16px; color: #fff; }
.topnav.dark { background: var(--navy); max-width: none; padding: 14px max(16px, calc((100% - 1248px) / 2)); }
.brand { font-family: 'Noto Serif KR', serif; font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: rgba(255,255,255,.12); display: inline-flex; align-items: center; justify-content: center; color: #e9cf8f; }
.admin-link { font-size: 13px; opacity: .75; border: 1px solid rgba(255,255,255,.3); border-radius: 999px; padding: 4px 14px; }
.admin-link:hover { opacity: 1; }

.hero { background: radial-gradient(1200px 400px at 20% -10%, #31497a 0%, transparent 60%), linear-gradient(160deg, var(--navy) 0%, var(--navy2) 100%); color: #fff; padding-bottom: 46px; position: relative; overflow: hidden; }
.hero::after { content: '✝'; position: absolute; right: -40px; bottom: -120px; font-size: 420px; color: rgba(255,255,255,.035); font-family: serif; pointer-events: none; }
.hero-inner { max-width: 820px; margin: 0 auto; padding: 34px 16px 0; text-align: center; position: relative; z-index: 1; }
.hero h1 { font-family: 'Noto Serif KR', serif; font-size: clamp(26px, 5vw, 40px); font-weight: 700; letter-spacing: -.5px; }
.hero-sub { margin-top: 8px; opacity: .78; font-size: 15px; }
.search-box { margin: 26px auto 0; display: flex; align-items: center; background: #fff; border-radius: 999px; padding: 6px 6px 6px 20px; box-shadow: 0 14px 40px rgba(0,0,0,.28); max-width: 720px; }
.search-ico { color: var(--violet); font-size: 18px; margin-right: 10px; }
.search-box input { flex: 1; border: none; outline: none; font-size: 17px; padding: 10px 0; min-width: 0; background: transparent; color: var(--ink); }
.search-box button { border: none; background: var(--gold); color: #fff; font-size: 15px; font-weight: 700; border-radius: 999px; padding: 11px 26px; cursor: pointer; }
.search-box button:hover { background: #95732f; }
.examples { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
.examples button { border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.07); color: #fff; border-radius: 999px; padding: 5px 13px; font-size: 13px; cursor: pointer; }
.examples button:hover { background: rgba(255,255,255,.18); }

/* ── 조건 ── */
.facets { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); margin-top: -24px; position: relative; z-index: 2; padding: 14px 16px; box-shadow: 0 6px 20px rgba(60,40,10,.06); display: flex; flex-direction: column; gap: 10px; }
.facet-row { display: flex; gap: 10px; align-items: flex-start; }
.facet-lbl { flex-shrink: 0; width: 34px; font-size: 13px; font-weight: 700; color: var(--muted); padding-top: 5px; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.chips button { flex-shrink: 0; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 12px; font-size: 13px; cursor: pointer; color: var(--ink); white-space: nowrap; }
.chips button small { color: var(--muted); margin-left: 3px; }
.chips button.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.chips button.on small { color: rgba(255,255,255,.7); }
.chips .grp { flex-shrink: 0; font-size: 11px; color: var(--gold); align-self: center; padding: 0 2px 0 6px; font-weight: 700; }
.facet-selects { flex-wrap: wrap; align-items: center; gap: 8px 16px; font-size: 13px; color: var(--muted); }
.facet-selects select, .facet-selects input { border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; font-size: 13px; background: #fff; color: var(--ink); margin-left: 4px; }
.facet-selects input { width: 78px; }
.link-btn { border: none; background: none; color: var(--gold); cursor: pointer; font-size: 13px; text-decoration: underline; }

/* ── AI 해석 ── */
.understood { margin-top: 18px; padding: 10px 14px; border-radius: 10px; background: #f1ecff; border: 1px solid #ddd2ff; color: #45338a; font-size: 13.5px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.understood b { margin-right: 4px; }
.understood .tag { background: #fff; border-radius: 999px; padding: 1px 10px; border: 1px solid #ddd2ff; font-size: 12.5px; }
.understood .vis { flex-basis: 100%; color: #5b4aa0; font-size: 12.5px; }

/* ── 결과 ── */
.result-head { display: flex; align-items: baseline; gap: 10px; margin: 26px 0 14px; }
.result-head h2 { font-family: 'Noto Serif KR', serif; font-size: 21px; }
.result-head span { color: var(--muted); font-size: 13.5px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.card { background: var(--paper); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); transition: transform .15s, box-shadow .15s; display: flex; flex-direction: column; }
.card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(60,40,10,.12); }
.card .ph { aspect-ratio: 4 / 5; background: #ece6da; overflow: hidden; position: relative; }
.card .ph img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s; }
.card:hover .ph img { transform: scale(1.04); }
.card .ph .noimg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #c7bba6; font-size: 40px; font-family: serif; }
.card .ph .rank { position: absolute; left: 10px; top: 10px; background: rgba(23,35,59,.85); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 999px; }
.card .ph .cnt { position: absolute; right: 10px; bottom: 10px; background: rgba(0,0,0,.55); color: #fff; font-size: 11px; padding: 1px 7px; border-radius: 6px; }
.card .bd { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card h3 { font-size: 15.5px; font-weight: 700; line-height: 1.35; }
.card .meta { font-size: 12.5px; color: var(--muted); }
.card .tags { display: flex; flex-wrap: wrap; gap: 4px; }
.t { font-size: 11.5px; padding: 1px 8px; border-radius: 999px; background: var(--gold-soft); color: #7a5d22; }
.t.s { background: #ede7ff; color: #5b3fb6; }
.t.m { background: #e7f0ec; color: #2f6150; }
.card .why { font-size: 11.5px; color: #5b3fb6; margin-top: auto; padding-top: 4px; border-top: 1px dashed var(--line); }
.empty { grid-column: 1 / -1; text-align: center; padding: 60px 10px; color: var(--muted); }
.skel { background: linear-gradient(90deg, #ece6da 0%, #f5f0e6 50%, #ece6da 100%); background-size: 200% 100%; animation: sh 1.2s infinite; border-radius: var(--radius); aspect-ratio: 4 / 6; }
@keyframes sh { to { background-position: -200% 0; } }
.more { text-align: center; margin: 26px 0 40px; }
.more button { border: 1px solid var(--navy); background: transparent; color: var(--navy); border-radius: 999px; padding: 10px 34px; font-size: 14px; cursor: pointer; font-weight: 700; }
.more button:hover { background: var(--navy); color: #fff; }
.foot { text-align: center; color: var(--muted); font-size: 12.5px; padding: 26px 16px 34px; border-top: 1px solid var(--line); }

/* ── 상세 ── */
.view { padding-top: 26px; padding-bottom: 40px; }
.loading { padding: 80px 0; text-align: center; color: var(--muted); }
.view-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 34px; align-items: start; }
@media (max-width: 900px) { .view-grid { grid-template-columns: 1fr; gap: 20px; } }
.gallery .main { background: #ece6da; border-radius: var(--radius); overflow: hidden; display: flex; align-items: center; justify-content: center; aspect-ratio: 1; cursor: zoom-in; }
.gallery .main img { max-width: 100%; max-height: 100%; object-fit: contain; }
.gallery .thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; }
.gallery .thumbs button { border: 2px solid transparent; border-radius: 10px; overflow: hidden; width: 74px; height: 74px; flex-shrink: 0; cursor: pointer; padding: 0; background: #ece6da; position: relative; }
.gallery .thumbs button.on { border-color: var(--gold); }
.gallery .thumbs img { width: 100%; height: 100%; object-fit: cover; }
.gallery .thumbs span { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.5); color: #fff; font-size: 10.5px; }
.info h1 { font-family: 'Noto Serif KR', serif; font-size: clamp(24px, 4vw, 32px); line-height: 1.3; }
.info .where { color: var(--muted); margin-top: 6px; }
.info .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.info .tags .t { font-size: 13px; padding: 3px 12px; }
.desc { margin-top: 18px; background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--violet); border-radius: 10px; padding: 14px 16px; font-size: 14.5px; }
.desc small { display: block; color: var(--violet); font-weight: 700; font-size: 12px; margin-bottom: 4px; }
dl.spec { margin-top: 18px; display: grid; grid-template-columns: 110px 1fr; border-top: 1px solid var(--line); }
dl.spec dt, dl.spec dd { padding: 10px 4px; border-bottom: 1px solid var(--line); font-size: 14px; }
dl.spec dt { color: var(--muted); }
.author-box { margin-top: 18px; font-size: 13.5px; color: var(--muted); white-space: pre-line; }
.author-box b { color: var(--ink); }
.similar h2 { font-family: 'Noto Serif KR', serif; font-size: 20px; margin: 40px 0 14px; }
.lightbox { position: fixed; inset: 0; background: rgba(10,10,10,.9); z-index: 50; display: none; align-items: center; justify-content: center; cursor: zoom-out; }
.lightbox.on { display: flex; }
.lightbox img { max-width: 95vw; max-height: 94vh; }

@media (max-width: 600px) {
    .search-box { padding-left: 14px; }
    .search-box button { padding: 10px 16px; }
    .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .card .bd { padding: 9px 10px 11px; }
    .card h3 { font-size: 14px; }
    .facet-lbl { width: 30px; }
}
