/* -------------------------------------------------------------
   LinkWheel theme stylesheet
   Plain CSS. System fonts only. No transitions/animations.
   ------------------------------------------------------------- */

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Consolas,
    "Liberation Mono", Menlo, monospace;

  --color-bg: #ffffff;
  --color-text: #1a1a1a;
  --color-muted: #5f5f5f;
  --color-link: #0b5fff;
  --color-link-visited: #5a2ea6;
  --color-border: #e2e2e2;
  --color-accent-bg: #f6f6f6;

  --max-width: 860px;
  --max-width-narrow: 700px;
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #14161a;
    --color-text: #ececec;
    --color-muted: #a2a2a2;
    --color-link: #6ea8fe;
    --color-link-visited: #b79cf0;
    --color-border: #2b2e33;
    --color-accent-bg: #1c1f24;
  }
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

a {
  color: var(--color-link);
  text-decoration: underline;
}

a:visited {
  color: var(--color-link-visited);
}

a:hover,
a:focus {
  text-decoration: none;
}

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

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-2);
}

.wrap-narrow {
  max-width: var(--max-width-narrow);
}

/* ---------- header ---------- */

.site-header {
  border-bottom: 1px solid var(--color-border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-2);
  padding-bottom: var(--space-2);
}

.site-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
}

.site-title a {
  color: var(--color-text);
  text-decoration: none;
}

.site-header nav {
  position: relative;
}

.site-nav {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: var(--space-3);
}

.site-nav a {
  color: var(--color-text);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  text-decoration: underline;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 0.4rem 0.6rem;
  cursor: pointer;
}

.nav-toggle-icon {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--color-text);
  position: relative;
}

.nav-toggle-icon::before,
.nav-toggle-icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: var(--color-text);
}

.nav-toggle-icon::before {
  top: -6px;
}

.nav-toggle-icon::after {
  top: 6px;
}

/* ---------- main content ---------- */

#main-content {
  padding: var(--space-4) 0;
  min-height: 60vh;
}

.page-header h1,
.post-header h1 {
  margin-top: 0;
  margin-bottom: var(--space-1);
  font-size: 1.9rem;
  line-height: 1.25;
}

.page-intro {
  color: var(--color-muted);
  margin-bottom: var(--space-3);
}

/* ---------- post list (home, sections, taxonomies) ---------- */

.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-list li {
  border-bottom: 1px solid var(--color-border);
}

.post-list li a {
  display: block;
  padding: var(--space-2) 0;
  text-decoration: none;
  color: var(--color-text);
  font-size: 1.05rem;
}

.post-list li a:hover,
.post-list li a:focus {
  color: var(--color-link);
  text-decoration: underline;
}

/* ---------- single article ---------- */

.post-header {
  margin-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: var(--space-2);
}

.post-meta {
  color: var(--color-muted);
  font-size: 0.9rem;
  margin: 0;
}

.post-tags a {
  margin-left: var(--space-1);
  color: var(--color-muted);
  text-decoration: none;
  border: 1px solid var(--color-border);
  border-radius: 3px;
  padding: 0.1rem 0.5rem;
  font-size: 0.85rem;
}

.post-content {
  font-size: 1.05rem;
}

.post-content h2,
.post-content h3 {
  margin-top: var(--space-4);
}

.post-content pre {
  background: var(--color-accent-bg);
  padding: var(--space-2);
  overflow-x: auto;
  border-radius: 4px;
}

.post-content code {
  font-family: var(--font-mono);
  background: var(--color-accent-bg);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
}

.post-content pre code {
  background: none;
  padding: 0;
}

.post-content blockquote {
  margin-left: 0;
  padding-left: var(--space-2);
  border-left: 3px solid var(--color-border);
  color: var(--color-muted);
}

/* ---------- related posts (link wheel) ---------- */

.related-posts {
  margin: var(--space-4) 0;
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
}

.related-posts h2 {
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-muted);
  margin-bottom: var(--space-2);
}

.related-posts ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.related-posts li {
  border-bottom: 1px solid var(--color-border);
}

.related-posts li a {
  display: block;
  padding: var(--space-1) 0;
  text-decoration: none;
}

.related-posts li a:hover {
  text-decoration: underline;
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--color-border);
  color: var(--color-muted);
  font-size: 0.9rem;
}

.site-footer .wrap {
  padding: var(--space-2);
  text-align: center;
}

/* ---------- responsive ---------- */

@media (max-width: 600px) {
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .site-nav {
    display: none;
    flex-direction: column;
    position: absolute;
    right: 0;
    top: 100%;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: var(--space-2);
    min-width: 160px;
    gap: var(--space-1);
    z-index: 10;
  }

  .site-nav.is-open {
    display: flex;
  }

  .page-header h1,
  .post-header h1 {
    font-size: 1.5rem;
  }
}
