/* community.aloca.io preview (ADR-050). Served with default-src 'none': system fonts only, no external or extra assets. */
:root {
  color-scheme: light dark;
  --brand: #ff500a;
  --brand-soft: #fff1ea;
  --ink: #1f1d1a;
  --muted: #6b6761;
  --faint: #918b82;
  --bg: #ffffff;
  --panel: #f7f5f1;
  --line: #e8e5df;
  --row-hover: #fbfaf8;
  --cat-announcements: #ff500a;
  --cat-questions: #2563eb;
  --cat-features: #16a34a;
  --cat-bugs: #9b51e0;
  --header-h: 60px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --brand-soft: #3a1d10;
    --ink: #f1efe9;
    --muted: #b0aba2;
    --faint: #8d877e;
    --bg: #181715;
    --panel: #22201d;
    --line: #34312c;
    --row-hover: #1e1c1a;
  }
}
* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--header-h) + 16px); }
/* Column layout keeps the footer at the bottom of the window when a view is short. */
body { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--brand); }
a:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--bg); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--faint); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); }
.header-inner { max-width: 1180px; height: var(--header-h); margin: 0 auto; padding: 0 20px; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: baseline; gap: 8px; margin-right: auto; }
.brand-word { font-weight: 900; font-size: 22px; letter-spacing: -.02em; color: var(--brand); }
.brand-sub { font-size: 18px; color: var(--muted); font-weight: 400; }
.brand:hover .brand-sub { color: var(--ink); }
.header-links { display: flex; align-items: center; gap: 18px; font-size: 14px; }
.header-links a { color: var(--ink); }
.button { display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 6px; background: var(--brand); color: #fff !important; font-weight: 600; font-size: 13px; }
.button:hover { background: #e64600; }
.preview-bar { margin: 0; padding: 7px 20px; text-align: center; font-size: 13px; color: var(--muted); background: var(--panel); border-bottom: 1px solid var(--line); }
.preview-bar strong { color: var(--brand); text-transform: uppercase; letter-spacing: .08em; font-size: 11px; margin-right: 6px; }

/* Layout */
.layout { flex: 1 0 auto; width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; }
.sidebar { position: sticky; top: calc(var(--header-h) + 12px); align-self: start; padding: 16px 0 24px; display: grid; gap: 2px; font-size: 14px; }
.side-link { display: flex; align-items: center; gap: 9px; padding: 6px 10px; border-radius: 6px; color: var(--ink); }
.side-link:hover { background: var(--panel); color: var(--ink); }
.side-heading { margin: 14px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.side-all { color: var(--muted); font-size: 13px; }
/* The active entry follows the #fragment; without :has() no entry is highlighted. */
body:not(:has(.view:target)) .side-topics,
body:has(#latest:target) .side-topics,
body:has(#t-welcome:target) .side-about,
body:has(#categories:target) .side-all,
body:has(#c-announcements:target) .side-c-announcements,
body:has(#c-questions:target) .side-c-questions,
body:has(#c-features:target) .side-c-features,
body:has(#c-bugs:target) .side-c-bugs { background: var(--panel); font-weight: 600; }

/* Category colours */
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--cat); flex: none; }
.cat-announcements { --cat: var(--cat-announcements); }
.cat-questions { --cat: var(--cat-questions); }
.cat-features { --cat: var(--cat-features); }
.cat-bugs { --cat: var(--cat-bugs); }

/* Views: one is visible at a time, chosen by the #fragment. Without :has() all views stay visible. */
.views { padding: 20px 0 48px; min-width: 0; }
.view { display: block; scroll-margin-top: calc(var(--header-h) + 16px); }
.views:has(.view:target) .view:not(:target) { display: none; }
.views:not(:has(.view:target)) .view:not(#latest) { display: none; }
.views:has(.topic-view:target) .welcome { display: none; }

/* Welcome banner */
.welcome { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 24px; padding: 22px 26px; border: 1px solid var(--line); border-radius: 10px; background: linear-gradient(135deg, var(--brand-soft), var(--bg) 60%); }
.welcome h1 { margin: 0 0 4px; font-size: 22px; }
.welcome p { margin: 0; color: var(--muted); }
.welcome-links { display: flex; gap: 8px; }
.welcome-links a { display: grid; justify-items: center; gap: 4px; min-width: 84px; padding: 8px 10px; border-radius: 8px; font-size: 13px; font-weight: 600; }
.welcome-links a:hover { background: var(--bg); }
.welcome-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 15px; font-weight: 800; }

/* Tabs */
.tabs { display: flex; gap: 4px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.tabs .tab { padding: 8px 12px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 600; font-size: 14px; }
.tabs .tab.active { color: var(--brand); border-bottom-color: var(--brand); }

/* Topic and category tables */
table { width: 100%; border-collapse: collapse; }
th { padding: 10px 8px; text-align: left; font-size: 13px; font-weight: 600; color: var(--muted); border-bottom: 2px solid var(--line); }
td { padding: 12px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:hover { background: var(--row-hover); }
.col-num { width: 72px; text-align: center; color: var(--muted); font-size: 14px; }
.col-activity { width: 84px; }
.col-posters { width: 52px; }
.topic-title { font-size: 16px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.pinned .topic-title { font-weight: 650; }
.pin { color: var(--faint); flex: none; }
.topic-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 3px; font-size: 13px; }
.badge { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); }
.tag { color: var(--faint); }
.excerpt { margin: 6px 0 0; max-width: 640px; color: var(--muted); font-size: 14px; }
.excerpt a { color: var(--brand); }
.avatar { display: block; border-radius: 50%; background: var(--panel); }
.col-latest { width: 38%; font-size: 14px; }
.category-row td:first-child { border-left: 4px solid var(--cat); padding-left: 14px; }
.category-name { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; font-size: 16px; }
.category-description { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.category-head { margin-bottom: 12px; padding: 4px 0 12px 16px; border-left: 4px solid var(--cat); }
.category-head h1 { margin: 0 0 4px; font-size: 22px; display: flex; align-items: center; gap: 10px; }
.category-head p { margin: 0; color: var(--muted); }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); background: var(--panel); border-radius: 10px; }

/* Topic view */
.topic-view { max-width: 780px; }
.back { display: inline-block; margin-bottom: 12px; font-size: 14px; color: var(--muted); }
.topic-view h1 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 26px; line-height: 1.25; }
.post { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px; margin-top: 18px; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.avatar-large { width: 44px; height: 44px; }
.post-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; font-size: 14px; }
.post-head time { margin-left: auto; color: var(--faint); font-size: 13px; }
.staff { padding: 0 6px; border-radius: 4px; background: var(--brand-soft); color: var(--brand); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.post-body { font-size: 15px; line-height: 1.65; }
.post-body h2 { margin: 18px 0 6px; font-size: 16px; }
.post-body ul { padding-left: 20px; }
.post-body li { margin-bottom: 4px; }
.post-body a { color: var(--brand); }
.closed { margin: 14px 0; color: var(--faint); font-size: 14px; }
.topic-nav { display: flex; justify-content: space-between; gap: 16px; margin-top: 18px; font-size: 14px; }
.topic-nav a { color: var(--muted); }
.topic-nav .newer { text-align: right; }

/* Footer */
.site-footer { width: 100%; max-width: 1180px; margin: 0 auto; padding: 20px; display: flex; flex-wrap: wrap; gap: 8px 20px; border-top: 1px solid var(--line); color: var(--faint); font-size: 13px; }
.site-footer a { color: var(--muted); }

@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
}
@media (max-width: 640px) {
  .header-inner { padding: 0 16px; gap: 10px; }
  .header-links a:not(.button) { display: none; }
  .brand-word { font-size: 20px; }
  .brand-sub { font-size: 16px; }
  .layout { padding: 0 16px; }
  .welcome { flex-direction: column; align-items: flex-start; padding: 18px; }
  .welcome-links { width: 100%; justify-content: space-between; }
  .col-posters, .col-latest { display: none; }
  .col-num { width: 56px; }
  .topic-view h1 { font-size: 22px; }
}
