/* 숫자로 보는 — DataBrew 인포그래픽 디자인 언어(연회색 격자 + 짙은 회색 글자) */
:root {
  --bg: #D6D5D0;
  --grid: #C9C8C2;
  --ink: #2C3030;
  --ink-2: #4A4E4E;
  --muted: #6B6E6C;
  --rule: #B2B4B0;
  --band: #C4C4BE;
  --paper: #DEDDD8;
  --font: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --gap: 36px;
}
[hidden] { display: none !important; }
* { box-sizing: border-box; border-radius: 0 !important; box-shadow: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  background-color: var(--bg);
  /* 인포그래픽과 같은 72px 격자, 1px 선 */
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 72px 72px;
  background-position: 36px 36px;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { display: block; max-width: 100%; }
.wrap { max-width: 1224px; margin: 0 auto; padding: 0 36px; }

/* ---------- 머리 ---------- */
.masthead { position: relative; padding: 40px 0 28px; text-align: center; border-bottom: 2px solid var(--rule); }
.masthead .issue { position: absolute; left: 0; top: 40px; font-size: 14px; font-weight: 700; letter-spacing: .01em; }
.logo { position: absolute; right: 0; top: 34px; display: block; text-decoration: none; text-align: right; line-height: .86; color: var(--ink); }
.logo .l1 { display: block; font-size: 21px; font-weight: 700; letter-spacing: -.01em; }
.logo .l2 { display: block; font-size: 31px; font-weight: 800; letter-spacing: .01em; }
.masthead .title { margin: 0; font-size: clamp(44px, 7vw, 76px); font-weight: 900; letter-spacing: -.04em; line-height: 1.08; }
.masthead .title a { text-decoration: none; }
.masthead .tagline { margin: 10px 0 0; font-size: clamp(16px, 2vw, 20px); font-weight: 500; color: var(--ink-2); letter-spacing: -.01em; }

/* ---------- 검색·필터 (콘텐츠가 적을 때도 두 줄을 넘지 않게) ---------- */
.tools { padding: 20px 0 24px; }
.tools .row { display: flex; align-items: center; gap: 10px; }
.tools .row + .row { margin-top: 10px; }
.search { flex: 1; display: flex; align-items: center; border: 1px solid var(--ink); background: var(--paper); min-width: 0; }
.search label { padding: 0 0 0 12px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.search input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font: inherit; font-size: 15px; color: var(--ink); padding: 9px 12px;
}
.search input::placeholder { color: var(--muted); }
.search:focus-within, .sel select:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.sel select {
  appearance: none; -webkit-appearance: none; font: inherit; font-size: 13.5px; font-weight: 500; color: var(--ink);
  background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0h10L5 6z' fill='%232C3030'/%3E%3C/svg%3E") no-repeat right 10px center;
  border: 1px solid var(--ink); padding: 9px 28px 9px 10px; cursor: pointer; outline: 0;
}
.cats { flex-wrap: wrap; gap: 4px 14px !important; }
.chip {
  font: inherit; font-size: 13.5px; font-weight: 500; color: var(--ink-2); background: none; border: 0;
  padding: 2px 0; cursor: pointer; border-bottom: 2px solid transparent;
}
.chip b { font-weight: 500; color: var(--muted); font-size: 12px; margin-left: 1px; }
.chip:hover { color: var(--ink); }
.chip[aria-pressed="true"] { color: var(--ink); font-weight: 800; border-bottom-color: var(--ink); }
.chip:disabled { color: var(--rule); cursor: default; }
.chip:disabled b { color: var(--rule); }
.count { margin-left: auto; font-size: 13px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.empty { display: none; padding: 60px 0; text-align: center; color: var(--ink-2); font-size: 16px; }
.empty.on { display: block; }
.more-wrap { display: flex; justify-content: center; margin: -36px 0 64px; }
.btn.more { font-size: 14px; padding: 12px 28px; min-width: 220px; }

/* ---------- 바둑판 ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 1fr;           /* 모든 카드 높이 통일 */
  gap: var(--gap);
  margin: 0 0 72px;
  padding: 0;
  list-style: none;
}
.card { display: flex; flex-direction: column; min-width: 0; background: var(--paper); border-top: 3px solid var(--ink); }
.card[hidden] { display: none; }
.card .shot {
  display: block; width: 100%; padding: 0; margin: 0; border: 0; cursor: zoom-in;
  background: var(--bg); aspect-ratio: 1 / 1;
}
.card .shot img { width: 100%; height: 100%; object-fit: contain; }
.card .body { display: flex; flex-direction: column; flex: 1; padding: 16px 18px 14px; }
.meta { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 13px; }
.meta time { font-weight: 700; letter-spacing: .01em; }
.meta .cat { color: var(--ink-2); font-weight: 500; background: var(--band); padding: 1px 8px; }
.card h2 { margin: 8px 0 12px; line-height: 1.3; }
.card h2 a { text-decoration: none; display: block; }
.card h2 .nm { display: block; font-size: 24px; font-weight: 800; letter-spacing: -.03em; }
.card h2 .tt { display: block; margin-top: 2px; font-size: 15.5px; font-weight: 700; color: var(--ink-2); letter-spacing: -.02em; }
.card h2 a:hover, .card h2 a:focus-visible { text-decoration: underline; text-underline-offset: 4px; }
.card .sub { margin: 0 0 10px; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.card .desc { margin: 0; padding: 10px 0 0; border-top: 1px solid var(--rule); font-size: 14px; line-height: 1.7; color: var(--ink); }
.card .desc span { display: block; }
.card .desc span + span { margin-top: 4px; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 14px; }

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font: inherit; font-size: 12.5px; font-weight: 700; line-height: 1; color: var(--ink);
  background: transparent; border: 1px solid var(--ink); padding: 7px 10px; cursor: pointer; text-decoration: none;
}
.btn:hover, .btn:focus-visible { background: var(--ink); color: var(--bg); }
.btn.done { background: var(--ink); color: var(--bg); }

/* ---------- 개별 페이지 ---------- */
.crumbs { padding: 20px 0 0; font-size: 13px; font-weight: 500; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.article { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 48px; padding: 24px 0 64px; align-items: start; }
.article .shot { display: block; padding: 0; border: 0; background: var(--bg); cursor: zoom-in; width: 100%; aspect-ratio: 1 / 1; border-top: 3px solid var(--ink); }
.article .shot img { width: 100%; height: 100%; object-fit: contain; }
.article h1 { margin: 10px 0 4px; font-size: clamp(38px, 5vw, 56px); font-weight: 900; letter-spacing: -.04em; line-height: 1.1; }
.article .kicker { font-size: 16px; font-weight: 700; }
.article .sub { margin: 0 0 18px; font-size: 18px; font-weight: 500; color: var(--ink-2); }
.article .desc { margin: 0; padding: 16px 0; border-top: 2px solid var(--rule); border-bottom: 1px solid var(--rule); font-size: 16px; line-height: 1.85; }
.article .desc span { display: block; }
.article .desc span + span { margin-top: 8px; }
.article .source { margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.article .actions { margin-top: 0; padding-top: 18px; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 28px; font-size: 14px; }
.pager a { display: block; padding: 10px 12px; border: 1px solid var(--rule); text-decoration: none; background: var(--paper); }
.pager a:hover { border-color: var(--ink); }
.pager small { display: block; font-size: 12px; color: var(--muted); }
.pager a { font-weight: 700; }
.pager em { display: block; font-style: normal; font-weight: 400; font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pager .next { text-align: right; grid-column: 2; }

/* ---------- 확대 보기 ---------- */
.lightbox { padding: 0; border: 0; background: transparent; max-width: none; max-height: none; width: 100vw; height: 100vh; margin: 0; }
.lightbox::backdrop { background: rgba(44, 48, 48, .92); }
.lightbox .frame { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 16px; }
.lightbox img { max-width: min(1080px, 100%); max-height: calc(100vh - 80px); width: auto; height: auto; object-fit: contain; background: var(--bg); }
.lightbox .bar { display: flex; gap: 8px; }
.lightbox .btn { color: var(--bg); border-color: var(--bg); background: transparent; }
.lightbox .btn:hover, .lightbox .btn:focus-visible { background: var(--bg); color: var(--ink); }

/* ---------- 바닥 ---------- */
footer { border-top: 2px solid var(--rule); padding: 20px 0 40px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 20px; font-size: 13px; color: var(--ink-2); }
footer a { font-weight: 700; text-decoration: none; }
footer a:hover { text-decoration: underline; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--bg); font-size: 14px; font-weight: 500; padding: 10px 16px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 10; }
.toast.on { opacity: 1; }

/* ---------- 반응형: PC 3열 · 태블릿 2열 · 모바일 1열 ---------- */
@media (max-width: 1023px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); --gap: 28px; }
  .article { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 639px) {
  .wrap { padding: 0 18px; }
  .grid { grid-template-columns: minmax(0, 1fr); --gap: 24px; }
  .masthead { padding: 64px 0 22px; }
  .masthead .issue { top: 20px; font-size: 13px; }
  .logo { top: 14px; }
  .logo .l1 { font-size: 17px; }
  .logo .l2 { font-size: 25px; }
  .tools .row:first-child { flex-wrap: wrap; }
  .search { flex-basis: 100%; }
  .sel { flex: 1; }
  .sel select { width: 100%; }
}
