@charset "utf-8";
/* ─────────────────────────────────────────────────────────────
   색은 표지 사진(새벽 바다)에서 가져왔다.
   종이는 푸른빛 도는 흰색, 글자는 깊은 물빛, 강조는 해 뜨는 금색.
   ───────────────────────────────────────────────────────────── */
:root {
  --paper:     #FFFFFF;
  --band:      #F6F4EE;   /* 아이보리 띠 */
  --surface:   #FFFFFF;
  --ink:       #1E2A24;
  --ink-soft:  #5C665F;
  --ink-faint: #8D958F;
  --rule:      #E3E1D9;
  --green:     #1F4433;   /* 짙은 초록 - 단추와 띠 */
  --green-2:   #2E5C46;
  --gold:      #8A7442;
  --sea:       #2F5D7C;
  --danger:    #A33A34;
  --scrim:     rgba(20, 28, 24, .45);
  --on-gold:   #FFFFFF;   /* 금색 딱지 위의 글자 */
  --fs: 1.0625rem;

  /* ── 폭은 여기 세 개로만 정한다. 페이지마다 따로 적지 않는다 ──
     --page    : 머리말·진열·꼬리말 같은 넓은 구역
     --doc     : 이용 안내처럼 글이 많은 페이지
     --measure : 책 본문 (한 줄 길이)
                 em 으로 적는다. 읽기 화면에서 '가+' 로 글자를 키우면 줄도 같이 늘어나
                 한 줄 글자 수가 그대로 유지된다. (rem 이면 글자만 커져 줄이 짧아진다) */
  --page:    74rem;
  --doc:     46rem;
  --measure: 33rem;     /* 휴대폰(600px 미만): 원래 값. 화면이 이보다 좁아 사실상 꽉 찬다 */
}

/* 넓은 화면에서는 줄을 늘려 준다.
   한글은 한 줄에 30~45자가 읽기 편한 범위라 그 안에서만 늘린다. */
/* 태블릿(600~1199px, 8인치 세로 ~600px 부터): 화면의 90% 까지, 42em(약 42자)을 넘지 않게.
   PC(1200px 이상, 차례가 왼쪽에 붙는 화면): 40em(약 40자)에서 멈춘다. */
@media (min-width: 600px)  { :root { --measure: min(42em, 90vw); } }
@media (min-width: 1000px) { :root { --doc: 50rem; } }
@media (min-width: 1200px) { :root { --measure: 40em; } }
@media (min-width: 1400px) { :root { --doc: 54rem; } }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #101613; --band: #151D18; --surface: #17201B; --ink: #E2E7E3;
    --ink-soft: #A2ABA5; --ink-faint: #737D77; --rule: #29332C;
    --green: #7FB79A; --green-2: #9CCBB2; --gold: #C6AC72; --sea: #8FB6CE;
    --danger: #E08A84; --scrim: rgba(0,0,0,.6); --on-gold: #17201B;
  }
}
:root[data-theme="dark"] {
  --paper: #101613; --band: #151D18; --surface: #17201B; --ink: #E2E7E3;
  --ink-soft: #A2ABA5; --ink-faint: #737D77; --rule: #29332C;
  --green: #7FB79A; --green-2: #9CCBB2; --gold: #C6AC72; --sea: #8FB6CE;
  --danger: #E08A84; --scrim: rgba(0,0,0,.6); --on-gold: #17201B;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Noto Serif KR", Batang, serif;
  font-size: var(--fs);
  line-height: 1.9;
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--sea); }
.sans { font-family: "IBM Plex Sans KR", system-ui, sans-serif; }

