/* Community forum (/forum, /forum/authority|topic|thread|user/:x, /forum/new) on the Site Plan design.
   Squared-off cards with hairlines, SF Pro at 600 at most, amber for new things and actions, mono for dates and
   places. Needs tokens.css and base.css (views/partials/site/head.ejs). Tokens only, so it re-lights on dark. */

/* ---------- Head band ---------- */
.fo-hero {
  position: relative; background: var(--paper-2); border-bottom: 1px solid var(--rule); overflow: hidden;
  padding: calc(var(--nav-clear, 88px) + clamp(12px, 2vw, 28px)) 0 clamp(32px, 4vw, 52px);
}
.fo-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--scrim) 1px, transparent 1px), linear-gradient(90deg, var(--scrim) 1px, transparent 1px);
  background-size: 32px 32px; -webkit-mask-image: radial-gradient(110% 100% at 80% 20%, #000 25%, transparent 75%); mask-image: radial-gradient(110% 100% at 80% 20%, #000 25%, transparent 75%);
}
.fo-hero > .wrap { position: relative; display: grid; gap: 18px; }
.fo-crumbs { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; font: 12px/1.4 var(--font-mono); color: var(--ink-3); letter-spacing: 0; min-width: 0; }
.fo-crumbs a:hover { color: var(--ink); }
.fo-crumbs [aria-current] { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: min(46ch, 70vw); }
.fo-hero-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 20px 40px; }
.fo-hero-copy { display: grid; gap: 12px; min-width: 0; max-width: 760px; }
.fo-hero .h1 { font-size: clamp(40px, 5vw, 72px); line-height: .98; }
.fo-hero .h1.fo-h1--long { font-size: clamp(30px, 3.4vw, 50px); line-height: 1.05; letter-spacing: -0.035em; }
.fo-sub { color: var(--ink-2); font-size: 17px; max-width: 60ch; }
.fo-meta-line { font: 12.5px/1.5 var(--font-mono); color: var(--ink-3); letter-spacing: 0; }
.fo-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* Real counts, counting up */
.fo-stats { display: flex; flex-wrap: wrap; gap: 0; margin: 6px 0 0; }
.fo-stats > div { padding: 0 24px; border-left: 1px solid var(--rule); }
.fo-stats > div:first-child { padding-left: 0; border-left: 0; }
.fo-stats dt { font: 11px/1.3 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.fo-stats dd { margin: 6px 0 0; font-family: var(--font-display); font-weight: 600; font-size: clamp(28px, 2.6vw, 38px); line-height: 1; letter-spacing: -0.035em; color: var(--ink); font-variant-numeric: tabular-nums; }

/* Search an authority */
.fo-search { display: flex; gap: 8px; min-width: 0; }
.fo-search .fo-field { position: relative; flex: 1; min-width: 0; }
.fo-search .fo-field .ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.fo-search .input { height: 44px; padding-left: 38px; border-radius: 12px; font-size: 15px; }
.fo-search .btn { --h: 44px; }

/* ---------- Layout ---------- */
.fo-main { padding: clamp(28px, 4vw, 56px) 0 clamp(64px, 8vw, 112px); }
.fo-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: clamp(24px, 3.4vw, 48px); align-items: start; }
.fo-feed { display: grid; gap: 10px; min-width: 0; }
.fo-feed-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 0 0 4px; }
.fo-feed-h h2 { font-family: var(--font-display); font-weight: 600; font-size: 22px; letter-spacing: -0.02em; color: var(--ink); }
.fo-feed-h a, .fo-feed-h span { font-size: 14px; color: var(--ink-3); }
.fo-feed-h a:hover { color: var(--ink); }
.fo-feed + .fo-feed-h, .fo-feed + .fo-section { margin-top: 36px; }

