/* The Ogre Stronghold — archive theme.
   Palette lifted from the original forum's own "Curve" theme CSS (2011 capture):
   white page, #292929 charcoal text, #af282d brick-red as the one accent —
   no gold/brass, that was invented before the real stylesheet was checked.
   Dark mode is a new addition (the original never had one): same accent
   identity, brightened just enough to keep contrast on a dark ground.
   No web fonts on purpose: the archive must survive offline and forever. */

:root {
  --stone:   #ffffff;   /* page background */
  --slab:    #f0f0f0;   /* raised panel / alternating post background */
  --slab-2:  #e7e7e7;   /* hover / alt panel */
  --iron:    #cfcfcf;   /* rules, borders */
  --bone:    #292929;   /* body text — the original's own charcoal */
  --ash:     #6b6b6b;   /* muted meta */
  --accent:   #af282d;  /* the original's one accent: brick red */
  --accent-d: #7d1c20;
  --measure: 68ch;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --stone:   #17181a;
    --slab:    #222325;
    --slab-2:  #2a2b2e;
    --iron:    #3d3e42;
    --bone:    #e8e6e3;
    --ash:     #9a9a9a;
    --accent:   #e2555c;
    --accent-d: #af282d;
  }
}
:root[data-theme="dark"] {
  --stone:   #17181a;
  --slab:    #222325;
  --slab-2:  #2a2b2e;
  --iron:    #3d3e42;
  --bone:    #e8e6e3;
  --ash:     #9a9a9a;
  --accent:   #e2555c;
  --accent-d: #af282d;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--stone);
  color: var(--bone);
  font: 16px/1.65 ui-serif, Georgia, "Times New Roman", serif;
  -webkit-text-size-adjust: 100%;
}

/* ── header / the hold gate ─────────────────────────────────────────────── */
.hold {
  border-bottom: 2px solid var(--accent-d);
  background: var(--slab);
  padding: 2rem 1.25rem 1.5rem;
}
.brand { display: inline-block; text-decoration: none; }
.brand-plate {
  display: block; max-width: 100%; height: auto; border-radius: 3px;
  border: 1px solid var(--iron);
  box-shadow: 0 2px 10px rgba(0,0,0,.15);
}
.tagline { color: var(--ash); margin: .5rem 0 1.25rem; font-style: italic; }
.topnav { margin: 0 0 1rem; font-family: ui-sans-serif, system-ui, sans-serif; font-size: .85rem;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }
.topnav a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--accent-d); }
.topnav a:hover { color: var(--bone); }
.theme-toggle {
  font: inherit; color: var(--ash); background: var(--slab); border: 1px solid var(--iron);
  border-radius: 4px; padding: .3rem .7rem; cursor: pointer;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent-d); }