/* ── 공통 막대 ─────────────────────────────────────────── */
.bar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: .5rem;
  padding: .55rem clamp(.7rem, 3vw, 1.2rem);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
  font-family: "IBM Plex Sans KR", system-ui, sans-serif;
}
.bar .who {
  flex: 1; min-width: 0;
  font-size: .78rem; letter-spacing: .02em; color: var(--ink-soft);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar .who a { color: inherit; text-decoration: none; }
.bar .who a:hover { color: var(--ink); }
/* 높이를 못 박지 않고 안쪽 여백으로 정한다.
   높이를 고정하고 줄 높이를 1로 누르면 한글 글자가 위로 붙어 보인다. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  min-width: 2.2rem; min-height: 2.2rem;
  /* 위 여백을 아래보다 조금 크게. 한글은 내려긋는 획이 없어 정확히 가운데
     두면 글자가 떠 보이므로, 그만큼(약 1.5px) 내려 앉힌다. */
  padding: .52rem .85rem .4rem;
  border: 1px solid var(--rule); border-radius: .5rem;
  background: var(--surface); color: var(--ink-soft);
  font-family: "IBM Plex Sans KR", system-ui, sans-serif;
  font-size: .82rem; line-height: 1.25; text-decoration: none; cursor: pointer;
  transition: color .15s, border-color .15s;
}
.btn:hover { color: var(--ink); border-color: var(--ink-faint); }
.btn:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn.primary:hover { color: #fff; filter: brightness(1.08); }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--rule)); }
/* 큰 단추. 높이를 못 박지 않고 여백으로 키운다 (위 여백을 조금 더 줘 글자를 내려 앉힘) */
.btn.lg { font-size: .92rem; min-height: 2.8rem; padding: .78rem 1.6rem .64rem; }
.progress { position: absolute; left: 0; bottom: -1px; height: 2px; background: var(--green); width: 0; }

/* ── 목록 화면 ─────────────────────────────────────────── */
.wrap { max-width: var(--page); margin: 0 auto; padding: clamp(1.4rem, 5vw, 3rem) clamp(1rem, 4vw, 1.5rem) 5rem; }

/* 글이 많은 페이지 (이용 안내 등). 안에 든 .chapter 는 폭 제한을 풀어 준다. */
.wrap.doc, .admin-wrap.doc { max-width: var(--doc); }
.wrap.doc .chapter { max-width: none; padding-left: 0; padding-right: 0; }
.masthead { text-align: center; margin-bottom: clamp(2rem, 6vw, 3.4rem); }
.masthead h1 {
  font-family: "Gowun Batang", serif; font-weight: 700;
  font-size: clamp(1.6rem, 5vw, 2.1rem); margin: 0 0 .5rem; text-wrap: balance;
}
.masthead p { margin: 0; color: var(--ink-soft); font-size: .95rem; }

.books { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(1.2rem, 3vw, 1.8rem);
         grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
.book a { display: grid; gap: .9rem; text-decoration: none; color: inherit; }
.book .thumb {
  aspect-ratio: 130 / 190; background: var(--surface);
  border: 1px solid var(--rule); border-radius: 3px; overflow: hidden;
  box-shadow: 0 12px 28px -18px rgba(10,20,30,.5);
  transition: transform .18s, box-shadow .18s;
}
.book a:hover .thumb { transform: translateY(-3px); box-shadow: 0 18px 34px -18px rgba(10,20,30,.6); }
.book .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.book .no { font-family: "IBM Plex Sans KR", sans-serif; font-size: .7rem;
            letter-spacing: .16em; color: var(--gold); }
.book h2 { font-family: "Gowun Batang", serif; font-size: 1.12rem; font-weight: 700;
           margin: .15rem 0 .2rem; line-height: 1.45; }
.book .meta { font-size: .82rem; color: var(--ink-faint); font-family: "IBM Plex Sans KR", sans-serif; }
.book .sum { font-size: .88rem; color: var(--ink-soft); line-height: 1.7; margin: .35rem 0 0; }
.empty { text-align: center; color: var(--ink-faint); padding: 4rem 1rem; }

/* ── 첫 화면 여는 글 ──────────────────────────────────
   표지 사진의 새벽빛을 아주 옅게 깔아 책들과 이어 붙인다. */
.hero {
  position: relative;
  padding: clamp(3.5rem, 12vw, 7rem) clamp(1.1rem, 5vw, 1.5rem) clamp(2.5rem, 7vw, 4rem);
  text-align: center;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute; inset: -30% -20% auto -20%; height: 70%;
  background: radial-gradient(60% 100% at 50% 0%,
              color-mix(in srgb, var(--gold) 16%, transparent) 0%,
              color-mix(in srgb, var(--sea) 8%, transparent) 45%,
              transparent 72%);
  pointer-events: none;
}
.hero > * { position: relative; }
.hero .brand {
  font-family: "IBM Plex Sans KR", sans-serif;
  font-size: .74rem; letter-spacing: .22em; color: var(--ink-faint);
  margin: 0 0 1.4rem; text-transform: uppercase;
}
.hero h1 {
  font-family: "Gowun Batang", serif; font-weight: 700;
  font-size: clamp(1.75rem, 5.6vw, 2.6rem); line-height: 1.5;
  margin: 0 auto; max-width: 22ch; text-wrap: balance;
}
.hero .sub {
  margin: 1.2rem auto 0; max-width: 30rem;
  color: var(--ink-soft); font-size: 1rem; line-height: 1.9;
}

.intro {
  max-width: 42rem; margin: 0 auto;
  padding: 0 clamp(1.1rem, 5vw, 1.5rem);
}
@media (min-width: 1200px) { .intro { max-width: 50rem; } }
.intro p { margin: 0 0 1.25em; line-height: 2.05; text-indent: 0; font-size: 1.03em; }
.intro .closing {
  margin-top: 2.2em; padding-top: 2.2em;
  border-top: 1px solid var(--rule);
}
.intro .sign {
  margin-top: 1.6em; text-align: right;
  font-family: "IBM Plex Sans KR", sans-serif;
  font-size: .99rem; letter-spacing: .12em; color: var(--ink-faint);
}

/* 목록 머리 */
.shelf-head {
  max-width: 60rem; margin: clamp(3.5rem, 10vw, 6rem) auto clamp(1.4rem, 4vw, 2.2rem);
  padding: 0 clamp(1rem, 4vw, 1.5rem);
  display: flex; align-items: baseline; gap: 1rem;
}
.shelf-head h2 {
  font-family: "IBM Plex Sans KR", sans-serif; font-weight: 500;
  font-size: .76rem; letter-spacing: .2em; color: var(--ink-faint);
  margin: 0; white-space: nowrap;
}
.shelf-head .line { flex: 1; height: 1px; background: var(--rule); }
.shelf-head .count {
  font-family: "IBM Plex Sans KR", sans-serif; font-size: .76rem; color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

.site-foot {
  max-width: 60rem; margin: clamp(4rem, 10vw, 7rem) auto 0;
  padding: 2.2rem clamp(1rem, 4vw, 1.5rem) 4rem;
  border-top: 1px solid var(--rule);
  text-align: center; font-family: "IBM Plex Sans KR", sans-serif;
  font-size: .8rem; line-height: 2; color: var(--ink-faint);
}
.site-foot a { color: var(--ink-soft); text-decoration: none; }
.site-foot a:hover { color: var(--ink); }

/* ── 리더 ──────────────────────────────────────────────── */
.cover-block { display: grid; place-items: center; gap: 1.4rem; text-align: center;
               padding: clamp(1.2rem, 5vw, 3rem) 1rem clamp(2rem, 6vw, 3.5rem); }
.cover-block img { display: block; width: auto; height: auto;
  max-width: min(100%, 25rem); max-height: 74vh; border-radius: 3px;
  box-shadow: 0 1px 2px rgba(10,20,30,.10), 0 18px 40px -18px rgba(10,20,30,.45); }
.cover-block .series { font-family: "IBM Plex Sans KR", sans-serif; font-size: .74rem;
                       letter-spacing: .16em; color: var(--ink-faint); margin: 0; }
.cover-block .author { color: var(--ink-soft); font-size: .95rem; margin: .35rem 0 0; }

.chapter { max-width: var(--measure); margin: 0 auto;
           padding: clamp(2rem, 7vw, 3.6rem) clamp(1.1rem, 5vw, 1.5rem) 0;
           scroll-margin-top: 4rem; }
.chapter + .chapter { border-top: 1px solid var(--rule); }
/* 본문은 워드처럼 글자 단위로 줄을 바꾸고 양쪽 맞춤한다. (사이트 전체는 어절 단위 keep-all 이라
   짧은 안내 글엔 좋지만, 긴 본문에서는 오른쪽 끝이 들쭉날쭉해진다)
   가운데 놓는 줄(제목·찬송·구절 표시)은 양쪽 맞춤에서 뺀다. */
.chapter p, .chapter .v { word-break: normal; text-align: justify; text-justify: inter-character; }
.chapter p.center, .chapter p.ref, .chapter p.hymn, .chapter p.hymn-title { text-align: center; }
.chapter .eyebrow { font-family: "IBM Plex Sans KR", sans-serif; font-size: .72rem;
                    font-weight: 500; letter-spacing: .18em; color: var(--gold); margin: 0 0 .35rem; }
.chapter h2 { font-family: "Gowun Batang", serif; font-weight: 700; font-size: 1.42em;
              line-height: 1.45; text-wrap: balance; margin: 0 0 1.4rem; }
.chapter p { margin: 0 0 1.05em; text-indent: 1em; }
.chapter p:first-of-type, .chapter p.center, .chapter p.ref,
.chapter p.hymn, .chapter p.hymn-title, .chapter .v { text-indent: 0; }

/* 설교 본문이 아닌 안내 글은 들여쓰기 없이 */
.chapter.flat p { text-indent: 0; }

.chapter .scripture { margin: 1.8em 0; padding: 1.1em 1.2em; background: var(--surface);
                      border-left: 2px solid var(--gold); border-radius: 0 4px 4px 0; }
.chapter .scripture .v { margin: 0 0 .55em; padding-left: 1.6em; font-size: .93em;
                         line-height: 1.8; color: var(--ink-soft); }
.chapter .scripture .v:last-child { margin-bottom: 0; }
.chapter .vn { display: inline-block; width: 1.6em; margin-left: -1.6em;
               font-family: "IBM Plex Sans KR", sans-serif; font-size: .78em; font-weight: 500;
               color: var(--gold); font-variant-numeric: tabular-nums; }
.chapter .ref { text-align: center; margin: 2em 0 .9em; font-family: "Gowun Batang", serif;
                font-weight: 700; font-size: .98em; }
.chapter .hymn-title { text-align: center; margin: .4em 0 1.4em; font-family: "Gowun Batang", serif;
                       font-weight: 700; font-size: 1em; }
.chapter .hymn { text-align: center; margin: 0 0 .5em; color: var(--ink-soft); }

.downloads { max-width: var(--measure); margin: 3rem auto 0; text-align: center;
             padding: 1.6rem clamp(1.1rem, 5vw, 1.5rem); font-family: "IBM Plex Sans KR", sans-serif; }
.downloads .label { font-size: .74rem; letter-spacing: .16em; color: var(--ink-faint); margin: 0 0 .9rem; }
.colophon { max-width: var(--measure); margin: 2rem auto 0; text-align: center;
            padding: 2.6rem clamp(1.1rem, 5vw, 1.5rem) 0; border-top: 1px solid var(--rule); }
.colophon .t { font-family: "Gowun Batang", serif; font-weight: 700; font-size: 1.1em; margin: 0; }
.colophon p { margin: .3em 0; }
.colophon .s { font-size: .86em; color: var(--ink-soft); }
.colophon .credits { margin-top: 2rem; font-family: "IBM Plex Sans KR", sans-serif;
                     font-size: .8rem; line-height: 2.1; color: var(--ink-faint); }

/* ── 차례 서랍 ─────────────────────────────────────────── */
.scrim { position: fixed; inset: 0; z-index: 40; background: var(--scrim);
         opacity: 0; pointer-events: none; transition: opacity .22s; }
.scrim.open { opacity: 1; pointer-events: auto; }
.toc { position: fixed; z-index: 41; top: 0; left: 0; bottom: 0; width: min(21rem, 86vw);
       background: var(--surface); border-right: 1px solid var(--rule);
       transform: translateX(-100%); transition: transform .24s ease;
       display: flex; flex-direction: column; }
.toc.open { transform: none; }
.toc header { display: flex; align-items: center; justify-content: space-between;
              padding: .9rem 1rem; border-bottom: 1px solid var(--rule);
              font-family: "IBM Plex Sans KR", sans-serif; font-size: .78rem;
              letter-spacing: .14em; color: var(--ink-faint); }
.toc ol { list-style: none; margin: 0; padding: .6rem 0 2rem; overflow-y: auto; }
.toc a { display: flex; gap: .8rem; align-items: baseline; padding: .62rem 1.1rem;
         color: var(--ink-soft); text-decoration: none; font-size: .94rem; line-height: 1.5; }
.toc a:hover { color: var(--ink); background: color-mix(in srgb, var(--sea) 8%, transparent); }
.toc a.here { color: var(--ink); box-shadow: inset 2px 0 0 var(--gold); }
.toc .tnum { font-family: "IBM Plex Sans KR", sans-serif; font-size: .74rem; color: var(--gold);
             width: 1.4rem; flex: none; font-variant-numeric: tabular-nums; }
.resume { position: fixed; z-index: 20; left: 50%; bottom: 1.2rem; transform: translate(-50%, 4rem);
          display: flex; gap: .7rem; align-items: center; padding: .55rem .7rem .55rem 1rem;
          background: var(--surface); border: 1px solid var(--rule); border-radius: 999px;
          box-shadow: 0 10px 30px -12px rgba(10,20,30,.5);
          font-family: "IBM Plex Sans KR", sans-serif; font-size: .82rem; color: var(--ink-soft);
          transition: transform .28s ease, opacity .28s; opacity: 0; }
.resume.show { transform: translate(-50%, 0); opacity: 1; }

/* ── 넓은 화면의 읽기 화면: 차례를 왼쪽에 늘 펼쳐 둔다 ──────────
   좁은 화면에서는 위 규칙 그대로 서랍으로 열린다. */
@media (min-width: 1200px) {
  body.reading .toc {
    transform: none;
    top: 3.4rem;                       /* 위 막대 아래에서 시작 */
    width: 19rem;
    background: transparent;
    border-right: 1px solid var(--rule);
  }
  body.reading .toc > header { display: none; }
  body.reading .toc ol { padding: 1.6rem 0 3rem; }
  body.reading .toc a { padding-left: 1.4rem; }
  body.reading .scrim { display: none; }
  body.reading #tocBtn { display: none; }
  body.reading main { margin-left: 19rem; }
  body.reading .resume { left: calc(50% + 9.5rem); }
}

/* ── 폼 · 관리자 ───────────────────────────────────────── */
.panel { max-width: 26rem; margin: clamp(2.5rem, 10vh, 6rem) auto; padding: 0 1.2rem; }
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: .7rem;
        padding: clamp(1.4rem, 4vw, 2rem); }
.card h1 { font-family: "Gowun Batang", serif; font-size: 1.35rem; margin: 0 0 .4rem; }
.card .lead { color: var(--ink-soft); font-size: .9rem; margin: 0 0 1.6rem; line-height: 1.7; }

/* align-content: start 가 없으면, 옆 칸에 도움말이 있어 키가 큰 경우
   이 칸의 입력상자가 늘어나 두 칸의 높이가 어긋난다. */
.field { display: grid; gap: .35rem; margin-bottom: 1.1rem; align-content: start; }
.field label { font-family: "IBM Plex Sans KR", sans-serif; font-size: .82rem; color: var(--ink-soft); }
.field .hint { font-family: "IBM Plex Sans KR", sans-serif; font-size: .76rem; color: var(--ink-faint); }
input[type=text], input[type=password], input[type=date], input[type=number],
input[type=file], textarea, select {
  width: 100%; padding: .6rem .7rem; font: inherit; font-size: .95rem;
  color: var(--ink); background: var(--paper);
  border: 1px solid var(--rule); border-radius: .45rem;
}
textarea { min-height: 6rem; line-height: 1.7; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--sea); outline-offset: 1px; border-color: var(--sea); }
.row { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-top: 1.4rem; }

.notice { padding: .8rem 1rem; border-radius: .5rem; margin-bottom: 1.2rem;
          font-family: "IBM Plex Sans KR", sans-serif; font-size: .87rem; line-height: 1.6; }
.notice.ok  { background: color-mix(in srgb, var(--sea) 10%, transparent); color: var(--ink); }
.notice.bad { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--ink); }

