/* Blog pages. Same colors as the chatroom (redesign 2026-12-04), with a serif face for headlines. */
:root {
  --bg: #ffffff;
  --side: #f5f5f2;
  --hover: #ebebe7;
  --line: #e3e3dd;
  --text: #1b1b18;
  --text-2: #4a4a44;
  --muted: #6e6e66;
  --accent: #3451e0;
  --accent-text: #2b43c2;
  --accent-soft: #ebeefc;
  --danger: #d92d20;
  --shadow: 0 1px 2px rgb(16 24 40 / 0.06);
  color-scheme: light;
  --serif: Georgia, "Times New Roman", "Songti SC", "SimSun", serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) {
    --bg: #18191c;
    --side: #101113;
    --hover: #26282d;
    --line: #2d2f35;
    --text: #ededee;
    --text-2: #b6b7bd;
    --muted: #90929b;
    --accent: #4c63e6;
    --accent-text: #a5b2ff;
    --accent-soft: #20264a;
    --danger: #f97066;
    --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme=dark] {
  --bg: #18191c;
  --side: #101113;
  --hover: #26282d;
  --line: #2d2f35;
  --text: #ededee;
  --text-2: #b6b7bd;
  --muted: #90929b;
  --accent: #4c63e6;
  --accent-text: #a5b2ff;
  --accent-soft: #20264a;
  --danger: #f97066;
  --shadow: none;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.6 Inter, system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-text); }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* moderator-only controls stay hidden unless the page finds mod access */
.mod-only { display: none !important; }
.is-mod a.mod-only, .is-mod span.mod-only { display: inline-flex !important; }
.is-mod form.mod-only { display: block !important; }
.is-mod .need-mod { display: none; }

.top {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  height: 57px; padding: 0 24px; border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 15px; color: var(--text); text-decoration: none; white-space: nowrap; }
.brand em { font-style: normal; font-weight: 400; color: var(--muted); }
.logo { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: #fff; display: grid; place-items: center; }
/* the app mark: two chat bubbles, one answering the other, on a lit tile (the same mark is the favicon) */
.logo {
  border-radius: 9px; color: #fff;
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 78%, #fff), var(--accent) 45%, color-mix(in srgb, var(--accent) 70%, #000));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.3), inset 0 -1px 0 rgb(0 0 0 / 0.2), 0 1px 2px rgb(0 0 0 / 0.2), 0 4px 12px -6px color-mix(in srgb, var(--accent) 80%, transparent);
}
.logo svg { width: 19px; height: 19px; fill: currentColor; stroke: none; }

.top nav { display: flex; gap: 8px; }
#theme { width: 36px; padding: 0; justify-content: center; }
#theme svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:root[data-theme=dark] #theme .moon, :root:not([data-theme=dark]) #theme .sun { display: none; }
.btn {
  display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font-size: 14px; font-weight: 550; text-decoration: none; cursor: pointer;
  box-shadow: var(--shadow); white-space: nowrap;
}
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn.small { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn.danger { color: var(--danger); }

.wrap { max-width: 1040px; margin: 0 auto; padding: 40px 24px 24px; }
.page-title { margin: 0; font-family: var(--serif); font-size: 44px; line-height: 1.1; letter-spacing: -0.02em; }
.page-sub { margin: 6px 0 32px; color: var(--text-2); font-size: 17px; }
.kicker { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--accent-text); text-decoration: none; }
.meta { font-size: 13.5px; color: var(--muted); }
.empty { padding: 12vh 0; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--text); font-size: 18px; margin-bottom: 4px; }

