/* Base styles */
@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&display=swap');

:root {
  --bg: #f4efe7;
  --panel: #fbf7ef;
  --panel-soft: #ebe2d5;
  --border: #d8ccba;
  --border-strong: #9c8e79;
  --text: #191713;
  --muted: #6d6255;
  --accent: #b35a2f;
  --accent-strong: #7a351d;
  --code-bg: #211d18;
  --code-text: #f7efe4;
  --shadow: none;
}

* {
  box-sizing: border-box;
}

body {
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  line-height: 1.7;
  font-size: 1rem;
  text-rendering: optimizeLegibility;
}

strong,
b {
  font-weight: 700;
}

::selection {
  background: rgba(179, 90, 47, 0.22);
}

/* Layout */
.container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
aside {
  width: 232px;
  background-color: rgba(244, 239, 231, 0.92);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1.8rem 1.2rem;
  position: fixed;
  top: 0;
  bottom: 0;
  backdrop-filter: blur(16px);
}

aside .logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.8rem;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid var(--border);
}

aside .logo img {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 50%;
}

aside .logo span {
  font-family: 'Space Mono', 'GT Flexa Mono', 'IBM Plex Mono', 'SFMono-Regular', Menlo, Consolas, 'Liberation Mono', monospace;
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.25;
}

aside .links {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

aside .links a {
  color: var(--muted);
  font-family: 'Space Mono', 'GT Flexa Mono', 'IBM Plex Mono', 'SFMono-Regular', Menlo, Consolas, 'Liberation Mono', monospace;
  text-decoration: none;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  padding: 0.36rem 0;
  text-transform: uppercase;
}

aside .links a:hover {
  color: var(--accent-strong);
}

/* Main content */
main {
  flex: 1;
  margin-left: 232px;
  max-width: 790px;
  padding: 4.25rem 2rem 4.5rem 3.25rem;
}

main h1 {
  color: var(--text);
  font-size: 2.45rem;
  font-weight: 700;
  line-height: 1.08;
  margin: 0 0 2rem;
  letter-spacing: 0;
}

main h2,
main h3 {
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.25;
  margin: 3rem 0 1rem;
}

main h2 {
  font-size: 1.5rem;
}

main h3 {
  font-size: 1.18rem;
}

main p {
  margin: 1.05rem 0 0;
}

main a {
  color: var(--accent-strong);
  text-decoration: underline;
  text-decoration-color: rgba(179, 90, 47, 0.35);
  text-underline-offset: 0.18em;
}

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

main ul,
main ol {
  padding-left: 1.35rem;
}

main li {
  margin-bottom: 0.55rem;
}

main blockquote {
  background: transparent;
  border-left: 3px solid var(--accent);
  color: var(--text);
  font-style: normal;
  margin: 2rem 0;
  padding: 0.2rem 0 0.2rem 1rem;
}

main article {
  max-width: 100%;
  overflow-x: auto;
}

main article img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 2rem 0;
  border: 1px solid var(--border);
}

/* Tables scroll internally without expanding the page. */
main table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 2rem 0;
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

main th,
main td {
  display: table-cell;
  padding: 0.72rem 0.85rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

main thead {
  background: var(--panel-soft);
}

main th {
  font-family: 'Space Mono', 'GT Flexa Mono', 'IBM Plex Mono', 'SFMono-Regular', Menlo, Consolas, 'Liberation Mono', monospace;
  color: var(--accent-strong);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

main tbody tr:nth-child(even) {
  background: #f0e8dc;
}

main tbody tr:last-child td {
  border-bottom: none;
}

main td code,
main th code,
main :not(pre) > code {
  background: #ebe2d5;
  color: #2a211b;
  padding: 0.12rem 0.35rem;
  border: 1px solid #d8ccba;
  border-radius: 0.25rem;
  font-size: 0.9em;
}

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

/* Post header */
main > header {
  background: transparent;
  color: var(--text);
  padding: 0 0 1.75rem;
  border-bottom: 1px solid var(--border-strong);
  margin-bottom: 2.5rem;
}

main > header h1 {
  color: var(--text);
  margin: 0 0 0.9rem;
  font-size: 2.75rem;
  letter-spacing: 0;
  line-height: 1.05;
  text-transform: none;
}

main > header .post-meta {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

main > header .post-meta .published-at {
  font-family: 'Space Mono', 'GT Flexa Mono', 'IBM Plex Mono', 'SFMono-Regular', Menlo, Consolas, 'Liberation Mono', monospace;
  color: var(--accent-strong);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

main > header .post-meta .summary {
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.62;
  margin: 0;
}

/* Code styling */
main pre {
  background-color: var(--code-bg);
  color: var(--code-text);
  padding: 1.15rem;
  border: 1px solid var(--border);
  border-radius: 0;
  overflow-x: auto;
  font-size: 0.86rem;
  line-height: 1.6;
  margin-top: 1.6rem;
  box-shadow: var(--shadow);
  font-family: 'Space Mono', 'GT Flexa Mono', 'IBM Plex Mono', 'SFMono-Regular', Menlo, Consolas, 'Liberation Mono', monospace;
}

main code {
  font-family: 'Space Mono', 'GT Flexa Mono', 'IBM Plex Mono', 'SFMono-Regular', Menlo, Consolas, 'Liberation Mono', monospace;
}

/* Search bar */
.search-bar-wrapper {
  margin-bottom: 2.25rem;
}

#search-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 500px;
  border: 1px solid var(--border-strong);
  border-radius: 0;
  padding: 0.52rem 0.7rem;
  background-color: rgba(251, 247, 239, 0.78);
}

#search-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: 'Space Mono', 'GT Flexa Mono', 'IBM Plex Mono', 'SFMono-Regular', Menlo, Consolas, 'Liberation Mono', monospace;
  font-size: 0.82rem;
}

#search-input::placeholder {
  color: #8c7f6e;
  opacity: 1;
}

/* Search functionality - Hide/Show elements */
.hidden {
  display: none !important;
}

/* Footer */
footer {
  margin-left: 232px;
  padding: 2rem 1rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

/* Post list styling */
#post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

#post-list li {
  margin: 0;
  padding: 1.65rem 0;
  border-bottom: 1px solid var(--border);
}

#post-list li:first-child {
  border-top: 1px solid var(--border);
}