.admin-wrap { max-width: 58rem; margin: 0 auto; padding: 2rem clamp(1rem, 4vw, 1.5rem) 5rem; }
.admin-head { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.6rem; }
.admin-head h1 { font-family: "Gowun Batang", serif; font-size: 1.5rem; margin: 0; flex: 1; }
table.list { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.list th, table.list td { text-align: left; padding: .75rem .6rem; border-bottom: 1px solid var(--rule); vertical-align: middle; }
table.list th { font-family: "IBM Plex Sans KR", sans-serif; font-size: .76rem; letter-spacing: .08em;
                color: var(--ink-faint); font-weight: 500; }
table.list td.num { font-variant-numeric: tabular-nums; color: var(--ink-soft); white-space: nowrap; }
table.list .title { font-family: "Gowun Batang", serif; font-weight: 700; }
table.list .tools { display: flex; gap: .4rem; justify-content: flex-end; }
.pill { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .74rem;
        font-family: "IBM Plex Sans KR", sans-serif; border: 1px solid var(--rule); color: var(--ink-soft); }
.pill.on { color: var(--sea); border-color: color-mix(in srgb, var(--sea) 45%, var(--rule)); }
.scroll-x { overflow-x: auto; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
html { scroll-behavior: smooth; }

/* ═══════════════════════════════════════════════════════════
   첫 화면 (시안 구조: 머리말 · 큰 그림 · 네 칸 · 진열 · 구독 띠 · 꼬리말)
   ═══════════════════════════════════════════════════════════ */

/* ── 머리말 ── */
.head {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.head-in {
  max-width: 74rem; margin: 0 auto;
  display: flex; align-items: center; gap: 1.2rem;
  padding: .7rem clamp(1rem, 4vw, 1.6rem);
}
.logo { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: inherit; flex: none; }
.logo .mark {
  width: 2.1rem; height: 2.1rem; flex: none; border-radius: .4rem;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--green) 12%, transparent);
  color: var(--green); font-size: 1.1rem;
}
.logo .mark img { width: 100%; height: 100%; object-fit: contain; border-radius: .4rem; }
/* 이름과 부제 상자. 줄 높이를 정해 두지 않으면 본문 기본값(1.9배)을 물려받아
   상자가 아이콘보다 훨씬 커지고, 그러면 이름이 아이콘 위로 뜬다. */
.logo-text { display: flex; flex-direction: column; justify-content: center; line-height: 1.25; }
.logo .name { display: block; font-family: "Gowun Batang", serif; font-weight: 700;
              font-size: 1.05rem; line-height: 1.25; }
.logo .sub { display: block; font-family: "IBM Plex Sans KR", sans-serif;
             font-size: .68rem; line-height: 1.3; color: var(--ink-faint); margin-top: .05rem; }

.nav { display: flex; gap: .3rem; flex: 1; }
.nav a {
  font-family: "IBM Plex Sans KR", sans-serif; font-size: .88rem;
  color: var(--ink-soft); text-decoration: none; padding: .5rem .7rem; border-radius: .4rem;
}
.nav a:hover { color: var(--ink); background: var(--band); }
.nav a.on { color: var(--ink); font-weight: 500; }

/* margin-left:auto 가 있어야 좁은 화면에서도 오른쪽 끝에 붙는다.
   (넓은 화면에서는 가운데 메뉴가 밀어 주지만, 모바일에서는 그 메뉴가 숨겨진다) */
.head-tools { display: flex; align-items: center; gap: .5rem; flex: none; margin-left: auto; }
.search { position: relative; }
.search input {
  width: 11rem; padding: .5rem 2.1rem .5rem .8rem;
  border: 1px solid var(--rule); border-radius: 999px; background: var(--band);
  font-family: "IBM Plex Sans KR", sans-serif; font-size: .82rem; color: var(--ink);
}
.search button {
  position: absolute; right: .25rem; top: 50%; transform: translateY(-50%);
  border: 0; background: none; cursor: pointer; color: var(--ink-faint);
  padding: .3rem .45rem; font-size: .9rem;
}
.burger { display: none; }
.mobile-nav {
  display: none; border-top: 1px solid var(--rule); background: var(--paper);
  padding: .5rem clamp(1rem, 4vw, 1.6rem) 1rem;
}
.mobile-nav.open { display: block; }
.mobile-nav a {
  display: block; padding: .7rem .2rem; text-decoration: none; color: var(--ink-soft);
  font-family: "IBM Plex Sans KR", sans-serif; font-size: .92rem;
  border-bottom: 1px solid var(--rule);
}
.mobile-nav a:last-child { border-bottom: 0; }

/* ── 큰 그림 ── */
.banner { background: var(--band); border-bottom: 1px solid var(--rule); }
.banner-in {
  max-width: 74rem; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1fr; align-items: center;
  min-height: 20rem;
}
.banner-copy { padding: clamp(2.2rem, 6vw, 4rem) clamp(1.2rem, 4vw, 2.5rem); }
.banner h1 {
  font-family: "Gowun Batang", serif; font-weight: 700;
  font-size: clamp(1.6rem, 3.6vw, 2.35rem); line-height: 1.5; margin: 0 0 1.1rem;
  text-wrap: balance;
}
.banner p { margin: 0 0 1.8rem; color: var(--ink-soft); line-height: 1.9; }
.banner .cta { display: flex; gap: .7rem; flex-wrap: wrap; }
.banner .cta .btn { min-height: 2.7rem; padding: .72rem 1.4rem .6rem; border-radius: 999px; font-size: .88rem; }
.banner-photo { align-self: stretch; min-height: 14rem; position: relative; overflow: hidden; }
.banner-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.banner-photo.empty {
  background: linear-gradient(140deg,
    color-mix(in srgb, var(--green) 22%, var(--band)),
    color-mix(in srgb, var(--gold) 16%, var(--band)));
}

/* ── 네 칸 안내 ── */
.feats { border-bottom: 1px solid var(--rule); background: var(--paper); }
.feats-in {
  max-width: 74rem; margin: 0 auto; padding: 1.5rem clamp(1rem, 4vw, 1.6rem);
  display: grid; gap: 1.2rem; grid-template-columns: repeat(4, 1fr);
}
.feat { display: flex; gap: .8rem; align-items: flex-start; }
.feat .ic {
  width: 2.2rem; height: 2.2rem; flex: none; border-radius: .5rem;
  display: grid; place-items: center; font-size: 1.05rem;
  background: var(--band); color: var(--green);
}
.feat b { display: block; font-family: "IBM Plex Sans KR", sans-serif; font-size: .88rem; font-weight: 500; }
.feat span { font-family: "IBM Plex Sans KR", sans-serif; font-size: .78rem; color: var(--ink-faint); line-height: 1.6; }

/* ── 진열 ── */
.shelf { max-width: 74rem; margin: 0 auto; padding: clamp(2.4rem, 6vw, 3.6rem) clamp(1rem, 4vw, 1.6rem); }
.shelf-top { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 1.4rem; }
.shelf-top h2 { font-family: "Gowun Batang", serif; font-size: 1.35rem; font-weight: 700; margin: 0; }
.shelf-top a {
  font-family: "IBM Plex Sans KR", sans-serif; font-size: .82rem;
  color: var(--ink-soft); text-decoration: none;
}
.shelf-top a:hover { color: var(--ink); }
.grid { display: grid; gap: clamp(1rem, 2.5vw, 1.6rem); grid-template-columns: repeat(4, 1fr); }
.grid.wide { grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); }

