/* 글창고 — 신춘문예 당선작품 (웹) */
:root {
  --bg: #fffdf8;
  --card: #ffffff;
  --line: #e8e1d2;
  --ink: #211d18;
  --ink-2: #4a443b;
  --muted: #7a7263;
  --accent: #2f6743;
  --accent-ink: #ffffff;
  --accent-soft: #eaf2ec;
  --gold: #bf8c00;
  --gold-soft: #f7edd6;
  --danger: #b3412e;
  --radius: 14px;
  --reader-size: 18px;
  --shadow: 0 1px 2px rgba(40, 34, 22, .05), 0 4px 14px rgba(40, 34, 22, .05);
  --sans: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", "Malgun Gothic", sans-serif;
  --serif: "Noto Serif KR", "Nanum Myeongjo", "AppleMyungjo", serif;
  /* 본문은 기기에 들어 있는 명조체로 (긴 소설에 웹폰트를 받으면 데이터가 많이 듭니다) */
  --serif-text: "Noto Serif CJK KR", "Noto Serif KR Local", "Nanum Myeongjo", "AppleMyungjo", "Batang", serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171512; --card: #201d19; --line: #34302a; --ink: #eee7da; --ink-2: #d2c9b9; --muted: #9c9383;
    --accent: #7fb893; --accent-ink: #10150f; --accent-soft: #22302a; --gold-soft: #3a3121; --danger: #e5866f;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--sans); word-break: keep-all; overflow-wrap: anywhere; }
body.drawer-open { overflow: hidden; }
a { color: inherit; }
img { max-width: 100%; height: auto; display: block; }
button, input, textarea { font: inherit; color: inherit; }
.serif { font-family: var(--serif); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.sr-only, .hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { flex: none; }

/* ── 헤더 ── */
.gc-header {
  position: sticky; top: 0; z-index: 20; height: 58px; display: flex; align-items: center; gap: 8px; padding: 0 10px;
  padding-top: env(safe-area-inset-top); background: color-mix(in srgb, var(--bg) 92%, transparent);
  border-bottom: 1px solid var(--line); backdrop-filter: saturate(1.4) blur(8px);
}
.gc-hd-ic { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 12px; background: none; color: var(--ink); cursor: pointer; text-decoration: none; }
.gc-hd-ic:hover, .gc-hd-ic:focus-visible { background: var(--accent-soft); }
.gc-brand { flex: 1; display: flex; flex-direction: column; align-items: center; line-height: 1.15; text-decoration: none; }
.gc-brand .sub { font-size: 11px; color: var(--muted); letter-spacing: .04em; }
.gc-brand .main { font: 700 19px/1.2 var(--serif); color: var(--accent); }

/* ── 서랍 메뉴 ── */
.drawer-dim { position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, .35); }
.drawer {
  position: fixed; z-index: 31; top: 0; bottom: 0; left: 0; width: min(300px, 84vw); background: var(--card);
  display: flex; flex-direction: column; padding: calc(10px + env(safe-area-inset-top)) 12px 16px; box-shadow: 4px 0 24px rgba(0, 0, 0, .12);
}
.drawer[hidden], .drawer-dim[hidden] { display: none; }
.drawer-head { display: flex; align-items: center; padding: 4px 4px 12px; border-bottom: 1px solid var(--line); }
.drawer-head .gc-brand { align-items: flex-start; }
.drawer-menu { list-style: none; margin: 12px 0; padding: 0; flex: 1; }
.drawer-menu a { display: flex; align-items: center; gap: 14px; padding: 13px 12px; border-radius: 12px; text-decoration: none; font-size: 16px; }
.drawer-menu a:hover, .drawer-menu a[aria-current] { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.drawer-foot { margin: 0; font-size: 12px; color: var(--muted); padding: 0 12px; }

/* ── 본문 틀 ── */
.page { max-width: 720px; margin: 0 auto; padding: 18px 16px 40px; }
.site-foot { max-width: 720px; margin: 0 auto; padding: 24px 16px 40px; border-top: 1px solid var(--line); text-align: center; font-size: 13px; color: var(--muted); }
.site-foot p { margin: 4px 0; }
.site-foot a { color: inherit; text-decoration: underline; }

/* ── 문서(개인정보처리방침) ── */
.doc { padding: 36px 40px 40px; font-size: 15px; line-height: 1.85; color: var(--ink); }
.doc-head { padding-bottom: 20px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.doc-head .page-title { font-size: 26px; margin: 0 0 6px; }
.doc-head p { margin: 0; font-size: 14px; }
.doc-summary { margin: 20px 0 8px !important; padding: 16px 18px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 10%, var(--card)); color: var(--accent); font-weight: 600; }
.doc h2 { font-size: 18px; margin: 40px 0 14px; padding-top: 28px; border-top: 1px solid var(--line); }
.doc h3 { font-size: 15.5px; margin: 24px 0 8px; color: var(--ink-2); }
.doc p { margin: 0 0 14px; }
.doc ul { margin: 0 0 16px; padding-left: 1.3em; }
.doc li { margin: 0 0 8px; padding-left: 2px; }
.doc li::marker { color: var(--muted); }
.doc a { color: var(--accent); word-break: break-all; }
@media (max-width: 600px) {
  .doc { padding: 26px 20px 28px; font-size: 14.5px; }
  .doc h2 { margin-top: 32px; padding-top: 24px; }
}
.page-title { font-size: 24px; margin: 4px 0 14px; }
.section-title { font-size: 17px; margin: 28px 0 12px; display: flex; align-items: center; gap: 6px; }
.count { font-size: 13px; font-weight: 600; color: var(--muted); }
.title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.flash { background: var(--accent-soft); color: var(--accent); border-radius: 12px; padding: 12px 14px; margin: 0 0 16px; font-weight: 600; }
.flash.error { background: color-mix(in srgb, var(--danger) 12%, var(--card)); color: var(--danger); }
.empty { padding: 28px 20px; text-align: center; }
.empty p { margin: 6px 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 0 18px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); text-decoration: none; font-weight: 600; cursor: pointer;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.link-btn { border: 0; background: none; color: var(--muted); font-size: 13px; padding: 4px 0; cursor: pointer; text-decoration: underline; }
.badge { display: inline-block; font-size: 12px; font-weight: 700; color: var(--accent); background: var(--accent-soft); border-radius: 6px; padding: 1px 7px; margin-right: 4px; }

/* ── 메인 서재 ── */
.intro { padding: 20px; }
.intro h1 { margin: 0 0 6px; font-size: 22px; color: var(--accent); }
.intro p { margin: 0; color: var(--ink-2); }
.intro blockquote { margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--line); }
.intro blockquote p { font-family: var(--serif-text); font-size: 16px; color: var(--ink); }
.intro cite { display: block; margin-top: 4px; text-align: right; font-style: normal; font-size: 13px; color: var(--muted); }
.year-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
/* 배너가 줄 가운데(홀수 번째 카드 다음)에 오면 다음 카드가 빈칸을 채워, 연도 카드는 늘 두 개씩 한 줄 */
@media (min-width: 600px) { .year-grid { grid-template-columns: 1fr 1fr; grid-auto-flow: row dense; } .year-grid .banner { grid-column: 1 / -1; } }
.year-card { position: relative; display: block; aspect-ratio: 550 / 228; border-radius: 12px; overflow: hidden; background: var(--gold); box-shadow: var(--shadow); }
.year-card img { width: 100%; height: 100%; object-fit: cover; }
.year-card .year-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font: 700 34px var(--serif); color: #fff; }
.year-card img + .year-label { display: none; }
.year-card:hover, .year-card:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
/* ── 신고 ── */
.report { margin-top: 6px; font-size: 13px; }
.report > summary { display: inline-block; cursor: pointer; color: var(--muted); list-style: none; padding: 2px 0; }
.report > summary::-webkit-details-marker { display: none; }
.report > summary:hover { color: var(--ink-2); text-decoration: underline; }
.report form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.report select, .report input[type="text"] { padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: var(--card); color: var(--ink); }
.report input[type="text"] { flex: 1 1 160px; min-width: 0; }
.report .hint { flex-basis: 100%; margin: 2px 0 0; font-size: 12px; }
.post-actions .report { margin-top: 0; }
/* 글 아래 버튼 줄에서는 좋아요 · 공유와 같은 모양으로 */
.post-actions .report > summary {
  display: inline-flex; align-items: center; min-height: 38px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card); font-size: 14px; font-weight: 600; color: var(--ink-2);
}
.post-actions .report[open] { flex-basis: 100%; }

