/* ── SoloLibrary: a building you can walk into ─────────────────────────────
   Forked from The Workshop's book-page shell, re-tuned to the SoloLibrary's
   warm cream. Two fonts: DM Serif Display for headings, IBM Plex Serif for
   everything else (SoLove pages read in Georgia, the way the originals do).
   Colors are signals, not decoration: amber = SoLove, electric blue = the
   Ladder, forest green = the Light, copper = things worth carrying,
   orange = the library's own voice. The page is paper. */

:root {
  --paper: #f4efe4;
  --paper-soft: #fbf8f0;
  --card: #fffdf6;
  --ink: #21201b;
  --ink-soft: #57534a;
  --ink-faint: #8d8674;

  /* Rachel's library brand (8/6): slate blue + rustic copper, the wordmark
     colors. Bright electric blue retired from this app on her call. */
  --solove: #a86a1c;
  --ladder: #2a5673;
  --light: #1e4d38;
  --carry: #a95e2c;
  --story: #b97a56;
  --forest: #1e2a22;

  --border: rgba(33, 32, 27, 0.16);
  --border-light: rgba(33, 32, 27, 0.12);
  --shadow-sm: 0 6px 18px rgba(33, 32, 27, 0.07);
  --shadow: 0 14px 40px rgba(33, 32, 27, 0.10);

  --paper-on-forest: #f4efe4;
  --muted-on-forest: #c9c2ae;

  --serif: "DM Serif Display", Georgia, serif;
  --body: "IBM Plex Serif", Georgia, serif;
  --max: 1080px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  font-family: var(--body);
  background: #e9e0cc; /* the desk the book lies on */
  color: var(--ink);
  line-height: 1.72;
  overflow-x: hidden;
}

a { color: inherit; }
:focus-visible { outline: 3px solid var(--ladder); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; line-height: 1.12; margin: 0; }
p { margin: 0 0 1em; }

/* ── The book page ───────────────────────────────────────────────────── */
.book-wrap { padding: 1.5rem .9rem 2.6rem; }
.book-page {
  position: relative;
  max-width: 1240px;
  margin: 0 auto;
  background: var(--paper);
  border: 1px solid rgba(33, 32, 27, 0.10);
  border-radius: 20px;
  box-shadow: 0 26px 70px rgba(33, 32, 27, 0.16), 0 3px 12px rgba(33, 32, 27, 0.07);
  overflow: hidden;
}
.book-page::before {
  content: ""; position: absolute; inset: 13px;
  border: 1px solid rgba(33, 32, 27, 0.15);
  border-radius: 12px;
  pointer-events: none; z-index: 6;
}
.book-corner {
  position: absolute; width: 30px; height: 30px;
  border: 0 solid rgba(33, 32, 27, 0.32);
  pointer-events: none; z-index: 6;
}
.book-corner::after {
  content: ""; position: absolute; width: 4px; height: 4px;
  border-radius: 50%; background: rgba(33, 32, 27, 0.32);
}
.book-corner.tl { top: 21px; left: 21px; border-width: 1px 0 0 1px; border-top-left-radius: 24px; }
.book-corner.tl::after { left: -2.5px; bottom: -2px; }
.book-corner.tr { top: 21px; right: 21px; border-width: 1px 1px 0 0; border-top-right-radius: 24px; }
.book-corner.tr::after { right: -2.5px; bottom: -2px; }
.book-corner.bl { bottom: 21px; left: 21px; border-width: 0 0 1px 1px; border-bottom-left-radius: 24px; }
.book-corner.bl::after { left: -2.5px; top: -2px; }
.book-corner.br { bottom: 21px; right: 21px; border-width: 0 1px 1px 0; border-bottom-right-radius: 24px; }
.book-corner.br::after { right: -2.5px; top: -2px; }

/* The ribbon. Color comes from the room's signal. */
.page-ribbon {
  position: absolute; top: 0; left: var(--ribbon-x, 14%);
  width: 22px; height: 88px;
  background: var(--signal, var(--story));
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 80%, 0 100%);
  box-shadow: 0 6px 14px rgba(33, 32, 27, 0.20);
  z-index: 7;
}

.page-shell { min-height: 66vh; padding: 0 clamp(1.2rem, 4vw, 3.4rem) 2.6rem; }
.inner { max-width: var(--max); margin: 0 auto; }

