/* site-evolver theme — WordPress-style layout */

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

:root {
  --accent:   #0073aa;
  --accent-h: #005177;
  --text:     #333;
  --muted:    #767676;
  --border:   #e5e5e5;
  --bg:       #f1f1f1;
  --card-bg:  #fff;
  --radius:   4px;
  --max-w:    1100px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-h); text-decoration: underline; }

/* ── Header ─────────────────────────────────────────────────────────────── */
#site-header {
  background: var(--accent);
  color: #fff;
  padding: 0 1.5rem;
}
#site-header .inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
#site-header .site-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.5px;
}
#site-header .site-title:hover { text-decoration: none; opacity: .85; }
#site-header .tagline {
  font-size: .8rem;
  opacity: .75;
  margin-left: .5rem;
}

nav#main-nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}
nav#main-nav a {
  color: rgba(255,255,255,.85);
  font-size: .9rem;
  font-weight: 500;
}
nav#main-nav a:hover { color: #fff; text-decoration: none; }

/* ── Layout ─────────────────────────────────────────────────────────────── */
#page {
  max-width: var(--max-w);
  margin: 2rem auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 768px) {
  #page { grid-template-columns: 1fr; }
  #sidebar { display: none; }
}

/* ── Article cards (index page) ─────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: box-shadow .15s;
}
.card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.card h2 { font-size: 1.2rem; margin-bottom: .4rem; }
.card h2 a { color: var(--text); }
.card h2 a:hover { color: var(--accent); text-decoration: none; }
.card .meta { font-size: .82rem; color: var(--muted); margin-bottom: .75rem; }
.card .excerpt { font-size: .95rem; color: #555; }

/* ── Single article ─────────────────────────────────────────────────────── */
article.post {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 2.5rem;
}
article.post h1 {
  font-size: 1.9rem;
  line-height: 1.3;
  margin-bottom: .5rem;
}
article.post .post-meta {
  font-size: .85rem;
  color: var(--muted);
  margin-bottom: 1.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
article.post h2 {
  font-size: 1.3rem;
  margin: 1.75rem 0 .6rem;
  color: #222;
}
article.post h3 { font-size: 1.1rem; margin: 1.25rem 0 .4rem; }
article.post p  { margin-bottom: 1rem; }
article.post ul, article.post ol { margin: .5rem 0 1rem 1.5rem; }
article.post li { margin-bottom: .3rem; }
article.post pre {
  background: #f6f8fa;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  overflow-x: auto;
  font-size: .88rem;
  margin-bottom: 1rem;
}
article.post code {
  background: #f6f8fa;
  padding: .15em .4em;
  border-radius: 3px;
  font-size: .9em;
}
article.post pre code { background: none; padding: 0; }
article.post blockquote {
  border-left: 4px solid var(--accent);
  padding: .5rem 1rem;
  color: #555;
  margin: 1rem 0;
  font-style: italic;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
#sidebar .widget {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}
#sidebar .widget-title {
  font-size: .95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  margin-bottom: 1rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--border);
}
#sidebar ul { list-style: none; }
#sidebar ul li { padding: .35rem 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
#sidebar ul li:last-child { border-bottom: none; }

/* ── Search (Pagefind) ───────────────────────────────────────────────────── */
.search-wrap { margin-bottom: 1.5rem; }
.pagefind-ui__search-input {
  width: 100% !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  padding: .6rem 1rem !important;
  font-size: .95rem !important;
}

/* ── Footer ─────────────────────────────────────────────────────────────── */
#site-footer {
  border-top: 1px solid var(--border);
  background: var(--card-bg);
  text-align: center;
  padding: 1.5rem;
  font-size: .82rem;
  color: var(--muted);
  margin-top: 3rem;
}