#post-list li a {
  color: var(--text);
  text-decoration: none;
  display: inline-block;
  margin-bottom: 0.45rem;
  font-size: 1.18rem;
  line-height: 1.35;
  letter-spacing: 0;
}

#post-list li a:hover {
  color: var(--accent-strong);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

#post-list li .summary,
#post-list li .topics,
#post-list li .published-at {
  margin: 0.35rem 0;
  font-size: 0.94rem;
  color: var(--muted);
}

#post-list li .topics,
#post-list li .published-at {
  display: inline-flex;
  align-items: center;
  font-family: 'Space Mono', 'GT Flexa Mono', 'IBM Plex Mono', 'SFMono-Regular', Menlo, Consolas, 'Liberation Mono', monospace;
  margin: 0.45rem 1rem 0 0;
  color: var(--accent-strong);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

#post-list li .published-at {
  margin-right: 0;
}

#post-list li p:first-of-type {
  margin-top: 0;
}

/* Search results styling */
#search-results {
  padding-left: 0;
}

#search-results li {
  margin-bottom: 1.5rem;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid var(--border);
  list-style: none;
}

#search-results li a {
  color: var(--text);
  text-decoration: none;
  display: inline-block;
  margin-bottom: 0.25rem;
  font-size: 1.08rem;
  line-height: 1.45;
  letter-spacing: 0;
}

#search-results li a:hover {
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 0.22em;
}

#search-results li .summary,
#search-results li .topics,
#search-results li .published-at {
  margin: 0.25rem 0;
  font-size: 0.9rem;
  color: var(--muted);
}

#search-results li .topics,
#search-results li .published-at {
  display: inline-flex;
  align-items: center;
  margin: 0.4rem 1rem 0 0;
  color: var(--accent-strong);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

#search-results li .published-at {
  margin-right: 0;
}

#search-results li p:first-of-type {
  margin-top: 0;
}

/* Responsive layout */
@media (max-width: 768px) {
  body {
    font-size: 0.96rem;
  }

  .container {
    flex-direction: column;
  }

  aside {
    width: 100%;
    position: static;
    flex-direction: column;
    padding: 1rem;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  aside .logo {
    margin-bottom: 0.8rem;
    padding-bottom: 0.8rem;
  }

  aside .links {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.85rem;
  }

  aside .links a {
    padding: 0.2rem 0;
  }

  main {
    max-width: none;
    margin-left: 0;
    padding: 2rem 1rem;
  }

  main h1,
  main > header h1 {
    font-size: 2rem;
  }

  main table {
    box-shadow: none;
  }

  main th,
  main td {
    padding: 0.65rem 0.72rem;
  }

  #search-wrapper {
    max-width: none;
  }

  footer {
    margin-left: 0;
  }
}
  font-family: 'Space Mono', 'GT Flexa Mono', 'IBM Plex Mono', 'SFMono-Regular', Menlo, Consolas, 'Liberation Mono', monospace;
  font-family: 'Space Mono', 'GT Flexa Mono', 'IBM Plex Mono', 'SFMono-Regular', Menlo, Consolas, 'Liberation Mono', monospace;
