/* The novel page, ported 1:1 from the approved mockup.
   Everything lives under .nlshell so the homepage and chapter reader
   never feel a thing. Colors come from the shared tokens in style.css. */

.nlshell{position:relative;z-index:1;max-width:1100px;margin:0 auto;
  padding:clamp(18px,4vw,40px) clamp(16px,4vw,44px) 80px}

/* ---- hero: cover window + the book's identity ---- */
.nlshell .hero{display:flex;gap:clamp(20px,4vw,44px);align-items:flex-start;flex-wrap:wrap}
.nlshell .coverbox{flex:none;width:min(260px,62vw);position:relative}
.nlshell .coverbox img{width:100%;aspect-ratio:5/7;object-fit:cover;display:block;
  border-radius:12px;border:1.5px solid var(--line);
  box-shadow:0 18px 50px rgba(0,0,0,.45)}
/* A soft halo so the cover sits in the night sky, not on it. */
.nlshell .coverbox::after{content:'';position:absolute;inset:-22px -26px;z-index:-1;
  border-radius:30px;background:radial-gradient(50% 50% at 50% 45%,var(--goldtint),transparent 75%)}
.nlshell .hero-main{flex:1;min-width:min(100%,300px)}
.nlshell .eyebrow{font-weight:800;font-size:.78rem;letter-spacing:.22em;text-transform:uppercase;color:var(--muted)}
.nlshell .noveltitle{font-family:'Questrial','Outfit',sans-serif;font-weight:400;font-size:clamp(1.7rem,4.5vw,2.5rem);line-height:1.15;margin:.35rem 0 .2rem;color:var(--ink)}
.nlshell .byline{font-size:1rem;font-weight:700;color:var(--muted)}
.nlshell .byline .name{color:var(--ink)}

/* status + tags. Each status is a regular tinted pill whose whole glitter
   budget goes into one big diamond with two tiny companions. The statuses
   show their personality in how hard the star shines: ongoing glows steady,
   completed shines in three layers, hiatus dims to a restful glimmer, and
   dropped is a hollow SVG star whose light has gone out. */
.nlshell .statuswrap{position:relative;display:inline-flex}
.nlshell .statuswrap.ongoing{--st:var(--gold);--stdeep:var(--golddeep);--sttint:var(--goldtint)}
.nlshell .statuswrap.complete{--st:var(--greendeep);--stdeep:var(--greendeep);--sttint:var(--greentint)}
.nlshell .statuswrap.hiatus{--st:var(--orangedeep);--stdeep:var(--orangedeep);--sttint:var(--orangetint)}
.nlshell .statuswrap.dropped{--st:var(--reddeep);--stdeep:var(--reddeep);--sttint:var(--redtint)}
.nlshell .statusflag{display:inline-flex;align-items:center;gap:5px;border-radius:999px;
  padding:5px 14px 5px 10px;font-size:.72rem;font-weight:800;letter-spacing:.08em;
  text-transform:uppercase;background:var(--sttint);color:var(--stdeep);
  border:1px solid var(--st)}
.nlshell .ststar{position:relative;font-size:14px;line-height:1;color:var(--stdeep);
  transform:translateY(-1px);
  filter:drop-shadow(0 0 1.5px var(--st)) drop-shadow(0 0 5px var(--st));opacity:.95}
.nlshell .ststar .mini{position:absolute;font-style:normal;line-height:1;color:inherit}
.nlshell .ststar .m1{top:-4px;left:-3px;font-size:7px;opacity:.85}
.nlshell .ststar .m2{bottom:-2px;left:-5px;font-size:5px;opacity:.6}
.nlshell .statuswrap.ongoing .ststar{filter:drop-shadow(0 0 1.5px var(--st)) drop-shadow(0 0 4px var(--st))}
.nlshell .statuswrap.complete .ststar{filter:drop-shadow(0 0 2px var(--st)) drop-shadow(0 0 6px var(--st)) drop-shadow(0 0 11px var(--st))}
.nlshell .statuswrap.hiatus .ststar{opacity:.55;filter:drop-shadow(0 0 1px var(--st))}
.nlshell .statuswrap.dropped .ststar{opacity:.6;transform:translateY(-1px);
  filter:drop-shadow(0 0 1px var(--st))}