.card a { display: block; text-decoration: none; color: inherit; }
.card .shot {
  position: relative;
  aspect-ratio: 130 / 190; border-radius: 4px; overflow: hidden;
  background: var(--band); border: 1px solid var(--rule);
  box-shadow: 0 10px 24px -16px rgba(20,30,25,.45);
  transition: transform .18s, box-shadow .18s;
}
.card a:hover .shot { transform: translateY(-3px); box-shadow: 0 16px 30px -16px rgba(20,30,25,.55); }
.card .shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card h3 {
  font-family: "Gowun Batang", serif; font-size: .98rem; font-weight: 700;
  margin: .8rem 0 .2rem; line-height: 1.45;
}
.card .by { font-family: "IBM Plex Sans KR", sans-serif; font-size: .78rem; color: var(--ink-faint); }
.card .price {
  font-family: "IBM Plex Sans KR", sans-serif; font-size: .92rem; font-weight: 500;
  margin-top: .35rem; font-variant-numeric: tabular-nums;
}
.card .price .free { color: var(--green); }
.card .own {
  display: inline-block; margin-top: .35rem; padding: .1rem .5rem; border-radius: 999px;
  font-family: "IBM Plex Sans KR", sans-serif; font-size: .72rem;
  color: var(--green); border: 1px solid color-mix(in srgb, var(--green) 40%, var(--rule));
}