/* ---------- Thread rows ---------- */
.fo-row {
  position: relative; display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 18px; padding: 18px 20px;
  border-radius: var(--r-lg); background: var(--sheet); box-shadow: var(--sh-1);
  transition: box-shadow var(--dur-quick) var(--ease-out), transform var(--dur-quick) var(--ease-out);
}
.fo-row:hover { box-shadow: var(--sh-2); }
.fo-count { display: grid; align-content: center; justify-items: center; gap: 2px; height: 64px; border-radius: 14px; background: var(--paper-2); color: var(--ink-3); }
.fo-count b { font-family: var(--font-display); font-weight: 600; font-size: 24px; line-height: 1; letter-spacing: -0.03em; color: var(--ink); font-variant-numeric: tabular-nums; }
.fo-count small { font: 10px/1 var(--font-mono); letter-spacing: .04em; text-transform: uppercase; }
.fo-count.is-hot { background: var(--amber-soft); }
.fo-count.is-hot small { color: var(--amber-ink); }
.fo-count .ico { color: var(--ink-3); }
.fo-row-main { display: grid; gap: 6px; min-width: 0; align-content: start; }
.fo-title { font-family: var(--font-display); font-weight: 600; font-size: 19px; line-height: 1.25; letter-spacing: -0.018em; color: var(--ink); text-wrap: pretty; }
.fo-title:hover { text-decoration: underline; text-decoration-color: var(--amber); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.fo-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13.5px; color: var(--ink-3); line-height: 1.5; }
.fo-meta time, .fo-date { font: 12.5px/1.5 var(--font-mono); letter-spacing: 0; color: var(--ink-3); }
.fo-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-4); }
.fo-excerpt { font-size: 15px; line-height: 1.55; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fo-more { justify-self: start; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; color: var(--ink); margin-top: 2px; }
.fo-more .ico { transition: transform var(--dur-quick) var(--ease-out); }
.fo-more:hover .ico, .fo-row:hover .fo-more .ico { transform: translateX(3px); }

/* Place and topic tags: places in mono (like a drawing note), topics as squared chips */
.fo-place { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 8px; background: var(--amber-wash); box-shadow: inset 0 0 0 1px var(--amber-soft); font: 500 12px/1 var(--font-mono); color: var(--amber-ink); letter-spacing: 0; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
a.fo-place:hover { background: var(--amber-soft); }
.fo-topic { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 10px; background: var(--sheet); box-shadow: inset 0 0 0 1px var(--rule-2); font-size: 13.5px; font-weight: 500; color: var(--ink-2); white-space: nowrap; transition: box-shadow var(--dur-instant), color var(--dur-instant), background-color var(--dur-instant); }
.fo-topic small { font: 11.5px/1 var(--font-mono); color: var(--ink-3); letter-spacing: 0; }
a.fo-topic:hover { color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink-3); }
.fo-topics { display: flex; flex-wrap: wrap; gap: 8px; }

/* Author line and badges (views/forum/_helpers.ejs) */
.fo-author { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.fo-name { font-weight: 600; color: var(--ink); }
a.fo-name:hover { text-decoration: underline; text-decoration-color: var(--amber); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.fo-badge { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 6px; font: 500 10.5px/1 var(--font-mono); letter-spacing: .04em; background: var(--paper-2); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--rule); }
.fo-badge--verified { background: var(--amber-wash); color: var(--amber-ink); box-shadow: inset 0 0 0 1px var(--amber-soft); }
.fo-badge--admin { background: var(--ink); color: var(--paper); box-shadow: none; }
.fo-avatar { flex: none; width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--amber-soft); color: var(--amber-ink); font-family: var(--font-display); font-weight: 600; font-size: 16px; text-transform: uppercase; }
.fo-avatar--lg { width: 64px; height: 64px; border-radius: 18px; font-size: 28px; }

/* ---------- Sidebar ---------- */
.fo-side { display: grid; gap: 14px; position: sticky; top: calc(var(--nav-clear, 88px) + 12px); }
.fo-panel { padding: 20px; border-radius: var(--r-lg); background: var(--sheet); box-shadow: var(--sh-1); display: grid; gap: 12px; min-width: 0; }
.fo-panel h2, .fo-panel h3 { font: 500 11.5px/1.3 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.fo-panel p { font-size: 14.5px; line-height: 1.55; color: var(--ink-2); }
.fo-panel .btn { width: 100%; }
.fo-panel--amber { background: var(--amber-field); box-shadow: none; color: #111214; }
.fo-panel--amber p { color: #2B2D31; }
.fo-auths { max-height: 260px; overflow-y: auto; margin: 0 -6px; padding: 0 6px; overscroll-behavior: contain; }
.fo-auths a { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--rule-soft); font-size: 14.5px; color: var(--ink-2); }
.fo-auths a:last-child { border-bottom: 0; }
.fo-auths a:hover { color: var(--ink); }
.fo-auths a .ico { color: var(--ink-4); transition: transform var(--dur-quick) var(--ease-out), color var(--dur-quick); }
.fo-auths a:hover .ico { color: var(--ink); transform: translateX(2px); }
.fo-rules { display: grid; gap: 8px; }
.fo-rules li { position: relative; padding-left: 18px; font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }
.fo-rules li::before { content: ""; position: absolute; left: 2px; top: .55em; width: 6px; height: 6px; border-radius: 50%; background: var(--amber); }
.fo-link { display: inline-flex; align-items: center; gap: 6px; font-size: 14.5px; font-weight: 500; color: var(--ink); }
.fo-link .ico { transition: transform var(--dur-quick) var(--ease-out); }
.fo-link:hover .ico { transform: translateX(3px); }

/* ---------- Empty and notices ---------- */
.fo-empty { display: grid; justify-items: center; gap: 14px; padding: clamp(32px, 5vw, 56px) 24px; text-align: center; border-radius: var(--r-lg); background: var(--sheet); box-shadow: var(--sh-1); color: var(--ink-2); }
.fo-empty .ico { color: var(--amber-deep); }
.fo-empty--sm { justify-items: start; text-align: left; padding: 20px; font-size: 15px; }
.fo-notice { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-md); font-size: 15px; line-height: 1.5; background: var(--green-wash); color: var(--green-ink); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--green) 25%, transparent); }
.fo-notice .ico { flex: none; margin-top: 2px; }
.fo-notice--warn { background: var(--amber-wash); color: var(--amber-ink); box-shadow: inset 0 0 0 1px var(--amber-soft); }
.fo-notice-wrap { margin-top: 18px; }

