/* ============================================================
   ARP17 blog theme
   Adapted from the arp17.eu landing page stylesheet.
   Palette:
     paper       #F5F7F6  cool white
     grid        #E3E9E7  graph-paper lines
     ink         #14262B  deep slate-teal
     ink-soft    #435A60  secondary text
     ultramarine #2036C4  single accent
   Type:
     display  Bricolage Grotesque
     body     Archivo
     utility  IBM Plex Mono
   ============================================================ */

:root {
  --paper: #F5F7F6;
  --grid: #E3E9E7;
  --ink: #14262B;
  --ink-soft: #435A60;
  --accent: #2036C4;
  --node-fill: #FFFFFF;
  --font-display: "Bricolage Grotesque", "Archivo", sans-serif;
  --font-body: "Archivo", -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", monospace;
  --measure: 38rem;
  --gutter: clamp(1.25rem, 5vw, 4rem);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--gh-font-body, var(--font-body));
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 36px 36px;
  -webkit-font-smoothing: antialiased;
}

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

/* ---------- Focus and skip link ---------- */

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: 0.75rem 1.25rem;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  text-decoration: none;
  transition: top 0.15s ease-out;
}

.skip-link:focus {
  top: 1rem;
}

/* ---------- Header ---------- */

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding: 1.1rem var(--gutter);
  border-bottom: 1px solid var(--ink);
  background: var(--paper);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none;
}

.wordmark-loop {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--accent);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.5rem;
  list-style: none;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.25rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--ink);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.35em;
}

.site-nav .nav-cta {
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: 0.25rem 1.1rem;
}

.site-nav .nav-cta:hover {
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
}

@media (max-width: 45.99rem) {
  .site-header {
    padding-block: 0.6rem;
  }

  .site-nav {
    gap: 0;
  }

  .site-nav a {
    font-size: 0.78rem;
    padding: 0.25rem 0.4rem;
  }

  .site-nav .nav-cta {
    padding: 0.25rem 0.8rem;
  }
}

/* ---------- Shared section shell ---------- */

.section {
  padding: clamp(3.5rem, 9vw, 7rem) var(--gutter);
  max-width: 74rem;
  margin-inline: auto;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.1rem;
}

.eyebrow a {
  color: inherit;
  text-decoration: none;
}

.eyebrow a:hover {
  text-decoration: underline;
  text-underline-offset: 0.35em;
}

.version {
  display: inline-block;
  margin-right: 0.6rem;
  padding: 0.1rem 0.5rem;
  border: 1.5px solid currentColor;
  border-radius: 4px;
  text-transform: none;
}

h1, h2, h3 {
  font-family: var(--gh-font-heading, var(--font-display));
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.2rem, 5.5vw, 3.6rem);
  max-width: 20ch;
}

h2 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  max-width: 26ch;
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
}

.lede,
.section-lede {
  max-width: var(--measure);
  margin-top: 1.25rem;
  font-size: clamp(1.0625rem, 1.8vw, 1.2rem);
  color: var(--ink-soft);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.6rem 1.6rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  transition: transform 0.12s ease-out, background-color 0.12s ease-out, color 0.12s ease-out;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-ghost {
  border: 1.5px solid var(--ink);
  color: var(--ink);
}

.btn-ghost:hover {
  background: var(--ink);
  color: var(--paper);
}

/* ---------- Post list (index, tag, author) ---------- */

.post-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 3rem;
}

.post-card {
  display: flex;
  flex-direction: column;
  padding: 1.75rem 1.5rem;
  border: 1.5px solid var(--ink);
  border-radius: 10px;
  background: var(--paper);
}

.post-card-meta {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.85rem;
}

.post-card-title {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 0.6rem;
}

.post-card-title a {
  color: var(--ink);
  text-decoration: none;
}

.post-card-title a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.post-card-excerpt {
  color: var(--ink-soft);
}

/* ---------- Pagination ---------- */

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-top: 3rem;
}

.pagination-count {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ink-soft);
}

/* ---------- Post page ---------- */

.post-header {
  margin-bottom: 2.5rem;
}

.post-feature {
  margin-bottom: 2.5rem;
}

.post-feature img {
  width: 100%;
  border: 1.5px solid var(--ink);
  border-radius: 10px;
}

.post-feature figcaption {
  margin-top: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.post-footer {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1.5px solid var(--ink);
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2.25rem;
}

/* ---------- Post content (Ghost cards) ---------- */

.gh-content > * + * {
  margin-top: 1.4rem;
}

.gh-content > * {
  max-width: var(--measure);
}

.gh-content h2 {
  margin-top: 2.8rem;
}

.gh-content h3 {
  margin-top: 2.2rem;
}

.gh-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.gh-content a:hover {
  text-decoration-thickness: 2px;
}

.gh-content ul,
.gh-content ol {
  padding-left: 1.4rem;
}

.gh-content li + li {
  margin-top: 0.4rem;
}

.gh-content blockquote {
  padding-left: 1.25rem;
  border-left: 3px solid var(--accent);
  color: var(--ink-soft);
}

.gh-content code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--grid);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.gh-content pre {
  background: var(--ink);
  color: var(--paper);
  padding: 1.25rem 1.5rem;
  border-radius: 10px;
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.55;
}

.gh-content pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
}

.gh-content hr {
  border: none;
  border-top: 1.5px dashed var(--ink-soft);
  margin-block: 2.5rem;
}

.gh-content figure img {
  border: 1.5px solid var(--ink);
  border-radius: 10px;
}

.gh-content figcaption {
  margin-top: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.gh-content table {
  border-collapse: collapse;
  width: 100%;
}

.gh-content th,
.gh-content td {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--grid);
  text-align: left;
}

.gh-content th {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Ghost card widths */

.gh-content .kg-width-wide {
  max-width: min(100%, 60rem);
}

.gh-content .kg-width-full {
  max-width: 100%;
}

/* Ghost bookmark / button / callout cards: keep them on-palette */

.gh-content .kg-bookmark-container {
  border: 1.5px solid var(--ink);
  border-radius: 10px;
}

.gh-content .kg-callout-card {
  border-radius: 10px;
}

.gh-content .kg-btn {
  border-radius: 999px;
  font-family: var(--font-mono);
}

/* ---------- Footer ---------- */

.site-footer {
  padding: 2rem var(--gutter) 2.5rem;
  border-top: 1px solid var(--ink);
  background: var(--paper);
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.site-footer a {
  color: inherit;
}

.site-footer a:hover {
  color: var(--accent);
}

.footer-note {
  margin-top: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

/* ---------- Desktop layout ---------- */

@media (min-width: 46rem) {
  .post-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .btn,
  .skip-link {
    transition: none;
  }

  .btn:hover {
    transform: none;
  }
}
