/* 딜장부 — 토큰: 종이 #F6F2EA · 잉크 #1C1A16 · 딜 강조 #C23A1E · 카드 #FFFFFF · 선 #E3DCD0 (SPEC §7.1)
   글자는 어디서도 14px 미만으로 내려가지 않는다(REQ-25). opacity는 어디에도 쓰지 않는다(§5.3).
   position 속성에 fixed·sticky 값을 쓰지 않는다(§7.3 금지). */
:root {
  --paper: #F6F2EA;
  --ink: #1C1A16;
  --accent: #C23A1E;
  --card: #FFFFFF;
  --line: #E3DCD0;
  --muted: #57524A;
  --muted-2: #6F695F;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "IBM Plex Sans KR", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--accent); }
h1, h2, h3 { margin: 0; }
p { margin: 0; }
img { max-width: 100%; display: block; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; width: 1px; height: 1px; overflow: hidden;
}
.skip-link:focus {
  position: static; display: inline-block; width: auto; height: auto;
  padding: 10px 16px; margin: 8px; background: var(--ink); color: var(--paper);
  font-size: 14px; font-weight: 600; border-radius: 8px;
}

/* 터치 영역 44px 이상(REQ-HD-25-AC-HD-36) - 시각 크기는 그대로 두고 히트박스만 늘린다 */
.site-nav a, .footer-links a, .callout a, .state-msg a, a.logo {
  display: inline-flex; align-items: center; min-height: 44px; margin: -12px 0; padding: 0 8px;
}

/* P1 — 페이지 최상단 고지(항상 <body> 첫 콘텐츠, JS 없이도 보인다) */
.disclosure-top {
  background: var(--paper); color: var(--accent);
  padding: 12px 16px; font-size: 15px; line-height: 22px; border-bottom: 1px solid var(--line);
}

.page {
  max-width: 1120px; margin: 0 auto; padding: 0 16px;
}

.site-header { border-bottom: 1px solid var(--line); }
.site-header-inner {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 8px; padding: 20px 16px 16px;
}
.brand { display: flex; flex-direction: column; gap: 4px; }
.logo { font-family: "Hahmlet", serif; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); }
.tagline { font-size: 14px; color: var(--muted); }
.site-nav { display: flex; gap: 18px; }
.site-nav a { font-size: 14px; font-weight: 600; }

main#edition {
  display: flex; flex-direction: column; gap: 20px;
  max-width: 1120px; margin: 0 auto; padding: 16px 16px 32px;
}
main#edition:empty::before { content: ''; }