/* ---------- Thread page ---------- */
.fo-thread-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 14.5px; color: var(--ink-3); }
.fo-posts { display: grid; gap: 12px; min-width: 0; }
.fo-post { border-radius: var(--r-lg); background: var(--sheet); box-shadow: var(--sh-1); overflow: hidden; scroll-margin-top: calc(var(--nav-clear, 88px) + 16px); }
.fo-post--op { box-shadow: var(--sh-2); }
.fo-post--op .fo-post-head { background: var(--amber-wash); }
.fo-post:target { box-shadow: 0 0 0 2px var(--amber), var(--sh-2); }
.fo-post-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px 12px 14px; border-bottom: 1px solid var(--rule-soft); background: var(--paper-2); }
.fo-post-who { display: flex; align-items: center; gap: 12px; min-width: 0; font-size: 15px; }
.fo-post-who > div { display: grid; gap: 1px; min-width: 0; }
.fo-op-tag { font: 500 10.5px/1 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--amber-ink); }
.fo-post-body { padding: clamp(16px, 2.2vw, 24px); }
.fo-flag { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 10px; border-radius: 9px; font-size: 13px; color: var(--ink-3); transition: background-color var(--dur-instant), color var(--dur-instant); }
.fo-flag:hover { background: var(--sheet); color: var(--ink); box-shadow: inset 0 0 0 1px var(--rule-2); }
.fo-flag-form { margin: 0; flex: none; }

/* Post text (markdown from lib/forum-markdown.js) */
.forum-post-body { color: var(--ink-2); font-size: 16.5px; line-height: 1.7; overflow-wrap: break-word; }
.forum-post-body > * + * { margin-top: .85em; }
.forum-post-body p { margin: 0; }
.forum-post-body * + p { margin-top: .85em; }
.forum-post-body ul, .forum-post-body ol { padding-left: 1.3em; }
.forum-post-body ul { list-style: disc; }
.forum-post-body ol { list-style: decimal; }
.forum-post-body li { margin: .25em 0; }
.forum-post-body li::marker { color: var(--amber-deep); }
.forum-post-body a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--amber); text-decoration-thickness: 1.5px; text-underline-offset: 3px; word-break: break-word; }
.forum-post-body a:hover { text-decoration-color: var(--ink); }
.forum-post-body strong, .forum-post-body b { color: var(--ink); font-weight: 600; }
.forum-post-body code { font-family: var(--font-mono); font-size: .88em; background: var(--paper-2); padding: 1px 5px; border-radius: 5px; }
.forum-post-body pre { background: #16181B; color: #F4F2EC; padding: 14px 16px; border-radius: var(--r-md); overflow-x: auto; font-size: 14px; }
.forum-post-body pre code { background: transparent; padding: 0; color: inherit; }
.forum-post-body blockquote { margin: 0; padding: 12px 16px; border-left: 3px solid var(--amber); background: var(--paper-2); border-radius: 0 10px 10px 0; color: var(--ink-2); }
.forum-post-body h1, .forum-post-body h2, .forum-post-body h3 { font-family: var(--font-display); font-weight: 600; color: var(--ink); letter-spacing: -0.015em; line-height: 1.25; margin-top: 1.2em; }
.forum-post-body h1 { font-size: 22px; } .forum-post-body h2 { font-size: 20px; } .forum-post-body h3 { font-size: 18px; }
.forum-post-body img { max-width: 100%; height: auto; border-radius: 10px; }
.forum-post-body table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-size: 15px; }
.forum-post-body th, .forum-post-body td { padding: 8px 10px; border-bottom: 1px solid var(--rule); text-align: left; }

