/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Flexoki-inspired palette */
  --bg: #FFFCF0;
  --bg-secondary: #F2F0E5;
  --text: #100F0F;
  --text-secondary: #6F6E69;
  --text-muted: #B7B5AC;
  --accent: #AF3029;
  --accent-hover: #D14D41;
  --link: #AF3029;
  --link-hover: #D14D41;
  --border: #E6E4D9;
  --code-bg: #F2F0E5;
  --max-width: 640px;
}

html {
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  padding: 0 1.5rem;
}

/* === Layout === */
.site-wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 0 6rem;
}

/* === Header === */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 3rem;
  padding-bottom: 1rem;
}

.site-title a {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

.site-title a:hover {
  color: var(--accent);
}

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

.site-nav a {
  font-size: 0.95rem;
  color: var(--text-secondary);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--accent);
}

/* === Post List (Home) === */
.post-list {
  list-style: none;
}

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

.post-item-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.post-item-title a {
  color: var(--accent);
  text-decoration: none;
}

.post-item-title a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.post-item-date {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.post-item-summary {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* === Single Post / Page === */
.page-header {
  margin-bottom: 2rem;
}

.page-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 0.3rem;
}

.page-date {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.page-content {
  font-size: 1rem;
  line-height: 1.8;
}

.page-content h2 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-top: 2.5rem;
  margin-bottom: 0.8rem;
  color: var(--text);
}

.page-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.6rem;
}

.page-content p {
  margin-bottom: 1.2rem;
}

.page-content a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.page-content a:hover {
  color: var(--link-hover);
}

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

.page-content ul, .page-content ol {
  margin-bottom: 1.2rem;
  padding-left: 1.5rem;
}

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

.page-content blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  margin: 1.5rem 0;
  color: var(--text-secondary);
  font-style: italic;
}

.page-content code {
  font-family: 'SF Mono', 'Fira Code', 'Fira Mono', Menlo, monospace;
  font-size: 0.88em;
  background: var(--code-bg);
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

.page-content pre {
  background: var(--code-bg);
  padding: 1.2rem;
  border-radius: 6px;
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--border);
}

.page-content pre code {
  background: none;
  padding: 0;
  font-size: 0.85rem;
  line-height: 1.6;
}

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

/* === Footer === */
.site-footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
}

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

.site-footer a:hover {
  color: var(--accent);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 0.5rem;
}

/* === Responsive === */
@media (max-width: 600px) {
  html { font-size: 16px; }
  .site-header { flex-direction: column; gap: 0.5rem; }
  .site-wrapper { padding: 2rem 0 4rem; }
}