/* Completed shines in three layers, so its big diamond and two tiny
   companions take turns twinkling. The other statuses keep their
   personalities: ongoing glows steady, hiatus rests, dropped stays dark. */
@keyframes st-twinkle{0%,100%{opacity:1;transform:scale(1)}
  50%{opacity:.4;transform:scale(.8)}}
@keyframes st-glowpulse{0%,100%{opacity:.95}50%{opacity:.55}}
.nlshell .statuswrap.complete .ststar{animation:st-glowpulse 2.6s ease-in-out infinite}
.nlshell .statuswrap.complete .ststar .mini{animation:st-twinkle 2.6s ease-in-out infinite}
.nlshell .statuswrap.complete .ststar .m1{animation-delay:.9s}
.nlshell .statuswrap.complete .ststar .m2{animation-delay:1.7s}
@media (prefers-reduced-motion: reduce){
  .nlshell .statuswrap.complete .ststar,
  .nlshell .statuswrap.complete .ststar .mini{animation:none}}
.nlshell .statusrow{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin:18px 0 0}
.nlshell .tag{padding:4px 13px;border-radius:999px;font-size:.7rem;font-weight:800;
  letter-spacing:.08em;text-transform:uppercase;text-decoration:none}
.nlshell .tag.gold{background:var(--goldtint);color:var(--golddeep);border:1px solid var(--gold)}
.nlshell .tag.pink{background:var(--pinktint);color:var(--pinkdeep);border:1px solid var(--pink)}
.nlshell .tag.purple{background:var(--purpletint);color:var(--purpledeep);border:1px solid var(--purple)}
/* minor tags are the whisper line: no chips, just muted words joined by
   tiny gold stars, so the majors stay the show */
.nlshell .minorrow{margin-top:16px;display:block}
.nlshell .whisper .also{font-size:.68rem;font-weight:800;letter-spacing:.14em;
  text-transform:uppercase;color:var(--muted);margin-right:6px}
.nlshell .whisper .wtag{display:inline;font-size:.82rem;font-weight:700;
  color:var(--muted);letter-spacing:0;text-transform:none;background:none;
  border:0;padding:0;border-radius:0;text-decoration:none;transition:color .15s}
.nlshell .whisper .wtag:hover,.nlshell .whisper .wtag:active{color:var(--gold)}
.nlshell .whisper .sep{color:var(--gold);margin:0 7px;font-size:.7rem}

/* the fact sheet */
.nlshell .facts{margin:18px 0 0;display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));
  gap:10px 26px}
.nlshell .fact{display:flex;flex-direction:column;gap:2px}
.nlshell .fact dt{font-size:.72rem;font-weight:800;letter-spacing:.14em;text-transform:uppercase;color:var(--muted)}
.nlshell .fact dd{margin:0;font-weight:700;font-size:.95rem;color:var(--ink)}

/* stats strip with the gold four-pointed separators */
.nlshell .statline{margin:14px 0 0;display:flex;flex-wrap:wrap;gap:6px 10px;align-items:baseline;
  font-weight:800;font-size:.95rem;color:var(--ink)}
/* Each stat is its own little box: a long hand-typed chunk (the free
   text chapter total) wraps inside itself instead of shoving the rest
   of the line around. Short stats never notice the cap. */
.nlshell .statline > span{max-width:30ch}
.nlshell .statline .sep{color:var(--gold);font-size:.8rem}

/* the publishing schedule: free text from the Novel Details box, shown
   with gold star separators and day names wearing weight 600 (the
   dressed-up look the approved mockup had). Mobile keeps it under the
   byline; on desktop it joins the word count on one line, and its
   trailing star acts as the divider between schedule and statline. */