/* ---------- Composer (reply and new thread) ---------- */
.fo-composer { display: grid; gap: 18px; padding: clamp(20px, 2.6vw, 30px); border-radius: var(--r-xl); background: var(--sheet); box-shadow: var(--sh-3); min-width: 0; }
.fo-composer-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 1px solid var(--rule); }
.fo-composer-head h2 { font-family: var(--font-display); font-weight: 600; font-size: 22px; letter-spacing: -0.02em; color: var(--ink); }
.fo-composer-head .mono { color: var(--ink-3); font-size: 12px; }
.fo-composer .field label, .fo-legend { font-size: 14px; font-weight: 600; color: var(--ink); }
.fo-composer .input, .fo-composer .select { height: 48px; }
.fo-composer textarea.input { height: auto; min-height: 150px; padding: 12px 14px; line-height: 1.6; resize: vertical; font-size: 15.5px; }
.fo-composer textarea.fo-tall { min-height: 260px; }
.fo-hint { font-size: 12.5px; color: var(--ink-3); }
.fo-composer-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 18px; }
.fo-cancel { font-size: 15px; color: var(--ink-3); }
.fo-cancel:hover { color: var(--ink); }
.fo-chips { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 10px; }
.fo-chips > div { display: flex; flex-wrap: wrap; gap: 8px; }
.fo-chip { position: relative; display: inline-flex; cursor: pointer; }
.fo-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.fo-chip span {
  display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 8px 13px; border-radius: 10px;
  font-size: 14px; font-weight: 500; line-height: 1.25; color: var(--ink-2); background: var(--sheet); box-shadow: inset 0 0 0 1px var(--rule-2);
  transition: background-color var(--dur-instant) var(--ease-out), box-shadow var(--dur-instant) var(--ease-out), color var(--dur-instant);
}
.fo-chip span::before { content: ""; width: 14px; height: 14px; border-radius: 4px; flex: none; box-shadow: inset 0 0 0 1.5px var(--ink-4); transition: background-color var(--dur-quick), box-shadow var(--dur-quick); }
.fo-chip:hover span { color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink-3); }
.fo-chip input:checked + span { color: var(--ink); background: var(--amber-soft); box-shadow: inset 0 0 0 1.5px var(--amber); }
.fo-chip input:checked + span::before { background: var(--amber) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='none' stroke='%23111214' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3.5 7.2 2.3 2.3 4.7-5'/%3E%3C/svg%3E") center / 14px no-repeat; box-shadow: none; }
.fo-chip input:focus-visible + span { box-shadow: inset 0 0 0 1.5px var(--amber), var(--focus); }
.fo-gate { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px 16px; align-items: start; padding: clamp(20px, 2.6vw, 28px); border-radius: var(--r-lg); background: var(--amber-wash); box-shadow: inset 0 0 0 1px var(--amber-soft); }
.fo-gate .ico-box { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--amber-field); color: #111214; }
.fo-gate h2 { font-family: var(--font-display); font-weight: 600; font-size: 20px; letter-spacing: -0.02em; color: var(--ink); }
.fo-gate p { color: var(--ink-2); font-size: 15px; margin-top: 4px; }
.fo-gate .btn { grid-column: 2; justify-self: start; }
.fo-section { margin-top: 32px; scroll-margin-top: calc(var(--nav-clear, 88px) + 16px); }
.fo-section > h2 { font-family: var(--font-display); font-weight: 600; font-size: 22px; letter-spacing: -0.02em; color: var(--ink); margin-bottom: 12px; }

/* Profile */
.fo-profile { display: flex; align-items: center; gap: 18px; }

/* ---------- Motion: rows rise in (base.css .rv), nothing else moves ---------- */
@media (max-width: 1023px) {
  .fo-grid { grid-template-columns: minmax(0, 1fr); }
  .fo-side { position: static; }
}
@media (max-width: 600px) {
  .fo-row { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 16px; }
  .fo-count { grid-auto-flow: column; justify-content: start; align-items: baseline; gap: 6px; height: auto; background: none; padding: 0; }
  .fo-count .ico { display: none; }
  .fo-count b { font-size: 15px; letter-spacing: 0; }
  .fo-count.is-hot { background: none; }
  .fo-row .fo-count { order: 2; }
  .fo-title { font-size: 17.5px; }
  .fo-stats > div { padding: 0 16px; }
  .fo-actions, .fo-actions > *, .fo-search { width: 100%; }
  .fo-actions .btn { flex: 1; }
  .fo-gate { grid-template-columns: minmax(0, 1fr); }
  .fo-gate .btn { grid-column: 1; }
  .fo-composer-foot .btn { width: 100%; }
  .fo-post-head { padding: 10px 12px; }
}
.page-forum :is(strong, b, th) { font-weight: 600; }
.fo-panel .fo-search .btn { width: auto; flex: none; }