/* ── date-range filter (custom, alongside Pagefind's own search box) ────── */
.date-filter { max-width: 640px; margin: .75rem 0 0; font-family: ui-sans-serif, system-ui, sans-serif; font-size: .85rem; }
.date-filter summary { color: var(--ash); cursor: pointer; }
.date-filter summary:hover { color: var(--accent); }
.date-filter form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem; margin: .75rem 0 .5rem; }
.date-filter label { display: flex; flex-direction: column; gap: .2rem; color: var(--ash); font-size: .78rem; }
.date-filter input, .date-filter button {
  font: inherit; padding: .4rem .6rem; border: 1px solid var(--iron); border-radius: 4px;
  background: var(--stone); color: var(--bone);
}
.date-filter input[type="number"] { width: 6rem; }
.date-filter button { background: var(--accent); color: #fff; border-color: var(--accent-d); cursor: pointer; }
.date-filter button:hover { background: var(--accent-d); }
.date-filter .hint { color: var(--ash); font-size: .78rem; margin: 0 0 .75rem; max-width: var(--measure); }
#date-results .thread-row { border-bottom: 1px solid var(--iron); }

/* ── Pagefind search box, retinted to the theme ─────────────────────────── */
#search { max-width: 640px; }
:root {
  --pagefind-ui-primary: var(--accent);
  --pagefind-ui-text: var(--bone);
  --pagefind-ui-background: var(--slab);
  --pagefind-ui-border: var(--iron);
  --pagefind-ui-tag: var(--slab-2);
  --pagefind-ui-border-radius: 4px;
  --pagefind-ui-font: ui-sans-serif, system-ui, sans-serif;
}

main { max-width: 900px; margin: 0 auto; padding: 1.75rem 1.25rem 3rem; }

/* ── breadcrumbs ────────────────────────────────────────────────────────── */
.crumbs { color: var(--ash); font-size: .82rem; letter-spacing: .04em;
  text-transform: uppercase; margin-bottom: 1.4rem; }
.crumbs a { color: var(--ash); text-decoration: none; border-bottom: 1px solid var(--iron); }
.crumbs a:hover { color: var(--accent); }
.crumbs span { opacity: .5; margin: 0 .1rem; }

/* ── welcome block (home) ───────────────────────────────────────────────── */
.welcome-block { background: var(--slab); border: 1px solid var(--iron); border-left: 3px solid var(--accent);
  border-radius: 3px; padding: 1.5rem 1.75rem; margin: 0 0 2rem; max-width: var(--measure); }
.welcome-title { font: 700 1.3rem ui-sans-serif, "Arial Narrow", sans-serif;
  letter-spacing: .04em; text-transform: uppercase; color: var(--accent); margin: 0 0 .8rem; }
.welcome-block p { margin: 0 0 .8rem; }
.welcome-block p:last-child { margin-bottom: 0; }

/* ── board list (home) ──────────────────────────────────────────────────── */
.forum-stats { color: var(--ash); font-size: .85rem; margin: 0 0 1.75rem;
  font-family: ui-sans-serif, system-ui, sans-serif; }
.forum-stats strong { color: var(--accent); font-weight: 700; }
.stats-date { display: inline-block; margin-left: .4rem; opacity: .7; font-style: italic; }
.subforum-line { color: var(--ash); font-size: .82rem; margin: .3rem 0 0; }
.subforum-line a { color: var(--ash); border-bottom: 1px dotted var(--iron); text-decoration: none; }
.subforum-line a:hover { color: var(--accent); }
.board-tally { color: var(--ash); font-size: .85rem; margin: 0 0 1rem;
  font-family: ui-sans-serif, system-ui, sans-serif; }
.board-tally-then { cursor: help; border-bottom: 1px dotted var(--iron); }
.board-count { cursor: default; }
.category-group { margin: 0 0 2rem; }
.category-title { color: var(--accent); font: 700 .95rem ui-sans-serif, "Arial Narrow", sans-serif;
  letter-spacing: .12em; text-transform: uppercase; margin: 0 0 .3rem;
  padding-bottom: .4rem; border-bottom: 1px solid var(--accent-d); }
.boardlist, .threadlist { list-style: none; margin: 0; padding: 0; }
.board { border-bottom: 1px solid var(--iron); }
.board > a {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 1rem; padding: 1.05rem .25rem .55rem; text-decoration: none;
}
.board-name {
  color: var(--bone); font: 600 1.2rem ui-sans-serif, system-ui, sans-serif;
  letter-spacing: .02em;
}
.board > a:hover .board-name { color: var(--accent); }
.board-count { color: var(--ash); font-size: .8rem; white-space: nowrap;
  font-family: ui-sans-serif, system-ui, sans-serif; }
.board-desc { color: var(--ash); margin: 0 0 1rem; font-size: .95rem; }

/* ── thread list (board page) ───────────────────────────────────────────── */
.board-title {
  font: 700 1.9rem/1.1 ui-sans-serif, "Arial Narrow", sans-serif;
  letter-spacing: .06em; text-transform: uppercase; margin: 0 0 .3rem;
}
.lede { color: var(--ash); margin: 0 0 1.75rem; max-width: var(--measure); }
.thread-row { display: flex; flex-direction: column; gap: .15rem;
  padding: .8rem .25rem; border-bottom: 1px solid var(--iron); }
.thread-row a { color: var(--bone); text-decoration: none;
  font-size: 1.08rem; font-family: ui-sans-serif, system-ui, sans-serif; }
.thread-row a:hover { color: var(--accent); }
.thread-row .meta { color: var(--ash); font-size: .8rem;
  font-family: ui-sans-serif, system-ui, sans-serif; }
.empty { color: var(--ash); padding: 1.5rem .25rem; font-style: italic; }

/* ── thread (posts) ─────────────────────────────────────────────────────── */
.thread-title {
  font: 700 1.75rem/1.2 ui-sans-serif, "Arial Narrow", sans-serif;
  letter-spacing: .02em; margin: 0 0 .4rem;
}
.orig { margin: 0 0 1.5rem; }
.orig a { color: var(--accent-d); font-size: .82rem;
  font-family: ui-sans-serif, system-ui, sans-serif; }
.poll { border: 1px solid var(--iron); background: var(--slab); border-radius: 3px;
  padding: 1rem 1.15rem; margin: 0 0 1.5rem; }
.poll-question { font: 700 1.1rem ui-sans-serif, system-ui, sans-serif; margin: 0 0 .9rem; }
.poll-options { margin: 0; }
.poll-option { margin: 0 0 .7rem; }
.poll-option dt { color: var(--bone); font: 600 .92rem ui-sans-serif, system-ui, sans-serif; margin-bottom: .25rem; }
.poll-option dd { margin: 0; display: flex; align-items: center; gap: .7rem; }
.poll-bar { flex: 1; height: 10px; background: var(--iron); border-radius: 5px; overflow: hidden; }
.poll-bar-fill { height: 100%; background: var(--accent); }
.poll-tally { color: var(--ash); font-size: .8rem; white-space: nowrap;
  font-family: ui-sans-serif, system-ui, sans-serif; }
.poll-meta { color: var(--ash); font-size: .78rem; margin: .8rem 0 0; }

.post { border: 1px solid var(--iron); border-left: 3px solid var(--accent-d);
  background: var(--slab); border-radius: 3px; padding: 1rem 1.15rem;
  margin: 0 0 1rem; }
.post-head { display: flex; justify-content: space-between; align-items: baseline;
  gap: 1rem; margin-bottom: .7rem; padding-bottom: .5rem;
  border-bottom: 1px dashed var(--iron); }
.post-author { color: var(--accent); font-weight: 700; letter-spacing: .03em;
  font-family: ui-sans-serif, system-ui, sans-serif; }
.post-date { color: var(--ash); font-size: .78rem;
  font-family: ui-sans-serif, system-ui, sans-serif; }
.post-body { max-width: var(--measure); }
.post-body p { margin: 0 0 .8rem; }
.post-body img { max-width: 100%; height: auto; }
.post-body a { color: var(--accent); }
.dead-link { text-decoration: line-through; color: var(--ash); cursor: help; }
.post-signature { margin-top: .9rem; padding-top: .7rem; border-top: 1px dashed var(--iron);
  color: var(--ash); font-size: .82rem; font-style: italic; max-width: var(--measure); }
/* legacy SMF quotes, if any survive */
.post-body blockquote, .post-body .quote {
  border-left: 2px solid var(--iron); margin: .6rem 0; padding: .3rem .9rem;
  color: var(--ash); background: var(--slab-2); font-size: .95rem; }

/* ── continue-on-github ─────────────────────────────────────────────────── */
.continue-thread { border-top: 1px dashed var(--iron); margin: 1.5rem 0 0; padding-top: 1.25rem; }
.continue-thread .button {
  display: inline-block; color: #fff; background: var(--accent);
  font: 700 .9rem ui-sans-serif, system-ui, sans-serif; letter-spacing: .02em;
  text-decoration: none; padding: .6rem 1.1rem; border-radius: 4px;
}
.continue-thread .button:hover { background: var(--accent-d); }
.continue-thread .hint { color: var(--ash); font-size: .8rem; max-width: var(--measure);
  margin: .6rem 0 0; }

/* ── footer / epitaph ───────────────────────────────────────────────────── */
.epitaph { border-top: 1px solid var(--iron); color: var(--ash);
  font-size: .82rem; text-align: center; padding: 1.75rem 1.25rem; max-width: 900px;
  margin: 0 auto; line-height: 1.6; }
.restorer-credit { display: inline-flex; align-items: center; gap: .5rem;
  margin-top: 1rem; text-decoration: none; color: var(--ash);
  font-family: ui-sans-serif, system-ui, sans-serif; font-size: .78rem; }
.restorer-credit img { height: 28px; width: auto; }
.restorer-credit:hover { color: var(--accent); }
.epitaph a { color: var(--accent-d); }
.epitaph a:hover { color: var(--accent); }

/* ── focus + small screens ──────────────────────────────────────────────── */
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
@media (max-width: 560px) {
  .board > a { flex-direction: column; gap: .1rem; }
  main { padding: 1.25rem 1rem 2.5rem; }
}