.edition-main, .edition-aside { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.edition-head { display: flex; flex-direction: column; gap: 8px; padding: 16px 0 4px; border-top: 2px solid var(--ink); }
.eyebrow { font-size: 14px; font-weight: 700; color: var(--accent); }
.edition-title { font-family: "Hahmlet", serif; font-size: 30px; line-height: 1.2; font-weight: 800; letter-spacing: -0.02em; }
.edition-meta { font-size: 14px; color: var(--muted); }
.edition-intro, .state-msg-text { font-size: 15px; line-height: 1.6; }
.state-msg-text { font-weight: 600; }

.stale-banner {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 12px 14px; background: #FBEBD3; color: #6B3A00; border-radius: 12px; font-size: 14px; line-height: 1.5;
}

.section-title { font-size: 17px; font-weight: 700; }
.section-desc { font-size: 14px; color: var(--muted); line-height: 1.5; }

.store { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.store-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.store-title { font-size: 17px; font-weight: 700; }
.store-checked { font-size: 14px; color: var(--muted); }
.store-disclosure { font-size: 15px; color: var(--accent); font-weight: 500; }

.deal-grid { display: flex; flex-direction: column; gap: 12px; }

.deal {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px;
}
.deal.is-soldout { border-color: #D8CBB3; }

.deal-img { width: 96px; height: 96px; border-radius: 12px; object-fit: cover; }
.deal-store { font-size: 14px; font-weight: 600; color: var(--muted); }
.deal-title { font-size: 16px; line-height: 1.4; font-weight: 600; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-clamp: 2; overflow: hidden; }
.ad-tag { font-size: inherit; font-weight: 700; color: var(--accent); }

.deal-price { display: flex; align-items: baseline; gap: 6px; font-size: 14px; color: var(--muted); }
.deal-price strong { font-size: 22px; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; }

.deal-meta { font-size: 14px; color: var(--ink); }

.deal-note {
  padding: 10px 12px; background: var(--paper); border-radius: 10px; font-size: 15px; line-height: 1.5; color: var(--ink);
}
.deal-label { font-weight: 700; margin-right: 4px; }

.deal-end { font-size: 14px; font-weight: 600; color: var(--ink); }

.deal-chip {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
  font-size: 14px; font-weight: 700; padding: 3px 10px; border-radius: 999px;
}
.deal-chip.is-live { color: #1D6A43; background: #E2F0E7; }
.deal-chip.is-soldout { color: #7A4300; background: #FBEBD3; }

.deal-stale { font-size: 14px; color: #8A5A00; }

.deal-disclosure { font-size: 15px; color: var(--accent); line-height: 1.5; }

.deal-buy {
  display: flex; height: 48px; align-items: center; justify-content: center;
  border-radius: 12px; font-size: 15px; font-weight: 600;
  background: var(--ink); color: var(--paper); border: none; width: 100%; cursor: pointer;
}
.deal-buy.is-off { background: #EDE8E0; color: var(--muted); }

.ended-section, .past-section, .openchat-section { display: flex; flex-direction: column; gap: 10px; }
.ended-list, .past-list { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }

.ended-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.ended-item:last-child { border-bottom: none; }
.ended-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ended-name { font-size: 14px; color: var(--muted-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ended-edition { font-size: 14px; color: var(--muted-2); }
.ended-chip { flex-shrink: 0; font-size: 14px; font-weight: 700; color: var(--muted); background: #ECE7DF; padding: 3px 10px; border-radius: 999px; }

.past-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 52px; padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--ink);
}
.past-list .past-item:last-child { border-bottom: none; }
.past-title { font-family: "Hahmlet", serif; font-size: 16px; font-weight: 600; }
.past-meta { font-size: 14px; color: var(--muted); }

.openchat-section { padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.openchat-cta {
  display: flex; height: 44px; align-items: center; justify-content: center;
  border: 1px solid var(--ink); border-radius: 12px; font-size: 14px; font-weight: 600;
}

.aside-extra { display: none; }
.callout { padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; gap: 8px; }
.callout .section-desc { line-height: 1.6; }
.pc-note { padding: 14px 16px; background: #EFEAE1; border-radius: 14px; font-size: 14px; line-height: 1.5; }

.state-msg {
  display: flex; flex-direction: column; gap: 10px; align-items: flex-start;
  padding: 28px 20px; background: var(--card); border: 1px dashed #CFC6B8; border-radius: 14px;
}
.state-title { font-family: "Hahmlet", serif; font-size: 20px; font-weight: 600; }
.retry-btn {
  height: 48px; padding: 0 20px; border: 1px solid var(--ink); border-radius: 12px;
  background: var(--card); color: var(--ink); font-size: 15px; font-weight: 600; cursor: pointer;
}

.site-footer { border-top: 1px solid var(--line); }
.site-footer-inner { display: flex; flex-direction: column; gap: 8px; padding: 20px 16px 28px; }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-links a { font-size: 14px; font-weight: 600; }
.footer-line { font-size: 14px; color: var(--muted); line-height: 1.5; }

/* 데스크톱: 본문 760px + 사이드바 320px 2열(Desktop 시안) */
@media (min-width: 1024px) {
  main#edition { flex-direction: row; align-items: flex-start; gap: 40px; padding-top: 32px; }
  .edition-main { width: 760px; }
  .edition-aside { width: 320px; }
  .deal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .edition-title { font-size: 40px; }
  .aside-extra { display: flex; flex-direction: column; } /* 기본 row면 제목·문단·링크가 한 줄로 눌린다(9/29 라이브 실측) */
}

/* 문서 페이지(고르는 기준·개인정보처리방침·404) 공용 */
.doc-main { max-width: 640px; margin: 0 auto; padding: 20px 16px 40px; display: flex; flex-direction: column; gap: 16px; }
.doc-title { font-family: "Hahmlet", serif; font-size: 28px; line-height: 1.3; font-weight: 800; letter-spacing: -0.02em; }
.doc-section { display: flex; flex-direction: column; gap: 8px; padding: 18px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.doc-section-head { display: flex; align-items: baseline; gap: 10px; }
.doc-num { font-family: "Hahmlet", serif; font-size: 20px; font-weight: 800; color: var(--accent); }
.doc-h2 { font-size: 16px; font-weight: 700; }
.doc-p { font-size: 15px; line-height: 1.6; color: var(--ink); }
.doc-quote { padding: 10px 12px; background: var(--paper); border-radius: 10px; font-size: 15px; line-height: 1.5; }
.doc-list { display: flex; flex-direction: column; gap: 10px; }
.doc-list dt { font-size: 14px; font-weight: 700; margin-top: 10px; }
.doc-list dd { font-size: 15px; line-height: 1.6; color: var(--muted); margin: 2px 0 0; }