/* ── 구독 띠 ── */
.band-cta { background: var(--green); color: #fff; }
:root[data-theme="dark"] .band-cta { color: #0E1512; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .band-cta { color: #0E1512; }
}
.band-in {
  max-width: 74rem; margin: 0 auto; padding: 1.8rem clamp(1rem, 4vw, 1.6rem);
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
}
.band-cta .txt b { display: block; font-family: "Gowun Batang", serif; font-size: 1.05rem; margin-bottom: .3rem; }
.band-cta .txt span { font-family: "IBM Plex Sans KR", sans-serif; font-size: .82rem; opacity: .82; }
.band-cta form { display: flex; gap: .5rem; flex: none; flex-wrap: wrap; justify-content: flex-end; }
.band-cta .consent { flex-basis: 100%; font-family: "IBM Plex Sans KR", sans-serif;
                     font-size: .72rem; opacity: .7; text-align: right; line-height: 1.5; max-width: 26rem; }
.band-cta input {
  width: 15rem; max-width: 46vw; padding: .6rem .9rem; border-radius: .4rem;
  border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.14); color: inherit;
  font-family: "IBM Plex Sans KR", sans-serif; font-size: .85rem;
}
.band-cta input::placeholder { color: currentColor; opacity: .6; }
.band-cta button {
  padding: .6rem 1.1rem; border-radius: .4rem; border: 0; cursor: pointer;
  background: #fff; color: var(--green);
  font-family: "IBM Plex Sans KR", sans-serif; font-size: .85rem; font-weight: 500;
}