/* ── Header ──────────────────────────────────────────────────────────── */
.ws-header {
  position: relative; z-index: 8;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 2rem clamp(1.2rem, 4vw, 3.4rem) 1.4rem;
  border-bottom: 1px solid var(--border-light);
  flex-wrap: wrap;
}
.ws-brand { display: flex; align-items: baseline; gap: .65rem; text-decoration: none; }
.ws-brand .name { font-family: var(--serif); font-size: 1.5rem; }
.ws-brand .name .solo { color: var(--ladder); }
.ws-brand .name .lib { color: var(--story); }
.ws-brand .star { color: var(--story); font-size: .85rem; align-self: center; }
.ws-brand .place { font-style: italic; color: var(--ink-soft); font-size: 1.02rem; }
.ws-nav { display: flex; gap: 1.1rem; flex-wrap: wrap; font-size: .93rem; }
.ws-nav a {
  text-decoration: none; color: var(--ink-soft);
  padding-bottom: 2px; border-bottom: 2px solid transparent;
}
.ws-nav a:hover { color: var(--ink); }
.ws-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--signal-current, var(--story)); }

/* ── Wayfinding ──────────────────────────────────────────────────────── */
.room-label {
  font-style: italic; font-size: 1rem; margin: 2.6rem 0 .7rem;
  color: var(--signal, var(--story));
}
.room-label .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: currentColor; margin-right: .5rem; vertical-align: 1px; }

.page-title { font-size: clamp(2.1rem, 5.4vw, 3.6rem); max-width: 18ch; margin-bottom: 1.1rem; }
.page-title em { font-style: italic; color: var(--signal, var(--story)); }
.lede { font-size: 1.14rem; color: var(--ink-soft); max-width: 62ch; }

.ornament { text-align: center; color: var(--ink-faint); margin: 2.8rem 0; letter-spacing: .6em; font-size: .8rem; }

/* The vow strip on the front door. */
.vow-strip { display: flex; flex-wrap: wrap; gap: .55rem; margin: 1.4rem 0 .4rem; }
.vow-strip .stamp {
  font-style: italic; font-size: .88rem; color: var(--ladder);
  border: 1.5px solid var(--ladder); border-radius: 999px;
  padding: .22rem .8rem; background: var(--paper-soft);
}

/* The page turn. No room dead-ends. */
.page-turn {
  margin-top: 3rem; padding: 1.6rem 1.8rem;
  border: 1px solid var(--border); border-radius: 16px;
  background: var(--card);
  display: block; text-decoration: none;
  transition: transform .15s, box-shadow .15s;
}
.page-turn:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.page-turn .kicker { font-style: italic; color: var(--ink-faint); font-size: .92rem; }
.page-turn .where { font-family: var(--serif); font-size: 1.35rem; margin: .2rem 0; color: var(--signal-next, var(--ink)); }
.page-turn .why { color: var(--ink-soft); font-size: .98rem; }

/* Start here, if you wonder. A lamp-lit band on the front door. */
.start-here {
  display: block; text-decoration: none;
  margin: 1.6rem 0 0; padding: 1.5rem 1.8rem;
  background: var(--forest); color: var(--paper-on-forest);
  border-radius: 16px;
  transition: transform .15s, box-shadow .15s;
}
.start-here:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.start-here .kicker { font-style: italic; font-size: .92rem; color: var(--muted-on-forest); display: block; }
.start-here .where { font-family: var(--serif); font-size: 1.4rem; display: block; margin: .2rem 0; }
.start-here .why { font-size: .96rem; color: var(--muted-on-forest); display: block; }

/* ── Cards and doors ─────────────────────────────────────────────────── */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.1rem; margin: 1.8rem 0; }
.door {
  display: flex; flex-direction: column; gap: .45rem;
  background: var(--card); border: 1px solid var(--border);
  border-top: 4px solid var(--signal, var(--story));
  border-radius: 16px; padding: 1.5rem 1.4rem 1.3rem;
  text-decoration: none; transition: transform .15s, box-shadow .15s;
}
.door:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); }
.door .eyebrow { font-style: italic; font-size: .9rem; color: var(--signal, var(--story)); }
.door h3 { font-size: 1.45rem; }
.door p { color: var(--ink-soft); font-size: .97rem; margin: 0; flex-grow: 1; }
.door .go { font-style: italic; font-size: .92rem; color: var(--ink-faint); margin-top: .6rem; }
.door:hover .go { color: var(--signal, var(--story)); }

