/* ==========================================================================
   The Fosgate Files: imageboard styles
   Light is a blue-grey board theme, dark is a soft charcoal one.
   With no saved choice the page follows the system setting.
   ========================================================================== */

:root {
  --bg: #eef2ff;
  --ink: #000;
  --muted: #707070;
  --link: #34345c;
  --hover: #dd0000;
  --post: #d6daf0;
  --post-line: #b7c5d9;
  --side: #b7c5d9;
  --title: #af0a0f;
  --subject: #0f0c5d;
  --name: #117743;
  --green: #789922;
  --quote: #dd0000;
  --hl: #d6bad0;
  --hl-line: #ba9dbf;
  --box-bar: #98e;
  --box-bar-ink: #000;
  --box: #fff;
  --input: #fff;
  --input-line: #aaa;
  --shadow: 0 0 5px rgba(0, 0, 0, .25);

  --fs: 14px;
  --f: arial, helvetica, sans-serif;
  --f-title: tahoma, "Segoe UI", sans-serif;
  /* banner scene: day */
  --sc-sky-top: var(--bg); --sc-sky-mid: #d9e3f7; --sc-sky-low: #f6efe2; --sc-glow: #fffaf0;
  --sc-city: #a9b4c6; --sc-land: #56657a; --sc-hill: #66778a; --sc-bridge: #3d4757; --sc-truss: #5a6575;
  --sc-water-top: #b9c8e2; --sc-water-low: var(--bg); --sc-ripple: #fff; --sc-tank: #fbfcfd; --sc-tank2: #d3d9e2;
  --sc-title: #af0a0f; --sc-shadow: #fff; --sc-nd: none; --sc-dd: inline;
  color-scheme: light;
}
:root[data-size="s"]  { --fs: 12.5px; }
:root[data-size="l"]  { --fs: 16px; }
:root[data-size="xl"] { --fs: 18.5px; }

