/* The Vyrnfall forum. Colours, type, buttons, panels and fields come from assets/vyrnfall-ui.css;
   this file is the forum's layout: a top bar, lists of boards and threads, and posts. */

html { scroll-padding-top: 84px; }
body { min-height: 100vh; }
#app { min-height: 100vh; display: flex; flex-direction: column; }
h1 { font-size: clamp(26px, 3.2vw, 38px); color: #fff; overflow-wrap: anywhere; }
h1:focus { outline: none; }
h2 { font-size: 18px; color: var(--violet-hi); letter-spacing: 0.04em; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.stack { display: grid; gap: 14px; }
.stack-lg { display: grid; gap: 20px; align-content: start; }
.hint { font: 400 14px/1.4 var(--font-text); color: var(--muted); }
.hint:empty { display: none; }
.facts { margin: 0; padding-left: 20px; display: grid; gap: 8px; color: var(--muted); font-size: 16px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 60; padding: 10px 14px; background: var(--violet); color: var(--gold-ink); font-weight: 700; border-radius: var(--radius-sm); }
.skip:focus { top: 12px; color: var(--gold-ink); }
.boot { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
textarea.vf-input { min-height: 140px; resize: vertical; line-height: 1.5; }

/* ---- the top bar ---- */
.top { position: sticky; top: 0; z-index: 20; background: rgb(11 8 15 / 0.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(8px); }
.top__in { max-width: var(--page); margin: 0 auto; padding: 8px var(--gutter); display: flex; align-items: center; gap: 22px; min-height: 64px; }
.top__brand img { width: 132px; height: auto; }
.top__nav { display: flex; gap: 2px; flex: 1; }
.top__nav a { padding: 10px 14px; font: 700 15px/1.2 var(--font-title); letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; color: var(--muted); border-radius: var(--radius-sm); }
.top__nav a:hover { color: var(--ink); background: var(--surface-2); }
.top__nav a[aria-current] { color: #fff; box-shadow: inset 0 -2px 0 var(--crimson); border-radius: 0; }
.top__me { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.top__me .vf-btn { min-height: 40px; padding: 7px 16px; }
.top__who { display: inline-flex; align-items: center; gap: 8px; padding: 8px 10px; font-weight: 600; color: var(--ink); text-decoration: none; border-radius: var(--radius-sm); max-width: 220px; }
.top__who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top__who:hover { background: var(--surface-2); color: var(--violet-hi); }

/* ---- the page ---- */
.page { flex: 1; width: 100%; max-width: var(--page); margin: 0 auto; padding: 28px var(--gutter) 56px; display: grid; gap: 20px; align-content: start; }
.page[aria-busy="true"] { opacity: 0.6; transition: opacity 0.2s 0.25s; }
.lead { display: grid; gap: 8px; padding: 8px 0 4px; }
.lead p { color: var(--muted); max-width: 62ch; }
/* The front page's introduction: who can read, who can post, and the way in. */
.hub { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px 20px; padding: 18px 22px; background: linear-gradient(120deg, rgb(77 12 28 / 0.55), rgb(46 22 80 / 0.5)), var(--surface); border: 1px solid var(--line-hi); border-radius: var(--radius); box-shadow: var(--edge); }
.hub__mark { width: 64px; height: 64px; }
.hub__words { display: grid; gap: 6px; min-width: 0; }
.hub__words p { color: var(--muted); max-width: 68ch; }
.hub__words strong { color: var(--ink); }
.hub__acts { display: flex; flex-wrap: wrap; gap: 8px; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 14px; }
.head > div { display: grid; gap: 6px; min-width: 0; }
.head p { max-width: 70ch; }
.head__thread { font-size: clamp(24px, 2.8vw, 32px); }

.crumbs ol { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 15px; color: var(--muted); }
.crumbs li { display: inline-flex; gap: 6px; min-width: 0; }
.crumbs li + li::before { content: "›"; color: var(--metal); }
.crumbs span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46ch; }

/* ---- lists of boards and threads ---- */
.group { padding: 0; overflow: hidden; }
.group > h2 { display: flex; align-items: center; gap: 10px; padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.group > h2 .vf-icon { width: 18px; height: 18px; color: var(--violet); flex: none; }
.group--recent { border-color: var(--line-hi); }
.group--recent > h2 { color: #fff; background: linear-gradient(90deg, rgb(140 21 48 / 0.4), transparent 70%), var(--bg-2); }
.group--recent > h2 .vf-icon { color: var(--crimson-hi); }
.group__empty { padding: 18px 20px; }
.boards, .threads, .recent { margin: 0; padding: 0; list-style: none; }
.board, .thread { display: grid; grid-template-columns: minmax(0, 1fr) 104px minmax(0, 250px); gap: 18px; align-items: center; padding: 12px 20px; }
.thread--recent { grid-template-columns: minmax(0, 1fr) 88px minmax(0, 190px); padding: 10px 20px; }
.thread--recent h3 { font-size: 17px; }
.thread--recent .thread__last strong { color: var(--ink); font-weight: 600; }
/* The forum's own threads stay in the list, a step quieter than a conversation between players. */
.thread--system h3 a { color: var(--muted); font-weight: 600; }
.board:focus-within, .thread:focus-within { background: rgb(255 255 255 / 0.03); }
.board + .board, .thread + .thread { border-top: 1px solid var(--line); }
.board:hover, .thread:hover { background: rgb(255 255 255 / 0.02); }
.board h3, .thread h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font: 700 18px/1.3 var(--font-text); letter-spacing: 0; }
.board h3 a, .thread h3 a { color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.board h3 a:hover, .thread h3 a:hover { color: var(--violet-hi); text-decoration: underline; }
.thread__what p a, .board__last span { color: var(--muted); }
.thread__what p a:hover { color: var(--violet-hi); }
.board__what p, .thread__what p { color: var(--muted); font-size: 15px; margin-top: 2px; }
.board__count, .thread__count { font-size: 14px; line-height: 1.5; color: var(--muted); text-align: right; }
.board__count strong, .thread__count strong { color: var(--ink); }
.board__last, .thread__last { display: grid; gap: 1px; font-size: 14px; color: var(--muted); min-width: 0; }
.board__last a, .thread__last a { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread--pinned { background: rgb(131 61 206 / 0.07); }

.side { display: grid; gap: 12px; }
.recent { display: grid; gap: 12px; }
.recent li { display: grid; gap: 1px; min-width: 0; }
.recent a { font-weight: 600; overflow-wrap: anywhere; }
.recent span { font-size: 14px; color: var(--muted); }

.pager { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }
.pager > :last-child { justify-self: end; }
.pager > :first-child { justify-self: start; }
.pager .vf-btn { min-height: 40px; padding: 7px 14px; }

/* ---- a thread ---- */
.posts { display: grid; gap: 12px; }
.post { display: grid; grid-template-columns: 190px minmax(0, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--edge); overflow: hidden; }
.post--target { border-color: var(--amethyst); }
.post__who { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 16px 18px; background: var(--bg-2); border-right: 1px solid var(--line); }
.post__name { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
a.post__name:hover { color: var(--violet-hi); text-decoration: underline; }
.post__posts { font-size: 14px; color: var(--muted); }
.post__main { display: grid; gap: 12px; padding: 14px 20px 12px; min-width: 0; align-content: start; }
.post__meta { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; font-size: 14px; color: var(--muted); }
.post__n { font-weight: 700; text-decoration: none; }
.post__body { display: grid; gap: 12px; max-width: 76ch; overflow-wrap: anywhere; }
.post__picture { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.post__body blockquote, .report blockquote { margin: 0; padding: 8px 14px; border-left: 3px solid var(--line-hi); background: var(--bg-2); color: var(--muted); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.post__acts { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; margin-left: -8px; }
.act { min-height: 34px; padding: 4px 8px; font: 600 14px/1.2 var(--font-text); color: var(--muted); background: none; border: 0; border-radius: var(--radius-sm); cursor: pointer; }
.act:hover { color: var(--violet-hi); background: var(--surface-2); }
.act--bad { color: var(--bad); }
.act--bad:hover { color: #ffc2b5; background: #3a1d18; }
.confirm { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 14px; color: var(--ink); }
.confirm > span { padding-left: 8px; }
.post__report { padding-top: 12px; border-top: 1px solid var(--line); max-width: 560px; }
.post .stack .vf-btn, .post__report .vf-btn { min-height: 40px; }
#last { display: block; }

.staffbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; padding: 12px 20px; }
.staffbar select.vf-input { width: auto; min-height: 44px; max-width: 260px; }
.reply { display: grid; gap: 12px; }
.prompt { gap: 12px; }
.report { display: grid; gap: 10px; }

/* A message in place of content. */
.state { display: grid; justify-items: center; gap: 12px; padding: 48px 20px; text-align: center; }
.state p { max-width: 52ch; color: var(--muted); }
.state .row { justify-content: center; }

/* ---- sign-in ---- */
.signin { width: min(440px, calc(100vw - 24px)); }
.signin h2 { font-size: 18px; color: #fff; }
.signin__in { display: grid; gap: 16px; padding: 20px; }
.signin__in .vf-btn--gold { width: 100%; min-height: 50px; }
.signin__links { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 15px; color: var(--muted); }

.foot { border-top: 1px solid var(--line); background: var(--bg-2); }
.foot__in { max-width: var(--page); margin: 0 auto; padding: 20px var(--gutter); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; font-size: 15px; color: var(--muted); }

#toast {
  position: fixed; right: 20px; bottom: 20px; z-index: 70;
  max-width: min(420px, calc(100vw - 40px));
  background: var(--surface-2); color: var(--ink);
  border: 1px solid var(--good); border-left-width: 3px; border-radius: var(--radius);
  padding: 12px 16px; box-shadow: var(--shadow);
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.15s, transform 0.15s;
  pointer-events: none;
}
#toast.show { opacity: 1; transform: none; }
#toast.bad { border-color: var(--bad); }

@media (max-width: 980px) {
  .cols { grid-template-columns: minmax(0, 1fr); }
  .board, .thread, .thread--recent { grid-template-columns: minmax(0, 1fr) minmax(0, 220px); }
  .hub { grid-template-columns: auto minmax(0, 1fr); }
  .hub__acts { grid-column: 1 / -1; }
  .board__count, .thread__count { display: none; }
}
@media (max-width: 680px) {
  .top__in { gap: 10px; flex-wrap: wrap; min-height: 0; }
  .top__brand img { width: 108px; }
  .top__nav { order: 3; flex-basis: 100%; overflow-x: auto; margin: 0 -8px; }
  .top__nav a { padding: 8px 10px; font-size: 14px; }
  .top__who { padding: 8px 4px; }
  .top__who .vf-icon { display: none; }
  .top__who span { max-width: 104px; }
  .top__me .vf-btn { padding: 7px 10px; }
  .crumbs li:last-child:not(:first-child) { display: none; }
  .page { padding-top: 18px; gap: 16px; }
  .board, .thread, .thread--recent { grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 12px 16px; }
  .thread__last { display: flex; flex-wrap: wrap; gap: 0 8px; }
  .hub { padding: 16px; gap: 12px 14px; }
  .hub__mark { width: 44px; height: 44px; }
  .hub__acts .vf-btn { flex: 1 1 150px; }
  .group > h2 { padding: 12px 16px; }
  .post { grid-template-columns: minmax(0, 1fr); }
  .post__who { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .post__main { padding: 12px 16px; }
  .pager { grid-template-columns: auto 1fr auto; }
  .pager > span { text-align: center; }
  html { scroll-padding-top: 110px; }
}
@media (prefers-reduced-motion: reduce) { #toast, .page[aria-busy="true"] { transition: none; } #toast { transform: none; } }