/* ── Piece cards (the shelves) ───────────────────────────────────────── */
.piece-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 1.1rem; margin: 1.8rem 0; }
.piece-card {
  display: flex; flex-direction: column; gap: .45rem;
  background: var(--card); border: 1px solid var(--border);
  border-left: 5px solid var(--signal, var(--story));
  border-radius: 14px; padding: 1.35rem 1.3rem 1.15rem;
  text-decoration: none; transition: transform .15s, box-shadow .15s;
}
.piece-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); }
.piece-card .tag { font-style: italic; font-size: .86rem; color: var(--signal, var(--story)); }
.piece-card h3 { font-size: 1.35rem; }
.piece-card p { color: var(--ink-soft); font-size: .95rem; margin: 0; flex-grow: 1; }
.piece-card .meta-line {
  font-size: .85rem; color: var(--ink-faint);
  border-top: 1px dashed var(--border); padding-top: .55rem; margin-top: .55rem;
}
.piece-card .go { font-style: italic; font-size: .9rem; color: var(--ink-faint); margin-top: .35rem; }
.piece-card:hover .go { color: var(--signal, var(--story)); }
.piece-card.soon { border-style: dashed; background: transparent; cursor: default; }
.piece-card.soon:hover { transform: none; box-shadow: none; }
.piece-card.soon .tag, .piece-card.soon .go { color: var(--ink-faint); }

.shelf-note {
  font-style: italic; color: var(--ink-faint);
  padding: 2.4rem 1rem; text-align: center;
}

/* ── The reader ──────────────────────────────────────────────────────── */
.crumb { margin: 2.2rem 0 0; font-size: .95rem; }
.crumb a { text-decoration: none; font-style: italic; }
.piece-title { font-size: clamp(2rem, 5vw, 3.1rem); max-width: 22ch; margin: .4rem 0 .6rem; }
.piece-meta {
  font-size: .95rem; color: var(--ink-faint); font-style: italic;
  border-bottom: 1px dashed var(--border); padding-bottom: .9rem; max-width: 740px;
}

.listen {
  max-width: 740px; margin: 1.2rem 0;
  border: 1.5px dashed var(--border); border-radius: 14px;
  background: var(--paper-soft); padding: 1rem 1.2rem;
}
.listen .listen-label { font-style: italic; color: var(--ink-soft); font-size: .95rem; margin: 0 0 .5rem; }
.listen audio { width: 100%; }

.pdf-row { margin: 1.2rem 0; }
.pdf-btn {
  display: inline-block; text-decoration: none;
  font-weight: 600; font-size: .98rem; color: #fff;
  background: var(--signal, var(--story));
  border-radius: 12px; padding: .8rem 1.4rem;
  transition: transform .15s, box-shadow .15s;
}
.pdf-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }

/* The cream skin: the Ladder and the Light read here. */
.reader {
  max-width: 740px; margin: 1.8rem 0 0;
  font-size: 1.07rem; line-height: 1.78;
}
.reader h2 { font-size: 1.65rem; margin: 2.4rem 0 .8rem; }
.reader h3 { font-size: 1.3rem; margin: 1.9rem 0 .6rem; }
.reader p { margin: 0 0 1.15em; }
.reader blockquote {
  font-family: var(--serif); font-style: italic; font-size: 1.22rem;
  color: var(--forest); border-left: 3px solid var(--signal, var(--story));
  margin: 1.8rem 0; padding: .2rem 0 .2rem 1.2rem;
}
.reader ul, .reader ol { padding-left: 1.4rem; margin: 0 0 1.15em; }
.reader li { margin-bottom: .5rem; }
.reader img { max-width: 100%; height: auto; border-radius: 12px; }
.reader figure { margin: 2rem 0; }
.reader figcaption { font-size: .9rem; color: var(--ink-faint); font-style: italic; margin-top: .5rem; }
.reader hr { border: 0; border-top: 1px dashed var(--border); margin: 2.2rem 0; }
.reader dl { margin: 0 0 1.15em; }
.reader dt { font-family: var(--serif); font-size: 1.15rem; margin-top: 1.3rem; }
.reader dd { margin: .25rem 0 0; color: var(--ink-soft); }
.reader aside {
  border: 1.5px dashed var(--border); border-radius: 14px;
  background: var(--paper-soft); padding: 1.1rem 1.3rem; margin: 1.8rem 0;
  font-size: .97rem; color: var(--ink-soft);
}

/* Content furniture the writings brought with them. */
.reader p.beat { text-align: center; color: var(--ink-faint); letter-spacing: .6em; margin: 2rem 0; }
.reader p.verify { font-size: .92rem; font-style: italic; color: var(--ink-faint); }
.reader blockquote.prompt {
  font-family: var(--body); font-style: normal; font-size: 1rem; color: var(--ink);
  background: var(--paper-soft); border: 1px solid var(--border);
  border-left: 4px solid var(--signal, var(--story));
  border-radius: 12px; padding: 1rem 1.2rem;
}
.reader blockquote.prompt p { margin: 0 0 .4em; }
.reader ul.tbl-list li { margin-bottom: .8rem; }
.reader hr.wline { border-top-style: solid; opacity: .4; margin: 1.1rem 0; }
.reader aside.worksheet, .reader aside.sheet, .reader aside.usebox, .reader aside.note {
  border-style: solid; background: var(--card);
}