/* ── 꼬리말 ── */
.foot { background: var(--band); border-top: 1px solid var(--rule); }
.foot-in {
  max-width: 74rem; margin: 0 auto; padding: 2.4rem clamp(1rem, 4vw, 1.6rem) 3rem;
  display: grid; gap: 1.6rem; grid-template-columns: minmax(0,1fr) auto; align-items: start;
}
.foot .links { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.foot .links a {
  font-family: "IBM Plex Sans KR", sans-serif; font-size: .82rem;
  color: var(--ink-soft); text-decoration: none;
}
.foot .links a:hover { color: var(--ink); }
.foot .biz {
  margin-top: 1rem; font-family: "IBM Plex Sans KR", sans-serif;
  font-size: .76rem; line-height: 1.9; color: var(--ink-faint);
}
.foot .about { margin: .8rem 0 0; font-size: .85rem; color: var(--ink-soft); line-height: 1.8; max-width: 34rem; }

/* ── 좁은 화면 ── */
@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .feats-in { grid-template-columns: repeat(2, 1fr); }
  .banner-in { grid-template-columns: 1fr; }
  .banner-photo { order: -1; min-height: 11rem; aspect-ratio: 16/9; }
}
/* 머리말 메뉴를 햄버거로 접는 기준. 태블릿 세로(744~834px)는 메뉴가 다 들어가므로 PC 처럼 두고,
   휴대폰(대개 430px 이하)과 그 언저리에서만 접는다. */
