@import url("https://cdn.jsdelivr.net/npm/@fontsource/great-vibes@5.2.6/index.css"); /* script font for the overview month title */
/* Night Ferry: reader shell styles (two top buttons, month overview, wish list / theme). The article itself (sea + paper) is in nf-article.css.
   Shared by the standalone page and by any page that opens the reader in place; every class is prefixed nfr-.
   Needs: assets/paper-grain.png; markup comes from nf-reader.js. */
.nfr { position: fixed; inset: 0; z-index: 100; height: var(--screen-h, 100lvh); color: #ece3cf;
  font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "Hiragino Mincho ProN", "LXGW WenKai", serif; -webkit-tap-highlight-color: transparent; }
.nfr * { box-sizing: border-box; }
.nfr button, .nfr input { font-family: inherit; color: inherit; font-size: 15px; margin: 0; padding: 0; }
.nfr button { cursor: pointer; }
.nfr input { font-size: 16px; }
.nfr input:focus { outline: none; border-color: #ffc46a !important; }
.nfr [hidden] { display: none !important; }

/* two top buttons: they fade in once the article covers the screen (.nfr-chrome) */
.nfr-orb {
  position: fixed; z-index: 6; top: calc(env(safe-area-inset-top) + 10px);
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(247, 238, 220, 0.7); color: #2a2217; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.22);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; text-decoration: none;
  opacity: 0; transition: opacity 0.45s ease; pointer-events: none;
}
.nfr.nfr-chrome .nfr-orb { opacity: 1; pointer-events: auto; }
.nfr-orb:active { background: rgba(255, 255, 255, 1); }
.nfr-orb svg { color: #9a7b5c; } /* the colour is set on the svg itself so that .nfr button { color: inherit } cannot override it */
.nfr-orb svg path { stroke-width: 2.7; }
.nfr-orb.back { left: max(14px, calc(50vw - 280px + 14px)); }
.nfr-orb.list { right: max(14px, calc(50vw - 280px + 14px)); }

/* overview */
.nfr-ov {
  position: fixed; inset: 0; z-index: 10; height: var(--screen-h, 100lvh);
  background: url("assets/paper-grain.png") repeat, linear-gradient(180deg, #efe4cf 0, #e6d9c0 100%); /* kraft paper, same grain and colours as the article paper; opaque (the article is underneath and would show through) */
  color: #5a4d3c;
  display: flex; flex-direction: column; animation: nfrOvIn 0.28s ease-out;
}
@keyframes nfrOvIn { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.nfr-ov-head { display: flex; align-items: center; justify-content: center; gap: 4px; padding: calc(env(safe-area-inset-top) + 12px) 16px 10px; position: relative; }
.nfr-ov-arrow { width: 40px; height: 40px; border: none; background: none; border-radius: 50%; font-size: 26px; line-height: 1; color: #7a6b54; }
.nfr-ov-arrow svg { width: 16px; height: 16px; display: block; margin: 0 auto; }
.nfr-ov-arrow.off { opacity: 0.28; } /* no other month in that direction: dimmed, not hidden */
.nfr-ov-arrow:active { background: rgba(90, 77, 60, 0.12); }
.nfr-ov-month { min-width: 170px; text-align: center; font-family: "Great Vibes", "Snell Roundhand", cursive; font-size: 42px; font-weight: 400; letter-spacing: 0; line-height: 1; padding-top: 4px; color: #4a3e2e; }
.nfr-ov-close { position: absolute; right: 14px; top: calc(env(safe-area-inset-top) + 12px); width: 40px; height: 40px; border: none; background: none; border-radius: 50%; font-size: 26px; color: #9e8f76; }
.nfr-ov-scroll { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 6px 16px calc(24px + env(safe-area-inset-bottom)); scrollbar-width: none; }
.nfr-ov-scroll::-webkit-scrollbar { display: none; }
.nfr-ov-list { max-width: 560px; margin: 0 auto; }
.nfr-ov-month-list { display: flex; flex-direction: column; gap: 10px; } /* each month's row list is cached as a DOM node by nf-reader.js; this element is the cached unit */
.nfr-ov-row {
  position: relative; display: flex; align-items: center; gap: 14px; min-height: 66px; padding: 12px 16px;
  border-radius: 14px; overflow: hidden; border: 1px solid rgba(201, 154, 74, 0.6);
  background: linear-gradient(135deg, #e9dcc3, #e0d2b6); color: #4a3e2e; text-align: left; width: 100%; box-shadow: 0 1px 3px rgba(60, 45, 20, 0.14);
}
.nfr-ov-row .bg { position: absolute; inset: 0; background: center / cover no-repeat; opacity: 0.9; }
.nfr-ov-row::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(243, 233, 214, 0.58), rgba(243, 233, 214, 0.28)); z-index: 1; } /* cream wash over the row background */
.nfr-ov-row > * { position: relative; z-index: 2; }
.nfr-ov-row .bg { z-index: 0; } /* stacking: wallpaper at the bottom, cream wash (::after, z 1) above it, text on top; without an explicit z-index the wash ends up covered by .bg */
.nfr-ov-row .d { flex: 0 0 auto; width: 54px; text-align: center; }
.nfr-ov-row .d b { display: block; font-size: 20px; font-weight: 700; line-height: 1.1; color: #3b3022; }
.nfr-ov-row .d span { display: block; font-size: 11px; color: #7a6b54; letter-spacing: 1px; margin-top: 2px; }
.nfr-ov-row .t { flex: 1; min-width: 0; font-size: 16px; line-height: 1.45; color: #3b3022; }
.nfr-ov-row .d { color: #3b3022; }
.nfr-ov-row .t small { display: block; font-size: 11.5px; color: #7a6b54; letter-spacing: 1px; margin-top: 2px; }
.nfr-ov-row.now { border-color: #c99a4a; box-shadow: 0 0 0 1.5px rgba(201, 154, 74, 0.75), 0 1px 3px rgba(60, 45, 20, 0.14); }
.nfr-ov-row.plain::after { display: none; } /* rows without a wallpaper: the paper base is enough */
.nfr-ov-row:active { opacity: 0.8; }
.nfr-ov-empty { padding: 40px 0; text-align: center; color: #9e8f76; font-size: 14px; letter-spacing: 1px; }

/* wish list / long-running theme (at the bottom of the overview) */
.nfr-wish { max-width: 560px; margin: 28px auto 0; padding: 16px 16px 14px; border-radius: 16px; border: 1px solid rgba(90, 77, 60, 0.2); background: rgba(255, 255, 255, 0.22); } /* paper tone */
.nfr-wish h2 { font-size: 15px; font-weight: 600; letter-spacing: 2px; color: #5a4d3c; margin: 0 0 10px; }
.nfr-add { display: flex; gap: 8px; }
.nfr-add input { flex: 1; min-width: 0; height: 40px; padding: 0 14px; border: 1px solid rgba(90, 77, 60, 0.28); border-radius: 12px; background: rgba(255, 255, 255, 0.45); color: #3b3022; }
.nfr-add input::placeholder, .nfr-theme input::placeholder { color: #a39583; }
.nfr-add button { flex: 0 0 auto; width: 40px; height: 40px; border: none; border-radius: 12px; background: rgba(201, 154, 74, 0.28); color: #7a5a22; font-size: 20px; }
.nfr-wish-list { list-style: none; margin: 6px 0 0; padding: 0; }
.nfr-wish-list li { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-top: 1px solid rgba(90, 77, 60, 0.14); font-size: 15px; color: #4a3e2e; }
.nfr-wish-list li:first-child { border-top: none; }
.nfr-wish-list .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nfr-wish-list .m { font-size: 12px; color: #9e8f76; flex: 0 0 auto; }
.nfr-wish-list .rm { border: none; background: none; color: #9e8f76; font-size: 18px; padding: 0 4px; line-height: 1; }
.nfr-wish-list li.done .name { text-decoration: line-through; color: #9e8f76; }
.nfr-empty { padding: 10px 2px 4px; color: #9e8f76; font-size: 13.5px; text-align: center; }
.nfr-theme { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(90, 77, 60, 0.14); }
.nfr-theme label { flex: 0 0 auto; font-size: 13px; color: #7a6b54; }
.nfr-theme input { flex: 1; min-width: 0; height: 38px; padding: 0 12px; border: 1px solid rgba(90, 77, 60, 0.28); border-radius: 12px; background: rgba(255, 255, 255, 0.45); color: #3b3022; }

/* Picture viewer: covers the whole reader. Absolute inside .nfr rather than fixed / 100vh, so it follows the reader's own height (on an iOS home-screen app the document is shorter than the screen). */
.nfr-view { position: absolute; inset: 0; z-index: 40; background: rgba(8, 10, 16, 0.95); touch-action: none; overscroll-behavior: contain; -webkit-user-select: none; user-select: none; animation: nfrViewIn 0.18s ease; }
@keyframes nfrViewIn { from { opacity: 0; } to { opacity: 1; } }
.nfr-view-stage { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; touch-action: none; }
.nfr-view-stage img { display: block; width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; border: 0; border-radius: 0; background: none; box-shadow: none; padding: 0; margin: 0; transform-origin: center center; will-change: transform; touch-action: none; -webkit-touch-callout: default; } /* every box property is spelled out: the page hosting the reader may have a global img rule (a 100px round avatar style, say) */
.nfr-view-btn { position: absolute; top: calc(env(safe-area-inset-top) + 14px); width: 42px; height: 42px; padding: 0; border: 1px solid rgba(255, 255, 255, 0.32); border-radius: 50%; background: rgba(22, 24, 32, 0.6); display: flex; align-items: center; justify-content: center; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.nfr-view-btn svg { width: 20px; height: 20px; color: #f1e8d4; }
.nfr-view-btn.close { right: 14px; }
.nfr-view-btn.save { right: 66px; }
.nfr-view-btn:active { background: rgba(60, 64, 78, 0.8); }
.nfr-view-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 30px 24px calc(env(safe-area-inset-bottom) + 20px); text-align: center; color: #e9dfca; font-size: 13px; line-height: 1.6; background: linear-gradient(transparent, rgba(8, 10, 16, 0.82)); pointer-events: none; transition: opacity 0.2s; }
.nfr-view.zoomed .nfr-view-cap { opacity: 0; }
.nfr-view-cap .nf-credit { display: block; margin-top: 2px; font-size: 11px; opacity: 0.72; }
.nfr-view-cap a { color: inherit; text-decoration: none; }
.nfr-view-hint { position: absolute; left: 50%; top: calc(env(safe-area-inset-top) + 70px); transform: translateX(-50%); padding: 7px 16px; border-radius: 999px; background: rgba(22, 24, 32, 0.86); color: #f1e8d4; font-size: 13px; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .nfr-view { animation: none; } }
