/* ==========================================================================
   screen.css: layout for the Pixel Quest Ghost theme
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
/* anchor targets land below the sticky header */
[id] { scroll-margin-top: 96px; }
body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
html.font-retro-all { --font-body: var(--font-retro); }
html.font-retro-all body { font-size: 12px; line-height: 2.1; }
html.font-handjet body { line-height: 1.55; letter-spacing: .01em; }
html.font-handjet .gh-content { line-height: 1.6; }
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--foreground); }
::selection { background: var(--primary); color: var(--primary-foreground); }
:focus-visible { outline: 3px dashed var(--ring); outline-offset: 4px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.site { display: flex; flex-direction: column; min-height: 100vh; }
.site-main { flex: 1; }
.container { width: min(100% - 40px, 1160px); margin-inline: auto; }
.container--narrow { width: min(100% - 40px, 760px); }

h1, h2, h3, h4, h5, h6 { font-family: var(--font-retro); font-weight: 400; line-height: 1.55; letter-spacing: .5px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklab, var(--background) 92%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: var(--px) solid var(--bit-line);
}
.site-header__inner { display: flex; align-items: center; gap: 20px; min-height: 76px; }
.site-logo { display: flex; align-items: center; gap: 12px; color: var(--foreground); text-decoration: none; font-family: var(--font-retro); font-size: 14px; line-height: 1.4; }
.site-logo img { max-height: 40px; width: auto; }

.site-nav { margin-left: auto; }
.site-nav ul { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.site-nav a {
  display: block; padding: 8px 10px; color: var(--foreground); text-decoration: none;
  font-family: var(--font-retro); font-size: 9px; text-transform: uppercase;
}
.site-nav a:hover { background: var(--foreground); color: var(--background); }
.site-header__actions { display: flex; align-items: center; gap: 6px; }
.site-header__actions .bit-btn { margin-block: 0; margin-right: 14px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; padding: 0;
  border: 0; background: transparent; color: var(--foreground); cursor: pointer;
}
.icon-btn:hover { background: var(--accent); color: var(--accent-foreground); }
.icon-btn svg { width: 18px; height: 18px; shape-rendering: crispEdges; }
.theme-toggle .icon-moon { display: none; }
html.dark .theme-toggle .icon-sun { display: none; }
html.dark .theme-toggle .icon-moon { display: block; }
.menu-toggle { display: none; }

@media (max-width: 860px) {
  .menu-toggle { display: inline-grid; }
  .site-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    display: none; padding: 16px 20px 22px;
    background: var(--background); border-bottom: var(--px) solid var(--bit-line);
  }
  .site-nav ul { flex-direction: column; }
  .site-nav a { font-size: 11px; padding: 12px 10px; }
  html.nav-open .site-nav { display: block; }
  .site-header__actions { margin-left: auto; }
  .site-header__actions .hide-mobile { display: none; }
}

/* ---------- Hero ---------- */
.site-hero { padding: clamp(48px, 9vw, 110px) 0 clamp(36px, 6vw, 64px); text-align: center; }
.site-hero__title { margin: 0 0 18px; font-size: clamp(20px, 4.4vw, 44px); }
.site-hero__desc { max-width: 620px; margin: 0 auto 30px; color: var(--muted-foreground); font-family: var(--font-retro); font-size: 10px; line-height: 2.1; }
.site-hero--cover { position: relative; color: #fff; background: #000 center / cover no-repeat; }
.site-hero--cover::before { content: ""; position: absolute; inset: 0; background: rgb(0 0 0 / .55); }
.site-hero--cover .container { position: relative; }
.site-hero--cover .bit-btn { --bit-line: #fff; }
.site-hero--cover .site-hero__desc { color: rgb(255 255 255 / .85); }

/* ---------- Section headings ---------- */
.section { padding-block: 28px 56px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 30px; }
.section-title { display: flex; align-items: center; gap: 14px; margin: 0; font-size: clamp(14px, 2.2vw, 20px); }
.section-title::before { content: ""; width: 14px; height: 14px; background: var(--primary); box-shadow: 4px 4px 0 var(--bit-line); flex: none; }
.section-sub { margin: 8px 0 0; color: var(--muted-foreground); font-family: var(--font-retro); font-size: 9px; }

/* ---------- Post cards ---------- */
.post-feed { display: grid; gap: 40px 30px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.post-card { padding: 0; gap: 0; height: 100%; }
.post-card__image { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--muted); border-bottom: var(--px) solid var(--bit-line); }
.post-card__image img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s steps(6); }
.post-card:hover .post-card__image img { transform: scale(1.04); }
.post-card__body { display: flex; flex-direction: column; gap: 14px; flex: 1; padding: 20px 18px 18px; }
.post-card__title { margin: 0; font-size: 13px; line-height: 1.75; }
.post-card__title a { color: inherit; text-decoration: none; }
.post-card__title a:hover { color: var(--primary); }
.post-card__excerpt { margin: 0; color: var(--muted-foreground); font-size: 15px; line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-card__meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: auto; color: var(--muted-foreground); font-family: var(--font-retro); font-size: 8px; }
.post-card__meta .dot { width: 4px; height: 4px; background: currentColor; }
.post-card--featured .post-card__image::after { content: "★ FEATURED"; position: absolute; top: 12px; left: 12px; padding: 4px 8px; background: var(--xp); color: #111; font-family: var(--font-retro); font-size: 8px; }
.post-card--no-image .post-card__body { padding-top: 22px; }
.is-locked { display: inline-flex; gap: 4px; }
/* Events are listed in the event overview, never as normal posts */
.post-feed > .is-event-post { display: none; }

/* Large first card on home */
@media (min-width: 900px) {
  .post-feed--home > .post-card:nth-child(1 of :not(.is-event-post)) { grid-column: 1 / -1; flex-direction: row; }
  .post-feed--home > .post-card:nth-child(1 of :not(.is-event-post)) .post-card__image { flex: 1 1 58%; aspect-ratio: auto; min-height: 340px; border-bottom: 0; border-right: var(--px) solid var(--bit-line); }
  .post-feed--home > .post-card:nth-child(1 of :not(.is-event-post)) .post-card__body { flex: 1 1 42%; justify-content: center; padding: 32px; }
  .post-feed--home > .post-card:nth-child(1 of :not(.is-event-post)) .post-card__title { font-size: 18px; }
}

/* ---------- Events ---------- */
.events { padding-top: 44px; }
.event-list { display: grid; gap: 34px 30px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.event-card { flex-direction: row; gap: 18px; padding: 18px; height: 100%; align-items: stretch; }
.event-card[hidden] { display: none; }
.event-date {
  flex: none; display: grid; align-content: center; justify-items: center; gap: 6px;
  width: 84px; padding: 12px 6px 14px;
  background: var(--primary); color: var(--primary-foreground);
  font-family: var(--font-retro); text-transform: uppercase;
  box-shadow: inset 0 -6px 0 var(--bit-shade);
  text-decoration: none;
}
.event-date__month { font-size: 9px; }
.event-date__day { font-size: 24px; line-height: 1; }
.event-date__dow { font-size: 7px; opacity: .8; }
.event-card__body { display: flex; flex-direction: column; gap: 10px; min-width: 0; flex: 1; }
.event-card__title { margin: 0; font-size: 12px; line-height: 1.7; }
.event-card__title a { color: inherit; text-decoration: none; }
.event-card__title a:hover { color: var(--primary); }
.event-card__info { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; color: var(--muted-foreground); font-family: var(--font-retro); font-size: 8px; line-height: 1.8; }
.event-card__info li { display: flex; gap: 8px; align-items: flex-start; }
.event-card__info svg { width: 12px; height: 12px; flex: none; margin-top: 1px; }
.event-card__teaser { margin: 0; color: var(--muted-foreground); font-size: 14px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.event-card__foot { display: flex; align-items: center; gap: 12px; margin-top: auto; flex-wrap: wrap; }
.event-card.is-past { opacity: .72; }
.event-card.is-past .event-date { background: var(--muted); color: var(--muted-foreground); }
.event-card.is-today .event-date { background: var(--destructive); color: #fff; animation: bit-blink 1.2s steps(2) infinite; }
.events__empty { padding: 26px; text-align: center; }
.events__empty p { margin: 0; font-family: var(--font-retro); font-size: 10px; }
.events-past { margin-top: 48px; }
.events-past summary { cursor: pointer; font-family: var(--font-retro); font-size: 11px; margin-bottom: 26px; }
.event-list--compact .event-card { padding: 12px; }
.event-list--compact .event-date { width: 64px; }
.event-list--compact .event-date__day { font-size: 18px; }

/* Event panel on post page */
.event-panel { margin: 0 var(--px) 40px; }
.event-panel[hidden] { display: none; }
.event-panel .bit-card { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 22px; padding: 20px; }
.event-panel .event-date { width: 100px; }
.event-panel .event-date__day { font-size: 30px; }
.event-panel__info { flex: 1; min-width: 220px; }
.event-panel .event-card__info { font-size: 9px; }
.event-panel__status { margin-bottom: 10px; }

/* ---------- Article ---------- */
.article { padding-block: clamp(36px, 7vw, 80px) 40px; }
.article-header { margin-bottom: 40px; text-align: center; }
.article-header .bit-badges { justify-content: center; margin-bottom: 26px; }
.article-title { margin: 0 0 22px; font-size: clamp(18px, 3.6vw, 34px); }
.article-excerpt { max-width: 640px; margin: 0 auto 28px; color: var(--muted-foreground); font-size: 19px; line-height: 1.6; }
.article-meta { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; font-family: var(--font-retro); font-size: 9px; color: var(--muted-foreground); }
.article-meta a { color: var(--foreground); text-decoration: none; }
.article-meta .bit-avatar { --size: 36px; }
.article-authors { display: flex; }
.article-image { margin: 0 auto 50px; width: min(100% - 40px, 1040px); }
.article-image .bit-frame { overflow: hidden; }
.article-image img { width: 100%; }
.article-image figcaption { margin-top: 14px; color: var(--muted-foreground); font-size: 13px; text-align: center; }

/* ---------- Content (Koenig) ---------- */
.gh-content { font-size: 18px; line-height: 1.8; }
.gh-content > * { margin-block: 0; }
.gh-content > * + * { margin-top: 1.4em; }
.gh-content > :is(h2, h3, h4) { margin-top: 2em; }
.gh-content h2 { font-size: 20px; }
.gh-content h3 { font-size: 16px; }
.gh-content h4 { font-size: 13px; }
.gh-content h5, .gh-content h6 { font-size: 11px; }
.gh-content > blockquote:not([class]) {
  margin-inline: 0; padding: 4px 0 4px 22px;
  border-left: var(--px) solid var(--primary);
  font-style: italic;
}
.gh-content blockquote.kg-blockquote-alt { padding: 0 2em; text-align: center; font-size: 1.3em; font-style: italic; color: var(--muted-foreground); border: 0; }
.gh-content > :is(ul, ol) { padding-left: 1.4em; }
.gh-content > ul:not([class]) { list-style: none; }
.gh-content > ul:not([class]) > li { position: relative; }
.gh-content > ul:not([class]) > li::before { content: ""; position: absolute; left: -1.2em; top: .7em; width: 8px; height: 8px; background: var(--primary); }
.gh-content > :is(ul, ol) > li + li { margin-top: .4em; }
.gh-content hr { height: 0; border: 0; border-top: 4px dashed var(--bit-line); margin-block: 2.4em; }
.gh-content code:not(pre code) { padding: 2px 6px; background: var(--muted); font-family: var(--font-mono); font-size: .86em; }
.gh-content pre {
  overflow-x: auto; padding: 20px; margin-inline: var(--px);
  background: oklch(0.18 0 0); color: oklch(0.93 0 0);
  font-family: var(--font-mono); font-size: 14px; line-height: 1.6;
  box-shadow: 0 -6px 0 var(--bit-line), 0 6px 0 var(--bit-line), -6px 0 0 var(--bit-line), 6px 0 0 var(--bit-line);
}
.gh-content > table:not([class]) { width: 100%; border-collapse: collapse; font-size: 15px; display: block; overflow-x: auto; }
.gh-content > table:not([class]) th { font-family: var(--font-retro); font-size: 9px; font-weight: 400; text-align: left; }
.gh-content > table:not([class]) :is(th, td) { padding: 10px 12px; border: 3px solid var(--bit-line); }
.gh-content img { margin-inline: auto; }
.gh-content figcaption { margin-top: 12px; color: var(--muted-foreground); font-size: 14px; text-align: center; }
.gh-content .kg-image-card img { box-shadow: 0 -6px 0 var(--bit-line), 0 6px 0 var(--bit-line), -6px 0 0 var(--bit-line), 6px 0 0 var(--bit-line); }
.gh-content .kg-width-full img, .gh-content .kg-gallery-card img { box-shadow: none; }
.gh-content .kg-width-wide { position: relative; width: min(100vw - 40px, 1040px); left: 50%; transform: translateX(-50%); }
.gh-content .kg-width-full { position: relative; width: 100vw; left: 50%; transform: translateX(-50%); }
.gh-content .kg-width-full img { width: 100%; }
.kg-width-wide, .kg-width-full { max-width: none; }
.gh-content .kg-callout-card { border-radius: 0; box-shadow: 0 -6px 0 var(--bit-line), 0 6px 0 var(--bit-line), -6px 0 0 var(--bit-line), 6px 0 0 var(--bit-line); margin-inline: var(--px); }
.gh-content .kg-button-card a.kg-btn, .gh-content .kg-product-card a.kg-product-card-button, .gh-content .kg-header-card a.kg-header-card-button {
  border-radius: 0 !important; font-family: var(--font-retro); font-size: 10px; text-transform: uppercase;
  box-shadow: 0 -6px 0 var(--bit-line), 0 6px 0 var(--bit-line), -6px 0 0 var(--bit-line), 6px 0 0 var(--bit-line), inset 0 -6px 0 var(--bit-shade);
}
.gh-content .kg-bookmark-container, .gh-content .kg-product-card-container, .gh-content .kg-toggle-card, .gh-content .kg-file-card-container, .gh-content .kg-audio-card {
  border-radius: 0 !important; border: 0 !important;
  box-shadow: 0 -6px 0 var(--bit-line), 0 6px 0 var(--bit-line), -6px 0 0 var(--bit-line), 6px 0 0 var(--bit-line) !important;
}
.gh-content .kg-bookmark-card, .gh-content .kg-toggle-card, .gh-content .kg-file-card, .gh-content .kg-audio-card, .gh-content .kg-product-card { margin-inline: var(--px); }
.gh-content .kg-bookmark-title, .gh-content .kg-toggle-heading-text { font-family: var(--font-retro); font-size: 11px; line-height: 1.6; }
/* 8bit blocks inside posts can break out of the text column */
.gh-content > .bit-wide { position: relative; width: min(100vw - 40px, 1100px); left: 50%; transform: translateX(-50%); }
.gh-content > .kg-card.kg-html-card:has(> .bit-wide) { width: auto; }
.gh-content .bit-section :is(h2, h3) { margin-top: 0; }
.gh-content .bit-card ul, .gh-content .bit-accordion ul { padding-left: 1.2em; }

.article-footer { margin-top: 64px; }
.article-tags { display: flex; flex-wrap: wrap; gap: 10px 14px; margin-bottom: 40px; }
.author-box { flex-direction: row; align-items: center; gap: 20px; }
.author-box__name { margin: 0 0 6px; font-size: 12px; }
.author-box__name a { color: inherit; text-decoration: none; }
.author-box p { margin: 0; color: var(--muted-foreground); font-size: 15px; }

/* Members CTA box (end of posts) */
.cta-box { margin-block: 56px; text-align: center; align-items: center; padding: 34px 24px; }
.cta-box .bit-card__title { font-size: 15px; }
.cta-box .signup-form { width: 100%; max-width: 520px; }

/* Sign-up form (hero, banner, post) */
.signup-form { width: 100%; }
.signup-form__row { display: flex; flex-wrap: wrap; gap: 14px 18px; align-items: center; justify-content: center; }
.signup-form .bit-input { flex: 1 1 220px; min-width: 0; min-height: 48px; }
.signup-form .bit-btn { flex: none; min-height: 48px; }
.signup-form__loading { display: none; }
.signup-form.loading .signup-form__label { visibility: hidden; }
.signup-form.loading .signup-form__loading { display: grid; place-items: center; position: absolute; inset: 0; }
.signup-form.loading .bit-spinner { width: 14px; height: 14px; background: currentColor; }
.signup-form__msg { display: none; margin: 16px 0 0; font-family: var(--font-retro); font-size: 9px; line-height: 1.8; }
.signup-form.success .signup-form__msg--success { display: block; color: var(--primary); }
.signup-form.error .signup-form__msg--error { display: block; color: var(--destructive); }
.signup-form.success .signup-form__row { display: none; }
.site-hero__signup { max-width: 540px; margin: 0 auto; }
.site-hero--cover .signup-form .bit-input { --bit-line: #fff; }
.site-hero--cover .signup-form__msg--success { color: #fff; }

/* Sign-up banner (home page) */
.signup-banner-wrap { padding-block: 20px 56px; }
.signup-banner {
  display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; gap: 28px 44px;
  padding: clamp(28px, 5vw, 52px);
  background: var(--primary); color: var(--primary-foreground);
  --bit-shade: color-mix(in oklab, var(--primary-foreground) 25%, transparent);
  overflow: visible;
}
.signup-banner .bit-badge { margin-bottom: 18px; }
.signup-banner__title { margin: 0 0 14px; font-size: clamp(16px, 2.6vw, 24px); line-height: 1.5; }
.signup-banner__desc { margin: 0; font-size: 17px; line-height: 1.6; opacity: .85; }
.signup-banner .bit-input { --bit-line: var(--primary-foreground); }
.signup-banner .bit-btn { --btn-bg: var(--primary-foreground); --btn-fg: var(--primary); --bit-line: var(--primary-foreground); }
.signup-banner .signup-form__row { justify-content: flex-start; }
.signup-banner .signup-form.success .signup-form__msg--success { color: inherit; }
.signup-banner__signin { margin: 16px 0 0; font-family: var(--font-retro); font-size: 8px; opacity: .85; }
.signup-banner__signin a { color: inherit; }
.signup-banner__pixels { position: absolute; top: -18px; right: 34px; display: flex; gap: 8px; }
.signup-banner__pixels span { width: 12px; height: 12px; background: var(--bit-line); }
.signup-banner__pixels span:nth-child(2) { transform: translateY(-8px); background: var(--xp); }
.signup-banner__pixels span:nth-child(3) { transform: translateY(-2px); }
@media (max-width: 760px) { .signup-banner { grid-template-columns: 1fr; } }

/* Members-only paywall box */
.content-cta { align-items: center; gap: 18px; margin-block: 48px; padding: 40px 24px; text-align: center; }
.content-cta__icon svg { width: 40px; height: 40px; color: var(--primary); }
.content-cta__title { margin: 0; font-size: clamp(13px, 2vw, 17px); line-height: 1.6; }
.content-cta__desc { margin: 0; color: var(--muted-foreground); }
.content-cta__signin { margin: 0; font-family: var(--font-retro); font-size: 8px; color: var(--muted-foreground); }

/* Landing layout: home page content + "Full width" page template
   - text (paragraphs, headings, lists) stays in a readable column
   - anything else (HTML cards, images, embeds) uses the full site width
   - 8bitcn sections (.bit-section, .bit-hero, .bit-chapter) and .bit-full go edge to edge,
     so section backgrounds (bit-section--muted, --primary, --inverted) reach the screen edges */
.home-content { padding-block: 0 24px; }
.article--landing { padding-block: 0 40px; }
.gh-content--landing { --wide: 1160px; --gutter: 20px; font-size: 19px; }
.gh-content--landing > * { width: min(100% - var(--gutter) * 2, var(--wide)); margin-inline: auto; }
.gh-content--landing > :is(p, h1, h2, h3, h4, h5, h6, ul, ol, blockquote, hr, .kg-callout-card, .kg-toggle-card, .kg-bookmark-card, .kg-file-card, .kg-audio-card, .kg-signup-card:not(.kg-width-wide):not(.kg-width-full)) {
  width: min(100% - var(--gutter) * 2, 760px);
}
.gh-content--landing > :is(.bit-section, .bit-hero, .bit-chapter, .bit-full, .kg-width-full) {
  width: 100%;
  left: auto; transform: none;
  padding-inline: max(var(--gutter), (100% - var(--wide)) / 2);
}
.gh-content--landing > .bit-chapter { padding-block: clamp(70px, 10vw, 140px); }
.gh-content--landing > .kg-width-full { padding-inline: 0; }
.gh-content--landing > :is(.bit-wide, .kg-width-wide) { left: auto; transform: none; }
.gh-content--landing > :is(.bit-section, .bit-hero, .bit-chapter, .bit-full) + :is(.bit-section, .bit-hero, .bit-chapter, .bit-full) { margin-top: 0; }
.gh-content--landing > :first-child { margin-top: 0; }

/* .bit-full in normal posts and pages: break out to the full screen width */
.gh-content > .bit-full { position: relative; width: 100vw; left: 50%; transform: translateX(-50%); padding-inline: max(20px, (100vw - 1160px) / 2); }

/* Ghost's editor sign-up card & announcement bar */
.gh-content .kg-signup-card { border-radius: 0 !important; margin-inline: var(--px); box-shadow: 0 -6px 0 var(--bit-line), 0 6px 0 var(--bit-line), -6px 0 0 var(--bit-line), 6px 0 0 var(--bit-line); }
.gh-content .kg-signup-card-heading, .gh-content .kg-signup-card-subheading { font-family: var(--font-retro) !important; line-height: 1.5 !important; }
.gh-content .kg-signup-card-heading { font-size: clamp(16px, 3vw, 26px) !important; }
.gh-content .kg-signup-card-subheading { font-size: 11px !important; }
.gh-content .kg-signup-card-fields { border-radius: 0 !important; border-width: 4px !important; }
.gh-content .kg-signup-card-input { border-radius: 0 !important; font-family: var(--font-retro) !important; font-size: 10px !important; }
.gh-content .kg-signup-card-button { border-radius: 0 !important; font-family: var(--font-retro) !important; font-size: 10px !important; text-transform: uppercase; box-shadow: inset 0 -6px 0 rgb(0 0 0 / .2); }
.gh-content .kg-signup-card-disclaimer, .gh-content .kg-signup-card-success, .gh-content .kg-signup-card-error { font-family: var(--font-retro) !important; font-size: 9px !important; }
.gh-announcement-bar { font-family: var(--font-retro) !important; font-size: 10px !important; line-height: 1.7 !important; border-bottom: 4px solid var(--bit-line); }
.gh-announcement-bar a { text-decoration-thickness: 2px; text-underline-offset: 3px; }

/* Related & pagination */
.related { padding-block: 40px 70px; border-top: var(--px) solid var(--bit-line); }
.pagination { display: flex; align-items: center; justify-content: center; gap: 22px; margin-top: 56px; font-family: var(--font-retro); font-size: 9px; }
.pagination .page-number { color: var(--muted-foreground); }

/* Tag / author header */
.archive-header { padding: clamp(40px, 7vw, 80px) 0 40px; text-align: center; }
.archive-header .bit-avatar { --size: 110px; margin: 0 auto 26px; }
.archive-title { margin: 0 0 14px; font-size: clamp(18px, 3.4vw, 32px); }
.archive-desc { max-width: 620px; margin: 0 auto; color: var(--muted-foreground); }
.archive-count { margin-top: 18px; }

/* Error */
.error-screen { padding: clamp(60px, 12vw, 140px) 0; text-align: center; }
.error-code { margin: 0; font-size: clamp(56px, 14vw, 140px); line-height: 1; color: var(--primary); text-shadow: 6px 6px 0 var(--bit-line); }
.error-msg { margin: 30px 0; font-family: var(--font-retro); font-size: 12px; }
.blink { animation: bit-blink 1s steps(2) infinite; }

/* Footer */
.site-footer { margin-top: 40px; padding: 40px 0; border-top: var(--px) solid var(--bit-line); font-family: var(--font-retro); font-size: 9px; color: var(--muted-foreground); }
.site-footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.site-footer ul { display: flex; gap: 16px; margin: 0; padding: 0; list-style: none; flex-wrap: wrap; }
.site-footer a { color: var(--foreground); text-decoration: none; }
.site-footer a:hover { color: var(--primary); }
.site-footer__member a { text-decoration: underline; text-underline-offset: 4px; }

@media (max-width: 600px) {
  body { font-size: 16px; }
  .gh-content { font-size: 17px; }
  .event-card { padding: 14px; gap: 14px; }
  .event-date { width: 70px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Portal floating button iframe (lives in the page, not in the iframe) */
html.pq-portal-themed #ghost-portal-root .gh-portal-triggerbtn-iframe { border-radius: 0 !important; box-shadow: 8px 8px 0 color-mix(in oklab, var(--bit-line) 30%, transparent) !important; }
.gh-content--landing > :is(.bit-section, .bit-hero, .bit-chapter, .bit-full) + :not(.bit-section, .bit-hero, .bit-chapter, .bit-full) { margin-top: 2.4em; }

.article--events { padding-bottom: 0; }
.article--events .gh-content { margin-bottom: 8px; }

/* Single event card at the bottom of an event post */
.events--single { padding-top: 8px; }
.event-list--single { grid-template-columns: 1fr; }
/* Related posts: events are filtered out; show at most 3, hide the section if none are left */
.related .post-feed > .post-card:nth-child(n+4 of :not(.is-event-post)) { display: none; }
.related:not(:has(.post-card:not(.is-event-post))) { display: none; }
