/**
 * page.css — shared chrome for the standalone content pages (home, about).
 *
 * These are simple scroll pages (NOT the reader grid), so they live outside
 * layout.css. They reuse the design.css tokens + header. Content is a centered
 * single column. Placeholder copy for now — filled in later.
 */

.page {
  /* Exact viewport height (not min-height) so .page-main scrolls internally and
     the bottom command bar stays pinned to the bottom — not pushed below the
     fold by tall content. */
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--canvas);
  /* Safe-area insets so the header clears the Dynamic Island / notch and the
     side cutouts in landscape (mirrors .app in layout.css on the reader). The
     bottom is left to the command bar, which extends its own background into the
     home-indicator zone. Without this, the standalone pages (Library, About)
     jammed their header under the island. */
  padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left);
}

.page-main {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: clamp(1.5rem, 5vw, 3.5rem) clamp(1rem, 4vw, 2.5rem) 3rem;
}

.page-col {
  width: min(640px, 100%);
  margin: 0 auto;
}

.page-title {
  font-family: var(--font-jp);
  font-weight: 700;
  font-size: clamp(1.8rem, 4.5vw, 2.6rem);
  color: var(--brass);
  letter-spacing: 0.08em;
  margin: 0 0 0.3rem;
}
.page-title .en {
  display: block;
  font-family: var(--font-en);
  font-style: italic;
  font-weight: 400;
  font-size: 0.95rem;
  color: var(--text-soft);
  letter-spacing: 0.06em;
  margin-top: 0.4rem;
}

.page-lede {
  font-family: var(--font-en);
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text);
  margin: 1.5rem 0 2.2rem;
}

.page-section-label {
  font-family: var(--font-en);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-soft);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.6rem;
  margin: 2rem 0 1.2rem;
}

/* ===== Library =========================================================
   The home screen is a bookshelf: an optional "Continue reading" card on
   top, then each Series with its Books. Built by js/home.js from
   content/catalog.json. Monetization stays invisible — a gated/upcoming
   book renders as "Coming soon", never a price. */

/* A placeholder cover panel (cover art arrives later via catalog `cover` /
   chapter `art`). A large brass glyph on a deep indigo panel. */
.cc-cover,
.bc-cover {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-jp);
  font-weight: 700;
  color: var(--brass);
  background: linear-gradient(150deg, var(--indigo), #2f3a5a);
  border: 1px solid var(--tile-edge);
  border-radius: 10px;
  overflow: hidden;
}

/* ----- Continue reading ----- */
.continue-card {
  display: block;
  text-decoration: none;
  background: var(--canvas-elev);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--brass);
  border-radius: 12px;
  padding: 1rem 1.2rem 1.1rem;
  margin-bottom: 2.4rem;
  transition: border-color 140ms, transform 140ms;
}
.continue-card:hover { border-color: var(--brass); transform: translateY(-2px); }
.cc-label {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 0.7rem;
}
.cc-body { display: flex; gap: 1rem; align-items: center; }
.cc-cover { width: 52px; height: 52px; font-size: 1.7rem; }
.cc-text { min-width: 0; flex: 1 1 auto; }
.cc-jp {
  font-family: var(--font-jp);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--bone-bright);
  letter-spacing: 0.04em;
}
.cc-en {
  font-family: var(--font-en);
  font-style: italic;
  font-size: 0.88rem;
  color: var(--text-soft);
  margin-top: 0.15rem;
}
.cc-progress {
  height: 4px;
  border-radius: 100px;
  background: rgba(232, 220, 196, 0.1);
  margin-top: 0.7rem;
  overflow: hidden;
}
.cc-progress span {
  display: block;
  height: 100%;
  background: var(--brass);
  border-radius: inherit;
}

/* ----- Series + shelf ----- */
.series { margin-bottom: 2.6rem; }
.series-head {
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.8rem;
  margin-bottom: 1.3rem;
}
.series-jp {
  font-family: var(--font-jp);
  font-weight: 600;
  font-size: 1.5rem;
  color: var(--bone-bright);
  letter-spacing: 0.05em;
  margin: 0;
}
.series-en {
  display: inline-block;
  font-family: var(--font-en);
  font-style: italic;
  font-size: 0.9rem;
  color: var(--text-soft);
  margin-top: 0.2rem;
}
.series-blurb {
  font-family: var(--font-en);
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text);
  margin: 0.6rem 0 0;
}

.shelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

/* ----- Book card ----- */
.book-card {
  display: flex;
  gap: 1rem;
  background: var(--canvas-elev);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 1rem;
  transition: border-color 140ms, transform 140ms;
}
.book-card.is-open:hover { border-color: var(--brass); transform: translateY(-2px); }
.book-card.is-soon { opacity: 0.62; }
.bc-cover {
  width: 72px;
  height: 96px;
  font-size: 2.2rem;
}
.book-card.is-soon .bc-cover { filter: saturate(0.4); color: var(--text-soft); }
.bc-body { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.bc-titles { display: flex; flex-direction: column; }
.bc-jp {
  font-family: var(--font-jp);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--bone-bright);
  letter-spacing: 0.04em;
}
.bc-en {
  font-family: var(--font-en);
  font-style: italic;
  font-size: 0.9rem;
  color: var(--text-soft);
  margin-top: 0.1rem;
}
.bc-blurb {
  font-family: var(--font-en);
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text);
  margin: 0.55rem 0 0;
}
.bc-meta {
  font-family: var(--font-ui);
  font-size: 0.74rem;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  margin-top: 0.55rem;
}
.bc-cta { margin-top: auto; padding-top: 0.9rem; }
/* Filled brass pill — needs dark text, so override the universal brass
   `.app a` link color (design.css) with a higher-specificity selector. */
.app a.bc-btn {
  display: inline-block;
  text-decoration: none;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #1a1d2c;
  background: var(--brass);
  border-radius: 100px;
  padding: 0.45rem 1.2rem;
  transition: filter 140ms;
}
.app a.bc-btn:hover { filter: brightness(1.08); }
.bc-soon {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-soft);
  border: 1px solid var(--rule);
  border-radius: 100px;
  padding: 0.4rem 1rem;
}

.page-placeholder {
  font-family: var(--font-en);
  font-style: italic;
  color: var(--text-soft);
  line-height: 1.6;
}

/* Back link in the header nav. */
.page-nav { display: flex; gap: 1.2rem; align-items: baseline; }
.page-nav a {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-decoration: none;
}
.page-nav a:hover { color: var(--bone-bright); }
