/* Stylesheet of the static forum archive. Plain and hand-written: system fonts, no external resources. */

:root {
  --text: #1c1e21;
  --muted: #5f6770;
  --link: #0b5cad;
  --accent: #00796b;
  --line: #d9dde2;
  --soft: #f4f6f8;
  --banner-bg: #fff4d1;
  --banner-line: #e3c766;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  font-size: 100%;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--text);
  background: #fff;
}

a { color: var(--link); }
a:hover { text-decoration-thickness: 2px; }

img { max-width: 100%; height: auto; }

h1, h2, h3, h4 { line-height: 1.25; }
h1 { font-size: 1.7rem; margin: 0.4em 0 0.5em; }
h2 { font-size: 1.3rem; margin: 1.4em 0 0.5em; }

/* ---- page frame ---------------------------------------------------------------------------- */

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  padding: 0.5em 1em;
  background: #fff;
  z-index: 10;
}
.skip-link:focus { left: 0; }

.archive-banner {
  padding: 0.45rem 1rem;
  text-align: center;
  font-size: 0.9rem;
  background: var(--banner-bg);
  border-bottom: 1px solid var(--banner-line);
}

/* The logo is yellow on transparent, made for the forum's teal header bar, so the bar stays teal. */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding: 0.7rem max(1rem, calc((100% - 60rem) / 2));
  background: var(--accent);
  color: #fff;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  color: #fff;
  text-decoration: none;
}
.site-logo { height: 2rem; width: auto; max-width: 100%; }
.site-title { font-size: 1.25rem; font-weight: 600; }
/* the logo already spells the name: keep the text for screen readers only */
.site-logo + .site-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.site-nav a { margin-left: 1rem; color: #fff; }
.site-nav a:first-child { margin-left: 0; }

main {
  max-width: 60rem;
  margin: 0 auto;
  padding: 0.5rem 1rem 2rem;
}

.site-footer {
  max-width: 60rem;
  margin: 0 auto;
  padding: 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--muted);
}
.site-footer p { margin: 0; }