@media (max-width: 900px) {
  .nav a { white-space: nowrap; }        /* 태블릿에서 '소책자 몰' 이 두 줄로 꺾이지 않게 */
  .search input { width: 9rem; }
}
@media (max-width: 740px) {
  .nav { display: none; }
  .burger { display: inline-flex; }
  .search input { width: 8rem; }
}
@media (max-width: 560px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  /* 머리말이 화면보다 길어져 옆으로 넘치던 문제:
     글자 단추(내 서재·로그인·로그아웃·관리)는 햄버거 메뉴로 옮기고,
     로고는 줄어들 수 있게 하고 부제는 감춘다. */
  .head-in { gap: .5rem; min-width: 0; padding-left: .8rem; padding-right: .8rem; }
  .logo { flex: 1 1 auto; min-width: 0; }
  .logo-text { min-width: 0; }
  .logo .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .logo .sub { display: none; }
  .head-tools { gap: .25rem; }
  .head-tools .btn { padding-left: .45rem; padding-right: .45rem; }
  .head-tools .btn .lbl { display: none; }        /* 글자는 감추고 아이콘만 */
  .head-tools .btn i { margin: 0; }
  .search { display: none; }
  .band-in { flex-direction: column; align-items: stretch; }
  .band-cta form { width: 100%; }
  .band-cta input { flex: 1; max-width: none; }
  .foot-in { grid-template-columns: 1fr; }
}


/* ═══════════════════════════════════════════════════════════
   책 한 권 화면 · 장바구니 · 주문서
   ═══════════════════════════════════════════════════════════ */

/* 장바구니 개수 */
.cart-n { font-variant-numeric: tabular-nums; font-weight: 500; color: var(--green); }

/* 책 한 권 화면 */
.detail { display: grid; gap: clamp(1.5rem, 4vw, 3rem); grid-template-columns: minmax(0, 16rem) minmax(0, 1fr); align-items: start; }
.detail-cover { aspect-ratio: 130/190; border: 1px solid var(--rule); border-radius: 4px; overflow: hidden;
                background: var(--band); box-shadow: 0 14px 30px -18px rgba(20,30,25,.5); }
.detail-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.detail-info .eyebrow { font-family: "IBM Plex Sans KR", sans-serif; font-size: .72rem;
                        letter-spacing: .16em; color: var(--gold); margin: 0 0 .4rem; }
.detail-info h1 { font-family: "Gowun Batang", serif; font-size: clamp(1.5rem, 4vw, 1.9rem);
                  line-height: 1.4; margin: 0 0 .5rem; }
.detail-info .sub { color: var(--ink-soft); margin: 0 0 1.4rem; }
.detail-info .summary { line-height: 1.9; margin: 0 0 1.4rem; }
.detail-info .facts { font-family: "IBM Plex Sans KR", sans-serif; font-size: .85rem;
                      color: var(--ink-faint); margin: 0 0 1.6rem; }

.picks { border: 0; padding: 0; margin: 0 0 1.2rem; display: grid; gap: .7rem; }
.picks legend { font-family: "IBM Plex Sans KR", sans-serif; font-size: .78rem;
                letter-spacing: .1em; color: var(--ink-faint); padding: 0; margin-bottom: .7rem; }
.pick { display: flex; align-items: center; gap: .9rem; padding: 1rem 1.1rem;
        border: 1px solid var(--rule); border-radius: .6rem; cursor: pointer;
        transition: border-color .15s, background .15s; }
.pick:hover { border-color: var(--ink-faint); }
.pick:has(input:checked) { border-color: var(--green); background: color-mix(in srgb, var(--green) 6%, transparent); }
.pick.off { opacity: .5; cursor: not-allowed; }
.pick input { width: auto; flex: none; accent-color: var(--green); }
.pick-body { flex: 1; display: grid; gap: .2rem; }
.pick-body b { font-family: "IBM Plex Sans KR", sans-serif; font-size: .95rem; font-weight: 500; }
.pick-note { font-family: "IBM Plex Sans KR", sans-serif; font-size: .78rem; color: var(--ink-faint); line-height: 1.6; }
.pick-price { font-family: "IBM Plex Sans KR", sans-serif; font-size: 1.05rem; font-weight: 500;
              white-space: nowrap; font-variant-numeric: tabular-nums; }

.qty-row { display: flex; align-items: center; gap: .7rem; margin-bottom: 1.2rem; }
.qty-row label { font-family: "IBM Plex Sans KR", sans-serif; font-size: .85rem; color: var(--ink-soft); }
.qty-row input { width: 5rem; }

/* 장바구니 */
.cart-list { list-style: none; margin: 0 0 2rem; padding: 0; }
.cart-item { display: grid; grid-template-columns: 4.5rem minmax(0,1fr) auto; gap: 1.2rem;
             align-items: start; padding: 1.2rem 0; border-bottom: 1px solid var(--rule); }
.ci-cover { aspect-ratio: 130/190; border: 1px solid var(--rule); border-radius: 3px;
            overflow: hidden; background: var(--band); }
.ci-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ci-title { font-family: "Gowun Batang", serif; font-weight: 700; font-size: 1.05rem;
            color: inherit; text-decoration: none; }
