/* Seiko Club Singapore Museum — retro board chrome (phpBB-era layout, original styling) */
/* Self-hosted IBM Plex (SIL OFL 1.1, see /fonts/OFL.txt). Latin subset only.
   Sans: variable wght 400–600 (one file). Serif: 700 only (every Serif use is bold).
   Build rewrites these URLs to content-hashed copies in /assets/. */
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("ibm-plex-sans-latin-400-600.5c3f169eab.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Serif";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("ibm-plex-serif-latin-700.886ea167fa.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ink: #1c2430;
  --muted: #5a6573;
  --paper: #e8edf2;
  --panel: #f4f7fa;
  --line: #b8c4d0;
  --header: #243447;
  --header-ink: #f0f4f8;
  --accent: #0b5ea8;
  --accent-dim: #0a4d8c;
  --row-alt: #dfe7ef;
  --ok: #2f6b3a;
  --warn: #8a5a12;
  --post-bg: #ffffff;
  --max: 960px;
}

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

html { font-size: 15px; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, #d5dde6 0%, var(--paper) 180px);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--accent-dim); }

t { display: contents; }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 0.75rem 2.5rem;
}

/* Header */
.site-header {
  background: var(--header);
  color: var(--header-ink);
  border-bottom: 3px solid var(--accent);
}

.site-header .wrap {
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: baseline;
  justify-content: space-between;
}

.brand {
  font-family: "IBM Plex Serif", Georgia, serif;
  font-weight: 700;
  font-size: clamp(1.15rem, 2.5vw, 1.55rem);
  letter-spacing: -0.01em;
  color: var(--header-ink);
  text-decoration: none;
}
.brand:hover { color: #fff; text-decoration: none; }

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  font-size: 0.9rem;
}
.nav a { color: #c5d4e4; }
.nav a:hover { color: #fff; }

.honesty {
  margin: 0.85rem auto 0;
  max-width: var(--max);
  padding: 0.55rem 0.75rem;
  background: #fff8e8;
  border: 1px solid #e0c98a;
  border-left: 4px solid var(--warn);
  color: #4a3a18;
  font-size: 0.88rem;
  line-height: 1.45;
}

/* Breadcrumbs */
.crumbs {
  margin: 0.9rem 0 0.75rem;
  font-size: 0.88rem;
  color: var(--muted);
}
.crumbs a { font-weight: 500; }
.crumbs .sep { margin: 0 0.35rem; color: #8a96a4; }

/* Panel / tables (forum index, topic list) */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  margin-bottom: 1rem;
}

.panel-head {
  background: var(--header);
  color: var(--header-ink);
  padding: 0.45rem 0.65rem;
  font-weight: 600;
  font-size: 0.92rem;
}

.panel-head a { color: #d6e6f7; }

table.forumlist,
table.topiclist {
  width: 100%;
  border-collapse: collapse;
  background: var(--post-bg);
}

table.forumlist th,
table.topiclist th {
  text-align: left;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 0.4rem 0.55rem;
  border-bottom: 1px solid var(--line);
  background: #eef2f6;
}

table.forumlist td,
table.topiclist td {
  padding: 0.55rem;
  border-bottom: 1px solid #d5dde6;
  vertical-align: top;
}

table.forumlist tr:nth-child(even) td,
table.topiclist tr:nth-child(even) td {
  background: var(--row-alt);
}

.forum-name {
  font-weight: 600;
  font-size: 1rem;
}
.forum-desc {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.4;
}

.num {
  text-align: center;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  width: 4.5rem;
}

.lastpost {
  font-size: 0.85rem;
  color: var(--muted);
  width: 11rem;
}
.lastpost strong { color: var(--ink); font-weight: 500; }

.cat-row td {
  background: #cfd8e3 !important;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.4rem 0.55rem !important;
  border-bottom: 1px solid var(--line);
}

.icon-cell {
  width: 2.2rem;
  text-align: center;
  color: var(--accent);
  font-size: 1.1rem;
}

/* Posts */
.topic-title {
  font-family: "IBM Plex Serif", Georgia, serif;
  font-size: clamp(1.25rem, 3vw, 1.65rem);
  margin: 0 0 0.75rem;
  line-height: 1.2;
}

.post {
  display: grid;
  grid-template-columns: 9rem 1fr;
  border: 1px solid var(--line);
  background: var(--post-bg);
  margin-bottom: 0.65rem;
}

.post-meta {
  background: #eef2f6;
  border-right: 1px solid var(--line);
  padding: 0.65rem;
  font-size: 0.85rem;
}

.post-author {
  font-weight: 600;
  color: var(--ink);
  word-break: break-word;
}

.post-time {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.post-body {
  padding: 0.75rem 0.9rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.post-body img {
  max-width: 100%;
  height: auto;
  display: inline-block;
  margin: 0.35rem 0;
  border: 1px solid var(--line);
  background: #eee;
}

.post-body img.broken {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 8rem;
  min-height: 4rem;
  padding: 0.5rem;
  font-size: 0.75rem;
  color: var(--muted);
  object-fit: none;
  border-style: dashed;
}

/* Dead hotlink placeholder — rendered at build time, sized up front, no network */
.post-body .img-gone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 18rem;
  aspect-ratio: 3 / 1;
  margin: 0.35rem 0;
  padding: 0.5rem;
  overflow: hidden;
  vertical-align: middle;
  border: 1px dashed var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.3;
  text-align: center;
}

.post-subject {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

/* Pagination */
.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  margin: 0.75rem 0;
  font-size: 0.9rem;
}
.pager a,
.pager span {
  display: inline-block;
  min-width: 1.75rem;
  text-align: center;
  padding: 0.2rem 0.4rem;
  border: 1px solid var(--line);
  background: #fff;
}
.pager .current {
  background: var(--header);
  color: #fff;
  border-color: var(--header);
}

/* Search / insights */
.page-title {
  font-family: "IBM Plex Serif", Georgia, serif;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  margin: 0.25rem 0 0.75rem;
}

.lede {
  color: var(--muted);
  line-height: 1.5;
  max-width: 42rem;
  margin: 0 0 1rem;
}

.search-box {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.search-box input[type="search"],
.search-box select {
  font: inherit;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--line);
  background: #fff;
}
.search-box input[type="search"] { flex: 1 1 14rem; min-width: 10rem; }
.search-box button {
  font: inherit;
  font-weight: 600;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--accent-dim);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}
.search-box button:hover { background: var(--accent-dim); }

.suggest-wrap {
  position: relative;
  flex: 1 1 14rem;
  min-width: 10rem;
}
.suggest-wrap input[type="search"] {
  width: 100%;
}
.suggest-list {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  top: calc(100% + 2px);
  margin: 0;
  padding: 0.25rem 0;
  list-style: none;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 4px 14px rgba(28, 36, 48, 0.12);
  max-height: 16rem;
  overflow: auto;
}
.suggest-list li a {
  display: flex;
  gap: 0.55rem;
  align-items: baseline;
  padding: 0.4rem 0.65rem;
  color: var(--ink);
  text-decoration: none;
}
.suggest-list li a:hover,
.suggest-list li[aria-selected="true"] a {
  background: #eef2f6;
  text-decoration: none;
}
.suggest-type {
  flex: 0 0 auto;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  min-width: 3.2rem;
}
.suggest-label { font-weight: 500; }

.panel-body {
  padding: 0.65rem 0.75rem;
  background: var(--post-bg);
  line-height: 1.5;
}

.enrichment .enrich-note {
  margin: 0 0 0.65rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.enrichment .enrich-blurb { margin: 0 0 0.75rem; }
.enrichment .enrich-aliases { margin: 0 0 0.75rem; font-size: 0.9rem; }
.enrichment .enrich-sub {
  margin: 0.85rem 0 0.35rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--header);
}
.enrichment .enrich-list,
.enrichment .enrich-quotes {
  margin: 0;
  padding-left: 1.15rem;
}
.enrichment .enrich-list li,
.enrichment .enrich-quotes li { margin-bottom: 0.35rem; }
.enrichment .enrich-cites,
.enrichment .muted { color: var(--muted); font-size: 0.85rem; }
.enrichment .enrich-sources {
  margin: 0.85rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.results li { margin-bottom: 0.75rem; }
.results .meta { font-size: 0.85rem; color: var(--muted); }
.results .excerpt { font-size: 0.9rem; margin-top: 0.2rem; color: #333; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.65rem;
  margin: 1rem 0;
}
.stat {
  background: #fff;
  border: 1px solid var(--line);
  padding: 0.65rem 0.75rem;
}
.stat .n {
  font-family: "IBM Plex Serif", Georgia, serif;
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--header);
}
.stat .l { font-size: 0.8rem; color: var(--muted); }

.site-footer {
  margin-top: 2rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
  color: var(--muted);
}

/* Home hybrid (design 3) */
.wrap-wide {
  max-width: 1120px;
}

.top-intro {
  margin: 0.85rem 0 0;
  padding: 1rem 1.1rem 1.05rem;
  background: #fff8e8;
  border: 1px solid #e0c98a;
  border-left: 4px solid var(--warn);
}

.top-intro .brand-hero {
  font-family: "IBM Plex Serif", Georgia, serif;
  font-weight: 700;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.45rem;
  color: var(--ink);
}

.top-intro .intent-copy {
  margin: 0 0 0.4rem;
  max-width: 44rem;
  line-height: 1.5;
  color: var(--ink);
  font-size: 0.98rem;
}

.top-intro .honesty-inline {
  margin: 0;
  color: #4a3a18;
  font-size: 0.88rem;
  line-height: 1.45;
}

.top-intro .intent-links {
  margin: 0;
  padding-top: 0.55rem;
  border-top: 1px solid #e0c98a;
  font-size: 0.9rem;
  font-weight: 500;
}

.section-label {
  font-family: "IBM Plex Serif", Georgia, serif;
  font-size: 1.2rem;
  margin: 1.25rem 0 0.65rem;
}

.home-layout {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas:
    "toggle"
    "main";
  gap: 0.85rem;
  margin-top: 0.85rem;
  align-items: start;
}

.forums-toggle {
  grid-area: toggle;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  justify-self: start;
  margin: 0;
  padding: 0.45rem 0.75rem;
  background: var(--header);
  color: var(--header-ink);
  border: 1px solid var(--header);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.forums-toggle-icon {
  display: block;
  width: 1.05rem;
  height: 0.85rem;
  background:
    linear-gradient(var(--header-ink), var(--header-ink)) 0 0 / 100% 2px no-repeat,
    linear-gradient(var(--header-ink), var(--header-ink)) 0 50% / 100% 2px no-repeat,
    linear-gradient(var(--header-ink), var(--header-ink)) 0 100% / 100% 2px no-repeat;
}

.forum-scrim {
  display: none;
}

.forum-rail { grid-area: rail; }
.home-main { grid-area: main; min-width: 0; }

.forum-rail {
  background: var(--panel);
  border: 1px solid var(--line);
  font-size: 0.82rem;
}

.forum-rail-inner {
  padding: 0.55rem 0.5rem 0.65rem;
}

.rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.rail-head .rail-title {
  margin: 0;
}

.forums-close {
  display: none;
  margin: 0;
  padding: 0 0.35rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

/* Mobile: forums as off-canvas drawer (feed stays the only scroll surface) */
@media (max-width: 719px) {
  .forum-scrim {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(28, 36, 48, 0.45);
    border: 0;
    padding: 0;
    margin: 0;
  }
  .forum-scrim.is-open {
    display: block;
  }

  .forum-rail {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(18rem, 88vw);
    z-index: 40;
    max-height: 100vh;
    overflow: auto;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    box-shadow: none;
  }
  .forum-rail.is-open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(28, 36, 48, 0.18);
  }

  .forums-close { display: block; }

  body.forums-open {
    overflow: hidden;
  }
}

@media (min-width: 720px) {
  .home-layout {
    grid-template-columns: 14.5rem minmax(0, 1fr);
    grid-template-areas: "rail main";
    gap: 1.35rem;
    min-height: calc(100vh - 14rem);
    align-items: stretch;
  }

  .forums-toggle,
  .forums-close,
  .forum-scrim {
    display: none !important;
  }

  .forum-rail {
    position: sticky;
    top: 0.75rem;
    align-self: start;
    max-height: calc(100vh - 1.5rem);
    overflow: auto;
    transform: none;
  }

  .home-main {
    max-height: calc(100vh - 14rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 0.15rem;
  }
}

.rail-title {
  margin: 0 0 0.5rem;
  padding: 0 0.2rem;
  font-family: "IBM Plex Serif", Georgia, serif;
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.15;
}

.rail-head .rail-title {
  margin: 0;
  padding: 0 0.2rem;
}

.rail-section { margin-bottom: 0.65rem; }

.rail-cat {
  margin: 0 0 0.2rem;
  padding: 0.25rem 0.35rem;
  background: var(--header);
  color: var(--header-ink);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.rail-forum {
  display: flex;
  justify-content: space-between;
  gap: 0.4rem;
  align-items: baseline;
  padding: 0.28rem 0.35rem;
  border-bottom: 1px solid #d5dde6;
  color: inherit;
  text-decoration: none;
}
.rail-forum:hover {
  background: var(--row-alt);
  text-decoration: none;
}
.rail-forum:last-child { border-bottom: 0; }

.rail-name {
  font-weight: 500;
  line-height: 1.3;
  color: var(--ink);
}

.rail-counts {
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 0.72rem;
}

.rail-legend {
  display: flex;
  justify-content: flex-end;
  margin: 0.4rem 0 0;
  padding: 0 0.35rem;
  font-size: 0.68rem;
  color: var(--muted);
}

.did-you-know {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  background: #eef5fb;
  border: 1px solid #b9d0e8;
  border-left: 4px solid var(--accent);
}

.dyk-label {
  margin: 0 0 0.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-dim);
}

.dyk-model {
  margin: 0 0 0.35rem;
  font-family: "IBM Plex Serif", Georgia, serif;
  font-weight: 700;
  font-size: 1.05rem;
}

.dyk-text {
  margin: 0;
  line-height: 1.5;
  color: var(--ink);
  font-size: 0.95rem;
}

.feed-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0.15rem 0 0.65rem;
}

.feed-head h2 {
  font-family: "IBM Plex Serif", Georgia, serif;
  font-size: 1.2rem;
  margin: 0;
}

.feed {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.feed-card {
  display: block;
  background: var(--post-bg);
  border: 1px solid var(--line);
  padding: 0.9rem 1rem 1rem;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.feed-card:hover {
  border-color: var(--accent);
  text-decoration: none;
  box-shadow: 0 1px 0 rgba(11, 94, 168, 0.12);
}

.feed-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  align-items: center;
  margin-bottom: 0.45rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.feed-card-meta .author {
  font-weight: 600;
  color: var(--ink);
}

.model-chip {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  background: #e8f1fa;
  border: 1px solid #b9d0e8;
  color: var(--accent-dim);
  font-size: 0.75rem;
  font-weight: 600;
}

.feed-card-quote {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink);
}

.feed-card-topic {
  margin: 0.55rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.feed-end {
  margin: 1rem 0 0;
  padding: 0.85rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  border: 1px dashed var(--line);
  background: var(--panel);
}

.feed-sentinel { height: 1px; }

@media (max-width: 640px) {
  .post { grid-template-columns: 1fr; }
  .post-meta {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 0.75rem;
    align-items: baseline;
  }
  .post-time { margin-top: 0; }
  .num, .lastpost { display: none; }
  table.forumlist th:nth-child(n+3),
  table.topiclist th:nth-child(n+3) { display: none; }
}