.banner a { display: block; border-radius: 12px; overflow: hidden; }
.banner img { width: 100%; }

/* ── 장르 탭 ── */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.tabs a { flex: none; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); text-decoration: none; font-weight: 600; }
.tabs a[aria-current] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tabs a[aria-current] .count { color: inherit; opacity: .8; }

/* ── 작품 목록 ── */
.work-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.work-row { display: grid; gap: 3px; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; }
.work-row:hover { border-color: var(--accent); }
.work-row .press, .reader-meta .press { justify-self: start; font-size: 12px; font-weight: 600; color: #8a5c00; background: var(--gold-soft); border-radius: 5px; padding: 2px 8px; }
@media (prefers-color-scheme: dark) { .work-row .press, .reader-meta .press { color: #e6c27a; } }
.work-row .title { font: 700 17px/1.4 var(--serif); }
.work-row .author { font-size: 14px; color: var(--muted); }

/* ── 본문 읽기 ── */
.reader-head { padding: 22px 0 26px; margin-bottom: 30px; text-align: center; position: relative; }
.reader-head::after { content: ''; position: absolute; left: 50%; bottom: 0; width: 32px; height: 2px; margin-left: -16px; background: var(--gold); }
.reader-meta { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 13px; color: var(--muted); }
.reader-head h1 { font-size: 27px; line-height: 1.35; margin: 0; }
.reader-author { margin: 8px 0 0; color: var(--muted); letter-spacing: .03em; }
.reader-tools { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 18px; }
.reader-tools form { margin: 0; }
.font-tools { display: inline-flex; gap: 6px; }
.tool {
  display: inline-flex; align-items: center; gap: 5px; min-height: 38px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card); cursor: pointer; font-size: 14px; font-weight: 600; text-decoration: none;
}
.tool.on { color: #c2413a; border-color: #e9b3ad; background: color-mix(in srgb, #c2413a 8%, var(--card)); }
.tool.on .ic { fill: currentColor; }
.reader-text { font-family: var(--serif-text); font-size: var(--reader-size); line-height: 1.8; letter-spacing: -.005em; color: var(--ink); max-width: 38em; margin: 0 auto; }
.reader-text p { margin: 0 0 .75em; }
.reader-text p.gap { margin-top: 1.4em; }

/* ── 작품평 · 댓글 ── */
.reviews { margin-top: 36px; }
.write-box { display: grid; gap: 8px; padding: 14px; margin-bottom: 14px; }
.write-box label { font-size: 14px; font-weight: 600; }
.write-box input, .write-box textarea, .inline-form input, .search-box input {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); padding: 10px 12px; font-size: 16px;
}
.write-box textarea { resize: vertical; min-height: 84px; line-height: 1.6; }
.write-box input:focus, .write-box textarea:focus, .inline-form input:focus, .search-box input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.write-box input[name=nickname] { max-width: 220px; }
.write-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; }
.comment-list { list-style: none; margin: 0 0 14px; padding: 0; }
.comment-list li { padding: 12px 2px; border-bottom: 1px solid var(--line); }
.comment-list form { margin: 0; }
.comment-head { margin: 0; font-size: 14px; }
.comment-head time { color: var(--muted); font-size: 13px; margin-left: 4px; }
.comment-body { margin: 4px 0 0; color: var(--ink-2); }

/* ── 감상평 ── */
.post-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.post-card { display: block; padding: 16px; text-decoration: none; }
.post-card:hover { border-color: var(--accent); }
.post-excerpt { margin: 0 0 8px; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0; font-size: 13px; color: var(--muted); }
.post-meta strong { color: var(--ink); }
.post { padding: 18px; }
.post-body { margin: 14px 0; font-size: 17px; line-height: 1.85; }
.post-image { border-radius: 10px; margin-top: 12px; }
.post-actions { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.post-actions form { margin: 0; }

/* ── 검색 · 나의 서재 ── */
.search-box, .inline-form { display: flex; gap: 8px; margin-bottom: 12px; }
.search-box .btn { flex: none; width: 50px; padding: 0; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips a { display: inline-block; padding: 7px 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); text-decoration: none; font-size: 14px; }
.chips a:hover { border-color: var(--accent); color: var(--accent); }
.card.section, section.card { padding: 4px 16px 14px; }
section.card .section-title { margin-top: 14px; }
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--line); font-size: 15px; }
.mini-list a { text-decoration: none; }
.mini-list time { flex: none; color: var(--muted); font-size: 13px; }

.pager { display: flex; justify-content: center; gap: 6px; margin: 22px 0 6px; }
.pager a, .pager span { min-width: 38px; height: 38px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; border: 1px solid var(--line); text-decoration: none; background: var(--card); }
.pager span[aria-current] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50; background: #2b2721; color: #fff; padding: 11px 18px; border-radius: 12px; font-size: 14px; box-shadow: 0 6px 20px rgba(0, 0, 0, .2); }

.error-page { display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 20px; }
.error-box { max-width: 420px; text-align: center; }

@media (prefers-reduced-motion: no-preference) {
  .drawer:not([hidden]) { animation: slide-in .18s ease-out; }
  @keyframes slide-in { from { transform: translateX(-100%); } }
}
