/* ============================================
   Steve Nuttall — stevenuttall.me
   Earthy palette with warm orange accents
   ============================================ */

:root {
  --color-bg: #f7f4ef;
  --color-surface: #ffffff;
  --color-text: #2c2c2c;
  --color-text-muted: #6b6560;
  --color-accent: #c4652a;
  --color-accent-hover: #a8531e;
  --color-accent-soft: #e8a96f;
  --color-border: #ddd8d0;
  --color-tag-bg: #faf0e4;
  --color-tag-text: #8b5e30;
  --color-footer-bg: #eae6df;
  --color-sidebar-bg: #f0ece4;

  --font-body: Charter, "Bitstream Charter", "Sitka Text", Cambria, serif;
  --font-heading: system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

  --content-width: 42rem;
  --sidebar-width: 14rem;
  --gap: 3rem;
  --spacing: 1.5rem;
}

/* ---- Reset & Base ---- */

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

html {
  font-size: 18px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: calc(var(--content-width) + var(--gap) + var(--sidebar-width));
  margin: 0 auto;
  padding: 0 var(--spacing);
}

/* ---- Page layout (content + sidebar) ---- */

.page-layout {
  display: flex;
  gap: var(--gap);
  flex: 1;
  padding-top: 2.5rem;
  padding-bottom: 2.5rem;
}

.page-layout main {
  flex: 1;
  min-width: 0;
  max-width: var(--content-width);
}

/* ---- Links ---- */

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.2s;
}

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

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

.site-header {
  border-bottom: 2px solid var(--color-accent-soft);
  padding: 1.25rem 0;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
  text-decoration: none;
}

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

.site-nav {
  display: flex;
  gap: 1.5rem;
}

.site-nav a {
  font-family: var(--font-heading);
  font-size: 0.875rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

/* ---- Sidebar ---- */

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  padding-top: 0.25rem;
}

.sidebar-bio {
  margin-bottom: 1.5rem;
}

.sidebar-bio h3 {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-accent);
  margin-bottom: 0.5rem;
}

.sidebar-bio p {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

.sidebar-links {
  font-family: var(--font-heading);
  font-size: 0.8rem;
}

.sidebar-links .separator {
  color: var(--color-border);
  margin: 0 0.15rem;
}

.sidebar-disclaimer {
  border-top: 1px solid var(--color-border);
  padding-top: 1rem;
}

.sidebar-disclaimer p {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-style: italic;
  line-height: 1.5;
}

/* ---- Homepage ---- */

.recent-posts h2 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
}

/* ---- Post list ---- */

.post-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.post-summary {
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--color-border);
}

.post-summary:last-child {
  border-bottom: none;
}

.post-summary h2,
.post-summary h3 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  margin-bottom: 0.25rem;
}

.post-summary h2 a,
.post-summary h3 a {
  color: var(--color-text);
}

.post-summary h2 a:hover,
.post-summary h3 a:hover {
  color: var(--color-accent);
  text-decoration: none;
}

.summary {
  color: var(--color-text-muted);
  margin: 0.5rem 0;
}

.read-more {
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 600;
}

/* ---- Post meta (date, reading time) ---- */

.post-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin: 0.25rem 0 0.5rem;
}

/* ---- Single post ---- */

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

.post-header h1 {
  font-family: var(--font-heading);
  font-size: 2.25rem;
  line-height: 1.25;
}

.post-cover {
  margin-bottom: 2rem;
}

.post-cover img {
  width: 100%;
  height: auto;
  border-radius: 4px;
}

/* ---- Post content ---- */

.post-content {
  margin-bottom: 2rem;
}

.post-content h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  margin: 2.5rem 0 1rem;
}

.post-content h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  margin: 2rem 0 0.75rem;
}

.post-content p {
  margin-bottom: 1.25rem;
}

.post-content ul, .post-content ol {
  margin: 0 0 1.25rem 1.5rem;
}

.post-content li {
  margin-bottom: 0.4rem;
}

.post-content blockquote {
  border-left: 3px solid var(--color-accent);
  padding: 0.5rem 0 0.5rem 1.25rem;
  margin: 1.5rem 0;
  color: var(--color-text-muted);
  font-style: italic;
}

.post-content code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--color-tag-bg);
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

.post-content pre {
  background: #2b2b2b;
  color: #f8f8f2;
  padding: 1.25rem;
  border-radius: 6px;
  overflow-x: auto;
  margin: 1.5rem 0;
  line-height: 1.5;
}

.post-content pre code {
  background: none;
  padding: 0;
  font-size: 0.85rem;
  color: inherit;
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 1rem 0;
}

.post-content hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 2rem 0;
}

/* ---- Tags ---- */

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}

.tag {
  display: inline-block;
  background: var(--color-tag-bg);
  color: var(--color-tag-text);
  padding: 0.2em 0.7em;
  border-radius: 3px;
  font-size: 0.85rem;
  font-family: var(--font-heading);
}

.tag:hover {
  background: var(--color-accent);
  color: #fff;
  text-decoration: none;
}

/* ---- Comments ---- */

.comments {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
}

.comments h2 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
}

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

.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 1.25rem 0;
}

.copyright {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  text-align: center;
}

/* ---- List page (tags, sections) ---- */

.list-page h1 {
  font-family: var(--font-heading);
  font-size: 2rem;
  margin-bottom: 1.5rem;
}

/* ---- Responsive ---- */

@media (max-width: 768px) {
  .page-layout {
    flex-direction: column;
    gap: 2rem;
  }

  .sidebar {
    width: 100%;
    border-top: 1px solid var(--color-border);
    padding-top: 1.5rem;
  }
}

@media (max-width: 600px) {
  html {
    font-size: 16px;
  }

  .site-header .container {
    flex-direction: column;
    gap: 0.5rem;
  }

  .post-header h1 {
    font-size: 1.75rem;
  }
}