/* The SoLove skin: warmer, Georgia, drop cap, amber. */
.reader.solove {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.18rem; line-height: 1.85;
}
.reader.solove > p:first-of-type::first-letter {
  font-family: var(--serif);
  font-size: 3.4em; line-height: .82;
  float: left; padding: .08em .12em 0 0;
  color: var(--solove);
}
.reader.solove blockquote { color: var(--solove); border-left-color: var(--solove); }
.reader.solove details.scripture {
  border: 1px solid var(--border); border-left: 5px solid var(--solove);
  border-radius: 14px; background: var(--paper-soft);
  padding: 1rem 1.3rem; margin: 2rem 0;
  font-size: 1rem; line-height: 1.7;
}
.reader.solove details.scripture summary {
  font-family: var(--serif); font-size: 1.15rem; cursor: pointer;
  color: var(--solove); padding: .2rem 0;
}
.reader.solove aside.honesty {
  border-style: dashed; font-size: .95rem;
}
.reader.solove aside.closing {
  border: 0; background: linear-gradient(135deg, rgba(168, 106, 28, 0.10), rgba(210, 145, 47, 0.16));
  color: var(--ink); font-size: 1.05rem;
}

/* ── The plain picture banner ────────────────────────────────────────── */
.plain-picture {
  border: 1px solid var(--border); border-left: 5px solid var(--signal, var(--forest));
  background: var(--paper-soft); border-radius: 16px;
  padding: 1.5rem 1.7rem; margin: 1.8rem 0;
}
.plain-picture .pp-label { font-style: italic; color: var(--signal, var(--forest)); font-size: .92rem; margin-bottom: .4rem; }
.plain-picture p { font-size: 1.12rem; margin: 0; max-width: 68ch; }

/* ── The desk's form ─────────────────────────────────────────────────── */
.ws-form { margin: 2rem 0 0; display: grid; gap: 1.1rem; max-width: 720px; }
.ws-field { display: grid; gap: .35rem; }
.ws-field label { font-family: var(--serif); font-size: 1.08rem; }
.ws-field input[type="text"], .ws-field input[type="email"], .ws-field textarea {
  font-family: var(--body); font-size: 1rem; color: var(--ink);
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: .75rem .9rem; width: 100%;
}
.ws-consent { display: flex; gap: .6rem; align-items: flex-start; font-size: .92rem; color: var(--ink-soft); }
.ws-consent input { margin-top: .3rem; }
.fine-print { font-size: .88rem; margin: -.4rem 0 0; }
.fine-print a { color: var(--ink-faint); }
.ws-submit {
  font-family: var(--body); font-weight: 600; font-size: 1.02rem;
  background: var(--ladder); color: #fff; border: 0; border-radius: 12px;
  padding: .95rem 1.6rem; cursor: pointer; justify-self: start;
  transition: background .15s;
}
.ws-submit:hover { background: #224761; }
.ws-submit:disabled { opacity: .6; cursor: default; }
.form-status { font-size: .98rem; min-height: 1.4em; }

.opt-group { display: grid; gap: .5rem; }
.opt-group .opt {
  display: flex; gap: .6rem; align-items: flex-start;
  border: 1px solid var(--border); border-radius: 10px; background: var(--card);
  padding: .65rem .9rem; font-size: .96rem; color: var(--ink-soft); cursor: pointer;
}
.opt-group .opt:hover { border-color: var(--ink-faint); }
.opt-group .opt input { margin-top: .3rem; }
.opt-group .opt b { color: var(--ink); font-weight: 600; }
.hint-inline { font-size: .88rem; color: var(--ink-faint); font-style: italic; }

/* ── Footer ──────────────────────────────────────────────────────────── */
.ws-footer {
  border-top: 1px solid var(--border-light);
  margin-top: 3rem; padding: 1.8rem clamp(1.2rem, 4vw, 3.4rem) 2.2rem;
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  font-size: .92rem; color: var(--ink-faint);
}
.ws-footer a { color: var(--ink-soft); text-decoration: none; }
.ws-footer a:hover { color: var(--ink); }
.ws-footer .links { display: flex; gap: 1.1rem; flex-wrap: wrap; }

@media (max-width: 720px) {
  .ws-header { padding-top: 1.4rem; }
  .page-shell { padding-bottom: 1.8rem; }
  .reader { font-size: 1.03rem; }
  .reader.solove { font-size: 1.12rem; }
}
