/* ============================================================
   공유서재 — 스타일시트
   색과 서체는 아래 :root 값만 고치면 사이트 전체에 반영됩니다.
   ============================================================ */

:root {
  --ink: #14181a;
  --ink-soft: #3a4246;
  --ink-faint: #6d7671;
  --paper: #eceeec;
  --paper-raised: #f8f9f7;
  --rule: #cbd0cb;
  --verdigris: #2c6b5e;
  --verdigris-deep: #1e4a42;

  --face-masthead: "EB Garamond", "Gowun Batang", "Nanum Myeongjo", serif;
  --face-display: "Gowun Batang", "Nanum Myeongjo", "Apple SD Gothic Neo", serif;
  --face-latin: "EB Garamond", Georgia, serif;
  --face-body: "IBM Plex Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --face-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;

  --col: 54rem;
  --gutter: 1.75rem;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--face-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: -0.003em;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

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

.wrap {
  max-width: var(--col);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 20;
  background: var(--ink);
  color: var(--paper-raised);
  padding: 0.6rem 1rem;
  border-radius: 2px;
}

/* ---------- 상단 ---------- */

.topbar {
  border-bottom: 1px solid var(--rule);
}

.topbar-inner {
  max-width: var(--col);
  margin: 0 auto;
  padding: 1rem var(--gutter);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.topbar-mark {
  font-family: var(--face-latin);
  font-size: 1.125rem;
  text-decoration: none;
  letter-spacing: 0.16em;
}

.topbar-nav {
  display: flex;
  gap: 1.25rem;
  font-size: 0.8125rem;
  color: var(--ink-faint);
}

.topbar-nav a {
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}

.topbar-nav a:hover {
  color: var(--ink);
  border-bottom-color: var(--verdigris);
}

/* ---------- 표제부 ---------- */

.masthead {
  padding: 5.5rem 0 3rem;
}

.masthead-title {
  font-family: var(--face-masthead);
  font-weight: 400;
  font-size: clamp(2.375rem, 7.5vw, 3.75rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0 0 1.25rem;
  max-width: 12ch;
}

.masthead-tagline {
  font-size: 1.0625rem;
  color: var(--ink-soft);
  max-width: 34rem;
  margin: 0;
}

.masthead-meta {
  margin-top: 2.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
  font-family: var(--face-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  text-transform: uppercase;
}

.masthead-meta strong {
  color: var(--verdigris);
  font-weight: 400;
}

/* ---------- 책 목록 ---------- */

.shelf {
  padding-bottom: 4rem;
}

.entry {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 1.5rem;
  padding: 2.25rem 0;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
}

.entry:first-child {
  border-top: 1px solid var(--rule);
}

.entry:hover .entry-title {
  color: var(--verdigris);
}

.entry:hover .plate {
  transform: translateY(-3px);
}

/* 표지 */

.plate {
  width: 4.5rem;
  aspect-ratio: 5 / 7;
  border-radius: 1px;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(20, 24, 26, 0.18), 0 6px 14px -8px rgba(20, 24, 26, 0.4);
  transition: transform 200ms ease;
}

.plate-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.plate-auto {
  width: 100%;
  height: 100%;
  padding: 0.55rem 0.5rem;
  display: flex;
  align-items: flex-end;
  background: var(--ink);
  color: var(--paper-raised);
  font-family: var(--face-display);
  font-size: 0.6875rem;
  line-height: 1.35;
  letter-spacing: -0.01em;
  border-top: 3px solid var(--verdigris);
  overflow: hidden;
}

.plate-auto.tone-b {
  background: var(--verdigris-deep);
  border-top-color: var(--paper);
}

/* 본문 */

.entry-title {
  font-family: var(--face-display);
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1.35;
  letter-spacing: -0.015em;
  margin: -0.35rem 0 0.2rem;
  transition: color 150ms ease;
}

.entry-sub {
  font-family: var(--face-display);
  font-weight: 400;
  font-size: 1.0625rem;
  color: var(--ink-soft);
  margin: 0 0 0.45rem;
}

.entry-orig {
  font-family: var(--face-latin);
  font-size: 1.0625rem;
  font-style: italic;
  color: var(--ink-faint);
  margin: 0 0 0.75rem;
}

.entry-byline {
  font-size: 0.875rem;
  color: var(--ink-soft);
  margin: 0;
}

.entry-byline span {
  color: var(--ink-faint);
}

/* ---------- 책 상세 ---------- */

.detail {
  padding: 3.5rem 0 4rem;
}

.back {
  font-family: var(--face-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  text-decoration: none;
  text-transform: uppercase;
}

.back:hover {
  color: var(--verdigris);
}

.detail-head {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 2.5rem;
  margin-top: 2.5rem;
  align-items: start;
}

.detail-head .plate {
  width: 8.5rem;
}

.detail-head .plate-auto {
  font-size: 1rem;
  padding: 1rem 0.9rem;
  border-top-width: 5px;
}

.detail-title {
  font-family: var(--face-display);
  font-weight: 700;
  font-size: clamp(2.125rem, 7vw, 3.25rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: -0.5rem 0 0.35rem;
}

.detail-sub {
  font-family: var(--face-display);
  font-size: 1.25rem;
  color: var(--ink-soft);
  margin: 0 0 0.6rem;
}

.detail-orig {
  font-family: var(--face-latin);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--ink-faint);
  margin: 0 0 1.75rem;
}

/* 서지 항목 */

.meta {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 0 1.25rem;
  margin: 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}

.meta-k {
  font-size: 0.8125rem;
  color: var(--ink-faint);
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(203, 208, 203, 0.55);
}

.meta-v {
  font-size: 0.9375rem;
  color: var(--ink);
  margin: 0;
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(203, 208, 203, 0.55);
}

.meta-k:last-of-type,
.meta-v:last-of-type {
  border-bottom: 0;
}

.detail-byline {
  font-size: 0.9375rem;
  color: var(--ink-soft);
  margin: 0;
}

.detail-summary {
  margin: 3rem 0 0;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
  max-width: 40rem;
}

.detail-summary p {
  font-size: 1.0625rem;
  line-height: 1.9;
  color: var(--ink-soft);
  margin: 0 0 1.35rem;
}

.detail-summary p:last-child {
  margin-bottom: 0;
}

/* 내려받기 */

.downloads {
  margin-top: 2.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.dl {
  display: inline-flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.7rem 1.25rem;
  background: var(--ink);
  color: var(--paper-raised);
  text-decoration: none;
  border-radius: 2px;
  font-size: 0.9375rem;
  transition: background 150ms ease;
}

.dl:hover {
  background: var(--verdigris);
}

.dl-size {
  font-family: var(--face-mono);
  font-size: 0.6875rem;
  opacity: 0.66;
  letter-spacing: 0.04em;
}

.dl-note {
  margin-top: 1rem;
  font-size: 0.8125rem;
  color: var(--ink-faint);
}

/* ---------- 소개 ---------- */

.page {
  padding: 4rem 0;
  max-width: 38rem;
}

.page-title {
  font-family: var(--face-display);
  font-weight: 700;
  font-size: clamp(2rem, 6vw, 2.75rem);
  letter-spacing: -0.02em;
  margin: 0 0 2rem;
}

.page p {
  font-size: 1.0625rem;
  line-height: 1.9;
  color: var(--ink-soft);
}

/* ---------- 바닥 ---------- */

.foot {
  border-top: 1px solid var(--rule);
  padding: 2.5rem 0 3.5rem;
  font-size: 0.8125rem;
  color: var(--ink-faint);
}

.foot p {
  margin: 0 0 0.4rem;
}

.foot a {
  color: var(--verdigris);
}

/* ---------- 좁은 화면 ---------- */

@media (max-width: 34rem) {
  :root {
    --gutter: 1.25rem;
  }

  .masthead {
    padding: 3.5rem 0 2.25rem;
  }

  .entry {
    grid-template-columns: 3.5rem 1fr;
    gap: 1.1rem;
    padding: 1.75rem 0;
  }

  .plate {
    width: 3.5rem;
  }

  .plate-auto {
    font-size: 0.5625rem;
    padding: 0.4rem 0.35rem;
    border-top-width: 2px;
  }

  .entry-title {
    font-size: 1.25rem;
  }

  .entry-orig,
  .entry-sub {
    font-size: 0.9375rem;
  }

  .detail-head {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  .detail-head .plate {
    width: 7rem;
  }

}

@media (prefers-reduced-motion: reduce) {
  .plate,
  .dl,
  .entry-title {
    transition: none !important;
  }
}

/* ============================================================
   가-하 색인
   ============================================================ */

.index-bars {
  margin: 0 0 2.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--rule);
}

.index-row {
  display: grid;
  grid-template-columns: 2.75rem 1fr;
  align-items: start;
  gap: 0.6rem;
}

.index-row + .index-row {
  margin-top: 0.4rem;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(203, 208, 203, 0.5);
}

.index-label {
  font-family: var(--face-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  padding-top: 0.85rem;
}

.index-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.chip {
  font-family: var(--face-display);
  font-size: 0.9375rem;
  line-height: 1;
  min-width: 2.125rem;
  padding: 0.5rem 0.55rem;
  border: 1px solid transparent;
  border-radius: 2px;
  background: none;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}

.chip:first-child {
  font-family: var(--face-body);
  font-size: 0.8125rem;
  padding-left: 0.7rem;
  padding-right: 0.7rem;
  margin-right: 0.4rem;
}

.chip:hover:not(:disabled) {
  background: rgba(44, 107, 94, 0.1);
  color: var(--verdigris);
}

.chip.is-on {
  background: var(--ink);
  color: var(--paper-raised);
}

.chip.is-empty {
  color: var(--rule);
  cursor: default;
}

/* 묶음 표시 */

.group + .group {
  margin-top: 2.75rem;
}

.group-mark {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 1.5rem;
  align-items: center;
  margin-bottom: 0.25rem;
}

.group-mark span {
  font-family: var(--face-display);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--verdigris);
  text-align: center;
  line-height: 1;
}

.group-mark::after {
  content: "";
  height: 1px;
  background: var(--rule);
}

.group .entry:first-of-type {
  border-top: none;
}

.empty {
  padding: 3rem 0;
  color: var(--ink-faint);
  text-align: center;
}

/* 목록 항목 간소화 — 표지·제목·원서 제목·저자만 */

.entry-orig {
  margin-bottom: 0.35rem;
}

.entry-byline {
  font-size: 0.875rem;
  color: var(--ink-faint);
}

@media (max-width: 34rem) {
  .group-mark {
    grid-template-columns: 3.5rem 1fr;
    gap: 1.1rem;
  }
  .group-mark span {
    font-size: 1.25rem;
  }
  .chip {
    min-width: 1.9rem;
    padding: 0.45rem 0.4rem;
  }
  .index-row {
    grid-template-columns: 2.25rem 1fr;
    gap: 0.4rem;
  }
  .index-label {
    font-size: 0.625rem;
    padding-top: 0.8rem;
  }
}

@media (max-width: 34rem) {
  .meta {
    grid-template-columns: 6rem 1fr;
    gap: 0 0.9rem;
  }
  .meta-k {
    font-size: 0.75rem;
  }
  .meta-v {
    font-size: 0.875rem;
  }
}