.breadcrumb {
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

/* ---- home and category pages --------------------------------------------------------------- */

.category-index, .subcategory-index { list-style: none; padding: 0; margin: 0; }
.category-index > .category-entry { margin: 0 0 1.1rem; }
.subcategory-index { margin: 0.3rem 0 0 1.4rem; }
.subcategory-index > .category-entry { margin: 0.25rem 0; }

.category-name { font-weight: 600; }
.topic-count { color: var(--muted); font-size: 0.9rem; margin-left: 0.4rem; }
.category-description { margin: 0.15rem 0 0; color: var(--muted); }
.site-description { font-size: 1.1rem; margin: 0 0 0.75rem; }
.archive-notice { margin: 0.5rem 0 0; padding: 0.6rem 0.9rem; background: var(--soft); border-left: 4px solid var(--accent); }

.table-wrap { overflow-x: auto; }

table.topic-list { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.topic-list th, .topic-list td {
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.topic-list thead th { border-bottom: 2px solid var(--line); white-space: nowrap; }
.topic-list .col-replies { text-align: right; }
.topic-list .col-created, .topic-list .col-activity { white-space: nowrap; }
.topic-list .col-tags { color: var(--muted); }
.badge {
  display: inline-block;
  margin-left: 0.4em;
  padding: 0 0.45em;
  border: 1px solid var(--line);
  border-radius: 0.8em;
  font-size: 0.75rem;
  color: var(--muted);
}

/* ---- topic page ---------------------------------------------------------------------------- */

.tags { margin: 0 0 0.5rem; color: var(--muted); font-size: 0.9rem; }
.topic-status { margin: 0.5rem 0; padding: 0.4rem 0.8rem; background: var(--soft); border-left: 4px solid var(--muted); }

.post { margin: 1.5rem 0 0; padding-top: 0.9rem; border-top: 1px solid var(--line); }
.post:target { background: #fffbe6; }

.post-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.9rem;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: var(--muted);
}
.author-name { font-weight: 600; color: var(--text); }
.username { color: var(--muted); }
.post-number { text-decoration: none; }
.reply-to { color: var(--muted); }

.post-body { overflow-wrap: anywhere; }
.post-body > :first-child { margin-top: 0; }
.post-body p { margin: 0.7em 0; }
.post-body p:empty { display: none; }
.post-body h1 { font-size: 1.45rem; }
.post-body h2 { font-size: 1.25rem; }
.post-body h3 { font-size: 1.1rem; }
.post-body h4 { font-size: 1rem; }
.post-body ul, .post-body ol { padding-left: 1.6em; }
.post-body li > p { margin: 0.3em 0; }
.post-body sub, .post-body sup { line-height: 0; }

.post-body a.anchor {
  margin-left: -1em;
  padding-right: 0.3em;
  text-decoration: none;
  visibility: hidden;
}
.post-body a.anchor::before { content: "#"; }
.post-body :is(h1, h2, h3, h4):hover > a.anchor { visibility: visible; }

.post-body img.emoji { width: 1.25em; height: 1.25em; vertical-align: -0.25em; }
.post-body img.only-emoji { width: 2rem; height: 2rem; }

.post-body blockquote {
  margin: 0.9em 0;
  padding: 0.1em 1em;
  border-left: 4px solid var(--line);
  background: var(--soft);
}
.post-body blockquote > :first-child { margin-top: 0.5em; }
.post-body blockquote > :last-child { margin-bottom: 0.5em; }

aside.quote { margin: 0.9em 0; border-left: 4px solid var(--line); background: var(--soft); }
aside.quote .title { padding: 0.5em 0.9em 0; font-weight: 600; }
aside.quote blockquote { margin: 0; border-left: 0; background: transparent; }

.post-body pre {
  overflow-x: auto;
  margin: 0.9em 0;
  padding: 0.7em 0.9em;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 4px;
}
.post-body code, .post-body pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.9em;
}
.post-body pre code { white-space: pre; overflow-wrap: normal; }

/* Markdown tables: the wrapper scrolls, so a wide table never widens the page. */
.md-table { overflow-x: auto; margin: 0.9em 0; }
.post-body table { border-collapse: collapse; font-size: 0.95rem; }
.post-body th, .post-body td {
  padding: 0.35em 0.7em;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.post-body th { background: var(--soft); }

.post-body a.lightbox img { display: block; margin: 0.6em 0; }

.post-body a.attachment { font-weight: 600; }

.post-body .mention { font-weight: 600; }

.clear-both { clear: both; }

/* ---- oneboxes (link cards) and videos ------------------------------------------------------ */

aside.onebox {
  margin: 1em 0;
  padding: 0.7em 1em;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}
aside.onebox header.source { margin-bottom: 0.4em; font-size: 0.85rem; color: var(--muted); }
aside.onebox img.site-icon { width: 1rem; height: 1rem; margin-right: 0.4em; vertical-align: -0.15em; }
aside.onebox h3 { margin: 0.2em 0; font-size: 1.05rem; }
aside.onebox p { margin: 0.4em 0; }
aside.onebox img.thumbnail { max-width: 100%; height: auto; }
aside.onebox img.onebox-avatar { float: right; width: 5rem; margin: 0 0 0.5em 1em; }
aside.onebox .aspect-image img { display: block; width: 100%; max-width: 30rem; }

a.onebox, a.inline-onebox { overflow-wrap: anywhere; }

.lazyYT { margin: 1em 0; }
.lazyYT a { display: inline-block; max-width: 100%; color: inherit; text-decoration: none; }
.lazyYT img.ytp-thumbnail-image { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); }
.lazyYT .video-title { display: block; margin-top: 0.3em; color: var(--link); text-decoration: underline; }
.lazyYT .video-title::before { content: "\25B6\00a0"; text-decoration: none; display: inline-block; }

/* ---- poll (static: the option list as it was) ---------------------------------------------- */

.poll { margin: 1em 0; padding: 0.7em 1em; border: 1px solid var(--line); border-radius: 6px; }
.poll ul { margin: 0; padding-left: 1.2em; }
.poll li { margin: 0.3em 0; }
.poll li img { display: block; max-width: 12rem; margin-top: 0.2em; }
.poll-info { margin-top: 0.5em; color: var(--muted); font-size: 0.9rem; }
.poll-info p { margin: 0; }

/* ---- search and 404 ------------------------------------------------------------------------ */

.search-page .no-script, .not-found p { margin: 0.7em 0; }
#search { margin-top: 1rem; }

/* ---- small screens ------------------------------------------------------------------------- */

@media (max-width: 40rem) {
  h1 { font-size: 1.45rem; }
  .site-header { padding: 0.6rem 0.75rem; }
  main { padding-left: 0.75rem; padding-right: 0.75rem; }
  .topic-list { font-size: 0.9rem; }
  .topic-list .col-created, .topic-list .col-tags { display: none; }
  .subcategory-index { margin-left: 0.8rem; }
  .post-body a.anchor { margin-left: 0; }
  aside.onebox img.onebox-avatar { width: 3.5rem; }
}

@media print {
  .archive-banner, .site-nav, .skip-link { display: none; }
  .post { break-inside: avoid-page; }
  a { color: inherit; }
}
