/* ── Design Tokens ─────────────────────────────────────────────────
   Subnet Calculator (lkforge Network tool). Same visual family as the
   Network Tools suite — Space Grotesk + JetBrains Mono, light theme —
   with the network-emerald accent that brands the Network category. */
:root {
  --bg:        #f8f7f4;
  --surface:   #ffffff;
  --surface2:  #f3f2ef;
  --border:    #e2e0da;
  --text:      #1a1917;
  --muted:     #8a8680;
  --accent:    #059669;
  --accent-h:  #047857;
  --accent-bg: #e6f5ef;
  --accent-fg: #047857;
  --radius:    9px;
  --radius-lg: 14px;
  --shadow:    0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  --shadow-lg: 0 4px 20px rgba(0,0,0,.14);
  --mono:      'JetBrains Mono', ui-monospace, 'Courier New', monospace;
}

/* ── Reset ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Space Grotesk', system-ui, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Header ────────────────────────────────────────────────────── */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-logo { font-size: 1.15rem; font-weight: 700; color: var(--text); letter-spacing: -.5px; text-decoration: none; }
.site-nav { display: flex; align-items: center; gap: 6px; }
.nav-link {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 100px;
  font-size: .875rem;
  font-weight: 600;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  background: transparent;
  text-decoration: none;
  transition: background .18s, border-color .18s, color .18s, transform .1s;
}
.nav-link:hover { background: var(--accent); border-color: var(--accent); color: #fff; text-decoration: none; transform: translateY(-1px); }
.nav-link:active { transform: scale(.97); }
.nav-link.active { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (min-width: 680px) {
  .site-nav .nav-link { display: inline-flex; }
  .nav-hamburger { display: none; }
  .nav-mobile-menu { display: none !important; }
}
.nav-hamburger { display: flex; align-items: center; gap: 6px; background: none; border: 1px solid var(--border); cursor: pointer; padding: 6px 12px; border-radius: var(--radius); font-size: .85rem; font-weight: 600; letter-spacing: .06em; color: var(--text); transition: background .2s; min-height: 38px; }
.nav-hamburger:hover { background: rgba(0,0,0,.07); }
.nav-mobile-menu { display: none; flex-direction: column; background: var(--surface); border-bottom: 1px solid var(--border); padding: 10px 16px 14px; gap: 8px; }
.nav-mobile-menu.open { display: flex; }
.nav-mobile-link { display: block; text-align: center; text-decoration: none; font-size: 1rem; font-weight: 600; color: var(--text); background: var(--surface2); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 13px 16px; transition: background .18s, border-color .18s, color .18s; }
.nav-mobile-link:hover { background: var(--accent); border-color: var(--accent); color: #fff; text-decoration: none; }
.nav-mobile-link.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── Layout ────────────────────────────────────────────────────── */
.container { max-width: 860px; margin: 0 auto; padding: 0 20px; }
.page-main { padding: 36px 0 72px; }

/* ── Content page head (articles / blogs / posts) ──────────────── */
.page-head { margin-bottom: 32px; }
.page-head .page-tag { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-fg); background: var(--accent-bg); border-radius: 999px; padding: 3px 11px; margin-bottom: 14px; }
.page-head h1 { font-size: clamp(1.6rem, 4vw, 2rem); font-weight: 800; color: var(--text); margin-bottom: 8px; line-height: 1.2; }
.page-head p { color: var(--muted); font-size: 1rem; max-width: 62ch; }

/* ── Post grid (hub cards) ─────────────────────────────────────── */
.post-grid { display: grid; grid-template-columns: 1fr; gap: 18px; margin-bottom: 36px; }
@media (min-width: 700px) { .post-grid { grid-template-columns: 1fr 1fr; } }
.post-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px 22px; box-shadow: var(--shadow); text-decoration: none; color: var(--text); transition: transform .15s, border-color .18s, box-shadow .18s; }
.post-card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow-lg); text-decoration: none; }
.post-card .card-tag { align-self: flex-start; font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-fg); background: var(--accent-bg); border-radius: 999px; padding: 3px 10px; margin-bottom: 14px; }
.post-card h2 { font-size: 1.08rem; font-weight: 800; line-height: 1.35; color: var(--text); margin-bottom: 10px; }
.post-card p { color: var(--muted); font-size: .92rem; line-height: 1.55; margin-bottom: 16px; flex-grow: 1; }
.post-card .read-more { font-size: .82rem; font-weight: 700; letter-spacing: .04em; color: var(--accent); }
.post-card .read-more::after { content: " →"; }

/* ── Article / blog post body ──────────────────────────────────── */
.article-body { max-width: 700px; }
.article-body .post-tag { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-fg); background: var(--accent-bg); border-radius: 999px; padding: 3px 11px; margin-bottom: 14px; }
.article-body h1 { font-size: clamp(1.7rem, 4vw, 2.1rem); font-weight: 800; line-height: 1.2; margin-bottom: 10px; }
.article-body .article-meta { font-size: .85rem; color: var(--muted); margin-bottom: 28px; }
.article-body h2 { font-size: 1.25rem; font-weight: 800; margin: 32px 0 10px; }
.article-body h3 { font-size: 1.05rem; font-weight: 700; margin: 22px 0 8px; }
.article-body p { font-size: .98rem; color: var(--text); line-height: 1.75; margin-bottom: 16px; }
.article-body ul, .article-body ol { padding-left: 22px; margin-bottom: 16px; }
.article-body li { font-size: .98rem; color: var(--text); line-height: 1.75; margin-bottom: 8px; }
.article-body a { color: var(--accent); }
.article-body code { font-family: var(--mono); font-size: .86em; background: var(--surface2); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; }
.article-body pre { font-family: var(--mono); font-size: .85rem; line-height: 1.6; background: #0f1115; color: #e6edf3; border-radius: var(--radius); padding: 16px 18px; overflow-x: auto; margin-bottom: 18px; }
.article-body pre code { background: none; border: none; padding: 0; font-size: inherit; color: inherit; }
.article-body blockquote { border-left: 3px solid var(--accent-bg); padding: 4px 0 4px 16px; margin: 0 0 16px; color: var(--muted); font-style: italic; }
.article-body table { width: 100%; border-collapse: collapse; margin-bottom: 18px; font-size: .92rem; }
.article-body th, .article-body td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.article-body th { background: var(--surface2); font-weight: 700; }
.article-body td code { background: none; border: none; padding: 0; }

.article-cta { background: var(--accent-bg); border: 1px solid var(--accent-fg); border-radius: 12px; padding: 20px 24px; margin: 34px 0; }
.article-cta p { color: var(--accent-fg); font-weight: 600; margin-bottom: 12px; }
.article-cta a { display: inline-block; background: var(--accent); color: #fff; padding: 10px 22px; border-radius: var(--radius); font-weight: 700; font-size: .9rem; text-decoration: none; }
.article-cta a:hover { background: var(--accent-h); text-decoration: none; }

.related { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border); font-size: .9rem; color: var(--muted); }
.related a { color: var(--accent); }

/* ── Footer ────────────────────────────────────────────────────── */
footer.page-footer { border-top: 1px solid var(--border); padding: 24px 20px; text-align: center; font-size: .82rem; color: var(--muted); margin-top: 24px; }
footer.page-footer nav { margin-bottom: 6px; }
footer.page-footer nav a { color: var(--muted); }
footer.page-footer nav a:hover { color: var(--text); }