/* list of posts */
.card { display: flex; flex-direction: column; color: inherit; text-decoration: none; min-width: 0; }
.cover { display: block; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: var(--hover); }
.cover img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.card:hover .cover img { transform: scale(1.03); }
.cover-fill { display: grid; place-items: center; width: 100%; height: 100%; color: rgb(255 255 255 / 0.9); font-family: var(--serif); font-size: 72px; font-weight: 700; }
.card-body { display: flex; flex-direction: column; gap: 6px; padding: 14px 2px 0; }
.card-title { font-family: var(--serif); font-size: 22px; font-weight: 700; line-height: 1.22; letter-spacing: -0.01em; }
.card:hover .card-title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.card-sum { color: var(--text-2); font-size: 15px; line-height: 1.5; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.lead-wrap { padding-bottom: 36px; margin-bottom: 36px; border-bottom: 1px solid var(--line); }
.card.lead { flex-direction: row; gap: 32px; align-items: center; }
.card.lead .cover { flex: 1.25; }
.card.lead .card-body { flex: 1; padding: 0; gap: 10px; }
.card.lead .card-title { font-size: 36px; line-height: 1.14; }
.card.lead .card-sum { font-size: 17px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 36px 28px; }

/* one post */
.article { max-width: 760px; }
.back { display: inline-block; margin-bottom: 26px; font-size: 14px; color: var(--text-2); text-decoration: none; }
.back:hover { color: var(--text); }
.article h1 { margin: 8px 0 0; font-family: var(--serif); font-size: 46px; line-height: 1.1; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.standfirst { margin: 16px 0 0; font-size: 20px; line-height: 1.5; color: var(--text-2); }
.article > .meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 20px 0 0; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.tools { margin-left: auto; gap: 8px; }
.hero { display: block; width: 100%; max-height: 460px; object-fit: cover; border-radius: 12px; margin: 28px 0 0; }
.prose { margin-top: 28px; font-size: 18px; line-height: 1.75; overflow-wrap: anywhere; }
.prose p { margin: 0 0 1.2em; }
.prose h2 { margin: 1.8em 0 0.5em; font-family: var(--serif); font-size: 28px; line-height: 1.25; letter-spacing: -0.01em; }
.prose h3 { margin: 1.6em 0 0.4em; font-size: 20px; line-height: 1.3; }
.prose ul, .prose ol { margin: 0 0 1.2em; padding-left: 1.3em; }
.prose li { margin-bottom: 0.35em; }
.prose blockquote { margin: 0 0 1.2em; padding: 2px 0 2px 18px; border-left: 3px solid var(--accent); color: var(--text-2); font-family: var(--serif); font-size: 21px; font-style: italic; }
.prose code { font-size: 0.88em; padding: 2px 5px; border-radius: 5px; background: var(--hover); }
.discuss {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-top: 40px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--side);
}
.discuss b { display: block; font-size: 16px; }
.discuss span { color: var(--text-2); font-size: 14.5px; }

/* editor */
.editor { max-width: 760px; }
.editor .page-title { font-size: 34px; margin-bottom: 24px; }
.need-mod { padding: 16px 18px; border: 1px dashed var(--line); border-radius: 10px; color: var(--text-2); }
.editor label { display: block; margin-bottom: 16px; min-width: 0; }
.editor label span { display: block; font-size: 13.5px; font-weight: 600; color: var(--text-2); margin-bottom: 5px; }
.editor label i { font-style: normal; font-weight: 400; color: var(--muted); margin-left: 6px; }
.editor input, .editor select, .editor textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg);
}
.editor input[name=title] { font-family: var(--serif); font-size: 24px; font-weight: 700; }
.editor textarea { resize: vertical; line-height: 1.6; min-height: 300px; }
.editor input:focus, .editor select:focus, .editor textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.help { margin: -6px 0 0; font-size: 13px; color: var(--muted); line-height: 1.9; }
.help code { padding: 1px 5px; border-radius: 4px; background: var(--hover); color: var(--text-2); }
.err { min-height: 20px; margin: 10px 0 0; color: var(--danger); font-size: 14px; }
.actions { display: flex; justify-content: flex-end; margin-top: 8px; }

.foot { max-width: 1040px; margin: 40px auto 0; padding: 20px 24px 40px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--muted); }
.foot a { color: var(--text-2); text-decoration: none; }
.foot a:hover { text-decoration: underline; }

@media (max-width: 760px) {
  .top { padding: 0 14px; }
  .btn, .btn.small { height: 44px; }
  #theme { width: 44px; }
  .editor input, .editor select, .editor textarea { font-size: 16px; min-height: 44px; }
  .back { padding: 12px 0; margin-bottom: 14px; }
  .brand em { display: none; }
  .wrap { padding: 28px 16px 16px; }
  .page-title { font-size: 34px; }
  .card.lead { flex-direction: column; align-items: stretch; gap: 0; }
  .card.lead .card-body { padding-top: 14px; }
  .card.lead .card-title { font-size: 27px; }
  .article h1 { font-size: 33px; }
  .standfirst { font-size: 18px; }
  .prose { font-size: 17px; }
  .row { grid-template-columns: 1fr; gap: 0; }
}

/* small phones: the header keeps the logo and drops the word beside it, so the two buttons fit in every language */
@media (max-width: 400px) {
  .brand { font-size: 0; gap: 0; }
}
/* Mod view has one more header button (Write a post): on small phones the header was 10 px (375) to 65 px (320) too wide. The footer keeps the link to the chatroom. */
@media (max-width: 380px) { .is-mod .top nav .primary { display: none; } }
