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

body {
  font-family: "Newsreader", Georgia, serif;
  line-height: 1.7;
  font-size: 18px;
  color: #33302b;
  background: #faf7f2;
  padding: 2.5rem 1.25rem;
}

a {
  color: #6b5c4d;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color 0.2s ease;
}

a:hover {
  color: #3d3229;
}

/* ---- Layout ---- */

.site-wrapper {
  max-width: 960px;
  margin: 0 auto;
}

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

.site-title {
  font-weight: 700;
  font-size: 1.3rem;
  text-decoration: none;
  color: #33302b;
  letter-spacing: 0.02em;
}

.site-grid {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 3rem;
}

.site-content {
  min-height: 60vh;
  min-width: 0;
}

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

.sidebar {
  position: sticky;
  top: 2.5rem;
  align-self: start;
  font-size: 0.9rem;
}

.sidebar-bio {
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid #e6dfd6;
}

.sidebar-bio p {
  color: #6b5c4d;
  font-size: 0.88rem;
  line-height: 1.55;
  margin-bottom: 0.5rem;
}

.sidebar-bio a {
  font-size: 0.84rem;
  color: #8c8379;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid #e6dfd6;
}

.sidebar-nav a {
  text-decoration: none;
  color: #8c8379;
  letter-spacing: 0.04em;
  transition: color 0.2s ease;
}

.sidebar-nav a:hover {
  color: #33302b;
}

.sidebar-nav a[aria-current="page"] {
  color: #33302b;
  font-weight: 700;
}

.sidebar-footer a {
  font-size: 0.84rem;
  color: #8c8379;
  text-decoration: none;
  letter-spacing: 0.04em;
}

.sidebar-footer a:hover {
  color: #33302b;
}

/* ---- Typography ---- */

article {
  margin-bottom: 2rem;
}

h1 {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.25rem;
  color: #33302b;
}

h2 {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.35;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

h3 {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.4;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

p {
  margin-bottom: 1rem;
}

time {
  color: #8c8379;
  font-size: 0.85rem;
}

.tags {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  color: #8c8379;
}

.tags a {
  color: #8c8379;
  text-decoration: none;
}

.tags a:hover {
  color: #6b5c4d;
}

.post-separator {
  border: none;
  border-top: 1px solid #e6dfd6;
  margin: 1.5rem 0;
}

/* ---- Post list (editorial) ---- */

.post-list {
  list-style: none;
}

.post-list li {
  padding-bottom: 2rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid #e6dfd6;
}

.post-list li:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.post-list time {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.78rem;
  color: #8c8379;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.post-list a {
  font-size: 1.3rem;
  font-weight: 700;
  color: #33302b;
  text-decoration: none;
  line-height: 1.35;
}

.post-list a:hover {
  color: #6b5c4d;
}

.post-list .summary {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.92rem;
  color: #6b5c4d;
  font-style: italic;
  line-height: 1.5;
}

/* Lead post emphasis */
.post-list .lead-post a {
  font-size: 1.6rem;
}

.post-list .lead-post .summary {
  font-size: 1rem;
}

/* ---- Content elements ---- */

blockquote {
  border-left: 3px solid #e6dfd6;
  padding-left: 1.25rem;
  margin: 1.5rem 0;
  color: #6b5c4d;
  font-style: italic;
}

pre {
  background: #f0ece5;
  padding: 1.25rem;
  overflow-x: auto;
  border-radius: 4px;
  margin: 1.5rem 0;
  line-height: 1.5;
}

code {
  font-size: 0.88em;
}

:not(pre) > code {
  background: #f0ece5;
  padding: 0.15em 0.35em;
  border-radius: 3px;
}

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

ul,
ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.35rem;
}

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

.site-footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e6dfd6;
  font-size: 0.85rem;
  color: #8c8379;
}

/* ---- Search ---- */

#search-input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-family: "Newsreader", Georgia, serif;
  font-size: 1rem;
  margin-bottom: 1.5rem;
  border: 1px solid #e6dfd6;
  border-radius: 4px;
  background: #fff;
  color: #33302b;
  outline: none;
  transition: border-color 0.2s ease;
}

#search-input::placeholder {
  color: #8c8379;
}

#search-input:focus {
  border-color: #8c8379;
}

#search-results {
  list-style: none;
}

#search-results li {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e6dfd6;
}

#search-results li:last-child {
  border-bottom: none;
}

/* ---- Mobile ---- */

@media (max-width: 768px) {
  .site-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .sidebar {
    position: static;
    order: -1;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e6dfd6;
  }

  .sidebar-bio {
    display: none;
  }

  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: none;
  }

  .sidebar-footer {
    display: inline;
    margin-left: 1rem;
  }

  .sidebar-footer a {
    font-size: 0.9rem;
  }

  .post-list .lead-post a {
    font-size: 1.3rem;
  }
}