.nlshell .schedule{margin:12px 0 0;font-size:.92rem;font-weight:400;color:var(--ink);letter-spacing:.01em}
.nlshell .schedule .ssep{display:inline-block;margin:0 7px;color:var(--gold);opacity:.85;font-size:.85rem}
.nlshell .schedule b{font-weight:600}
.nlshell .statline-row{display:flex;flex-wrap:wrap;align-items:baseline;row-gap:8px;margin:14px 0 0}
.nlshell .statline-row .schedule{margin:0}
.nlshell .statline-row .schedule .ssep:last-child{margin-right:10px}
.nlshell .statline-row .statline{margin:0}

/* action row */
.nlshell .actions{display:flex;gap:10px;flex-wrap:wrap;margin:22px 0 0}
/* All three action buttons rest quiet (thin line, ink text) and share the
   same hover: the gold border, tint and text light up together. */
.nlshell .gopill{height:46px;display:inline-flex;align-items:center;padding:0 26px;border-radius:999px;
  border:1.5px solid var(--line);background:transparent;color:var(--ink);
  font-weight:800;font-size:.95rem;transition:.15s}
.nlshell .gopill:hover,.nlshell .gopill:active{border-color:var(--gold);background:var(--goldtint);color:var(--gold)}
/* The buttons' little star stays hidden until hover, then slides in and
   twinkles while you're pointing at the button. */
.nlshell .btnstar{display:inline-block;max-width:0;opacity:0;overflow:hidden;white-space:pre;
  transform:scale(.4) rotate(-90deg);transform-origin:50% 55%;
  transition:max-width .2s ease,opacity .2s ease,transform .25s ease}
.nlshell .gopill:hover .btnstar,.nlshell .ghostpill:hover .btnstar{
  max-width:1.15em;opacity:1;transform:scale(1) rotate(0deg);
  animation:btn-twinkle 1.8s ease-in-out .3s infinite}
@keyframes btn-twinkle{0%,100%{opacity:1}50%{opacity:.45}}
@media (prefers-reduced-motion: reduce){
  .nlshell .gopill:hover .btnstar,.nlshell .ghostpill:hover .btnstar{animation:none}}
.nlshell .ghostpill{height:46px;display:inline-flex;align-items:center;padding:0 22px;border-radius:999px;
  border:1.5px solid var(--line);background:transparent;color:var(--ink);
  font-weight:800;font-size:.95rem;transition:.15s}
.nlshell .ghostpill:hover,.nlshell .ghostpill:active{border-color:var(--gold);background:var(--goldtint);color:var(--gold)}

/* ---- description + chapter cards ---- */
.nlshell .card{background:var(--card);border:1px solid var(--line);border-radius:20px;
  padding:clamp(18px,3.5vw,28px);margin-top:26px;position:relative;z-index:1}
.nlshell .card h2{font-family:'Questrial','Outfit',sans-serif;
  font-weight:400;letter-spacing:.02em;font-size:1.35rem;margin:0 0 12px;color:var(--headings)}
.nlshell .blurb{color:var(--ink)}
.nlshell .blurb p{margin:.4em 0;line-height:1.7;font-size:1rem;color:var(--ink)}
.nlshell .blurb > :first-child{margin-top:0}
.nlshell .blurb > :last-child{margin-bottom:0}

/* ---- chapter list ---- */
.nlshell .chaphead{display:flex;align-items:baseline;gap:12px;flex-wrap:wrap;margin-top:34px}
.nlshell .chaphead h2{font-family:'Questrial','Outfit',sans-serif;
  font-weight:400;letter-spacing:.02em;font-size:1.35rem;margin:0;color:var(--headings)}
.nlshell .chaphead .count{color:var(--muted);font-weight:700;font-size:.85rem}
.nlshell .sortpill{margin-left:auto;height:34px;display:inline-flex;align-items:center;cursor:pointer;
  padding:0 14px;border-radius:999px;border:1.5px solid var(--line);background:transparent;
  font-weight:800;font-size:.78rem;color:var(--ink);font-family:inherit;transition:.15s}
.nlshell .sortpill:hover,.nlshell .sortpill:active{border-color:var(--gold);background:var(--goldtint);color:var(--gold)}
.nlshell .chapterlist{list-style:none;margin:14px 0 0;padding:0 6px 0 0;display:flex;flex-direction:column;
  gap:8px;max-height:520px;overflow-y:auto}
