/*
Theme Name: Northpine
Theme URI: https://northpine.dev
Author: Rex Fan
Author URI: https://northpine.dev
Description: Minimal, professional theme for Northpine — healthcare data engineering (FHIR, X12, .NET).
Version: 1.0.0
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
License: MIT License
License URI: https://opensource.org/licenses/MIT
Text Domain: northpine
*/

/* ============ Fonts (self-hosted) ============ */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/ibmplex-400.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('assets/fonts/ibmplex-500.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('assets/fonts/ibmplex-600.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/jetbrains-400.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('assets/fonts/jetbrains-500.woff2') format('woff2');
}

/* ============ Base ============ */
:root {
  --pine: #1F4D3A;
  --ink: #1a1a1a;
  --muted: #5c6660;
  --line: #e4e8e5;
  --bg: #ffffff;
  --panel: #f6f8f7;
  --font-sans: 'IBM Plex Sans', -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 1.7;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--pine); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 0.6em;
  letter-spacing: -0.01em;
}
h1 { font-size: 2.25rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1.1em; }

ul, ol { margin: 0 0 1.2em; padding-left: 1.4em; }
li { margin-bottom: 0.45em; }

img { max-width: 100%; height: auto; }

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--panel);
  padding: 0.12em 0.35em;
  border-radius: 4px;
}
pre {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 16px 18px;
  overflow-x: auto;
  line-height: 1.6;
  font-size: 0.9rem;
  margin: 0 0 1.4em;
}
pre code { background: none; padding: 0; font-size: inherit; }

blockquote {
  margin: 0 0 1.4em;
  padding: 0.2em 0 0.2em 1.1em;
  border-left: 3px solid var(--pine);
  color: var(--muted);
}
blockquote p:last-child { margin-bottom: 0; }

table { border-collapse: collapse; width: 100%; margin: 0 0 1.4em; font-size: 0.95rem; }
th, td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
th { font-weight: 600; background: var(--panel); }

hr { border: none; border-top: 1px solid var(--line); margin: 2.2em 0; }

/* Layout */
.wrap { max-width: 720px; margin: 0 auto; padding: 0 24px; }
.wrap--home { max-width: 1000px; }
.wrap--header { max-width: 1000px; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--pine); color: #fff; padding: 8px 14px; z-index: 100;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ============ Header ============ */
.site-header { border-bottom: 1px solid var(--line); padding: 28px 0 0; }
.header-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand svg { width: 26px; height: 26px; display: block; }
.brand-name { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; }
.tagline { display: block; color: var(--muted); font-size: 0.95rem; margin-top: 2px; }
.tagline .byline { white-space: nowrap; }

.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 26px; }
.site-nav a { color: var(--ink); font-size: 0.98rem; font-weight: 500; }
.site-nav a:hover { color: var(--pine); text-decoration: none; }
.site-nav .current-menu-item > a, .site-nav .current_page_item > a { color: var(--pine); }

/* ============ Sections ============ */
.section { padding: 44px 0; }
.section:first-of-type { padding-top: 56px; }
.section + .section { border-top: 1px solid var(--line); }

.kicker {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--pine);
  margin-bottom: 10px;
}

.sub { font-size: 1.25rem; color: var(--muted); margin: 0 0 1.2em; font-weight: 400; }

.intro { font-size: 1.05rem; max-width: 640px; }