:root[data-theme="dark"] {
  --bg: #1d1f21;
  --ink: #c5c8c6;
  --muted: #8a8d8b;
  --link: #81a2be;
  --hover: #a3c3e0;
  --post: #282a2e;
  --post-line: #111;
  --side: #4b4f54;
  --title: #c5c8c6;
  --subject: #b294bb;
  --name: #8abeb7;
  --green: #b5bd68;
  --quote: #5f89ac;
  --hl: #343a44;
  --hl-line: #5f89ac;
  --box-bar: #373b41;
  --box-bar-ink: #c5c8c6;
  --box: #282a2e;
  --input: #1d1f21;
  --input-line: #4b4f54;
  --shadow: 0 0 6px rgba(0, 0, 0, .6);
  /* banner scene: night */
  --sc-sky-top: var(--bg); --sc-sky-mid: #13161b; --sc-sky-low: #34363a; --sc-glow: #d9d5cb;
  --sc-city: #2a2b2f; --sc-land: #0b0d10; --sc-hill: #0e1014; --sc-bridge: #2a2d33; --sc-truss: #3a3e45;
  --sc-water-top: #18191d; --sc-water-low: var(--bg); --sc-ripple: #fff; --sc-tank: #e3e7ec; --sc-tank2: #c3c8cf;
  --sc-title: #ece9e2; --sc-shadow: #000; --sc-nd: inline; --sc-dd: none;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #1d1f21;
    --ink: #c5c8c6;
    --muted: #8a8d8b;
    --link: #81a2be;
    --hover: #a3c3e0;
    --post: #282a2e;
    --post-line: #111;
    --side: #4b4f54;
    --title: #c5c8c6;
    --subject: #b294bb;
    --name: #8abeb7;
    --green: #b5bd68;
    --quote: #5f89ac;
    --hl: #343a44;
    --hl-line: #5f89ac;
    --box-bar: #373b41;
    --box-bar-ink: #c5c8c6;
    --box: #282a2e;
    --input: #1d1f21;
    --input-line: #4b4f54;
    --shadow: 0 0 6px rgba(0, 0, 0, .6);
    /* banner scene: night */
    --sc-sky-top: var(--bg); --sc-sky-mid: #13161b; --sc-sky-low: #34363a; --sc-glow: #d9d5cb;
    --sc-city: #2a2b2f; --sc-land: #0b0d10; --sc-hill: #0e1014; --sc-bridge: #2a2d33; --sc-truss: #3a3e45;
    --sc-water-top: #18191d; --sc-water-low: var(--bg); --sc-ripple: #fff; --sc-tank: #e3e7ec; --sc-tank2: #c3c8cf;
    --sc-title: #ece9e2; --sc-shadow: #000; --sc-nd: inline; --sc-dd: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-padding-top: 20px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; padding: 0 10px;
  background: var(--bg); color: var(--ink);
  font-family: var(--f); font-size: var(--fs); line-height: 1.4;
}
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--hover); text-decoration: underline; }
button { font: inherit; }
hr { border: 0; border-top: 1px solid var(--post-line); margin: 8px 0; clear: both; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 1px; }
.muted { color: var(--muted); }
code { font-family: monospace; }
.skip { position: absolute; left: -999px; top: 4px; z-index: 200; background: var(--post); padding: 6px 10px; border: 1px solid var(--post-line); }
.skip:focus { left: 4px; }
.ref { font-family: var(--f); color: var(--quote); }
a.ref:hover { color: var(--hover); }
mark { background: #ff0; color: #000; }

/* ---------- board list (top and bottom navigation) ---------- */
.boardlist {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px;
  font-size: 12px; color: var(--muted); padding: 4px 0;
}
.boardlist a { color: var(--link); }
.boardlist a.cur { font-weight: bold; }
.boardlist button { background: none; border: 0; padding: 0; color: var(--link); cursor: pointer; font-size: 12px; }
.boardlist button:hover { color: var(--hover); text-decoration: underline; }
.boardlist.bottom { border-top: 1px solid var(--post-line); margin-top: 10px; padding-top: 6px; }

.app { outline: none; }
.loading, .notice { text-align: center; color: var(--muted); padding: 60px 0; }

/* ---------- board header ---------- */
.board-head { text-align: center; padding-top: 6px; }
.banner { display: inline-block; width: 320px; max-width: 100%; line-height: 0; }
.banner:hover { filter: brightness(1.06); }
/* the river illustration (banner and front-page logo); day or night follows the theme */
.scene { display: block; width: 100%; height: auto; }
.scene-title { font-family: var(--f-title); font-size: 21px; font-weight: bold; letter-spacing: -1px; fill: var(--sc-title); }
.scene-title.shadow { fill: var(--sc-shadow); opacity: .5; }
.scene .sc-night { display: var(--sc-nd); }
.scene .sc-day { display: var(--sc-dd); }
.s-sky-top { stop-color: var(--sc-sky-top); }
.s-sky-mid { stop-color: var(--sc-sky-mid); }
.s-sky-low { stop-color: var(--sc-sky-low); }
.s-glow { stop-color: var(--sc-glow); }
.s-water-top { stop-color: var(--sc-water-top); }
.s-water-low { stop-color: var(--sc-water-low); }
.sc-city { fill: var(--sc-city); }
.sc-land { fill: var(--sc-land); }
.sc-hill { fill: var(--sc-hill); }
.sc-bridge { fill: var(--sc-bridge); }
.sc-truss { fill: var(--sc-truss); }
.sc-lattice { stroke: var(--sc-truss); }
.sc-tank { fill: var(--sc-tank); }
.sc-tank2 { fill: var(--sc-tank2); }
.sc-ripple { fill: var(--sc-ripple); }
.board-title {
  margin: 8px 0 0; font-family: var(--f-title); font-size: 28px; font-weight: bold; letter-spacing: -2px;
  color: var(--title); line-height: 1.2; overflow-wrap: anywhere;
}
.board-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.searchbar { display: flex; justify-content: center; gap: 4px; margin: 10px auto 0; max-width: 420px; }
.searchbar input {
  flex: 1; min-width: 0; padding: 3px 6px; font: inherit; font-size: 13px;
  background: var(--input); color: var(--ink); border: 1px solid var(--input-line); border-radius: 0;
}
.searchbar button, .qr button {
  padding: 2px 12px; font-size: 13px; cursor: pointer; color: var(--ink);
  background: var(--post); border: 1px solid var(--input-line); border-radius: 2px;
}
.searchbar button:hover, .qr button:hover { border-color: var(--link); }

.navlinks { font-size: 13px; color: var(--muted); margin: 6px 0; }
.navlinks a.cur { font-weight: bold; color: var(--ink); }
.navlinks button { background: none; border: 0; padding: 0; color: var(--link); cursor: pointer; }
.navlinks button:hover { color: var(--hover); text-decoration: underline; }
.navlinks.filters { font-size: 12px; line-height: 1.7; }
.navlinks.more { text-align: center; margin: 14px 0; }

.board-info { max-width: 720px; margin: 8px auto; text-align: center; }
.board-info p { margin: 4px 0; }

/* ---------- posts ---------- */
.thread::after, .results::after { content: ""; display: block; clear: both; }
.post { overflow-wrap: anywhere; }
.post.op { margin: 4px 0 6px; }
.post.op::after { content: ""; display: block; clear: both; }
.reply-wrap { display: flex; align-items: flex-start; margin: 4px 0; }
.side { color: var(--side); font-size: 12px; padding: 4px 4px 0 2px; flex: none; user-select: none; }
.post.reply {
  background: var(--post); border: 1px solid var(--post-line); border-left: 0; border-top: 0;
  padding: 4px 10px 6px 8px; max-width: 100%; min-width: 0; display: flow-root;
}
.post.highlight, .post.reply.highlight { background: var(--hl); border: 1px solid var(--hl-line); }
.post.op.highlight { padding: 4px; }

.phead { font-size: 13px; line-height: 1.6; }
.phead .subject { color: var(--subject); font-weight: bold; }
.phead .name { color: var(--name); font-weight: bold; }
.phead .date { white-space: nowrap; }
.phead .no, .phead .no-ref { color: inherit; }
.phead .no:hover, .phead .no-ref:hover { color: var(--hover); }
.phead .likes { color: var(--muted); font-size: 12px; white-space: nowrap; }
.no-meta .phead .likes { display: none; }
.phead .rank { color: var(--title); font-weight: bold; }
.phead .board-tag { font-weight: bold; }
.acts { font-size: 12px; color: var(--muted); white-space: nowrap; }
.act { background: none; border: 0; padding: 0; margin: 0; color: var(--link); cursor: pointer; font-size: 12px; }
.act:hover { color: var(--hover); text-decoration: underline; }
.act b { font-weight: normal; }
.act.vote.on { color: var(--quote); font-weight: bold; }
.act.vote.on b { font-weight: bold; }

.ptext { margin: 6px 0 4px 2px; white-space: normal; }
.post.op .ptext { margin-left: 4px; }
.greentext { color: var(--green); }
.mention { color: var(--quote); }
.quotelink { color: var(--quote); text-decoration: underline; }
.quotelink:hover { color: var(--hover); }
.link { overflow-wrap: anywhere; }

.file { margin: 2px 0; }
.fileinfo { font-size: 12px; color: var(--muted); margin: 2px 0 3px; overflow-wrap: anywhere; }
.thumbs { display: flex; flex-wrap: wrap; gap: 6px; float: left; margin: 0 16px 6px 0; }
.thumb { display: block; line-height: 0; }
.thumb img { display: block; max-width: 125px; max-height: 125px; cursor: zoom-in; }
.op-file .thumb img { max-width: 250px; max-height: 250px; }
video.thumb { width: 220px; max-width: 100%; max-height: 260px; background: #000; }
.op-file video.thumb { width: 320px; max-height: 360px; }
.file.expanded .thumbs { float: none; }
.file.expanded .thumb img { max-width: 100%; max-height: none; cursor: zoom-out; }
.post.op .file { float: left; margin-right: 16px; }
.post.op .file .thumbs { float: none; margin-right: 0; }
.post.op .file.expanded { float: none; }

.thread-stats { font-size: 12px; color: var(--muted); margin: 10px 0 0; }

/* the final thread */
.thread.final .post.op .ptext, .thread.final .post.reply .ptext { font-size: 1.5em; }
.the-end { text-align: center; color: var(--muted); padding: 30px 0 10px; }
.the-end p { margin: 0; font-weight: bold; }
.the-end .care { margin-top: 12px; font-weight: normal; font-size: 12.5px; }

/* inline comments */
.replies { margin: 2px 0 8px 28px; max-width: 640px; }
.creply {
  background: var(--post); border: 1px solid var(--post-line); border-left: 0; border-top: 0;
  padding: 3px 8px 5px; margin: 3px 0; display: flow-root;
}
.creply .name.anon, .recent .name.anon { color: var(--name); font-weight: bold; }
.creply .cno { color: var(--muted); }
.clist > p { margin: 4px 0; }
.qr { display: grid; gap: 4px; margin-top: 6px; padding: 6px; background: var(--post); border: 1px solid var(--post-line); }
.qr-head { font-size: 12px; font-weight: bold; }
.qr input, .qr textarea {
  width: 100%; font: inherit; font-size: 13px; padding: 3px 5px;
  background: var(--input); color: var(--ink); border: 1px solid var(--input-line); border-radius: 0; resize: vertical;
}
.qr-row { display: flex; justify-content: space-between; align-items: center; font-size: 11px; }
.qr button:disabled { opacity: .5; cursor: default; }

/* search / top lists */
.results .post.op { background: var(--post); border: 1px solid var(--post-line); border-left: 0; border-top: 0; padding: 4px 10px 6px; margin: 6px 0; }

/* ---------- catalog ---------- */
.catalog { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 18px 10px; padding: 6px 0; }
.cat { display: flex; flex-direction: column; align-items: center; text-align: center; color: var(--ink); font-size: 12px; overflow-wrap: anywhere; }
.cat:hover { text-decoration: none; color: var(--ink); }
.cat img { max-width: 150px; max-height: 150px; box-shadow: var(--shadow); }
.cat:hover img { box-shadow: 0 0 0 2px var(--link); }
.cat .noimg { width: 120px; height: 90px; display: flex; align-items: center; justify-content: center; background: var(--post); border: 1px solid var(--post-line); color: var(--muted); font-size: 11px; }
.cat-meta { margin-top: 5px; font-size: 11px; color: var(--muted); }
.cat-meta b { color: var(--ink); }
.cat-text { margin-top: 2px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; max-width: 180px; }
.cat-text b { color: var(--subject); }

/* ---------- front page ---------- */
.front { max-width: 760px; margin: 0 auto; padding: 10px 0 20px; }
.logo { display: block; max-width: 640px; margin: 4px auto 10px; line-height: 0; }
.logo:hover { filter: brightness(1.08); }
.box { border: 1px solid var(--post-line); margin: 0 0 12px; background: var(--box); }
.box h2 { margin: 0; padding: 3px 8px; background: var(--box-bar); color: var(--box-bar-ink); font-size: 14px; font-weight: bold; font-family: var(--f); }
.box-body { padding: 8px 10px; }
.box-body p { margin: 4px 0 8px; }
.box-body.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 20px; }
.box-body h3 { margin: 4px 0; font-size: 13px; text-decoration: underline; font-family: var(--f); }
.box-body ul { list-style: none; margin: 0; padding: 0; }
.box-body li { padding: 1px 0; }
.box-body .post.op { margin: 0; }
.stats { display: flex; flex-wrap: wrap; gap: 4px 24px; }
.popular { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.pop { display: flex; flex-direction: column; align-items: center; text-align: center; color: var(--ink); font-size: 12px; overflow-wrap: anywhere; }
.pop:hover { text-decoration: none; color: var(--ink); }
.pop img { max-width: 100%; max-height: 140px; margin: 4px 0; box-shadow: var(--shadow); }
.pop:hover img { box-shadow: 0 0 0 2px var(--link); }
.pop-board { font-weight: bold; color: var(--link); }
.pop-text { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pop-meta { color: var(--muted); font-size: 11px; margin-top: 2px; }
.recent { list-style: none; margin: 0; padding: 0; }
.recent li { padding: 4px 0; border-bottom: 1px solid var(--post-line); font-size: 13px; }
.recent li:last-child { border-bottom: 0; }
.recent-body { overflow-wrap: anywhere; }
.front-search { margin: 18px auto 0; }

/* ---------- settings window ---------- */
.modal { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, .35); display: flex; align-items: flex-start; justify-content: center; padding: 70px 12px 12px; }
.window { width: min(420px, 100%); background: var(--post); border: 1px solid var(--post-line); box-shadow: var(--shadow); }
.window-head { display: flex; justify-content: space-between; align-items: center; padding: 3px 4px 3px 8px; background: var(--box-bar); color: var(--box-bar-ink); font-weight: bold; }
.window-x { background: none; border: 0; color: inherit; font-size: 18px; line-height: 1; cursor: pointer; padding: 0 6px; }
.window-body { padding: 6px 10px 10px; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--post-line); font-size: 13px; }
.setting:last-child { border-bottom: 0; }
.setting.check { justify-content: flex-start; cursor: pointer; }
.seg { display: inline-flex; gap: 0; }
.seg button { padding: 2px 8px; font-size: 12px; background: var(--input); color: var(--ink); border: 1px solid var(--input-line); margin-left: -1px; cursor: pointer; }
.seg button.on { background: var(--link); color: var(--bg); border-color: var(--link); font-weight: bold; }

/* ---------- toast / footer ---------- */
.toast {
  position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 130;
  background: var(--post); color: var(--ink); border: 1px solid var(--post-line); box-shadow: var(--shadow);
  padding: 6px 14px; font-size: 13px; max-width: calc(100vw - 24px); text-align: center;
}
.footer { text-align: center; font-size: 11px; color: var(--muted); padding: 8px 0 24px; }
.footer p { margin: 3px 0; }

/* ---------- small screens ---------- */
@media (max-width: 640px) {
  body { padding: 0 6px; }
  .boardlist { font-size: 11.5px; }
  .boardlist .nav-right { width: 100%; }
  .banner { width: 260px; }
  .board-title { font-size: 23px; letter-spacing: -1px; }
  .side { display: none; }
  .post.reply { border-left: 1px solid var(--post-line); width: 100%; }
  .thumb img { max-width: 100px; max-height: 100px; }
  .op-file .thumb img { max-width: 150px; max-height: 150px; }
  .post.op .file { margin-right: 10px; }
  video.thumb, .op-file video.thumb { width: 100%; }
  .thumbs { margin-right: 10px; }
  .replies { margin-left: 8px; }
  .catalog { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .cat img { max-width: 130px; max-height: 130px; }
  .box-body.cols { grid-template-columns: 1fr; }
  .popular { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- /pond/: the readers' board ---------- */
.navlinks.center { text-align: center; font-size: 15px; font-weight: bold; margin: 10px 0; }
.pf-wrap { max-width: 520px; margin: 10px auto; }
.postform { display: grid; gap: 3px; }
.postform label { display: grid; grid-template-columns: 86px minmax(0, 1fr); gap: 3px; align-items: stretch; }
.postform label > span {
  background: var(--box-bar); color: var(--box-bar-ink); border: 1px solid var(--post-line);
  font-weight: bold; font-size: 12.5px; padding: 3px 6px; display: flex; align-items: center;
}
.postform input, .postform textarea {
  width: 100%; font: inherit; font-size: 13px; padding: 3px 5px;
  background: var(--input); color: var(--ink); border: 1px solid var(--input-line); border-radius: 0; resize: vertical;
}
.postform .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.pf-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 11px; margin-top: 2px; }
.pf-row button { padding: 3px 14px; font-size: 13px; cursor: pointer; color: var(--ink); background: var(--post); border: 1px solid var(--input-line); border-radius: 2px; }
.pf-row button:hover { border-color: var(--link); }
.pf-row button:disabled { opacity: .5; cursor: default; }
.board-rules { font-size: 11.5px; color: var(--muted); margin-top: 8px; line-height: 1.45; }
.omitted { font-size: 12px; color: var(--muted); margin: 2px 0 4px 2px; }
.phead .you { color: var(--muted); font-weight: bold; font-size: 12px; }
.backlinks { font-size: 11.5px; }
.backlinks .quotelink { margin-right: 3px; }
.post.bpost.highlight { background: var(--hl); border: 1px solid var(--hl-line); }
.readers-board { grid-column: 1 / -1; border-top: 1px solid var(--post-line); padding-top: 6px; margin-top: 4px; }
.readers-board p { margin: 2px 0; }
@media (max-width: 640px) {
  .postform label { grid-template-columns: 70px minmax(0, 1fr); }
  .pf-row { flex-direction: column; align-items: flex-end; }
}

/* ---------- verse references written by readers, and hover previews ---------- */
.vref {
  color: var(--quote); font-weight: bold; text-decoration: none; white-space: nowrap;
  padding: 0 3px; border-radius: 3px;
  background: color-mix(in srgb, var(--quote) 12%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--quote) 25%, transparent);
  animation: vref-shine 3.2s ease-in-out infinite;
}
.vref:hover {
  color: var(--hover); text-decoration: none;
  background: color-mix(in srgb, var(--quote) 22%, transparent);
}
@keyframes vref-shine {
  0%, 100% { text-shadow: 0 0 0 transparent; }
  50% { text-shadow: 0 0 7px color-mix(in srgb, var(--quote) 70%, transparent); }
}
@media (prefers-reduced-motion: reduce) { .vref { animation: none; } }
.ref-preview {
  position: fixed; z-index: 150; max-width: 360px; pointer-events: none;
  background: var(--post); color: var(--ink); border: 1px solid var(--post-line); box-shadow: var(--shadow);
  padding: 6px 9px 7px; font-size: 13px; line-height: 1.4; overflow: hidden;
}
.ref-preview::after { content: ""; display: block; clear: both; }
.ref-preview img { float: left; max-width: 110px; max-height: 110px; margin: 2px 9px 3px 0; }
.ref-preview .pv-head { font-size: 11.5px; color: var(--muted); margin-bottom: 4px; }
.ref-preview .pv-head b { color: var(--name); }
.ref-preview .pv-media { float: left; font-size: 11px; color: var(--muted); margin-right: 8px; }
.ref-preview .pv-text { overflow-wrap: anywhere; }
.ref-preview .pv-post .phead .acts { display: none; }
.ref-preview .pv-post .ptext { margin: 4px 0 0; }

/* ---------- /pond/ images, reports and the moderation queue ---------- */
.pending-box {
  display: flex; align-items: center; justify-content: center; text-align: center;
  width: 125px; height: 90px; font-size: 11px; color: var(--muted);
  background: var(--bg); border: 1px dashed var(--post-line);
}
.file.pending img { outline: 2px dashed var(--title); outline-offset: 2px; min-width: 40px; min-height: 40px; }
.act.mod { color: var(--title); }
.queue-item .post.op { background: var(--post); border: 1px solid var(--post-line); padding: 4px 10px 6px; }
.queue-meta { font-size: 12px; margin: 4px 0 0 2px; }
.queue-meta b { color: var(--title); }
.postform input[type=file] { padding: 2px; font-size: 12px; }