.nlshell .chapterlist.nl-oldest-first{flex-direction:column-reverse}
.nlshell .chapterlist::-webkit-scrollbar{width:8px}
.nlshell .chapterlist::-webkit-scrollbar-thumb{background:var(--line);border-radius:99px}
.nlshell .chapterlist a{display:flex;justify-content:space-between;align-items:baseline;gap:10px;
  padding:10px 14px;border:1.5px solid transparent;border-radius:12px;background:var(--card);font-weight:800;
  font-size:.92rem;color:var(--ink);text-decoration:none;transition:.15s}
.nlshell .chapterlist a:hover,.nlshell .chapterlist a:active,.nlshell .chapterlist a:focus-visible{border-color:var(--gold)}
.nlshell .chapterlist a:hover,.nlshell .chapterlist a:active{transform:translateX(3px);color:var(--gold)}
.nlshell .chapterlist .spark{color:var(--golddeep);margin-right:10px;font-size:.95rem}
.nlshell .chapterlist .chwnum{color:var(--golddeep);font-weight:700;font-variant-numeric:tabular-nums}
.nlshell .chapterlist .date{color:var(--muted);font-weight:700;font-size:.8rem;white-space:nowrap}
.nlshell .newchip{margin-left:6px;background:var(--pink);color:#fff;border-radius:999px;
  padding:3px 11px;font-size:.68rem;font-weight:800;letter-spacing:.03em;flex:none}
/* A long title clips with an ellipsis instead of shoving the NEW chip onto
   its own line (spotted in the wild on Chapter 1's card). The title's span
   becomes a flex row that is allowed to shrink; the chip is not, so it
   always stays beside the title. The clipping is visual only: screen
   readers hear the full title, and the title attribute shows it on
   hover or long-press. */