.ci-title:hover { text-decoration: underline; }
.ci-kind { font-family: "IBM Plex Sans KR", sans-serif; font-size: .8rem;
           color: var(--ink-faint); margin: .3rem 0 0; }
.ci-qty { display: flex; align-items: center; gap: .5rem; margin-top: .7rem; }
.ci-qty label { font-family: "IBM Plex Sans KR", sans-serif; font-size: .8rem; color: var(--ink-soft); }
.ci-qty input { width: 4.5rem; }
.ci-price { text-align: right; display: grid; gap: .4rem; justify-items: end; }
.ci-price b { font-family: "IBM Plex Sans KR", sans-serif; font-size: 1.05rem;
              font-variant-numeric: tabular-nums; }

.cart-sum { background: var(--band); border: 1px solid var(--rule); border-radius: .7rem; padding: 1.4rem; }
.cart-sum .row { display: flex; justify-content: space-between; align-items: center;
                 grid-template-columns: none; gap: 1rem; padding: .45rem 0;
                 font-family: "IBM Plex Sans KR", sans-serif; font-size: .92rem; }
.cart-sum .row b { font-variant-numeric: tabular-nums; }
.cart-sum .row.total { border-top: 1px solid var(--rule); margin-top: .5rem; padding-top: .9rem; }
.cart-sum .row.total b { font-size: 1.25rem; font-weight: 700; }

/* 주문서 · 주문 내역 공용 줄 */
.row-line { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
            padding: .4rem 0; font-family: "IBM Plex Sans KR", sans-serif; font-size: .9rem; }
.row-line b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-line .hint { display: block; font-size: .76rem; }
.row-line.total { border-top: 1px solid var(--rule); margin-top: .5rem; padding-top: .8rem; }
.row-line.total b { font-size: 1.1rem; }

/* 주문 카드 (관리자 · 내 서재) */
.orders { display: grid; gap: 1.2rem; }
.order-card { margin-bottom: 1.2rem; }
.order-top { display: flex; justify-content: space-between; align-items: center;
             gap: 1rem; flex-wrap: wrap; padding-bottom: .8rem; border-bottom: 1px solid var(--rule); }
.order-items { padding-top: .6rem; }
.order-ship { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--rule); }
.order-ship .addr { font-family: "IBM Plex Sans KR", sans-serif; font-size: .88rem;
                    line-height: 1.8; margin: 0 0 .8rem; }
.ship-form { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

@media (max-width: 700px) {
  .detail { grid-template-columns: 1fr; }
  .detail-cover { max-width: 14rem; }
  .cart-item { grid-template-columns: 3.5rem minmax(0,1fr); }
  .ci-price { grid-column: 2; justify-items: start; text-align: left; }
}


/* ═══ 할인 표시 ═══ */
.sale-badge {
  position: absolute; top: .5rem; left: .5rem; z-index: 1;
  display: flex; align-items: baseline; gap: .18em;
  padding: .3rem .5rem .32rem; border-radius: .35rem;
  background: var(--gold); color: var(--on-gold);
  font-family: "IBM Plex Sans KR", sans-serif; font-size: .82rem; font-weight: 600;
  line-height: 1; font-variant-numeric: tabular-nums;
  box-shadow: 0 4px 12px -4px rgba(20, 30, 25, .55);
}
.sale-badge small { font-size: .64rem; font-weight: 400; opacity: .85; }

.pct { color: var(--gold); font-weight: 600; }
.was { color: var(--ink-faint); font-weight: 400; text-decoration-thickness: 1px; }

.sale-flag {
  display: inline-block; vertical-align: middle; margin-left: .5rem;
  padding: .22rem .55rem .26rem; border-radius: .35rem;
  background: var(--gold); color: var(--on-gold);
  font-family: "IBM Plex Sans KR", sans-serif; font-size: .72rem; font-weight: 500;
  letter-spacing: .02em; line-height: 1.4;
}
.pick-price .pct { display: block; font-size: .78rem; }
.pick-price .was { display: block; font-size: .78rem; }


/* 우편번호 + 찾기 단추 */
.zip-row { display: flex; gap: .5rem; align-items: center; }
.zip-row input { max-width: 9rem; }
.zip-row .btn { flex: none; white-space: nowrap; }


/* 우편번호 찾기 겹침창 */
.zip-layer { position: fixed; inset: 0; z-index: 1000; background: var(--scrim);
             display: flex; align-items: center; justify-content: center; padding: 1rem; }
/* hidden 표시가 붙어 있으면 반드시 감춘다. 위의 display:flex 가 브라우저 기본 규칙을 이기기 때문에
   이 줄이 없으면 겹침창이 처음부터 화면을 덮어 버린다. */
.zip-layer[hidden] { display: none !important; }
.zip-panel { width: min(100%, 32rem); height: min(100%, 36rem); background: var(--surface);
             border-radius: .8rem; overflow: hidden; display: flex; flex-direction: column;
             box-shadow: 0 30px 60px -20px rgba(0,0,0,.5); }
.zip-head { display: flex; justify-content: space-between; align-items: center;
            padding: .7rem .7rem .7rem 1.1rem; border-bottom: 1px solid var(--rule);
            font-family: "IBM Plex Sans KR", sans-serif; font-weight: 500; }
.zip-box { flex: 1; min-height: 0; }
@media (max-width: 600px) {
  .zip-layer { padding: 0; }
  .zip-panel { width: 100%; height: 100%; border-radius: 0; }
}
