/* 디자인팜 작업물 갤러리 - 햇살담은 디자인
   색: 로고의 세 색(진한 초록 #29845d · 연두 #8ec31f · 햇살 노랑 #fdd000). 바탕은 깨끗한 흰색에 아주 옅은 풀빛.
   표식: 재단선(트림 마크)은 '작업물 번호'와 상세 이미지에만 둔다 (로고의 모서리 선처럼 왼쪽 위 진초록, 오른쪽 아래 연두). */
:root {
  --paper: #f6f8f4;
  --sheet: #ffffff;
  --ink: #1e2a23;
  --muted: #66716a;
  --line: #dde3dc;
  --green: #29845d;
  --green-dk: #1f6a4a;
  --lime: #8ec31f;
  --lime-bg: #eef6df;
  --sun: #fdd000;
  --kakao: #fee500;
  --gap: 10px;
  --radius: 4px;
  font-family: "SUIT Variable", "SUIT", "Pretendard", "Noto Sans KR", "Apple SD Gothic Neo", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-size: 16px; line-height: 1.55; -webkit-text-size-adjust: 100%; font-feature-settings: "tnum"; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--lime); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- 공통 머리표 (어느 화면에서나 같은 모양: 세 색 띠 + 로고 + 햇살담은 디자인/디자인팜) ---------- */