.nlshell .chapterlist a > span:first-child{flex:1;min-width:0;display:flex;align-items:baseline}
.nlshell .chapterlist .name{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* ---- chapter groups (worlds / arcs) ---- */
/* When a novel has groups, the list becomes a wrapper holding one
   labeled block per run of chapters. The wrapper keeps the scroll and
   the sort flip; each inner list is a plain chapter list. Both levels
   reverse together, so a heading always sits above its chapters
   whether the pill says Newest first or Oldest first. */
.nlshell .chapterlist .chapterlist{max-height:none;overflow:visible;margin-top:8px}
.nlshell .chapterlist.nl-oldest-first .chapterlist{flex-direction:column-reverse}
/* The "In Order" flat twin and the grouped wrapper take turns being
   visible (the sort menu swaps them). The hidden attribute alone
   loses to the flex display rule above, so pin it here. */
.nlshell .chapterlist[hidden]{display:none}

/* ---- sort menu ---- */
/* The pill opens a small menu of sort choices instead of cycling.
   It anchors to the pill, folds on Escape or an outside click, and
   marks the active choice with a gold star. */
.nlshell .sortwrap{position:relative;display:inline-flex;margin-left:auto}
.nlshell .sortmenu{position:absolute;right:0;top:calc(100% + 6px);z-index:40;min-width:170px;
  padding:6px;border-radius:12px;border:1.5px solid var(--line);background:var(--card);
  box-shadow:0 10px 26px rgba(0,0,0,.35);display:flex;flex-direction:column;gap:2px}
.nlshell .sortmenu[hidden]{display:none}
.nlshell .sortopt{appearance:none;border:none;background:transparent;border-radius:8px;cursor:pointer;
  padding:8px 12px;text-align:left;font-family:inherit;font-weight:800;font-size:.82rem;color:var(--ink);transition:.12s}
.nlshell .sortopt:hover,.nlshell .sortopt:focus-visible{background:var(--goldtint);color:var(--gold)}
.nlshell .sortopt.nl-current{color:var(--gold)}
.nlshell .sortopt.nl-current::after{content:'\2726';margin-left:8px;font-size:.75rem}
.nlshell .nlgroupname{display:flex;align-items:center;gap:12px;margin:10px 0 0}
.nlshell .nlgroup:first-child .nlgroupname{margin-top:0}
.nlshell .nlgroupname .nlgrule{flex:1 1 auto;height:1px;background:var(--line)}
.nlshell .nlgroupname .nlgt{font-family:'Questrial','Outfit',sans-serif;font-weight:400;letter-spacing:.14em;
  text-transform:uppercase;font-size:.8rem;color:var(--gold);white-space:nowrap}
.nlshell .nlgroupname.ungrouped .nlgt{color:var(--muted);letter-spacing:.08em}

/* no chapters yet */
.nlshell .nochapters{margin:14px 0 0;padding:18px 20px;border:1px dashed var(--line);
  border-radius:14px;color:var(--muted);font-weight:700}

@media (max-width:640px){
  .nlshell .coverbox{margin:0 auto}
  .nlshell .hero{justify-content:center;text-align:center}
  .nlshell .statusrow,.nlshell .actions,.nlshell .statline{justify-content:center}
  .nlshell .statline-row{justify-content:center}
  .nlshell .statline-row .schedule{display:none}
  /* Phone screens are narrower than the desktop 30ch cap, so each stat
     takes the full centered width and wraps inside its own box. */
  .nlshell .statline > span{max-width:100%}
  /* Each stat becomes its own line with a star on each side, like the
     schedule pill — a long free-text total wraps inside its own line
     instead of shoving the word count around. */
  .nlshell .statline{display:block}
  .nlshell .statline .sep{display:none}
  .nlshell .statline > span{display:block}
  .nlshell .statline > span::before{content:'\2726\00a0\00a0';color:var(--gold);font-size:.8rem}
  .nlshell .statline > span::after{content:'\00a0\00a0\2726';color:var(--gold);font-size:.8rem}
  /* Really's free-text total goes without stars — plain text on its own line. */
  .nlshell .statline > span.total::before,
  .nlshell .statline > span.total::after{content:none}
  .nlshell .facts{grid-template-columns:1fr}
  .nlshell .chapterlist a{flex-wrap:wrap}
  .nlshell .sortwrap{margin-left:0}
  /* On phones the pill sits at the left edge, so the menu grows
     rightward from it instead of leftward off the screen. */
  .nlshell .sortmenu{right:auto;left:0}
}

/* Chips are links to the tag's archive page: keep them looking like the
   mockup's chips (no underline, no blue) and lift gently on hover. */
.nlshell a.tag{text-decoration:none;color:inherit}
.nlshell a.tag:hover{filter:brightness(1.18)}

/* On desktop the cover stretches to the hero's full height, so it fills
   the space beside the text instead of stopping short and leaving an
   empty bottom. The art is cropped to fit, never letterboxed. The 5/7
   aspect ratio stays on mobile (and as the cover's own minimum height),
   so a short novel page never shrinks the cover below its natural shape.
   The max-height is the leash: a cover can stretch to a book's shape,
   but a giant pile of tags must not stretch it into a yellow tower. */
@media (min-width:641px){
  .nlshell .hero{align-items:stretch}
  .nlshell .coverbox{max-height:400px}
  .nlshell .coverbox img{height:100%;object-fit:cover}
  .nlshell .schedule.bylinesched{display:none}
}

/* The "+ N more" fold for the whisper line: the JS hides everything past
   the first handful with .nl-folded, and the button simply un-hides the
   whole row. Without JS nothing is hidden and there is no button at all. */
.nlshell .whisper .wtag.nl-folded,.nlshell .whisper .sep.nl-folded{display:none}
.nlshell .whisper.nl-open .wtag.nl-folded,.nlshell .whisper.nl-open .sep.nl-folded{display:inline}
.nlshell .whisper .morelink{border:0;background:none;cursor:pointer;font-family:inherit;
  font-size:.78rem;font-weight:800;color:var(--purpledeep);padding:0;margin-left:6px;
  transition:color .15s}
.nlshell .whisper .morelink:hover,.nlshell .whisper .morelink:active{color:var(--gold)}
