/* Malggu Reading — library + reader on portal chrome */

.page-reading {
  --read-paper: #f3efe6;
  --read-ink: #1c1914;
  --read-muted: #5c564c;
  --read-accent: #c9a227;
  --read-card: rgba(255, 255, 255, 0.05);
  --read-line: rgba(255, 255, 255, 0.12);
}

.reading-shell {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 72px;
  position: relative;
  z-index: 1;
}

.reading-intro {
  margin-bottom: 28px;
  max-width: 40rem;
}

.reading-eyebrow {
  margin: 0 0 8px;
  color: var(--read-accent);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 700;
}

.reading-title {
  margin: 0 0 10px;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.15;
  color: #fff;
  font-weight: 750;
}

.reading-sub {
  margin: 0;
  color: var(--muted, #b7b3c7);
  line-height: 1.55;
  font-size: 1.02rem;
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 900px) {
  .book-grid { grid-template-columns: 1fr; }
}

.book-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 18px 16px;
  border-radius: 18px;
  border: 1px solid var(--read-line);
  background:
    linear-gradient(160deg, rgba(201, 162, 39, 0.12), transparent 42%),
    var(--read-card);
  text-align: left;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.book-card:hover,
.book-card:focus-visible {
  border-color: rgba(201, 162, 39, 0.55);
  transform: translateY(-2px);
  outline: none;
}

.book-card-kicker {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--read-accent);
  font-weight: 700;
}

.book-card-title {
  margin: 0;
  font-size: 1.35rem;
  color: #fff;
}

.book-card-en {
  margin: 0;
  color: var(--muted, #b7b3c7);
  font-size: 0.92rem;
}

.book-card-blurb {
  margin: 0;
  color: #d9d5e8;
  line-height: 1.5;
  font-size: 0.95rem;
  flex: 1;
}

.book-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.book-chip {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--read-line);
  font-size: 0.78rem;
  color: #efeaf8;
}

.book-card-cta {
  margin-top: 6px;
  align-self: flex-start;
  padding: 10px 14px;
  border-radius: 12px;
  border: none;
  background: #e8c547;
  color: #1a1408;
  font-weight: 700;
  font-size: 0.92rem;
}

.reading-legal {
  margin: 28px 0 0;
  color: var(--muted, #8f8a9d);
  font-size: 0.82rem;
  line-height: 1.5;
  max-width: 48rem;
}

/* Reader */
.reader-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-bottom: 18px;
}

.reader-back,
.tool-btn,
.pager-btn {
  border: 1px solid var(--read-line);
  background: rgba(255, 255, 255, 0.04);
  color: #f4f0ff;
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  font: inherit;
}

.reader-back:hover,
.tool-btn:hover,
.pager-btn:hover {
  border-color: rgba(201, 162, 39, 0.5);
}

.reader-meta { flex: 1; min-width: 180px; }
.reader-book-title { margin: 0; color: #fff; font-size: 1.25rem; }
.reader-book-sub { margin: 4px 0 0; color: var(--muted, #b7b3c7); font-size: 0.88rem; }
.reader-tools { display: flex; gap: 8px; }

.reader-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

@media (max-width: 800px) {
  .reader-layout { grid-template-columns: 1fr; }
}

.chapter-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--read-line);
  background: rgba(0, 0, 0, 0.22);
}

.chapter-link {
  text-align: left;
  border: none;
  background: transparent;
  color: #d7d2e6;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  line-height: 1.35;
}

.chapter-link.is-active,
.chapter-link:hover {
  background: rgba(201, 162, 39, 0.16);
  color: #fff;
}

.reader-page {
  border-radius: 20px;
  background: var(--read-paper);
  color: var(--read-ink);
  padding: clamp(22px, 4vw, 40px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  min-height: 420px;
}

.chapter-title {
  margin: 0 0 18px;
  font-size: 1.35rem;
  font-weight: 750;
}

.chapter-body {
  font-size: var(--reader-font, 1.18rem);
  line-height: 1.85;
  white-space: pre-wrap;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.chapter-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid rgba(28, 25, 20, 0.12);
}

.chapter-pager .pager-btn {
  color: var(--read-ink);
  border-color: rgba(28, 25, 20, 0.18);
  background: rgba(28, 25, 20, 0.04);
}

.pager-status {
  color: var(--read-muted);
  font-size: 0.88rem;
}

.pager-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