.btn {
  display: inline-block;
  background: var(--pine);
  color: #fff;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 10px 22px;
  border-radius: 5px;
  border: 1px solid var(--pine);
}
.btn:hover { background: #173d2e; text-decoration: none; }
.btn--ghost {
  background: transparent;
  color: var(--pine);
}
.btn--ghost:hover { background: var(--panel); }

/* Checklist block (home lead) */
.checklist {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px 30px;
}
.checklist h2 { margin-bottom: 0.3em; }
.checklist p { color: var(--muted); }
.checklist .btn { margin-top: 6px; }

/* Proof of work */
.proof-list { list-style: none; padding: 0; margin: 0; }
.proof-list li {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0;
}
.proof-list li:first-child { padding-top: 0; }
.proof-list li:last-child { border-bottom: none; }
.proof-list .tag { color: var(--muted); }

/* Post list (home latest + blog) */
.post-list { list-style: none; padding: 0; margin: 0; }
.post-list li { padding: 12px 0; border-bottom: 1px solid var(--line); margin-bottom: 0; }
.post-list li:first-child { padding-top: 0; }
.post-list li:last-child { border-bottom: none; }
.post-list time { color: var(--muted); font-size: 0.9rem; display: inline-block; min-width: 108px; }
.post-list a { color: var(--ink); font-weight: 500; }
.post-list a:hover { color: var(--pine); }

.cat-filter { list-style: none; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 26px; }
.cat-filter a {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 0.9rem;
  color: var(--muted);
}
.cat-filter a.is-active, .cat-filter a:hover { border-color: var(--pine); color: var(--pine); text-decoration: none; }

/* Tools list */
.tool-list { list-style: none; padding: 0; margin: 0; }
.tool-list li { padding: 18px 0; border-bottom: 1px solid var(--line); margin-bottom: 0; }
.tool-list li:first-child { padding-top: 0; }
.tool-list li:last-child { border-bottom: none; }
.tool-list h3 { margin-bottom: 0.2em; }
.tool-list .status {
  display: inline-block; font-size: 0.78rem; font-weight: 500;
  color: var(--pine); border: 1px solid var(--pine); border-radius: 999px;
  padding: 1px 10px; margin-left: 8px; vertical-align: 2px;
}
.tool-list .links { margin-top: 6px; font-size: 0.92rem; }

.muted { color: var(--muted); }

.form-placeholder {
  border: 1px dashed var(--line);
  border-radius: 6px;
  padding: 14px 18px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  background: var(--panel);
  margin-bottom: 0;
}

/* Series list */
.series-list { counter-reset: part; padding-left: 0; list-style: none; }
.series-list li { counter-increment: part; padding: 12px 0; border-bottom: 1px solid var(--line); margin-bottom: 0; }
.series-list li:last-child { border-bottom: none; }
.series-list .part-no::before {
  content: counter(part);
  display: inline-block; width: 2em; color: var(--muted);
  font-family: var(--font-mono); font-size: 0.85rem;
}
.series-list time { color: var(--muted); font-size: 0.9rem; margin-left: 10px; }

/* ============ Article (single) ============ */
.article { padding: 48px 0 24px; }
.article .byline { color: var(--muted); font-size: 0.95rem; margin-bottom: 2.2em; }
.article .content { max-width: 720px; }
.article .content h2 { margin-top: 1.8em; }
.article .content h3 { margin-top: 1.6em; }

.post-nav { margin: 40px 0 0; padding-top: 22px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.post-nav a { font-weight: 500; }
.post-nav .label { display: block; font-size: 0.8rem; color: var(--muted); font-weight: 400; }

.origin { margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.92rem; }

/* ============ Page (tools / about / newsletter) ============ */
.page { padding: 48px 0 24px; }
.page .content img { border-radius: 6px; }
.about-photo { max-width: 180px; border-radius: 8px; margin: 4px 0 22px; }

/* ============ 404 ============ */
.error-404 { padding: 80px 0; }

/* ============ Footer ============ */
.site-footer { border-top: 1px solid var(--line); margin-top: 56px; padding: 30px 0 40px; }
.site-footer p { margin: 0 0 6px; font-size: 0.9rem; color: var(--muted); }
.site-footer .disclaimer { font-size: 0.82rem; }

/* ============ Accessibility helpers ============ */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip: rect(0 0 0 0); overflow: hidden;
}

/* ============ Mobile ============ */
@media (max-width: 640px) {
  body { font-size: 17px; }
  h1 { font-size: 1.85rem; }
  h2 { font-size: 1.35rem; }
  .wrap, .wrap--home, .wrap--header { padding: 0 20px; }
  .site-header { padding-top: 20px; }
  .header-row { flex-direction: column; align-items: flex-start; gap: 10px; }
  .site-nav ul { gap: 4px 18px; }
  .checklist { padding: 22px 20px; }
  .post-list time { display: block; min-width: 0; }
  .section { padding: 34px 0; }
}
