/* Redline base: layout and components. Skins set the tokens below. */
:root {
  --bg: #fff;
  --paper: #fff;
  --ink: #111;
  --ink-2: #333;
  --muted: #5d6066;
  --line: #e4e4e4;
  --accent: #c81e1e;
  --accent-ink: #fff;
  --head-bg: #111;
  --head-ink: #fff;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.05), 0 10px 30px -18px rgb(0 0 0 / 0.25);
  --font-body: system-ui, sans-serif;
  --font-display: var(--font-body);
  --up: #12803f;
  --down: #c81f27;
  --wrap: 1140px;
  --read: 760px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.75 var(--font-body);
  font-feature-settings: "tnum";
  -webkit-font-smoothing: antialiased;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.25; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--paper); color: var(--ink); padding: 8px 14px; border-radius: 8px; }
.skip-link:focus { left: 12px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.wrap-read { max-width: var(--read); }
.site-main { min-height: 60vh; padding-bottom: 56px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 30; background: var(--head-bg); color: var(--head-ink); }
.header-inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { text-decoration: none; color: inherit; flex-shrink: 0; }
.logo { display: inline-flex; align-items: center; gap: 10px; }
.logo-mark { width: 30px; height: 30px; color: var(--accent); }
.logo-word { font-family: var(--font-display); font-weight: 700; font-size: 21px; letter-spacing: .06em; }
.logo-dot { color: var(--accent); }
.site-nav { display: flex; align-items: center; gap: 18px; margin-left: auto; }
.menu, .footer-menu { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; flex-wrap: wrap; }
.menu a { display: block; padding: 8px 12px; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: 15px; opacity: .85; }
.menu a:hover, .menu .current-menu-item > a { opacity: 1; color: inherit; background: rgb(255 255 255 / .1); }
.header-search input { width: 170px; border: 1px solid rgb(255 255 255 / .2); background: rgb(255 255 255 / .08); color: inherit; border-radius: 999px; padding: 7px 14px; font: inherit; font-size: 14px; }
.header-search input::placeholder { color: inherit; opacity: .6; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 0; color: inherit; width: 44px; height: 44px; cursor: pointer; }
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after { display: block; width: 22px; height: 2px; background: currentColor; border-radius: 2px; position: relative; margin: 0 auto; transition: transform .2s; }
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -7px; }
.nav-toggle-bars::after { top: 7px; }
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; position: absolute; inset: 64px 0 auto; background: var(--head-bg); flex-direction: column; align-items: stretch; padding: 12px 20px 20px; gap: 12px; box-shadow: 0 20px 30px -20px #000; }
  .site-nav.open { display: flex; }
  .menu { flex-direction: column; }
  .header-search input { width: 100%; }
}

/* Breadcrumbs, headings */
.breadcrumbs { font-size: 13px; color: var(--muted); padding: 18px 0 6px; }
.breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumbs li + li::before { content: "›"; margin-right: 6px; opacity: .6; }
.breadcrumbs a { text-decoration: none; }
.page-head { padding: 12px 0 24px; }
.page-title, .entry-title { font-size: clamp(28px, 4vw, 42px); }
.page-lead { color: var(--muted); max-width: 680px; }
.section-title { font-size: 22px; margin: 40px 0 16px; display: flex; align-items: center; gap: 12px; }
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* Hero */
.hero { padding: 48px 0 36px; }
.hero-kicker { color: var(--muted); font-size: 14px; letter-spacing: .04em; margin: 0 0 8px; }
.hero-title { font-size: clamp(34px, 6vw, 60px); margin: 0 0 12px; }
.hero-lead { max-width: 640px; color: var(--ink-2); font-size: 17px; margin: 0; }

/* Cards and grids */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .15s; }
.card:hover { transform: translateY(-2px); }
.card-media img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; }
.card-title { font-size: 18px; margin: 0; }
.card-title a { text-decoration: none; }
.card-excerpt { color: var(--muted); font-size: 14px; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-date { font-size: 12px; color: var(--muted); }
.chip { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 600; text-decoration: none; }

/* Entries */
.entry-head { padding: 8px 0 18px; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; }
.entry-media { margin: 0 0 24px; }
.entry-media img { border-radius: var(--radius); width: 100%; }
.entry-content { font-size: 17.5px; }
.entry-content h2 { font-size: 26px; margin: 1.6em 0 .6em; }
.entry-content h3 { font-size: 21px; margin: 1.4em 0 .5em; }
.entry-content img { border-radius: 10px; }
.entry-content table { width: 100%; border-collapse: collapse; margin: 1em 0 1.6em; font-size: 15px; }
.entry-content th, .entry-content td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.entry-content th { font-weight: 600; color: var(--muted); font-size: 13px; }
.entry-content blockquote { margin: 1.4em 0; padding: 6px 0 6px 20px; border-left: 3px solid var(--accent); color: var(--ink-2); }
.note { font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; margin-top: 28px; }

/* Forms, pagination, empty state */
.search-form { display: flex; gap: 8px; max-width: 520px; }
.search-form input { flex: 1; padding: 11px 16px; border: 1px solid var(--line); border-radius: 999px; font: inherit; background: var(--paper); color: var(--ink); }
.search-form button, .btn { padding: 11px 20px; border: 0; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-block; }
.pagination { display: flex; gap: 6px; flex-wrap: wrap; margin: 32px 0; }
.pagination a, .pagination span { padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); text-decoration: none; font-size: 14px; }
.pagination .current { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.empty { padding: 48px 0; }
.big-404 { font-family: var(--font-display); font-size: 96px; line-height: 1; color: var(--accent); margin: 24px 0 8px; }

/* Footer */
.site-footer { background: var(--head-bg); color: var(--head-ink); margin-top: 40px; }
.footer-inner { display: grid; grid-template-columns: 1.5fr 1fr; gap: 32px; padding-top: 44px; padding-bottom: 28px; }
.footer-brand p { opacity: .75; font-size: 14px; max-width: 420px; margin-top: 12px; }
.footer-menu { flex-direction: column; }
.footer-menu a { text-decoration: none; opacity: .8; font-size: 14px; }
.footer-base { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding-top: 16px; padding-bottom: 24px; font-size: 13px; opacity: .6; border-top: 1px solid rgb(255 255 255 / .1); }
@media (max-width: 700px) { .footer-inner { grid-template-columns: 1fr; } }

/* Shared data widgets used by the plugins */
.board { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin: 0 0 24px; }
.board-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.board-title { font-family: var(--font-display); font-size: 19px; margin: 0; }
.board-time { color: var(--muted); font-size: 13px; }
.board-body { padding: 16px 18px; }
.up { color: var(--up); }
.down { color: var(--down); }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kv-item { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; }
.kv-label { font-size: 13px; color: var(--muted); }
.kv-value { font-family: var(--font-display); font-size: 26px; font-weight: 700; line-height: 1.2; }
.kv-sub { font-size: 13px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
