/* Shared styles for the UnminerMac blog index + article pages.
   Mobile-first: small-screen rules are the base, larger breakpoints add. */
:root {
  --bg-1: #0f172a; --bg-2: #1e293b;
  --ink: #e2e8f0; --ink-dim: #94a3b8; --ink-faint: #64748b;
  --blue: #38bdf8; --blue-2: #3b82f6; --warn: #fbbf24;
  --bad: #f43f5e; --good: #22c55e;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, sans-serif;
  color: var(--ink); line-height: 1.65; font-size: 16px;
  background:
    radial-gradient(ellipse 60% 50% at 15% 10%, rgba(59,130,246,0.35), transparent 70%),
    radial-gradient(ellipse 50% 40% at 85% 85%, rgba(14,165,233,0.28), transparent 70%),
    linear-gradient(135deg, #0b1020 0%, #1e293b 50%, #0b1020 100%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;       /* prevent horizontal scroll from any overflow */
}
a { color: var(--blue); text-decoration: none; }
a:hover { color: #7dd3fc; }
code {
  background: rgba(148,163,184,0.15); padding: 0.1em 0.4em; border-radius: 5px;
  font-size: 0.88em; font-family: ui-monospace, "SF Mono", Menlo, monospace;
  word-break: break-word;   /* long hex strings wrap rather than overflow */
}
pre {
  background: rgba(0,0,0,0.45); padding: 1rem 1.1rem;
  border-radius: 12px; overflow-x: auto; border: 1px solid rgba(148,163,184,0.15);
  font-size: 0.78rem; line-height: 1.55;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  margin: 1.3rem 0;
  -webkit-overflow-scrolling: touch;
}
pre code { background: transparent; padding: 0; font-size: inherit; word-break: normal; }
.container { max-width: 820px; margin: 0 auto; padding: 0 1rem; }

/* Nav — horizontally scrollable on mobile so all links stay reachable */
nav {
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  background: rgba(11,16,32,0.75);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
nav .container {
  display: flex; align-items: center; gap: 0.75rem;
  height: 56px; max-width: 980px;
}
nav .brand {
  display: flex; align-items: center; gap: 0.5rem;
  font-weight: 600; color: var(--ink); flex-shrink: 0;
  font-size: 0.95rem;
}
nav .brand img { width: 26px; height: 26px; border-radius: 6px; }
nav .links {
  display: flex; gap: 1rem;
  font-size: 0.86rem;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  margin-left: auto;
  /* hide scrollbar but keep functionality */
  scrollbar-width: none;
}
nav .links::-webkit-scrollbar { display: none; }
nav .links a {
  color: var(--ink-dim);
  white-space: nowrap;
  padding: 0.25rem 0;
  flex-shrink: 0;
}
nav .links a:hover { color: var(--ink); }
nav .links a.active { color: var(--blue); }

/* ──────────────── BLOG INDEX (blog.html) ──────────────── */

.blog-header { padding: 3rem 0 1.5rem; }
.blog-header h1 {
  font-size: clamp(1.75rem, 6vw, 3rem);
  font-weight: 700; letter-spacing: -0.02em;
  margin-bottom: 0.75rem; line-height: 1.15;
  background: linear-gradient(135deg, #f0f9ff 0%, #38bdf8 50%, #3b82f6 100%);
  background-clip: text; -webkit-background-clip: text; color: transparent;
}
.blog-header .lede { font-size: 1.02rem; color: var(--ink-dim); max-width: 60ch; }
.blog-header .meta {
  font-size: 0.78rem; color: var(--ink-faint);
  margin-top: 0.75rem; padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.posts { padding: 1rem 0 4rem; display: flex; flex-direction: column; gap: 1rem; }
.post-card {
  background: rgba(20,28,48,0.55);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 1.25rem 1.35rem;
  transition: border-color 0.15s, transform 0.15s;
  display: block;
  color: inherit;
}
.post-card:hover, .post-card:focus-visible {
  border-color: rgba(59,130,246,0.35);
  transform: translateY(-1px);
}
.post-card .post-meta {
  font-size: 0.7rem; color: var(--ink-faint);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
}
.post-card .post-meta .num { color: var(--blue); font-weight: 600; }
.post-card h2 {
  font-size: 1.2rem; font-weight: 700;
  color: var(--ink); margin: 0 0 0.4rem;
  letter-spacing: -0.01em; line-height: 1.3;
}
.post-card p { color: var(--ink-dim); font-size: 0.92rem; margin: 0; line-height: 1.55; }
.post-card .more {
  color: var(--blue); font-size: 0.88rem;
  margin-top: 0.7rem; display: inline-block;
}

.series-intro {
  background: linear-gradient(135deg, rgba(59,130,246,0.10), rgba(14,165,233,0.05));
  border: 1px solid rgba(59,130,246,0.25);
  border-radius: 14px;
  padding: 1.2rem 1.35rem;
  margin: 1rem 0;
}
.series-intro p { color: var(--ink-dim); font-size: 0.92rem; margin: 0; }
.series-intro strong { color: var(--ink); }

/* ──────────────── ARTICLE PAGES (blog/*.html) ──────────────── */

article { padding: 2.5rem 0 3rem; }
.back-link {
  display: inline-block; font-size: 0.85rem;
  color: var(--ink-dim); margin-bottom: 2rem;
  padding: 0.3rem 0;
}
.back-link:hover { color: var(--ink); }
article .part-meta {
  font-size: 0.72rem; color: var(--ink-faint);
  text-transform: uppercase; letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}
article .part-meta .num { color: var(--blue); font-weight: 600; }
article h1 {
  font-size: clamp(1.6rem, 6vw, 2.4rem);
  font-weight: 700; letter-spacing: -0.02em;
  line-height: 1.2; margin-bottom: 0.7rem;
  background: linear-gradient(135deg, #f0f9ff 0%, #38bdf8 50%, #3b82f6 100%);
  background-clip: text; -webkit-background-clip: text; color: transparent;
}
article .lede { font-size: 1rem; color: var(--ink-dim); margin-bottom: 0.5rem; }
article .meta {
  font-size: 0.78rem; color: var(--ink-faint);
  margin-bottom: 2.5rem; padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
article h2 {
  font-size: clamp(1.2rem, 4vw, 1.4rem);
  font-weight: 700; letter-spacing: -0.01em;
  margin: 2.5rem 0 0.8rem; color: var(--ink);
  line-height: 1.3;
}
article h3 {
  font-size: 1.05rem; font-weight: 600;
  margin: 1.8rem 0 0.65rem; color: var(--blue);
  line-height: 1.35;
}
article p { margin: 0.9rem 0; color: var(--ink-dim); }
article p strong { color: var(--ink); }
article ul, article ol { margin: 0.9rem 0 0.9rem 1.4rem; color: var(--ink-dim); }
article li { margin: 0.35rem 0; }
article li strong { color: var(--ink); }

/* Tables — wrap horizontally on mobile rather than break the layout */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 1.3rem 0; }
.table-wrap table { margin: 0; }
table {
  width: 100%; border-collapse: collapse;
  margin: 1.3rem 0; font-size: 0.88rem;
}
thead th {
  text-align: left; padding: 0.65rem 0.55rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  color: var(--ink-faint); font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.05em;
  white-space: nowrap;
}
thead th:nth-child(n+2) { text-align: right; }
tbody td {
  padding: 0.6rem 0.55rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-variant-numeric: tabular-nums;
}
tbody td:first-child { color: var(--ink); }
tbody td:nth-child(n+2) { text-align: right; color: var(--ink-dim); }
tbody tr.highlight td { color: var(--ink); background: rgba(59,130,246,0.08); }
tbody tr.highlight td:nth-child(n+2) { color: var(--blue); font-weight: 600; }

.callout {
  background: rgba(20,28,48,0.55);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid rgba(255,255,255,0.08);
  border-left: 3px solid var(--blue);
  border-radius: 10px;
  padding: 1rem 1.2rem;
  margin: 1.3rem 0;
}
.callout.warn { border-left-color: var(--warn); }
.callout.good { border-left-color: var(--good); }
.callout p:first-child { margin-top: 0; }
.callout p:last-child { margin-bottom: 0; }

.verdict {
  background: linear-gradient(135deg, rgba(59,130,246,0.12), rgba(14,165,233,0.06));
  border: 1px solid rgba(59,130,246,0.3);
  border-radius: 14px;
  padding: 1.3rem 1.45rem;
  margin: 1.8rem 0;
}
.verdict h3 { color: var(--blue); margin-top: 0; }

/* Prev / next navigation at article bottom */
.pager {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem;
  margin: 3rem 0 0; padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.pager a {
  background: rgba(20,28,48,0.55);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 0.95rem 1.1rem;
  display: flex; flex-direction: column; gap: 0.2rem;
  color: var(--ink);
  transition: border-color 0.15s, background 0.15s;
  min-height: 60px;
}
.pager a:hover { border-color: rgba(59,130,246,0.35); }
.pager .pager-dir {
  font-size: 0.7rem; color: var(--ink-faint);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.pager .pager-title { font-size: 0.9rem; color: var(--ink); line-height: 1.3; }
.pager a.next { text-align: right; align-items: flex-end; }
.pager .placeholder { visibility: hidden; }

footer {
  padding: 2.5rem 0 3rem; text-align: center;
  color: var(--ink-faint); font-size: 0.82rem;
  border-top: 1px solid rgba(255,255,255,0.05);
  margin-top: 3rem;
}

/* ──────────────── BREAKPOINTS ──────────────── */

@media (min-width: 600px) {
  .container { padding: 0 1.5rem; }
  body { font-size: 17px; }
  article .lede { font-size: 1.1rem; }
  article p { margin: 1rem 0; }
  article h3 { font-size: 1.1rem; }
  .post-card { padding: 1.6rem 1.8rem; }
  .post-card h2 { font-size: 1.35rem; }
  .post-card p { font-size: 0.96rem; }
  .post-card .more { font-size: 0.9rem; }
  pre { font-size: 0.82rem; padding: 1.2rem 1.4rem; }
  nav .container { gap: 1rem; height: 60px; }
  nav .links { gap: 1.5rem; font-size: 0.92rem; }
  nav .brand { font-size: 1rem; }
  nav .brand img { width: 28px; height: 28px; }
  .blog-header { padding: 4rem 0 2rem; }
  .blog-header .lede { font-size: 1.15rem; }
  article { padding: 3.5rem 0 5rem; }
  .pager a { padding: 1.1rem 1.3rem; }
}

@media (min-width: 900px) {
  article h2 { font-size: 1.5rem; }
  table { font-size: 0.92rem; }
}

/* Reduce motion accessibility */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .post-card { transition: none; }
}