.df-stripe::before { content: ""; position: absolute; z-index: 5; left: 0; right: 0; top: 0; height: 4px; pointer-events: none;
  background: linear-gradient(90deg, #29845d 0 60%, #8ec31f 60% 88%, #fdd000 88%); }   /* 붙이는 쪽은 position(relative·fixed·sticky)이 있어야 함 */
.df-brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: inherit; white-space: nowrap; flex: none; }
.df-brand img { height: 26px; width: auto; display: block; }
.df-brand-t { display: grid; line-height: 1.05; padding-left: 9px; border-left: 1px solid #dde3dc; }
.df-brand-t small { font-size: 10.5px; font-weight: 700; color: #6f9d14; letter-spacing: .1em; }
.df-brand-t strong { font-size: 17px; font-weight: 800; color: #29845d; letter-spacing: -0.03em; }

/* ---------- 머리 ---------- */
.head { position: relative; padding-top: 4px; background: var(--sheet); border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.top {
  display: flex; gap: 24px; align-items: flex-end; justify-content: space-between;
  max-width: 1320px; margin: 0 auto; padding: 22px 24px 20px;
}
.logo { display: flex; align-items: center; gap: 16px; text-decoration: none; }
.logo img { height: 46px; width: auto; display: block; }
.logo-text { display: grid; line-height: 1.1; padding-left: 16px; border-left: 1px solid var(--line); }
.logo-text small { font-size: 13px; font-weight: 700; color: #6f9d14; letter-spacing: .12em; }
.logo-text strong { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; color: var(--green); }
.intro { margin: 10px 0 0; color: var(--muted); max-width: 46em; font-size: 15px; }
.search { position: relative; flex: 0 1 340px; }
.search input {
  width: 100%; height: 46px; padding: 0 14px; border: 2px solid var(--green); border-radius: 999px; padding-left: 18px;
  background: var(--sheet); font-size: 16px;
}
.suggest {
  position: absolute; z-index: 20; left: 0; right: 0; top: 50px; margin: 0; padding: 4px 0; list-style: none;
  background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(31,35,40,.12);
}
.suggest li { padding: 8px 14px; cursor: pointer; display: flex; justify-content: space-between; gap: 12px; }
.suggest li[aria-selected="true"], .suggest li:hover { background: var(--paper); }
.suggest small { color: var(--muted); }

/* ---------- 키워드 영역 ---------- */
.facets { max-width: 1320px; margin: 0 auto; padding: 0 24px; }
.facet { display: grid; grid-template-columns: 92px 1fr; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.facet:last-child { border-bottom: 1px solid var(--line); }
.facet h2 { margin: 0; font-size: 14px; font-weight: 700; color: var(--muted); padding-top: 4px; }
.facet h2 button { all: unset; cursor: default; }
.words { display: flex; flex-wrap: wrap; gap: 2px 4px; }
.word {
  border: 0; background: none; padding: 4px 8px; border-radius: var(--radius); cursor: pointer; font-size: 15px;
}
.word sup { font-size: 11px; color: var(--muted); margin-left: 2px; }
.word:hover { background: var(--lime-bg); }
.word.on { background: var(--green); color: #fff; }
.word.on sup { color: rgba(255,255,255,.8); }
.word.dim { opacity: .32; }
.word.expand { color: var(--green); font-weight: 600; }

.picked { max-width: 1320px; margin: 0 auto; padding: 14px 24px 6px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-height: 52px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 12px; border-radius: 999px;
  background: var(--green-dk); color: #fff; font-size: 14px; border: 0; cursor: pointer;
}
.chip b { font-weight: 400; opacity: .7; }
.chip span { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: rgba(255,255,255,.18); }
.count { color: var(--muted); font-size: 14px; }
.clear { border: 0; background: none; color: var(--green); cursor: pointer; font-size: 14px; }

/* ---------- 격자: 모양별 줄 ---------- */
.grid { max-width: 1320px; margin: 0 auto; padding: 8px 24px 0; display: flex; flex-direction: column; gap: var(--gap); }
.row { display: grid; gap: var(--gap); grid-template-columns: repeat(var(--cols), 1fr); }
.row.wide { display: flex; }
.row.wide.single .card { max-height: 260px; }
.card {
  position: relative; display: block; padding: 0; border: 0; background: var(--sheet); cursor: zoom-in;
  border-radius: var(--radius); overflow: hidden; aspect-ratio: 1 / 1;
}
.row.tall .card { aspect-ratio: 1 / 2; }
.row.wide .card { min-width: 0; }
.card img { width: 100%; height: 100%; object-fit: contain; display: block; padding: 8px; }
.row.wide .card img { padding: 0; object-fit: contain; }
.card.crop img { object-fit: cover; object-position: top; padding: 0; }
.card.crop::after {
  content: "세로 배너"; position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 6px; font-size: 12px; color: #fff;
  background: linear-gradient(transparent, rgba(31,35,40,.7));
}
.card.ph { display: grid; place-content: center; text-align: center; gap: 2px; color: var(--muted); cursor: pointer;
  background: repeating-linear-gradient(-45deg, #eef1ec 0 10px, #e7ebe4 10px 20px); }
.card.ph strong { font-size: 18px; color: var(--ink); }
.card.ph small { font-size: 13px; }

.more-wrap { text-align: center; padding: 28px 0 60px; }
.more { padding: 12px 40px; border: 2px solid var(--green); color: var(--green); background: var(--sheet); border-radius: var(--radius); cursor: pointer; font-weight: 700; }
.empty { text-align: center; color: var(--muted); padding: 60px 24px; }

/* ---------- 재단선: 번호표와 상세 이미지 ---------- */
.trim, .ticket { position: relative; }
.trim::before, .trim::after, .ticket::before, .ticket::after {
  content: ""; position: absolute; width: 18px; height: 18px; pointer-events: none;
}
.trim::before, .ticket::before { left: -14px; top: -14px; border-left: 2px solid var(--green); border-top: 2px solid var(--green); }
.trim::after, .ticket::after { right: -14px; bottom: -14px; border-right: 2px solid var(--lime); border-bottom: 2px solid var(--lime); }

/* ---------- 상세 화면 ---------- */
.viewer {
  position: fixed; inset: 0; z-index: 50; background: var(--paper);
  display: grid; grid-template-columns: 56px 1fr 56px 380px; grid-template-rows: 56px 1fr;
}
.viewer[hidden], .sheet[hidden] { display: none; }
.v-top { grid-column: 1 / -1; display: flex; align-items: center; gap: 18px; padding: 4px 20px 0; border-bottom: 1px solid var(--line); background: var(--sheet); }
.v-top .v-close { margin-left: auto; }
.v-pos { color: var(--muted); font-size: 14px; }
.v-close { border: 0; background: none; font-weight: 700; cursor: pointer; padding: 8px 4px; }
.v-nav { border: 0; background: none; font-size: 44px; line-height: 1; color: var(--muted); cursor: pointer; }
.v-nav:hover { color: var(--green); }
.v-nav:disabled { visibility: hidden; }
.v-figure { margin: 0; display: grid; place-items: center; padding: 34px; overflow: auto; min-height: 0; }
.v-figure .trim { display: inline-block; max-width: 100%; max-height: 100%; }
.v-figure img { display: block; max-width: 100%; max-height: calc(100vh - 140px); background: var(--sheet); }
.v-figure .trim.ph { width: min(420px, 70vw); aspect-ratio: 1 / 1; display: grid; place-content: center; text-align: center;
  background: repeating-linear-gradient(-45deg, #eef1ec 0 10px, #e7ebe4 10px 20px); color: var(--muted); }
.v-info { border-left: 1px solid var(--line); background: var(--sheet); padding: 34px 28px; overflow: auto; }
.ticket { display: inline-flex; flex-direction: column; padding: 4px 2px; margin: 4px 0 18px 14px; }
.ticket-label { font-size: 13px; color: var(--muted); }
.ticket strong { color: var(--green-dk); font-size: 46px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.05; }
.v-spec { display: grid; grid-template-columns: 56px 1fr; gap: 4px 12px; margin: 0 0 22px; }
.v-spec dt { color: var(--muted); }
.v-spec dd { margin: 0; }
.v-actions { display: grid; gap: 8px; margin-bottom: 26px; }
.v-sub { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn-kakao { height: 50px; border: 0; border-radius: var(--radius); background: var(--kakao); color: #191600; font-weight: 800; cursor: pointer; font-size: 16px; }
.btn-line { display: inline-grid; place-items: center; height: 42px; border: 1px solid var(--green); color: var(--green-dk); border-radius: var(--radius); background: var(--sheet); cursor: pointer; text-decoration: none; font-size: 15px; }
.btn-text { border: 0; background: none; color: var(--muted); cursor: pointer; }
.v-hint { margin: 0; font-size: 13px; color: var(--muted); }
.v-kw h3, .v-set h3 { font-size: 13px; color: var(--muted); font-weight: 600; margin: 0 0 8px; }
.v-kw .words { margin-bottom: 22px; }
.v-set .thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.v-set .thumbs button { border: 1px solid var(--line); background: var(--paper); padding: 4px; aspect-ratio: 1; cursor: pointer; border-radius: var(--radius); }
.v-set .thumbs img { width: 100%; height: 100%; object-fit: contain; }

/* ---------- 문의서 ---------- */
.sheet { position: fixed; inset: 0; z-index: 60; background: rgba(31,35,40,.45); display: grid; place-items: center; padding: 16px; }
.sheet-box { width: min(480px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--sheet); border-radius: 8px; padding: 26px 24px; }
.sheet-box h2 { margin: 0 0 4px; font-size: 20px; }
.sheet-box h2 span { color: var(--green); }
.sheet-note { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.sheet-note b { color: var(--ink); }
.sheet-copied { width: 100%; box-sizing: border-box; resize: none; font: inherit; font-size: 14px; line-height: 1.5; padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper, #f6f6f2); color: var(--ink); }
.fields { display: grid; gap: 12px; }
.fields label { display: grid; gap: 4px; font-size: 14px; font-weight: 600; }
.fields input, .fields textarea { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); font-weight: 400; font-size: 16px; background: var(--paper); }
.fields textarea { min-height: 70px; resize: vertical; }
.sheet-btns { display: grid; gap: 8px; margin-top: 18px; }

.toast { position: fixed; z-index: 80; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px; }

/* ---------- 휴대폰 ---------- */
@media (max-width: 760px) {
  .top { flex-direction: column; align-items: stretch; padding: 16px 16px 14px; gap: 12px; }
  .logo { gap: 12px; }
  .logo img { height: 34px; }
  .logo-text { padding-left: 12px; }
  .logo-text small { font-size: 11px; }
  .logo-text strong { font-size: 22px; }
  .intro { font-size: 14px; }
  .search { flex: none; }
  .facets, .picked, .grid { padding-left: 16px; padding-right: 16px; }
  .facet { grid-template-columns: 1fr; gap: 4px; }
  .facet h2 button { all: unset; cursor: pointer; display: flex; justify-content: space-between; width: 100%; padding: 4px 0; }
  .facet h2 button::after { content: "펼치기"; font-weight: 400; color: var(--green); }
  .facet.open h2 button::after { content: "접기"; }
  .facet:not(.open) .words { display: none; }
  .facet .words.has-on { display: flex; }
  .viewer { grid-template-columns: 1fr; grid-template-rows: 54px auto auto; overflow: auto; }
  .v-top { padding: 4px 14px 0; gap: 12px; }
  .v-top .df-brand img { height: 18px; }
  .v-nav { display: none; }
  .v-figure { padding: 20px 16px 8px; }
  .v-figure img { max-height: 70vh; }
  .v-info { border-left: 0; border-top: 1px solid var(--line); padding: 22px 16px 40px; }
  .ticket strong { font-size: 38px; }
}
@media (prefers-reduced-motion: no-preference) {
  .viewer:not([hidden]) .v-figure img { animation: drop .18s ease-out; }
  @keyframes drop { from { opacity: 0; transform: scale(.985); } to { opacity: 1; transform: none; } }
}
